diff options
| author | Glenn Morris | 2007-09-06 04:50:28 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-09-06 04:50:28 +0000 |
| commit | 8cf51b2c2f18417403f27fdc215f369af887d89b (patch) | |
| tree | 32b8f5cdf35f0c2e674c0f6a3d2e842396080b32 /doc | |
| parent | 19e364e29522a20357a236d8501725db47f7feee (diff) | |
| download | emacs-8cf51b2c2f18417403f27fdc215f369af887d89b.tar.gz emacs-8cf51b2c2f18417403f27fdc215f369af887d89b.zip | |
Move here from ../../man
Diffstat (limited to 'doc')
59 files changed, 56803 insertions, 0 deletions
diff --git a/doc/emacs/.gitignore b/doc/emacs/.gitignore new file mode 100644 index 00000000000..3ff56b474dd --- /dev/null +++ b/doc/emacs/.gitignore | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | *.aux | ||
| 2 | *.cp | ||
| 3 | *.cps | ||
| 4 | *.dvi | ||
| 5 | *.fn | ||
| 6 | *.fns | ||
| 7 | *.ky | ||
| 8 | *.kys | ||
| 9 | *.log | ||
| 10 | *.op | ||
| 11 | *.ops | ||
| 12 | |||
| 13 | *.pg | ||
| 14 | *.pgs | ||
| 15 | *.ps | ||
| 16 | *.tmp | ||
| 17 | *.toc | ||
| 18 | *.tp | ||
| 19 | *.tps | ||
| 20 | *.vr | ||
| 21 | *.vrs | ||
| 22 | Makefile | ||
| 23 | makefile | ||
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog new file mode 100644 index 00000000000..51803a75727 --- /dev/null +++ b/doc/emacs/ChangeLog | |||
| @@ -0,0 +1,8267 @@ | |||
| 1 | 2007-09-06 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * Move manual sources from man/ to subdirectories of doc/. | ||
| 4 | Split into the Emacs manual in emacs/, and other manuals in misc/. | ||
| 5 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Reduce to just the Emacs | ||
| 6 | manual. | ||
| 7 | (infodir): New variable. | ||
| 8 | (info): Use $infodir. | ||
| 9 | (emacsman): Delete target, not needed any more. | ||
| 10 | Move all targets that are not the Emacs manual to misc/Makefile.in. | ||
| 11 | (mostlyclean): Remove `gnustmp'. | ||
| 12 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS): Reduce to just the Emacs | ||
| 13 | manual. | ||
| 14 | (MULTI_INSTALL_INFO, ENVADD): Go up one more level. | ||
| 15 | (emacsman): Delete target, not needed any more. | ||
| 16 | (clean): Remove all info files but Emacs manual. | ||
| 17 | Move all targets that are not the Emacs manual to misc/Makefile.in. | ||
| 18 | * emacs-xtra.texi, emacs.texi (setfilename): Go up one more level. | ||
| 19 | |||
| 20 | * Makefile.in (INFOSOURCES): Delete. | ||
| 21 | (.SUFFIXES): Use $(TEXI2DVI) rather than texi2dvi. | ||
| 22 | (mostlyclean): Add *.op, *.ops. Move *.aux *.cps *.fns *.kys *.pgs | ||
| 23 | *.vrs *.toc here... | ||
| 24 | (maintainer-clean): ...from here. | ||
| 25 | |||
| 26 | 2007-09-05 Glenn Morris <rgm@gnu.org> | ||
| 27 | |||
| 28 | * custom.texi (Safe File Variables): Clarify `!' and risky variables. | ||
| 29 | |||
| 30 | 2007-09-01 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 31 | |||
| 32 | * calc.texi (Date Conversions): Clarify definition of | ||
| 33 | Julian day numbering. | ||
| 34 | (Date Forms): Clarify definition of Julian day numbering; | ||
| 35 | add some history. | ||
| 36 | |||
| 37 | 2007-08-30 Carsten Dominik <dominik@science.uva.nl> | ||
| 38 | |||
| 39 | * org.texi: Version 5.07 | ||
| 40 | |||
| 41 | 2007-08-29 Glenn Morris <rgm@gnu.org> | ||
| 42 | |||
| 43 | * emacs.texi (EMACSVER): Increase to 23.0.50. | ||
| 44 | |||
| 45 | 2007-08-24 IRIE Tetsuya <irie@t.email.ne.jp> (tiny change) | ||
| 46 | |||
| 47 | * message.texi (MIME): Replace mml-attach with mml-attach-file. | ||
| 48 | |||
| 49 | 2007-08-22 Carsten Dominik <dominik@science.uva.nl> | ||
| 50 | |||
| 51 | * org.texi (Adding hyperlink types): New section. | ||
| 52 | (Embedded LaTeX): Chapter updated because of LaTeX export. | ||
| 53 | (LaTeX export): New section. | ||
| 54 | (Using links out): New section. | ||
| 55 | |||
| 56 | 2007-08-22 Glenn Morris <rgm@gnu.org> | ||
| 57 | |||
| 58 | * faq.texi (Learning how to do something): Refcards now in | ||
| 59 | etc/refcards/ directory. | ||
| 60 | |||
| 61 | 2007-08-22 Michael Albinus <michael.albinus@gmx.de> | ||
| 62 | |||
| 63 | * tramp.texi (Remote Programs): Persistency file must be cleared when | ||
| 64 | changing `tramp-remote-path'. | ||
| 65 | (Filename Syntax): Don't use @var{} constructs inside the @trampfn | ||
| 66 | macro. | ||
| 67 | |||
| 68 | 2007-08-17 Eli Zaretskii <eliz@gnu.org> | ||
| 69 | |||
| 70 | * basic.texi (Position Info): Add index entry for face at point. | ||
| 71 | Mention that character faces are also displayed by "C-u C-x =". | ||
| 72 | |||
| 73 | 2007-08-17 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 74 | |||
| 75 | * calc.texi: Move contents to beginning of file. | ||
| 76 | (Algebraic Entry): Fix the formatting of an example. | ||
| 77 | |||
| 78 | 2007-08-15 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 79 | |||
| 80 | * calc.texi (Basic Operations on Units): Mention exact versus | ||
| 81 | inexact conversions. | ||
| 82 | |||
| 83 | 2007-08-14 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 84 | |||
| 85 | * calc.texi (Basic Operations on Units): Mention default | ||
| 86 | values for new units. | ||
| 87 | (Quick Calculator Mode): Mention that binary format will | ||
| 88 | be displayed. | ||
| 89 | |||
| 90 | 2007-08-14 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 91 | |||
| 92 | * gnus.texi (Selecting a Group): Mention gnus-maximum-newsgroup. | ||
| 93 | |||
| 94 | 2007-08-10 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 95 | |||
| 96 | * gnus.texi (NNTP): Mention nntp-xref-number-is-evil. | ||
| 97 | |||
| 98 | 2007-08-08 Glenn Morris <rgm@gnu.org> | ||
| 99 | |||
| 100 | * glossary.texi (Glossary): Deprecate `iff'. | ||
| 101 | * gnus.texi, sieve.texi: Replace `iff'. | ||
| 102 | |||
| 103 | 2007-08-07 Chong Yidong <cyd@stupidchicken.com> | ||
| 104 | |||
| 105 | * files.texi (File Conveniences): Document point motion keys in Image | ||
| 106 | mode. | ||
| 107 | |||
| 108 | 2007-08-03 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 109 | |||
| 110 | * calc.texi (Basic Graphics): Mention the graphing of error | ||
| 111 | forms. | ||
| 112 | (Graphics Options): Mention how `g s' handles error forms. | ||
| 113 | (Curve Fitting): Mention plotting the curves. | ||
| 114 | (Standard Nonlinear Models): Add additional models. | ||
| 115 | (Curve Fitting Details): Mention the Levenberg-Marquardt method. | ||
| 116 | (Linear Fits): Correct result. | ||
| 117 | |||
| 118 | 2007-08-01 Alan Mackenzie <acm@muc.de> | ||
| 119 | |||
| 120 | * cc-mode.texi (Mailing Lists and Bug Reports): Correct "-no-site-file" | ||
| 121 | to "--no-site-file". | ||
| 122 | |||
| 123 | 2007-07-29 Michael Albinus <michael.albinus@gmx.de> | ||
| 124 | |||
| 125 | * tramp.texi (Frequently Asked Questions): Point to mode line | ||
| 126 | extension in Emacs 23.1. | ||
| 127 | |||
| 128 | * trampver.texi: Update release number. | ||
| 129 | |||
| 130 | 2007-07-27 Glenn Morris <rgm@gnu.org> | ||
| 131 | |||
| 132 | * calc.texi (Copying) | ||
| 133 | * emacs.texi (Copying): Include license text from gpl.texi, rather than | ||
| 134 | in-line. | ||
| 135 | |||
| 136 | * gpl.texi: New file with text of GPL. | ||
| 137 | * Makefile.in (EMACSSOURCES): Add gpl.texi. | ||
| 138 | |||
| 139 | 2007-07-26 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 140 | |||
| 141 | * vc2-xtra.texi (Customizing VC): Add GIT and HG. | ||
| 142 | |||
| 143 | * dired.texi (Wdired): Mention C-x C-q key binding. | ||
| 144 | |||
| 145 | 2007-07-28 Nick Roberts <nickrob@snap.net.nz> | ||
| 146 | |||
| 147 | * building.texi (GDB Graphical Interface): Qualify use of "M-x gdba". | ||
| 148 | |||
| 149 | 2007-07-25 Glenn Morris <rgm@gnu.org> | ||
| 150 | |||
| 151 | * calc.texi (Copying) | ||
| 152 | * emacs.texi (Copying): Replace license with GPLv3. | ||
| 153 | |||
| 154 | * Relicense all FSF files to GPLv3 or later. | ||
| 155 | |||
| 156 | 2007-07-24 Glenn Morris <rgm@gnu.org> | ||
| 157 | |||
| 158 | * calendar.texi (Writing Calendar Files): cal-tex-diary etc only work | ||
| 159 | for some calendars. | ||
| 160 | |||
| 161 | 2007-07-23 Nick Roberts <nickrob@snap.net.nz> | ||
| 162 | |||
| 163 | * screen.texi (Mode Line): Describe new mode-line flag that shows if | ||
| 164 | default-directory for the current buffer is on a remote machine. | ||
| 165 | |||
| 166 | 2007-07-22 Michael Albinus <michael.albinus@gmx.de> | ||
| 167 | |||
| 168 | Sync with Tramp 2.1.10. | ||
| 169 | |||
| 170 | * tramp.texi (trampfn): Expand macro implementation in order to handle | ||
| 171 | empty arguments. | ||
| 172 | (trampfnmhl, trampfnuhl, trampfnhl): Remove macros. Replace all | ||
| 173 | occurencies by trampfn. | ||
| 174 | (Frequently Asked Questions): Extend example code for host | ||
| 175 | identification in the modeline. Add bbdb to approaches shortening Tramp | ||
| 176 | file names to be typed. | ||
| 177 | |||
| 178 | * trampver.texi: Update release number. | ||
| 179 | |||
| 180 | 2007-07-21 Eli Zaretskii <eliz@gnu.org> | ||
| 181 | |||
| 182 | * vc2-xtra.texi (Customizing VC) <vc-handled-backends>: Update the | ||
| 183 | default value. | ||
| 184 | |||
| 185 | 2007-07-21 Richard Stallman <rms@gnu.org> | ||
| 186 | |||
| 187 | * files.texi (Why Version Control?): Improve previous change. | ||
| 188 | |||
| 189 | 2007-07-18 Eric S. Raymond <esr@snark.thyrsus.com> | ||
| 190 | |||
| 191 | * files.texi (Why Version Control?): New node. | ||
| 192 | |||
| 193 | 2007-07-17 Michael Albinus <michael.albinus@gmx.de> | ||
| 194 | |||
| 195 | * tramp.texi: Move @setfilename ../info/tramp up, outside the header | ||
| 196 | section. Reported by <poti@potis.org>. | ||
| 197 | (Remote processes): Arguments of the program to be debugged are taken | ||
| 198 | literally. | ||
| 199 | (Frequently Asked Questions): Simplify recentf example. | ||
| 200 | |||
| 201 | 2007-07-14 Karl Berry <karl@gnu.org> | ||
| 202 | |||
| 203 | * info.texi (@copying): New Back-Cover Text. | ||
| 204 | |||
| 205 | * info.texi (Quitting Info): Move to proper place in source. | ||
| 206 | (Reported by Benno Schulenberg.) | ||
| 207 | |||
| 208 | 2007-07-13 Eli Zaretskii <eliz@gnu.org> | ||
| 209 | |||
| 210 | * Makefile.in (../info/emacs-mime): Use --enable-encoding. | ||
| 211 | |||
| 212 | * makefile.w32-in ($(infodir)/emacs-mime): Ditto. | ||
| 213 | |||
| 214 | * emacs-mime.texi: Add @documentencoding directive. | ||
| 215 | |||
| 216 | 2007-07-12 Nick Roberts <nickrob@snap.net.nz> | ||
| 217 | |||
| 218 | * tramp.texi (Remote processes): Add an anchor to the subsection | ||
| 219 | "Running a debugger on a remote host". | ||
| 220 | |||
| 221 | * building.texi (Starting GUD): Add xref to this anchor. | ||
| 222 | |||
| 223 | 2007-07-12 Michael Albinus <michael.albinus@gmx.de> | ||
| 224 | |||
| 225 | * tramp.texi (Remote processes): Don't call it "experimental" any | ||
| 226 | longer. Add subsection about running a debugger on a remote host. | ||
| 227 | |||
| 228 | 2007-07-10 Carsten Dominik <dominik@science.uva.nl> | ||
| 229 | |||
| 230 | * org.texi (Properties and columns): Chapter rewritten. | ||
| 231 | |||
| 232 | 2007-07-08 Michael Albinus <michael.albinus@gmx.de> | ||
| 233 | |||
| 234 | * tramp.texi: | ||
| 235 | * trampver.texi: Migrate to Tramp 2.1. | ||
| 236 | |||
| 237 | 2007-07-02 Carsten Dominik <dominik@science.uva.nl> | ||
| 238 | |||
| 239 | * org.texi (Properties): New chapter. | ||
| 240 | |||
| 241 | 2007-07-02 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 242 | |||
| 243 | * gnus-faq.texi ([3.2]): Fix locating of environment variables in the | ||
| 244 | Control Panel. | ||
| 245 | |||
| 246 | * gnus.texi (Misc Article): Add index entry for | ||
| 247 | gnus-single-article-buffer. | ||
| 248 | |||
| 249 | 2007-06-27 Andreas Seltenreich <andreas@gate450.dyndns.org> | ||
| 250 | |||
| 251 | * gnus.texi (Starting Up): Fix typo. | ||
| 252 | |||
| 253 | 2007-06-25 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 254 | |||
| 255 | * gnus.texi (Asynchronous Fetching): Fix typo. | ||
| 256 | |||
| 257 | 2007-06-24 Karl Berry <karl@gnu.org> | ||
| 258 | |||
| 259 | * emacs.texi: new Back-Cover Text. | ||
| 260 | |||
| 261 | 2007-06-20 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 262 | |||
| 263 | * calc.texi:Change ifinfo to ifnottex (as appropriate) throughout. | ||
| 264 | (About This Manual): Remove redundant information. | ||
| 265 | (Getting Started): Mention author. | ||
| 266 | (Basic Arithmetic, Customizing Calc): Make description of the | ||
| 267 | variable `calc-multiplication-has-precedence' match its new effect. | ||
| 268 | |||
| 269 | 2007-06-19 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 270 | |||
| 271 | * calc.texi (Basic Arithmetic, Customizing Calc): Mention | ||
| 272 | the variable `calc-multiplication-has-precedence'. | ||
| 273 | |||
| 274 | 2007-06-19 Carsten Dominik <dominik@science.uva.nl> | ||
| 275 | |||
| 276 | * org.texi (Tag): Section swapped with node Timestamps. | ||
| 277 | (Formula syntax for Lisp): Document new `L' flag. | ||
| 278 | |||
| 279 | 2007-06-06 Andreas Seltenreich <andreas@gate450.dyndns.org> | ||
| 280 | |||
| 281 | * gnus.texi (Misc Group Stuff, Summary Buffer) | ||
| 282 | (Server Commands, Article Keymap): Fix typo. s/function/command/. | ||
| 283 | |||
| 284 | 2007-06-07 Alan Mackenzie <acm@muc.de> | ||
| 285 | |||
| 286 | * display.texi (Optional Mode Line): Document the new form of | ||
| 287 | line+column numbers, "(561,2)". | ||
| 288 | |||
| 289 | 2007-06-06 Juanma Barranquero <lekktu@gmail.com> | ||
| 290 | |||
| 291 | * cc-mode.texi (Comment Commands, Getting Started, Style Variables): | ||
| 292 | * gnus.texi (Article Buttons, Mail Source Customization) | ||
| 293 | (Sending or Not Sending, Customizing NNDiary): | ||
| 294 | * maintaining.texi (Create Tags Table): | ||
| 295 | * message.texi (Message Headers): | ||
| 296 | * mh-e.texi (HTML): Fix typos. | ||
| 297 | |||
| 298 | 2007-06-07 Michael Albinus <michael.albinus@gmx.de> | ||
| 299 | |||
| 300 | Sync with Tramp 2.0.56. | ||
| 301 | |||
| 302 | * tramp.texi (Frequently Asked Questions): Improve ~/.zshrc | ||
| 303 | settings. Reported by Ted Zlatanov <tzz@lifelogs.com>. | ||
| 304 | |||
| 305 | 2007-06-02 Chong Yidong <cyd@stupidchicken.com> | ||
| 306 | |||
| 307 | * Version 22.1 released. | ||
| 308 | |||
| 309 | 2007-05-26 Michael Olson <mwolson@gnu.org> | ||
| 310 | |||
| 311 | * erc.texi (Modules): Fix references to completion modules. | ||
| 312 | |||
| 313 | 2007-05-09 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 314 | |||
| 315 | * gnus.texi (Running NNDiary): Use ~/.gnus.el instead of gnusrc. | ||
| 316 | |||
| 317 | 2007-05-09 Didier Verna <didier@xemacs.org> | ||
| 318 | |||
| 319 | * gnus.texi (Email Based Diary): New. Proper documentation for the | ||
| 320 | nndiary back end and the gnus-diary library. | ||
| 321 | |||
| 322 | 2007-05-07 Karl Berry <karl@gnu.org> | ||
| 323 | |||
| 324 | * emacs.texi (EMACSVER): Back to 22. | ||
| 325 | |||
| 326 | 2007-05-06 Richard Stallman <rms@gnu.org> | ||
| 327 | |||
| 328 | * maintaining.texi (Create Tags Table): Clean up previous change. | ||
| 329 | |||
| 330 | 2007-05-05 Francesco Potort,Al(B <pot@gnu.org> | ||
| 331 | |||
| 332 | * maintaining.texi (Create Tags Table): Add text about the dangers of | ||
| 333 | making symbolic links to tags files. | ||
| 334 | |||
| 335 | 2007-05-04 Karl Berry <karl@gnu.org> | ||
| 336 | |||
| 337 | * emacs.texi (EMACSVER) [smallbook]: 22.1 for printed version, not 22. | ||
| 338 | |||
| 339 | 2007-05-03 Karl Berry <karl@gnu.org> | ||
| 340 | |||
| 341 | * emacs.texi (EMACSVER) [smallbook]: 22 for printed version. | ||
| 342 | |||
| 343 | * .cvsignore (*.pdf): New entry. | ||
| 344 | |||
| 345 | * texinfo.tex: Update from current version for better pdf generation. | ||
| 346 | |||
| 347 | * emacs.texi (\urlcolor, \linkcolor) [smallbook]: \let to \Black | ||
| 348 | for printing. | ||
| 349 | |||
| 350 | 2007-05-01 Richard Stallman <rms@gnu.org> | ||
| 351 | |||
| 352 | * cmdargs.texi (Initial Options): Under --batch, mention --eval. | ||
| 353 | |||
| 354 | 2007-04-30 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 355 | |||
| 356 | * gnus.texi (Article Highlighting): Clarify gnus-cite-parse-max-size. | ||
| 357 | |||
| 358 | 2007-04-28 Glenn Morris <rgm@gnu.org> | ||
| 359 | |||
| 360 | * ack.texi (Acknowledgments): | ||
| 361 | * anti.texi (Antinews): | ||
| 362 | * faq.texi (New in Emacs 22): | ||
| 363 | * programs.texi (Program Modes): Restore mention of python.el pending | ||
| 364 | consideration of legal status. | ||
| 365 | |||
| 366 | 2007-04-28 Richard Stallman <rms@gnu.org> | ||
| 367 | |||
| 368 | * files.texi (File Names): Fixes to ~ description on MS systems. | ||
| 369 | |||
| 370 | 2007-04-27 J.D. Smith <jdsmith@as.arizona.edu> | ||
| 371 | |||
| 372 | * idlwave.texi: Minor updates for IDLWAVE 6.1. | ||
| 373 | |||
| 374 | 2007-04-26 Glenn Morris <rgm@gnu.org> | ||
| 375 | |||
| 376 | * emacs.texi (EMACSVER): Increase to 22.1.50. | ||
| 377 | |||
| 378 | 2007-04-25 Karl Berry <karl@gnu.org> | ||
| 379 | |||
| 380 | * emacs.texi: Improve line breaks on copyright page, | ||
| 381 | similar layout to lispref, 8.5x11 by default. | ||
| 382 | |||
| 383 | * dired.texi (Image-Dired): Improve line break, fix typo. | ||
| 384 | |||
| 385 | 2007-04-24 Chong Yidong <cyd@stupidchicken.com> | ||
| 386 | |||
| 387 | * programs.texi (Program Modes): | ||
| 388 | * faq.texi (New in Emacs 22): | ||
| 389 | * anti.texi (Antinews): | ||
| 390 | * ack.texi (Acknowledgments): python.el removed. | ||
| 391 | |||
| 392 | 2007-04-23 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 393 | |||
| 394 | * calc.texi (Reporting bugs): Update maintainer's address. | ||
| 395 | |||
| 396 | 2007-04-23 Chong Yidong <cyd@stupidchicken.com> | ||
| 397 | |||
| 398 | * display.texi (Highlight Interactively): Correct description of | ||
| 399 | hi-lock-file-patterns-policy. | ||
| 400 | |||
| 401 | * files.texi (File Archives): Mention self-extracting executables. | ||
| 402 | |||
| 403 | 2007-04-23 Eli Zaretskii <eliz@gnu.org> | ||
| 404 | |||
| 405 | * search.texi (Unconditional Replace, Query Replace): Add xref to | ||
| 406 | "Replacement and Case". | ||
| 407 | |||
| 408 | 2007-04-22 Chong Yidong <cyd@stupidchicken.com> | ||
| 409 | |||
| 410 | * dired.texi (Image-Dired): Move from Thumbnails node. | ||
| 411 | * misc.texi (Thumbnails): Node deleted. | ||
| 412 | * emacs.texi (Top): Update node listing. | ||
| 413 | |||
| 414 | * files.texi (File Conveniences): | ||
| 415 | * ack.texi (Acknowledgments): | ||
| 416 | * faq.texi (New in Emacs 22): Rename "tumme" to "image-dired". | ||
| 417 | |||
| 418 | 2007-04-21 Richard Stallman <rms@gnu.org> | ||
| 419 | |||
| 420 | * display.texi (Highlight Interactively): Correct previous change. | ||
| 421 | Clarify doc of hi-lock-find-patterns, and move new features into it. | ||
| 422 | |||
| 423 | 2007-04-20 David Koppelman <koppel@ece.lsu.edu> | ||
| 424 | |||
| 425 | * display.texi (Highlight Interactively): Document | ||
| 426 | hi-lock-file-patterns-policy. | ||
| 427 | |||
| 428 | 2007-04-20 Martin Rudalics <rudalics@gmx.at> | ||
| 429 | |||
| 430 | * display.texi (Scrolling): Fix typo. | ||
| 431 | |||
| 432 | 2007-04-15 Jay Belanger <belanger@truman.edu> | ||
| 433 | |||
| 434 | * calc.texi (Title page): Remove the date. | ||
| 435 | (Basic Arithmetic): Emphasize that / binds less strongly than *. | ||
| 436 | (The Standard Calc Interface): Change trail title. | ||
| 437 | (Floats): Mention that when non-decimal floats are entered, only | ||
| 438 | approximations are stored. | ||
| 439 | (Copying): Move to the appendices. | ||
| 440 | (GNU Free Documentation License): Add as an appendix. | ||
| 441 | |||
| 442 | 2007-04-15 Chong Yidong <cyd@stupidchicken.com> | ||
| 443 | |||
| 444 | * ada-mode.texi, autotype.texi, cc-mode.texi, cl.texi: | ||
| 445 | * dired-x.texi, ebrowse.texi, ediff.texi: | ||
| 446 | * emacs-mime.texi, erc.texi, eshell.texi: | ||
| 447 | * eudc.texi, flymake.texi, forms.texi, gnus.texi: | ||
| 448 | * idlwave.texi, message.texi, newsticker.texi, org.texi: | ||
| 449 | * pcl-cvs.texi, pgg.texi, rcirc.texi, reftex.texi, sc.texi: | ||
| 450 | * ses.texi, sieve.texi, smtpmail.texi, speedbar.texi: | ||
| 451 | * tramp.texi, url.texi, vip.texi, viper.texi, widget.texi: | ||
| 452 | * woman.texi: Include GFDL. | ||
| 453 | |||
| 454 | * doclicense.texi: Remove node heading, so that it can be included by | ||
| 455 | other files. | ||
| 456 | |||
| 457 | * emacs.texi: Insert node heading for GFDL. | ||
| 458 | |||
| 459 | * dired-x.texi: Relicence under GFDL. Remove date from title page. | ||
| 460 | |||
| 461 | * calc.texi (Algebraic Tutorial): Emphasize that / binds less strongly | ||
| 462 | than *. | ||
| 463 | |||
| 464 | 2007-04-14 Carsten Dominik <dominik@science.uva.nl> | ||
| 465 | |||
| 466 | * org.texi (Formula syntax for Calc): Emphasize the operator precedence | ||
| 467 | in Calc. | ||
| 468 | |||
| 469 | 2007-04-14 Eli Zaretskii <eliz@gnu.org> | ||
| 470 | |||
| 471 | * cmdargs.texi (Colors): Qualify "color of window" index entry by | ||
| 472 | "command line". | ||
| 473 | |||
| 474 | * display.texi (Faces): Refer to "Creating Frames" for face | ||
| 475 | and other frame customizations in .emacs. | ||
| 476 | |||
| 477 | * frames.texi (Creating Frames): Mention that face customizations can | ||
| 478 | be put in .emacs. Add index entries. | ||
| 479 | |||
| 480 | 2007-04-12 Richard Stallman <rms@gnu.org> | ||
| 481 | |||
| 482 | * glossary.texi (Glossary): Explain `iff'. | ||
| 483 | |||
| 484 | 2007-04-11 Karl Berry <karl@gnu.org> | ||
| 485 | |||
| 486 | * gnu.texi (Top), | ||
| 487 | * macos.texi (Mac Font Specs), | ||
| 488 | * anti.texi (Antinews), | ||
| 489 | * xresources.texi (Resources), | ||
| 490 | * misc.texi (Emulation), | ||
| 491 | * calendar.texi (Daylight Saving), | ||
| 492 | * dired.texi (Dired and Find), | ||
| 493 | * rmail.texi (Remote Mailboxes), | ||
| 494 | * sending.texi (Mail Headers), | ||
| 495 | * programs.texi (Which Function), | ||
| 496 | * files.texi (Recover), | ||
| 497 | * buffers.texi (Uniquify), | ||
| 498 | * frames.texi (Wheeled Mice), | ||
| 499 | * killing.texi (Rectangles): Wording to improve breaks in | ||
| 500 | 8.5x11 format. | ||
| 501 | * mule.texi (Language Environments): \hbadness=10000 since there's | ||
| 502 | no way to reword. | ||
| 503 | * emacs.texi (smallbook): New @set to more easily switch between | ||
| 504 | smallbook and 8.5x11. | ||
| 505 | |||
| 506 | 2007-04-11 Richard Stallman <rms@gnu.org> | ||
| 507 | |||
| 508 | * files.texi (File Conveniences): Add xref to Tumme. | ||
| 509 | Delete text about Thumbnail mode. | ||
| 510 | |||
| 511 | 2007-04-09 Romain Francoise <romain@orebokech.com> | ||
| 512 | |||
| 513 | * faq.texi (New in Emacs 22): Mention improvements to the Windows and | ||
| 514 | Mac OS ports. Make it clear that mouse-1 complements and doesn't | ||
| 515 | replace mouse-2. | ||
| 516 | |||
| 517 | 2007-04-09 Alan Mackenzie <acm@muc.de> | ||
| 518 | |||
| 519 | * cmdargs.texi (Initial Options): Call "inhibit-splash-screen" by its | ||
| 520 | new name. Insert concept index entries. | ||
| 521 | |||
| 522 | 2007-04-08 Richard Stallman <rms@gnu.org> | ||
| 523 | |||
| 524 | * url.texi: Fix some indexing. | ||
| 525 | (Disk Caching): Drop discussion of old/other Emacs versions. | ||
| 526 | |||
| 527 | 2007-04-08 Chong Yidong <cyd@stupidchicken.com> | ||
| 528 | |||
| 529 | * display.texi (Standard Faces): Document prefix arg for | ||
| 530 | list-faces-display. | ||
| 531 | |||
| 532 | * rmail.texi (Rmail Scrolling): Document rmail-end-of-message. | ||
| 533 | |||
| 534 | * woman.texi (Word at point, Interface Options): woman-topic-at-point | ||
| 535 | renamed to woman-use-topic-at-point. Document new behavior. | ||
| 536 | |||
| 537 | 2007-04-07 Chong Yidong <cyd@stupidchicken.com> | ||
| 538 | |||
| 539 | * url.texi (Disk Caching): Say Emacs 21 "and later". | ||
| 540 | |||
| 541 | * cc-mode.texi (Font Locking Preliminaries): Link to Emacs manual node | ||
| 542 | on Font locking which now mentions JIT lock. | ||
| 543 | |||
| 544 | * killing.texi (Deletion): Rewrite description of M-\ prefix argument. | ||
| 545 | |||
| 546 | * files.texi (Misc File Ops): Rewrite description of | ||
| 547 | insert-file-literally. | ||
| 548 | |||
| 549 | 2007-04-01 Michael Olson <mwolson@gnu.org> | ||
| 550 | |||
| 551 | * erc.texi: Update for the ERC 5.2 release. | ||
| 552 | |||
| 553 | 2007-03-31 David Kastrup <dak@gnu.org> | ||
| 554 | |||
| 555 | * woman.texi (Topic, Interface Options): Explain changes semantics of | ||
| 556 | woman-manpath in order to consider MANPATH_MAP entries. | ||
| 557 | |||
| 558 | 2007-03-31 Eli Zaretskii <eliz@gnu.org> | ||
| 559 | |||
| 560 | * misc.texi (Printing): Postscript -> PostScript. | ||
| 561 | |||
| 562 | * emacs-mime.texi (Non-MIME): Postscript -> PostScript. | ||
| 563 | |||
| 564 | * ack.texi (Acknowledgments): Postscript -> PostScript. | ||
| 565 | |||
| 566 | * custom.texi (Init File, Init Non-ASCII): Fix last change. | ||
| 567 | |||
| 568 | * emacs.texi (Top): Fix the menu due to the change in custom.texi | ||
| 569 | below. | ||
| 570 | |||
| 571 | 2007-03-30 Chong Yidong <cyd@stupidchicken.com> | ||
| 572 | |||
| 573 | * custom.texi (Non-ASCII Rebinding): Node deleted. Material moved to | ||
| 574 | Init Non-ASCII. | ||
| 575 | (Init Rebinding, Init Syntax): Link to Init Non-ASCII instead. | ||
| 576 | (Init Non-ASCII): New node. | ||
| 577 | |||
| 578 | 2007-03-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 579 | |||
| 580 | * macos.texi (Mac Font Specs): Mention AppleAntiAliasingThreshold. | ||
| 581 | |||
| 582 | 2007-03-26 Richard Stallman <rms@gnu.org> | ||
| 583 | |||
| 584 | * pgg.texi (Caching passphrase): Clean up previous change. | ||
| 585 | |||
| 586 | 2007-03-25 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 587 | |||
| 588 | * gnus.texi (Setting Process Marks): Fix typo. | ||
| 589 | |||
| 590 | 2007-03-25 Romain Francoise <romain@orebokech.com> | ||
| 591 | |||
| 592 | * faq.texi (New in Emacs 22): Reorganize using an itemized list for | ||
| 593 | readability, and include various fixes by Daniel Brockman, Nick Roberts | ||
| 594 | and Dieter Wilhelm. | ||
| 595 | |||
| 596 | 2007-03-24 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 597 | |||
| 598 | * gnus.texi (Splitting Mail): Reword "splitting"-as-adj to be -as-noun. | ||
| 599 | |||
| 600 | * gnus.texi (Mail Source Specifiers): Fix typo. | ||
| 601 | |||
| 602 | 2007-03-22 Ralf Angeli <angeli@caeruleus.net> | ||
| 603 | |||
| 604 | * reftex.texi (Imprint): Update maintainer information. | ||
| 605 | |||
| 606 | 2007-03-15 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 607 | |||
| 608 | * message.texi (Message Buffers): Update documentation for | ||
| 609 | message-generate-new-buffers. | ||
| 610 | |||
| 611 | 2007-03-15 Daiki Ueno <ueno@unixuser.org> | ||
| 612 | |||
| 613 | * pgg.texi (Caching passphrase): Describe pgg-passphrase-coding-system. | ||
| 614 | |||
| 615 | 2007-03-21 Glenn Morris <rgm@gnu.org> | ||
| 616 | |||
| 617 | * eshell.texi (Known problems): Emacs 22 comes with eshell 2.4.2. | ||
| 618 | |||
| 619 | 2007-03-19 Chong Yidong <cyd@stupidchicken.com> | ||
| 620 | |||
| 621 | * eshell.texi (Known problems): Emacs 21 -> 22. | ||
| 622 | |||
| 623 | * cc-mode.texi (Performance Issues): Update note about 21.3 to 22.1. | ||
| 624 | |||
| 625 | 2007-03-18 Jay Belanger <belanger@truman.edu> | ||
| 626 | |||
| 627 | * calc.texi (Time Zones): Mention that the DST rules changed in 2007. | ||
| 628 | |||
| 629 | 2007-03-12 Glenn Morris <rgm@gnu.org> | ||
| 630 | |||
| 631 | * calc.texi (Time Zones): Switch to new North America DST rule. | ||
| 632 | |||
| 633 | * calendar.texi, emacs.texi (Daylight Saving): Rename node from | ||
| 634 | "Daylight Savings". | ||
| 635 | |||
| 636 | * calc.texi, calendar.texi: Replace "daylight savings" with "daylight | ||
| 637 | saving" in text throughout. | ||
| 638 | |||
| 639 | 2007-03-11 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> | ||
| 640 | |||
| 641 | * gnus.texi (Mail and Post): Update documentation for gnus-user-agent. | ||
| 642 | The variable now uses a list of symbols instead of just a symbol. | ||
| 643 | Reported by Christoph Conrad <christoph.conrad@gmx.de>. | ||
| 644 | |||
| 645 | 2007-03-06 Romain Francoise <romain@orebokech.com> | ||
| 646 | |||
| 647 | * faq.texi (New in Emacs 22): Don't say "now" too much. Add MH-E to | ||
| 648 | new packages, and mention Gnus update. | ||
| 649 | |||
| 650 | 2007-03-04 Richard Stallman <rms@gnu.org> | ||
| 651 | |||
| 652 | * custom.texi (Safe File Variables): Minor correction. | ||
| 653 | |||
| 654 | 2007-02-27 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 655 | |||
| 656 | * gnus.texi (NNTP): Mention nntp-never-echoes-commands and | ||
| 657 | nntp-open-connection-functions-never-echo-commands. | ||
| 658 | |||
| 659 | 2007-02-28 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 660 | |||
| 661 | * rmail.texi (Movemail): Add internal ref. | ||
| 662 | Don't indent the intro for the PROTO table. | ||
| 663 | Format PROTO table items with @code. | ||
| 664 | |||
| 665 | 2007-02-27 Chong Yidong <cyd@stupidchicken.com> | ||
| 666 | |||
| 667 | * pgg.texi (Caching passphrase): Document gpg-agent usage, gpg-agent | ||
| 668 | problems on the console, and security risk in not using gpg-agent. | ||
| 669 | |||
| 670 | 2007-02-26 Nick Roberts <nickrob@snap.net.nz> | ||
| 671 | |||
| 672 | * building.texi: Remove references to bashdb. | ||
| 673 | |||
| 674 | 2007-02-25 Carsten Dominik <dominik@science.uva.nl> | ||
| 675 | |||
| 676 | * org.texi (The spreadsheet): Renamed from "Table calculations". | ||
| 677 | Completely reorganized and rewritten. | ||
| 678 | (CamelCase links): Section removed. | ||
| 679 | (Repeating items): New section. | ||
| 680 | (Tracking TODO state changes): New section. | ||
| 681 | (Agenda views): Chapter reorganized and rewritten. | ||
| 682 | (HTML export): Section rewritten. | ||
| 683 | (Tables in arbitrary syntax): New section. | ||
| 684 | (Summary): Better feature summary. | ||
| 685 | (Activation): Document problem with cut-and-paste of Lisp code | ||
| 686 | from PDF files. | ||
| 687 | (Visibility cycling): Document indirect buffer use. | ||
| 688 | (Structure editing): Document sorting. | ||
| 689 | (Remember): Section rewritten. | ||
| 690 | (Time stamps): Better description of time stamp types. | ||
| 691 | (Tag searches): Document regular expression search for tags. | ||
| 692 | (Stuck projects): New section. | ||
| 693 | (In-buffer settings): New keywords. | ||
| 694 | (History and Acknowledgments): Updated description. | ||
| 695 | |||
| 696 | 2007-02-24 Alan Mackenzie <acm@muc.de> | ||
| 697 | |||
| 698 | * cc-mode.texi (Movement Commands): Insert two missing command names. | ||
| 699 | (Getting Started): Slight wording correction (use conditional). | ||
| 700 | |||
| 701 | 2007-02-22 Kim F. Storm <storm@cua.dk> | ||
| 702 | |||
| 703 | * widget.texi (User Interface, Basic Types): Document need to put some | ||
| 704 | text before the %v escape in :format string in editable-field widget. | ||
| 705 | |||
| 706 | 2007-02-19 Juanma Barranquero <lekktu@gmail.com> | ||
| 707 | |||
| 708 | * mule.texi (Language Environments): Update list of supported language | ||
| 709 | environments. | ||
| 710 | |||
| 711 | 2007-02-18 Romain Francoise <romain@orebokech.com> | ||
| 712 | |||
| 713 | * pcl-cvs.texi (Miscellaneous commands): q runs `cvs-bury-buffer', not | ||
| 714 | `cvs-mode-quit'. | ||
| 715 | |||
| 716 | 2007-02-14 Kim F. Storm <storm@cua.dk> | ||
| 717 | |||
| 718 | * building.texi (Grep Searching): Fix lgrep doc. | ||
| 719 | |||
| 720 | 2007-02-12 Chong Yidong <cyd@stupidchicken.com> | ||
| 721 | |||
| 722 | * back.texi: Remove unused file. | ||
| 723 | |||
| 724 | 2007-02-10 Markus Triska <markus.triska@gmx.at> | ||
| 725 | |||
| 726 | * widget.texi (Programming Example): Put constant strings in :format. | ||
| 727 | |||
| 728 | 2007-02-07 Juanma Barranquero <lekktu@gmail.com> | ||
| 729 | |||
| 730 | * faq.texi (Fullscreen mode on MS-Windows): New node. | ||
| 731 | |||
| 732 | 2007-02-05 Francesco Potort,Al(B <pot@gnu.org> | ||
| 733 | |||
| 734 | * maintaining.texi (Tag Syntax): Now --members is the default for | ||
| 735 | etags, not for ctags yet. | ||
| 736 | |||
| 737 | 2007-02-04 David Kastrup <dak@gnu.org> | ||
| 738 | |||
| 739 | * faq.texi (AUCTeX): Update version number. Should probably be done | ||
| 740 | for other packages as well. | ||
| 741 | |||
| 742 | 2007-02-03 Eli Zaretskii <eliz@gnu.org> | ||
| 743 | |||
| 744 | * emacs.texi (Top): Update the top-level menus. Make the detailed menu | ||
| 745 | headers compliant with Texinfo guidelines and with what texnfo-upd.el | ||
| 746 | expects. Add comments to prevent people from inadvertently modifying | ||
| 747 | the key parts needed by `texinfo-multiple-files-update'. | ||
| 748 | |||
| 749 | 2007-01-29 Chong Yidong <cyd@stupidchicken.com> | ||
| 750 | |||
| 751 | * frames.texi (Secondary Selection): Window clicked does not matter | ||
| 752 | when mouse-yank-at-point is non-nil. | ||
| 753 | |||
| 754 | 2007-01-28 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> | ||
| 755 | |||
| 756 | * gnus.texi (Batching Agents): Fix example. Reported by Tassilo Horn | ||
| 757 | <tassilo@member.fsf.org>. | ||
| 758 | |||
| 759 | 2007-01-27 Eli Zaretskii <eliz@gnu.org> | ||
| 760 | |||
| 761 | * msdog.texi (ls in Lisp): Document ls-lisp-format-time-list and | ||
| 762 | ls-lisp-use-localized-time-format. | ||
| 763 | |||
| 764 | 2007-01-20 Markus Triska <markus.triska@gmx.at> | ||
| 765 | |||
| 766 | * flymake.texi (Flymake mode): find-file-hook instead of ...-hooks. | ||
| 767 | |||
| 768 | 2007-01-13 Michael Olson <mwolson@gnu.org> | ||
| 769 | |||
| 770 | * erc.texi (Modules): Mention capab-identify module. | ||
| 771 | |||
| 772 | 2007-01-16 Glenn Morris <rgm@gnu.org> | ||
| 773 | |||
| 774 | * abbrevs.texi (Editing Abbrevs): Describe how to disable a | ||
| 775 | system abbrev. | ||
| 776 | |||
| 777 | 2007-01-11 Richard Stallman <rms@gnu.org> | ||
| 778 | |||
| 779 | * msdog.texi (Windows Keyboard): Another small cleanup. | ||
| 780 | |||
| 781 | 2007-01-10 Richard Stallman <rms@gnu.org> | ||
| 782 | |||
| 783 | * msdog.texi (Windows Keyboard): Yet another try to make | ||
| 784 | everyone happy with that passage. | ||
| 785 | |||
| 786 | 2007-01-05 Richard Stallman <rms@gnu.org> | ||
| 787 | |||
| 788 | * anti.texi (Antinews): Mention M-x shell scrolling. | ||
| 789 | |||
| 790 | 2007-01-05 Nick Roberts <nickrob@snap.net.nz> | ||
| 791 | |||
| 792 | * building.texi (Watch Expressions): Describe gdb-max-children. | ||
| 793 | |||
| 794 | 2007-01-05 Michael Olson <mwolson@gnu.org> | ||
| 795 | |||
| 796 | * erc.texi (Getting Started): Update for /RECONNECT command. | ||
| 797 | |||
| 798 | 2007-01-04 Richard Stallman <rms@gnu.org> | ||
| 799 | |||
| 800 | * ebrowse.texi: Change C-c b to C-c C-m. | ||
| 801 | |||
| 802 | * msdog.texi (Windows Keyboard): Clarify previous change. | ||
| 803 | |||
| 804 | 2007-01-03 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 805 | |||
| 806 | * gnus.texi (Customizing Articles): Use index entries for gnus-treat-* | ||
| 807 | variables only in info to avoid redundant entries in the printed | ||
| 808 | manual. | ||
| 809 | |||
| 810 | 2007-01-02 Richard Stallman <rms@gnu.org> | ||
| 811 | |||
| 812 | * custom.texi (Changing a Variable): Minor clarification. | ||
| 813 | (Specific Customization): customize-customized => customize-unsaved. | ||
| 814 | |||
| 815 | * entering.texi (Entering Emacs): Clean up text about restarting | ||
| 816 | Emacs for each file. | ||
| 817 | |||
| 818 | * misc.texi (Shell Options): Minor cleanup. | ||
| 819 | |||
| 820 | * msdog.texi (Windows Keyboard): Explain that Windows was incompatible | ||
| 821 | with Emacs, not vice versa. | ||
| 822 | |||
| 823 | * programs.texi (Symbol Completion): Recommend customizing | ||
| 824 | window manager. | ||
| 825 | |||
| 826 | * xresources.texi (Resources): Minor fix. | ||
| 827 | |||
| 828 | 2007-01-02 Daiki Ueno <ueno@unixuser.org> | ||
| 829 | |||
| 830 | * message.texi (Using PGP/MIME): Document gpg-agent usage. | ||
| 831 | |||
| 832 | 2007-01-02 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 833 | |||
| 834 | * message.texi (Security): Split into sub-nodes. | ||
| 835 | |||
| 836 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 837 | |||
| 838 | * cc-mode.texi ("Limitations and Known Bugs"): Document problems with | ||
| 839 | eval-after-load in Emacs <=21 and a workaround. Document that | ||
| 840 | trigraphs are not supported. | ||
| 841 | |||
| 842 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 843 | |||
| 844 | * cc-mode.texi ("Filling and Breaking"): Amend the doc for | ||
| 845 | c-context-line-break. When invoked within a string, preserve | ||
| 846 | whitespace. Add a backslash only when also in a macro. | ||
| 847 | |||
| 848 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 849 | |||
| 850 | * cc-mode.texi ("Choosing a Style"): Mention c-file-style. | ||
| 851 | |||
| 852 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 853 | |||
| 854 | * cc-mode.texi ("Movement Commands", "Sample .emacs File"): C-M-[ae] | ||
| 855 | are now bound by default to c-\(beginning\|end\)-of-defun by default. | ||
| 856 | |||
| 857 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 858 | |||
| 859 | * cc-mode.texi ("Other Commands"): Move c-set-style (C-c .) here from | ||
| 860 | "Choosing a Style". | ||
| 861 | |||
| 862 | * cc-mode.texi ("Styles"): Add @dfn{style}. | ||
| 863 | |||
| 864 | 2007-01-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 865 | |||
| 866 | * xresources.texi (Table of Resources): Add scrollBarWidth resource. | ||
| 867 | |||
| 868 | 2007-01-01 Richard Stallman <rms@gnu.org> | ||
| 869 | |||
| 870 | * commands.texi (User Input): Document keys stolen by window mangers. | ||
| 871 | |||
| 872 | 2006-12-31 Richard Stallman <rms@gnu.org> | ||
| 873 | |||
| 874 | * custom.texi (Specific Customization): Document customize-option | ||
| 875 | instead of customize-variable. | ||
| 876 | |||
| 877 | 2006-12-31 Kim F. Storm <storm@cua.dk> | ||
| 878 | |||
| 879 | * major.texi (Choosing Modes): Document auto-mode-case-fold. | ||
| 880 | |||
| 881 | 2006-12-30 Kim F. Storm <storm@cua.dk> | ||
| 882 | |||
| 883 | * killing.texi (CUA Bindings): Fix typo. | ||
| 884 | |||
| 885 | * xresources.texi (Table of Resources): Mention grow-only value for | ||
| 886 | auto-resize-tool-bars. | ||
| 887 | |||
| 888 | 2006-12-30 Michael Albinus <michael.albinus@gmx.de> | ||
| 889 | |||
| 890 | Sync with Tramp 2.0.55. | ||
| 891 | |||
| 892 | * trampver.texi: Update release number. | ||
| 893 | |||
| 894 | 2006-12-29 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 895 | |||
| 896 | * gnus.texi (Customizing Articles): Add index entries for all | ||
| 897 | gnus-treat-* variables. | ||
| 898 | |||
| 899 | 2006-12-29 Jouni K. Sepp,Ad(Bnen <jks@iki.fi> | ||
| 900 | |||
| 901 | * gnus.texi (IMAP): Fix incorrect explanation of | ||
| 902 | nnimap-search-uids-not-since-is-evil in documentation for | ||
| 903 | nnimap-expunge-search-string. | ||
| 904 | |||
| 905 | 2006-12-27 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 906 | |||
| 907 | * gnus.texi (ifile spam filtering): Rename spam-ifile-database-path to | ||
| 908 | spam-ifile-database. | ||
| 909 | |||
| 910 | 2006-12-26 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 911 | |||
| 912 | * gnus.texi (Spam Package Configuration Examples): Don't encourage to | ||
| 913 | rebind C-s. | ||
| 914 | |||
| 915 | 2006-12-26 Jouni K. Sepp,Ad(Bnen <jks@iki.fi> | ||
| 916 | |||
| 917 | * gnus.texi (Group Parameters, Group Maintenance, Topic Commands) | ||
| 918 | (Mail Group Commands, Expiring Mail, IMAP): Add index entries for | ||
| 919 | "expiring mail". | ||
| 920 | (IMAP): Document nnimap-search-uids-not-since-is-evil and | ||
| 921 | nnimap-nov-is-evil. | ||
| 922 | |||
| 923 | 2006-12-27 Eli Zaretskii <eliz@gnu.org> | ||
| 924 | |||
| 925 | * msdog.texi (Windows Keyboard): Mention widespread Windows bindings, | ||
| 926 | and how to get them back. | ||
| 927 | |||
| 928 | 2006-12-26 Richard Stallman <rms@gnu.org> | ||
| 929 | |||
| 930 | * calendar.texi (Holidays): Holiday listing is based on current | ||
| 931 | practice, but DST is not. | ||
| 932 | |||
| 933 | 2006-12-25 Richard Stallman <rms@gnu.org> | ||
| 934 | |||
| 935 | * emacs.texi (Top): Update subnode menus. | ||
| 936 | |||
| 937 | * mark.texi (Transient Mark): Fix xref. | ||
| 938 | |||
| 939 | * killing.texi (Graphical Kill): Node deleted. | ||
| 940 | (Killing): Add xref to Cut and Paste. | ||
| 941 | (CUA Bindings): Update xref. | ||
| 942 | |||
| 943 | * frames.texi (Cut and Paste): New section to hold other nodes. | ||
| 944 | (Mouse Commands): Node demoted. | ||
| 945 | (Cut/Paste Other App): Split out from Mouse Commands. | ||
| 946 | (Word and Line Mouse): Likewise. | ||
| 947 | (Secondary Selection, Clipboard): Nodes demoted. | ||
| 948 | |||
| 949 | 2006-12-25 Kevin Ryde <user42@zip.com.au> | ||
| 950 | |||
| 951 | * cl.texi (Sorting Sequences): In sort*, add a little cautionary note | ||
| 952 | about the key procedure being used heavily. | ||
| 953 | |||
| 954 | 2006-12-24 Chong Yidong <cyd@stupidchicken.com> | ||
| 955 | |||
| 956 | * pgg.texi (Caching passphrase): Default for pgg-gpg-use-agent changed | ||
| 957 | to t. | ||
| 958 | (Prerequisites): Add explanation about gpg-agent. | ||
| 959 | |||
| 960 | 2006-12-24 Kevin Ryde <user42@zip.com.au> | ||
| 961 | |||
| 962 | * calendar.texi (Holidays): US daylight saving begins second Sunday | ||
| 963 | in March for 2007 onwards. | ||
| 964 | (Daylight Savings): Show new US default daylight saving rules, 2nd | ||
| 965 | Sun in Mar to 1st Sun in Nov, now in cal-dst.el. | ||
| 966 | |||
| 967 | 2006-12-23 Chong Yidong <cyd@stupidchicken.com> | ||
| 968 | |||
| 969 | * calendar.texi (Scroll Calendar): < and > are switched. | ||
| 970 | |||
| 971 | 2006-12-23 Kevin Rodgers <ihs_4664@yahoo.com> | ||
| 972 | |||
| 973 | * killing.texi (Deletion): Describe M-\ prefix argument. | ||
| 974 | |||
| 975 | 2006-12-23 Richard Stallman <rms@gnu.org> | ||
| 976 | |||
| 977 | * search.texi (Regexp Search): Explain why forward and reverse regexp | ||
| 978 | search are not mirror images. | ||
| 979 | |||
| 980 | 2006-12-22 Kevin Ryde <user42@zip.com.au> | ||
| 981 | |||
| 982 | * cl.texi (Sorting Sequences): Typo in sort*, example showed plain | ||
| 983 | "sort" instead of "sort*". | ||
| 984 | |||
| 985 | 2006-12-19 Richard Stallman <rms@gnu.org> | ||
| 986 | |||
| 987 | * calc.texi (History and Acknowledgements): Recognize that Emacs | ||
| 988 | now does have floating point. | ||
| 989 | |||
| 990 | 2006-12-19 Kim F. Storm <storm@cua.dk> | ||
| 991 | |||
| 992 | * major.texi (Choosing Modes): Describe match-function elements for | ||
| 993 | magic-mode-alist. | ||
| 994 | |||
| 995 | 2006-12-19 Michael Albinus <michael.albinus@gmx.de> | ||
| 996 | |||
| 997 | * tramp.texi (External transfer methods): Describe new method `scpc'. | ||
| 998 | |||
| 999 | 2006-12-18 Eli Zaretskii <eliz@gnu.org> | ||
| 1000 | |||
| 1001 | * msdog.texi (Windows Keyboard): Add a footnote about "Windows" keys | ||
| 1002 | peculiarities. | ||
| 1003 | |||
| 1004 | 2006-12-18 Richard Stallman <rms@gnu.org> | ||
| 1005 | |||
| 1006 | * abbrevs.texi (Editing Abbrevs): Fix previous change. | ||
| 1007 | |||
| 1008 | 2006-12-17 Sascha Wilde <wilde@sha-bang.de> | ||
| 1009 | |||
| 1010 | * pgg.texi: Added short note on gpg-agent to the introduction. | ||
| 1011 | |||
| 1012 | 2006-12-17 Alan Mackenzie <acm@muc.de> | ||
| 1013 | |||
| 1014 | * programs.texi (Left Margin Paren): Remove the bit which says | ||
| 1015 | that CC Mode sets open-paren-in-column-0-is-defun-start to nil. | ||
| 1016 | Discuss some of the issues of setting this option to nil. | ||
| 1017 | |||
| 1018 | 2006-12-17 Glenn Morris <rgm@gnu.org> | ||
| 1019 | |||
| 1020 | * abbrevs.texi (Editing Abbrevs): Mention system abbrevs. | ||
| 1021 | |||
| 1022 | 2006-12-16 Eli Zaretskii <eliz@gnu.org> | ||
| 1023 | |||
| 1024 | * msdog.texi (Windows Keyboard): Clarify `w32-recognize-altgr' effect. | ||
| 1025 | (Windows Files): `w32-get-true-file-attributes' is only relevant for | ||
| 1026 | NTFS volumes. | ||
| 1027 | (ls in Lisp): `links' in `ls-lisp-verbosity' is only relevant to NTFS | ||
| 1028 | volumes. | ||
| 1029 | |||
| 1030 | 2006-12-15 Eli Zaretskii <eliz@gnu.org> | ||
| 1031 | |||
| 1032 | * text.texi (HTML Mode): Fix "C-c TAB". | ||
| 1033 | |||
| 1034 | 2006-12-13 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 1035 | |||
| 1036 | * gnus.texi (Hiding Headers): Document that `long-to' and `many-to' | ||
| 1037 | also applies to Cc. | ||
| 1038 | |||
| 1039 | 2006-12-12 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 1040 | |||
| 1041 | * gnus.texi (X-Face): Clarify. Say which programs are required | ||
| 1042 | on Windows. | ||
| 1043 | |||
| 1044 | 2006-12-09 Richard Stallman <rms@gnu.org> | ||
| 1045 | |||
| 1046 | * misc.texi (Invoking emacsclient): Simplify TCP file text. | ||
| 1047 | |||
| 1048 | 2006-12-08 Kevin Rodgers <ihs_4664@yahoo.com> | ||
| 1049 | |||
| 1050 | * files.texi (Misc File Ops): Document insert-file-literally. | ||
| 1051 | |||
| 1052 | 2006-12-08 Eli Zaretskii <eliz@gnu.org> | ||
| 1053 | |||
| 1054 | * cmdargs.texi (Colors): Note that --color is intended for overriding | ||
| 1055 | the terminal defaults, not for normal invocation. | ||
| 1056 | |||
| 1057 | * misc.texi (Emacs Server): Improve wording. Don't mention the | ||
| 1058 | ``server program''. Add a cross-reference to "Init File" node. | ||
| 1059 | (Invoking emacsclient): Add index entries. Document both short and | ||
| 1060 | long versions of command-line options. Document the -f option. | ||
| 1061 | |||
| 1062 | 2006-12-08 Michael Olson <mwolson@gnu.org> | ||
| 1063 | |||
| 1064 | * erc.texi (Modules): Remove documentation for list module. | ||
| 1065 | |||
| 1066 | 2006-12-06 Richard Stallman <rms@gnu.org> | ||
| 1067 | |||
| 1068 | * text.texi (Outline Format): Say to set outline-regexp | ||
| 1069 | and outline-level with major modes and file local variables. | ||
| 1070 | |||
| 1071 | 2006-12-05 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> | ||
| 1072 | |||
| 1073 | * anti.texi (Antinews): Mention the alternative to | ||
| 1074 | `~/.emacs_SHELLNAME', which is `~/.emacs.d/init_SHELLNAME.sh'. | ||
| 1075 | |||
| 1076 | * faq.texi (^M in the shell buffer): Ditto. | ||
| 1077 | |||
| 1078 | * misc.texi (Interactive Shell): Ditto. | ||
| 1079 | |||
| 1080 | 2006-12-04 Eli Zaretskii <eliz@gnu.org> | ||
| 1081 | |||
| 1082 | * emacs.texi (Acknowledgments): Fix Arne J@o{}rgensen's name. | ||
| 1083 | |||
| 1084 | * ack.texi (Acknowledgments): Fix Arne J@o{}rgensen's name. | ||
| 1085 | |||
| 1086 | 2006-12-01 Eli Zaretskii <eliz@gnu.org> | ||
| 1087 | |||
| 1088 | * mule.texi (Enabling Multibyte): Rephrase the confusing reference to a | ||
| 1089 | colon in the mode line. | ||
| 1090 | |||
| 1091 | * msdog.texi (Windows Processes) [@ifnottex]: Mention w32-shell-execute. | ||
| 1092 | |||
| 1093 | 2006-11-26 Nick Roberts <nickrob@snap.net.nz> | ||
| 1094 | |||
| 1095 | * building.texi (Watch Expressions): Mention SPC for expanding/ | ||
| 1096 | contracting watch expressions. | ||
| 1097 | |||
| 1098 | 2006-11-26 Kim F. Storm <storm@cua.dk> | ||
| 1099 | |||
| 1100 | * kmacro.texi (Basic Keyboard Macro): Mention F3/F4 more. | ||
| 1101 | |||
| 1102 | 2006-11-26 Nick Roberts <nickrob@snap.net.nz> | ||
| 1103 | |||
| 1104 | * building.texi (Debugger Operation): Define text command mode. | ||
| 1105 | Clarify how tooltips work. | ||
| 1106 | (GDB Graphical Interface): Explain how to run in text command mode | ||
| 1107 | more clearly. | ||
| 1108 | |||
| 1109 | 2006-11-25 Juanma Barranquero <lekktu@gmail.com> | ||
| 1110 | |||
| 1111 | * mule.texi (Defining Fontsets): Fix use of `charset' and `font'. | ||
| 1112 | |||
| 1113 | 2006-11-22 Juanma Barranquero <lekktu@gmail.com> | ||
| 1114 | |||
| 1115 | * anti.texi (Antinews): Mention --server-file and TCP sockets. | ||
| 1116 | |||
| 1117 | 2006-11-20 Michael Olson <mwolson@gnu.org> | ||
| 1118 | |||
| 1119 | * erc.texi: Call this the 5.2 stable pre-release of ERC. | ||
| 1120 | |||
| 1121 | 2006-11-18 Chong Yidong <cyd@stupidchicken.com> | ||
| 1122 | |||
| 1123 | * misc.texi (Interactive Shell): INSIDE_EMACS is set to t, | ||
| 1124 | and EMACS is deprecated. | ||
| 1125 | |||
| 1126 | 2006-11-18 Juanma Barranquero <lekktu@gmail.com> | ||
| 1127 | |||
| 1128 | * makefile.w32-in (emacs.dvi): Remove xresmini.texi. | ||
| 1129 | |||
| 1130 | 2006-11-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 1131 | |||
| 1132 | * Makefile.in (emacs.dvi): Remove xresmini.texi. | ||
| 1133 | |||
| 1134 | * emacs.texi: Include xresources.texi both for info and dvi. | ||
| 1135 | |||
| 1136 | * xresources.texi: Merge text from xresmini.texi. | ||
| 1137 | |||
| 1138 | 2006-11-17 Carsten Dominik <dominik@science.uva.nl> | ||
| 1139 | |||
| 1140 | * org.texi: Fix typos. | ||
| 1141 | (Agenda commands): Document `C-k'. | ||
| 1142 | |||
| 1143 | 2006-11-16 Eli Zaretskii <eliz@gnu.org> | ||
| 1144 | |||
| 1145 | * url.texi (http/https): Fix a typo in the HTTP URL. | ||
| 1146 | |||
| 1147 | 2006-11-14 Stephen Leake <stephen_leake@stephe-leake.org> | ||
| 1148 | |||
| 1149 | * ada-mode.texi: Total rewrite. | ||
| 1150 | |||
| 1151 | 2006-11-13 Carsten Dominik <dominik@science.uva.nl> | ||
| 1152 | |||
| 1153 | * org.texi: Minor typo fixes. | ||
| 1154 | |||
| 1155 | 2006-11-13 Bill Wohler <wohler@newt.com> | ||
| 1156 | |||
| 1157 | Release MH-E manual version 8.0.3. | ||
| 1158 | |||
| 1159 | * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for | ||
| 1160 | release 8.0.3. | ||
| 1161 | |||
| 1162 | * mh-e.texi (Incorporating Mail): Use output of "mhparam Path" | ||
| 1163 | to set MAILDIR. | ||
| 1164 | (Reading Mail): Document the customization of read-mail-command | ||
| 1165 | for MH-E. | ||
| 1166 | (Viewing Attachments): Document mm-discouraged-alternatives. | ||
| 1167 | (Tool Bar): Fix Texinfo for mh-xemacs-use-tool-bar-flag. | ||
| 1168 | (Junk): Add more information about the settings of mh-junk-background | ||
| 1169 | in a program. Add /usr/bin/mh to PATH in examples. | ||
| 1170 | |||
| 1171 | 2006-11-12 Richard Stallman <rms@gnu.org> | ||
| 1172 | |||
| 1173 | * woman.texi: Update author address but say he no longer maintains it. | ||
| 1174 | |||
| 1175 | 2006-11-12 Roberto Rodr,Am(Bguez <lanubeblanca@googlemail.com> (tiny change) | ||
| 1176 | |||
| 1177 | * glossary.texi: Fix typos. | ||
| 1178 | |||
| 1179 | 2006-11-10 Carsten Dominik <carsten.dominik@gmail.com> | ||
| 1180 | |||
| 1181 | * org.texi (ARCHIVE tag): Document C-TAB for forcing cycling of | ||
| 1182 | archived trees. | ||
| 1183 | (Checkboxes): Section moved to chapter 5, and extended. | ||
| 1184 | (The date/time prompt): New section. | ||
| 1185 | (Link abbreviations): New section. | ||
| 1186 | (Presentation and sorting): New section. | ||
| 1187 | (Custom agenda views): Section completely rewritten. | ||
| 1188 | (Summary): Compare with Planner. | ||
| 1189 | (Feedback): More info about creating backtraces. | ||
| 1190 | (Plain lists): Modified example. | ||
| 1191 | (Breaking down tasks): New section. | ||
| 1192 | (Custom time format): New section. | ||
| 1193 | (Time stamps): Document inactive timestamps. | ||
| 1194 | (Setting tags): More details about fast tag selection. | ||
| 1195 | (Block agenda): New section. | ||
| 1196 | (Custom agenda views): Section rewritten. | ||
| 1197 | (Block agenda): New section. | ||
| 1198 | |||
| 1199 | 2006-11-07 Michael Albinus <michael.albinus@gmx.de> | ||
| 1200 | |||
| 1201 | * tramp.texi (Configuration): scp is the default method. | ||
| 1202 | (Default Method): Use ssh as example for another method. | ||
| 1203 | |||
| 1204 | 2006-11-06 Richard Stallman <rms@gnu.org> | ||
| 1205 | |||
| 1206 | * emacs.texi (Acknowledgments): Fix name spelling, add Anna Bigatti. | ||
| 1207 | |||
| 1208 | * ack.texi (Acknowledgments): Fix name spelling. | ||
| 1209 | |||
| 1210 | 2006-11-01 Juri Linkov <juri@jurta.org> | ||
| 1211 | |||
| 1212 | * search.texi (Word Search): Document incremental word search. | ||
| 1213 | |||
| 1214 | 2006-10-28 Glenn Morris <rgm@gnu.org> | ||
| 1215 | |||
| 1216 | * ack.texi (Acknowledgments): Add cal-html author. | ||
| 1217 | |||
| 1218 | * calendar.texi (Writing Calendar Files): Rename section (was "LaTeX | ||
| 1219 | Calendar"). Describe new package cal-html. | ||
| 1220 | * emacs.texi (Top): Rename old node "LaTeX Calendar" to "Writing | ||
| 1221 | Calendar Files." | ||
| 1222 | |||
| 1223 | 2006-10-27 Richard Stallman <rms@gnu.org> | ||
| 1224 | |||
| 1225 | * woman.texi: Downcase nroff/troff/roff. | ||
| 1226 | (Installation): Chapter deleted. Some xrefs deleted. | ||
| 1227 | (Background): woman doesn't advise man ;-). | ||
| 1228 | |||
| 1229 | 2006-10-26 Roberto Rodr,Am(Bguez <lanubeblanca@googlemail.com> (tiny change) | ||
| 1230 | |||
| 1231 | * ada-mode.texi (Project files, Identifier completion) | ||
| 1232 | (Automatic Casing, Debugging, Using non-standard file names) | ||
| 1233 | (Working Remotely): Fix typos. | ||
| 1234 | |||
| 1235 | 2006-10-23 Richard Stallman <rms@gnu.org> | ||
| 1236 | |||
| 1237 | * abbrevs.texi (Expanding Abbrevs): Expansion happens only when | ||
| 1238 | Abbrev mode is enabled. | ||
| 1239 | |||
| 1240 | 2006-10-20 Masatake YAMATO <jet@gyve.org> | ||
| 1241 | |||
| 1242 | * cc-mode.texi (Sample .emacs File): Added missing `)' in | ||
| 1243 | sample code `my-c-initialization-hook'. | ||
| 1244 | |||
| 1245 | 2006-10-19 Stuart D. Herring <herring@lanl.gov> | ||
| 1246 | |||
| 1247 | * widget.texi: Fix typos. | ||
| 1248 | |||
| 1249 | 2006-10-19 Michael Albinus <michael.albinus@gmx.de> | ||
| 1250 | |||
| 1251 | * tramp.texi (Frequently Asked Questions): Remove questions marked with | ||
| 1252 | "???". There have been no complaints for years, so the information | ||
| 1253 | must be appropriate. | ||
| 1254 | |||
| 1255 | 2006-10-16 Richard Stallman <rms@gnu.org> | ||
| 1256 | |||
| 1257 | * widget.texi: Use @var instead of capitalization. | ||
| 1258 | Clarify many widget type descriptions. | ||
| 1259 | |||
| 1260 | * emacs.texi: Update ISBN. | ||
| 1261 | |||
| 1262 | 2006-10-13 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> | ||
| 1263 | |||
| 1264 | * gnus.texi (Other modes): Fix typo. Add alternative index entry for | ||
| 1265 | gnus-dired-attach. | ||
| 1266 | (Selecting a Group): Fix typo. | ||
| 1267 | |||
| 1268 | 2006-10-12 Roberto Rodr,Am(Bguez <lanubeblanca@googlemail.com> (tiny change) | ||
| 1269 | |||
| 1270 | * widget.texi: Fix typos. | ||
| 1271 | |||
| 1272 | 2006-10-11 Kim F. Storm <storm@cua.dk> | ||
| 1273 | |||
| 1274 | * emacs.texi (Acknowledgments): Use @dotless{i}. | ||
| 1275 | |||
| 1276 | 2006-10-08 Nick Roberts <nickrob@snap.net.nz> | ||
| 1277 | |||
| 1278 | * building.texi (Breakpoints Buffer): Mention catchpoints. | ||
| 1279 | |||
| 1280 | 2006-10-08 Kim F. Storm <storm@cua.dk> | ||
| 1281 | |||
| 1282 | * ack.texi (Acknowledgments): Update. | ||
| 1283 | |||
| 1284 | * emacs.texi (Acknowledgments): Fix bad @/ form. | ||
| 1285 | |||
| 1286 | 2006-10-06 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 1287 | |||
| 1288 | * gnus.texi (Image Enhancements): Update for Emacs 22. | ||
| 1289 | |||
| 1290 | * gnus-faq.texi ([1.3]): Update. | ||
| 1291 | |||
| 1292 | 2006-10-06 Richard Stallman <rms@gnu.org> | ||
| 1293 | |||
| 1294 | * faq.texi (Displaying the current line or column): | ||
| 1295 | Delete "As of Emacs 20". | ||
| 1296 | |||
| 1297 | 2006-10-06 Romain Francoise <romain@orebokech.com> | ||
| 1298 | |||
| 1299 | * faq.texi (VM): VM works with Emacs 22 too. | ||
| 1300 | |||
| 1301 | 2006-10-06 Richard Stallman <rms@gnu.org> | ||
| 1302 | |||
| 1303 | * ebrowse.texi: Remove Emacs version "21" from title. | ||
| 1304 | |||
| 1305 | 2006-10-05 Kim F. Storm <storm@cua.dk> | ||
| 1306 | |||
| 1307 | * emacs.texi (Acknowledgments): Add more contributors. | ||
| 1308 | |||
| 1309 | 2006-10-03 Richard Stallman <rms@gnu.org> | ||
| 1310 | |||
| 1311 | * emacs.texi (Acknowledgments): Update version and edition. | ||
| 1312 | |||
| 1313 | 2006-10-02 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 1314 | |||
| 1315 | * gnus.texi (Foreign Groups): Say where change of editing commands are | ||
| 1316 | stored. Add reference to `gnus-parameters'. | ||
| 1317 | |||
| 1318 | 2006-10-01 Karl Berry <karl@gnu.org> | ||
| 1319 | |||
| 1320 | * custom.texi (Customization Groups): Page break to keep example buffer | ||
| 1321 | on one page. | ||
| 1322 | |||
| 1323 | 2006-09-30 Karl Berry <karl@gnu.org> | ||
| 1324 | |||
| 1325 | * programs.texi (Basic Indent): @need to improve page break. | ||
| 1326 | * text.texi: Rewording to improve page breaks, and use @LaTeX{}. | ||
| 1327 | |||
| 1328 | 2006-09-29 Glenn Morris <rgm@gnu.org> | ||
| 1329 | |||
| 1330 | * calendar.texi (Date Formats): Doc fix for european-calendar-style. | ||
| 1331 | |||
| 1332 | 2006-09-29 Karl Berry <karl@gnu.org> | ||
| 1333 | |||
| 1334 | * windows.texi (Basic Window): Remove forced @break, no longer | ||
| 1335 | desirable. | ||
| 1336 | * frames.texi (Frame Commands), | ||
| 1337 | * mark.texi (Marking Objects): Reword to avoid bad page break. | ||
| 1338 | * display.texi (Auto Scrolling): Use @tie{} to avoid bad line break. | ||
| 1339 | |||
| 1340 | 2006-09-19 Richard Stallman <rms@gnu.org> | ||
| 1341 | |||
| 1342 | * frames.texi (Dialog Boxes): Clean up wording: avoid passive, | ||
| 1343 | stick to present tense. | ||
| 1344 | |||
| 1345 | 2006-09-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 1346 | |||
| 1347 | * frames.texi (Dialog Boxes): Rename x-use-old-gtk-file-dialog | ||
| 1348 | to x-gtk-use-old-file-dialog. | ||
| 1349 | (Dialog Boxes): Document x-gtk-file-dialog-help-text. | ||
| 1350 | |||
| 1351 | 2006-09-15 Jay Belanger <belanger@truman.edu> | ||
| 1352 | |||
| 1353 | * calc.texi, emacs.texi, mh-e.texi (GNU GENERAL PUBLIC LICENSE): | ||
| 1354 | Change "Library Public License" to "Lesser Public License" | ||
| 1355 | throughout. Use "yyyy" to represent year. | ||
| 1356 | |||
| 1357 | 2006-09-15 Carsten Dominik <dominik@science.uva.nl> | ||
| 1358 | |||
| 1359 | * org.texi (Setting tags): Typo fix. | ||
| 1360 | |||
| 1361 | 2006-09-14 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 1362 | |||
| 1363 | * gnus.texi (Oort Gnus): Add @xref for `mm-fill-flowed'. | ||
| 1364 | |||
| 1365 | 2006-09-12 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 1366 | |||
| 1367 | * files.texi (Visiting): Add index entry "open file". | ||
| 1368 | |||
| 1369 | * reftex.texi (Citations Outside LaTeX): Simplify lisp example. | ||
| 1370 | |||
| 1371 | 2006-09-12 Paul Eggert <eggert@cs.ucla.edu> | ||
| 1372 | |||
| 1373 | * faq.texi (Escape sequences in shell output): EMACS is now set | ||
| 1374 | to Emacs's absolute file name, not to "t". | ||
| 1375 | (^M in the shell buffer): Likewise. | ||
| 1376 | * misc.texi (Interactive Shell): Likewise. | ||
| 1377 | |||
| 1378 | 2006-09-11 Richard Stallman <rms@gnu.org> | ||
| 1379 | |||
| 1380 | * building.texi (Compilation Mode): Clarification. | ||
| 1381 | (Grep Searching): Add xref to Compilation Mode. | ||
| 1382 | |||
| 1383 | 2006-09-11 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 1384 | |||
| 1385 | * gnus.texi (Mail Source Specifiers): Mention problem of duplicate | ||
| 1386 | mails with pop3-leave-mail-on-server. Fix wording. | ||
| 1387 | (Limiting): Improve gnus-summary-limit-to-articles. | ||
| 1388 | (X-Face): Fix typo. | ||
| 1389 | |||
| 1390 | 2006-09-11 Simon Josefsson <jas@extundo.com> | ||
| 1391 | |||
| 1392 | * smtpmail.texi (Authentication): Explain TLS and SSL better, based on | ||
| 1393 | suggested by Phillip Lord <phillip.lord@newcastle.ac.uk>. | ||
| 1394 | |||
| 1395 | 2006-09-08 Richard Stallman <rms@gnu.org> | ||
| 1396 | |||
| 1397 | * search.texi (Search): Ref multi-file search commands here. | ||
| 1398 | (Other Repeating Search): Not here. | ||
| 1399 | |||
| 1400 | 2006-09-06 Simon Josefsson <jas@extundo.com> | ||
| 1401 | |||
| 1402 | * smtpmail.texi (Authentication): Mention SSL. | ||
| 1403 | |||
| 1404 | 2006-09-01 Eli Zaretskii <eliz@gnu.org> | ||
| 1405 | |||
| 1406 | * rcirc.texi (Internet Relay Chat, Useful IRC commands): | ||
| 1407 | Don't use @indicateurl. | ||
| 1408 | |||
| 1409 | * cc-mode.texi (Subword Movement): Don't use @headitem. | ||
| 1410 | (Custom Braces, Clean-ups): Don't use @tie. | ||
| 1411 | |||
| 1412 | 2006-08-29 Michael Albinus <michael.albinus@gmx.de> | ||
| 1413 | |||
| 1414 | Sync with Tramp 2.0.54. | ||
| 1415 | |||
| 1416 | * tramp.texi (Bug Reports): The Tramp mailing list is moderated now. | ||
| 1417 | Suggested by Adrian Phillips <a.phillips@met.no>. | ||
| 1418 | |||
| 1419 | 2006-08-28 Richard Stallman <rms@gnu.org> | ||
| 1420 | |||
| 1421 | * windows.texi (Split Window): Update xref. | ||
| 1422 | |||
| 1423 | * basic.texi (Continuation Lines): Update xref. | ||
| 1424 | |||
| 1425 | * indent.texi (Tab Stops): Update xref. | ||
| 1426 | |||
| 1427 | * emacs.texi (Top): Update subnode menu. | ||
| 1428 | |||
| 1429 | * display.texi (Line Truncation, Displaying Boundaries): New nodes, | ||
| 1430 | split out of Display Custom. | ||
| 1431 | |||
| 1432 | 2006-08-25 Kim F. Storm <storm@cua.dk> | ||
| 1433 | |||
| 1434 | * display.texi (Display Custom): Add variables overline-margin | ||
| 1435 | and x-underline-at-descent-line. | ||
| 1436 | |||
| 1437 | 2006-08-25 Richard Stallman <rms@gnu.org> | ||
| 1438 | |||
| 1439 | * entering.texi (Exiting): Rewrite to give graphical displays | ||
| 1440 | priority over text terminals. | ||
| 1441 | |||
| 1442 | * search.texi (Incremental Search): Move index entries. | ||
| 1443 | |||
| 1444 | 2006-08-23 Chong Yidong <cyd@stupidchicken.com> | ||
| 1445 | |||
| 1446 | * custom.texi (Init File): Reference Find Init to avoid "home | ||
| 1447 | directory" confusion. | ||
| 1448 | |||
| 1449 | 2006-08-22 Nick Roberts <nickrob@snap.net.nz> | ||
| 1450 | |||
| 1451 | * building.texi (Other GDB-UI Buffers): Describe how to edit | ||
| 1452 | a value in the locals buffer. | ||
| 1453 | |||
| 1454 | 2006-08-21 Richard Stallman <rms@gnu.org> | ||
| 1455 | |||
| 1456 | * search.texi (Basic Isearch): Add `isearch' index entry. | ||
| 1457 | |||
| 1458 | 2006-08-16 Richard Stallman <rms@gnu.org> | ||
| 1459 | |||
| 1460 | * misc.texi (Saving Emacs Sessions): Clean up wording. | ||
| 1461 | |||
| 1462 | * mark.texi (Marking Objects): Mention term "select all". | ||
| 1463 | |||
| 1464 | * emacs.texi (Top): Update subnode menu. | ||
| 1465 | |||
| 1466 | * help.texi (Help Mode): Move node up in file. | ||
| 1467 | |||
| 1468 | 2006-08-15 Carsten Dominik <dominik@science.uva.nl> | ||
| 1469 | |||
| 1470 | * org.texi (Installation, Activation): Split from Installation and | ||
| 1471 | Activation. | ||
| 1472 | (Clocking work time): Documented new features. | ||
| 1473 | |||
| 1474 | 2006-08-15 Nick Roberts <nickrob@snap.net.nz> | ||
| 1475 | |||
| 1476 | * building.texi (Stack Buffer): Explain fringe arrow. | ||
| 1477 | |||
| 1478 | 2006-08-13 Alex Schroeder <alex@gnu.org> | ||
| 1479 | |||
| 1480 | * rcirc.texi (Configuration): Use correct variable in rcirc-authinfo | ||
| 1481 | example. | ||
| 1482 | |||
| 1483 | 2006-08-12 Eli Zaretskii <eliz@gnu.org> | ||
| 1484 | |||
| 1485 | * faq.texi (How to add fonts): New node. | ||
| 1486 | |||
| 1487 | * misc.texi (Saving Emacs Sessions): Clarify when desktop is restored | ||
| 1488 | on startup. | ||
| 1489 | |||
| 1490 | 2006-08-11 Romain Francoise <romain@orebokech.com> | ||
| 1491 | |||
| 1492 | * ack.texi (Acknowledgments): Delete mention to zone-mode.el. | ||
| 1493 | |||
| 1494 | 2006-08-10 Sven Joachim <svenjoac@gmx.de> (tiny change) | ||
| 1495 | |||
| 1496 | * mule.texi (Recognize Coding, Text Coding): Fix typos. | ||
| 1497 | |||
| 1498 | 2006-08-10 Richard Stallman <rms@gnu.org> | ||
| 1499 | |||
| 1500 | * text.texi (Format Faces): Substantial rewrites to deal | ||
| 1501 | with face merging. Empty regions don't count. Clarify | ||
| 1502 | face property inheritance. | ||
| 1503 | |||
| 1504 | 2006-08-08 Romain Francoise <romain@orebokech.com> | ||
| 1505 | |||
| 1506 | * dired.texi (Marks vs Flags): Fix typo reported by Ari Roponen | ||
| 1507 | <arjuropo@cc.jyu.fi>. | ||
| 1508 | |||
| 1509 | 2006-08-05 Romain Francoise <romain@orebokech.com> | ||
| 1510 | |||
| 1511 | * faq.texi (New in Emacs 22): Expand. | ||
| 1512 | |||
| 1513 | 2006-08-04 Eli Zaretskii <eliz@gnu.org> | ||
| 1514 | |||
| 1515 | * cmdargs.texi (Window Size X) <--geometry>: Only width and height | ||
| 1516 | apply to all frames. | ||
| 1517 | |||
| 1518 | 2006-08-03 Michael Olson <mwolson@gnu.org> | ||
| 1519 | |||
| 1520 | * erc.texi: Update for ERC 5.1.4. | ||
| 1521 | |||
| 1522 | 2006-08-01 Richard Stallman <rms@gnu.org> | ||
| 1523 | |||
| 1524 | * help.texi (Name Help): Add index entries for describe-variable. | ||
| 1525 | |||
| 1526 | 2006-08-01 Nick Roberts <nickrob@snap.net.nz> | ||
| 1527 | |||
| 1528 | * building.texi (GDB Graphical Interface): Shorten node names. | ||
| 1529 | (GDB-UI Layout): Use GDB-related. | ||
| 1530 | (Other GDB-UI Buffers): Simplify English. | ||
| 1531 | |||
| 1532 | 2006-07-31 Richard Stallman <rms@gnu.org> | ||
| 1533 | |||
| 1534 | * search.texi (Query Replace): Add xref for Dired's Q command. | ||
| 1535 | |||
| 1536 | 2006-07-28 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 1537 | |||
| 1538 | * gnus.texi (Oort Gnus): Mention that the Lisp files are now installed | ||
| 1539 | in .../site-lisp/gnus/ by default. | ||
| 1540 | [ From gnus-news.texi in the trunk. ] | ||
| 1541 | |||
| 1542 | 2006-07-27 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 1543 | |||
| 1544 | * gnus.texi (MIME Commands): Additions for yEnc. | ||
| 1545 | |||
| 1546 | 2006-07-31 Nick Roberts <nickrob@snap.net.nz> | ||
| 1547 | |||
| 1548 | * building.texi (GDB commands in Fringe): Rename to... | ||
| 1549 | (Source Buffers): ..this and move forward. Describe hollow arrow and | ||
| 1550 | new option gdb-find-source-frame. | ||
| 1551 | |||
| 1552 | 2006-07-29 Richard Stallman <rms@gnu.org> | ||
| 1553 | |||
| 1554 | * dired.texi (Operating on Files): Simplify previous change | ||
| 1555 | and fix Texinfo usage. | ||
| 1556 | |||
| 1557 | 2006-07-29 Eli Zaretskii <eliz@gnu.org> | ||
| 1558 | |||
| 1559 | * dired.texi (Operating on Files): Add cross-references. State the | ||
| 1560 | Unix commands that do similar things. | ||
| 1561 | |||
| 1562 | 2006-07-28 Richard Stallman <rms@gnu.org> | ||
| 1563 | |||
| 1564 | * mark.texi (Transient Mark): Clarify that region never disappears | ||
| 1565 | when Transient Mark mode is off, and not when it is on. | ||
| 1566 | |||
| 1567 | 2006-07-27 Richard Stallman <rms@gnu.org> | ||
| 1568 | |||
| 1569 | * search.texi (Non-ASCII Isearch): Clarify. Mention C-q. | ||
| 1570 | |||
| 1571 | 2006-07-24 Richard Stallman <rms@gnu.org> | ||
| 1572 | |||
| 1573 | * xresources.texi (GTK styles): Fix texinfo usage. | ||
| 1574 | |||
| 1575 | * pgg.texi, org.texi, info.texi, forms.texi, flymake.texi: | ||
| 1576 | * faq.texi: Move periods and commas inside quotes. | ||
| 1577 | |||
| 1578 | * commands.texi (User Input): Explain why we teach keyboard cmds. | ||
| 1579 | |||
| 1580 | * xresources.texi, xresmini.texi, search.texi, programs.texi: | ||
| 1581 | * misc.texi, kmacro.texi, killing.texi, glossary.texi: | ||
| 1582 | * fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi: | ||
| 1583 | * doclicense.texi, display.texi, dired.texi, basic.texi: | ||
| 1584 | * anti.texi, ack.texi: Move periods and commas inside quotes. | ||
| 1585 | |||
| 1586 | 2006-07-22 Eli Zaretskii <eliz@gnu.org> | ||
| 1587 | |||
| 1588 | * cmdargs.texi (General Variables): Document EMAIL. | ||
| 1589 | |||
| 1590 | 2006-07-21 Eli Zaretskii <eliz@gnu.org> | ||
| 1591 | |||
| 1592 | * frames.texi (Frame Commands): Mention that focus-follows-mouse | ||
| 1593 | doesn't have effect on MS-Windows. | ||
| 1594 | |||
| 1595 | 2006-07-20 Jay Belanger <belanger@truman.edu> | ||
| 1596 | |||
| 1597 | * calc.texi (Error forms): Mention M-+ keybinding for `calc-plus-minus'. | ||
| 1598 | |||
| 1599 | 2006-07-18 Chong Yidong <cyd@stupidchicken.com> | ||
| 1600 | |||
| 1601 | * faq.texi (Security risks with Emacs): Document Emacs 22 | ||
| 1602 | file-local-variable mechanism. | ||
| 1603 | |||
| 1604 | 2006-07-17 Richard Stallman <rms@gnu.org> | ||
| 1605 | |||
| 1606 | * building.texi (Grep Searching): Explain about chaining grep commands. | ||
| 1607 | |||
| 1608 | 2006-07-12 Michael Olson <mwolson@gnu.org> | ||
| 1609 | |||
| 1610 | * erc.texi: Update for ERC 5.1.3. | ||
| 1611 | |||
| 1612 | 2006-07-12 Alex Schroeder <alex@gnu.org> | ||
| 1613 | |||
| 1614 | * rcirc.texi: Fix typos. | ||
| 1615 | (Getting started with rcirc): New calling convention for M-x irc. | ||
| 1616 | Mention #rcirc. Removed channel tracking. | ||
| 1617 | (Configuration): Changed the names of all variables that got changed | ||
| 1618 | recently, eg. rcirc-server to rcirc-default-server. Added | ||
| 1619 | documentation for rcirc-authinfo, some background for Bitlbee, and | ||
| 1620 | rcirc-track-minor-mode. | ||
| 1621 | (Scrolling conservatively): Fixed the xref from Auto Scrolling to just | ||
| 1622 | Scrolling. | ||
| 1623 | (Reconnecting after you have lost the connection): Fixed example code | ||
| 1624 | to match code changes. | ||
| 1625 | |||
| 1626 | 2006-07-10 Nick Roberts <nickrob@snap.net.nz> | ||
| 1627 | |||
| 1628 | * killing.texi, gnus.texi, message.texi, mini.texi: Fix typos. | ||
| 1629 | |||
| 1630 | 2006-07-09 Chong Yidong <cyd@stupidchicken.com> | ||
| 1631 | |||
| 1632 | * misc.texi (Invoking emacsclient): Document behavior when emacsclient | ||
| 1633 | is invoked for multiple files. | ||
| 1634 | |||
| 1635 | 2006-07-08 Eli Zaretskii <eliz@gnu.org> | ||
| 1636 | |||
| 1637 | * msdog.texi (Windows Keyboard) [@iftex]: Add an @inforef to the | ||
| 1638 | on-line manual for the rest of this node. | ||
| 1639 | (Windows Mouse) <w32-pass-extra-mouse-buttons-to-system>: Include | ||
| 1640 | unconditionally. | ||
| 1641 | (Windows Processes) <w32-quote-process-args>: Include unconditionally. | ||
| 1642 | Improve wording. | ||
| 1643 | (Windows Printing): Improve wording. | ||
| 1644 | (Windows Misc) [@iftex]: Add an @inforef to the on-line manual for the | ||
| 1645 | rest of this node. | ||
| 1646 | |||
| 1647 | 2006-07-07 Carsten Dominik <dominik@science.uva.nl> | ||
| 1648 | |||
| 1649 | * org.texi (Exporting): Document `C-c C-e' as the prefix for exporting | ||
| 1650 | commands. | ||
| 1651 | (Global TODO list): Document the use of the variables | ||
| 1652 | `org-agenda-todo-ignore-scheduled' and | ||
| 1653 | `org-agenda-todo-list-sublevels'. | ||
| 1654 | |||
| 1655 | 2006-07-05 Richard Stallman <rms@gnu.org> | ||
| 1656 | |||
| 1657 | * faq.texi (Scrolling only one line): Fix xref. | ||
| 1658 | |||
| 1659 | 2006-07-05 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 1660 | |||
| 1661 | * building.texi (Lisp Eval): | ||
| 1662 | * faq.texi (Evaluating Emacs Lisp code): | ||
| 1663 | Throughout, replace eval-current-buffer with eval-buffer. | ||
| 1664 | |||
| 1665 | 2006-07-05 Nick Roberts <nickrob@snap.net.nz> | ||
| 1666 | |||
| 1667 | * mule.texi (Coding Systems, Specify Coding): Link descriptions | ||
| 1668 | of character translation. | ||
| 1669 | |||
| 1670 | 2006-07-04 Nick Roberts <nickrob@snap.net.nz> | ||
| 1671 | |||
| 1672 | * rmail.texi (Remote Mailboxes): Add missing @code keyword. | ||
| 1673 | |||
| 1674 | 2006-07-03 Karl Berry <karl@gnu.org> | ||
| 1675 | |||
| 1676 | * emacs.texi (\hbadness): Set to 6000 so we aren't bothered by | ||
| 1677 | not-too-underfull hboxes in the TeX output. | ||
| 1678 | * abbrevs.texi, buffers.texi, building.texi, calendar.texi, | ||
| 1679 | * cmdargs.texi, custom.texi, dired.texi, macos.texi, | ||
| 1680 | * maintaining.texi, misc.texi, mule.texi, programs.texi, rmail.texi, | ||
| 1681 | * sending.texi, text.texi: Fix overfull/underfull boxes. | ||
| 1682 | |||
| 1683 | 2006-07-03 Romain Francoise <romain@orebokech.com> | ||
| 1684 | |||
| 1685 | * m-x.texi (M-x): Fix. | ||
| 1686 | |||
| 1687 | 2006-07-03 Richard Stallman <rms@gnu.org> | ||
| 1688 | |||
| 1689 | * rcirc.texi (Scrolling conservatively): Fix xref. | ||
| 1690 | |||
| 1691 | * pcl-cvs.texi (Viewing differences): Usage fix. | ||
| 1692 | |||
| 1693 | * search.texi (Other Repeating Search): filename -> file name. | ||
| 1694 | |||
| 1695 | * misc.texi (Narrowing): Minor cleanups. | ||
| 1696 | |||
| 1697 | * files.texi (Visiting): filename -> file name. | ||
| 1698 | |||
| 1699 | * emacs.texi (Top): Update subnode menus. | ||
| 1700 | |||
| 1701 | * mule.texi (Coding Systems): Move char translation stuff here. | ||
| 1702 | (Specify Coding, Output Coding): New nodes, out of Recognize Coding. | ||
| 1703 | (Recognize Coding): Substantial local rewrites. | ||
| 1704 | (International): Update menu. | ||
| 1705 | |||
| 1706 | * display.texi (Auto Scrolling): New node, broken out of Scrolling. | ||
| 1707 | (Scrolling): Substantial local rewrites. | ||
| 1708 | (Display): Update menu and intro. | ||
| 1709 | |||
| 1710 | * dired.texi: filename -> file name. | ||
| 1711 | |||
| 1712 | * custom.texi (Safe File Variables): Texinfo usage fix. | ||
| 1713 | |||
| 1714 | 2006-07-03 Ted Zlatanov <tzz@lifelogs.com> | ||
| 1715 | |||
| 1716 | * help.texi, m-x.texi: Lots of cleanups. | ||
| 1717 | |||
| 1718 | 2006-07-03 Carsten Dominik <dominik@science.uva.nl> | ||
| 1719 | |||
| 1720 | * org.texi (Agenda commands): Document `s' key to save all org-mode | ||
| 1721 | buffers. | ||
| 1722 | |||
| 1723 | 2006-06-30 Eli Zaretskii <eliz@gnu.org> | ||
| 1724 | |||
| 1725 | * msdog.texi (ls in Lisp, Windows Keyboard, Windows Mouse) | ||
| 1726 | (Windows Processes, Windows Misc): Shorten the printed version by | ||
| 1727 | selectively conditioning less important portions by @ifnottex. | ||
| 1728 | |||
| 1729 | 2006-06-30 Ralf Angeli <angeli@caeruleus.net> | ||
| 1730 | |||
| 1731 | * pcl-cvs.texi (Customizing Faces): Remove -face suffix from face | ||
| 1732 | names. Mention `cvs-msg' face. | ||
| 1733 | |||
| 1734 | 2006-06-29 Carsten Dominik <dominik@science.uva.nl> | ||
| 1735 | |||
| 1736 | * org.texi (Checkboxes): New section. | ||
| 1737 | |||
| 1738 | 2006-06-28 Carsten Dominik <dominik@science.uva.nl> | ||
| 1739 | |||
| 1740 | * org.texi (Embedded LaTeX): Fix typos and implement small improvements | ||
| 1741 | throughout this chapter. | ||
| 1742 | |||
| 1743 | 2006-06-27 Chong Yidong <cyd@stupidchicken.com> | ||
| 1744 | |||
| 1745 | * info.texi (Help-Small-Screen): Clarify placement of "All" and "Top" | ||
| 1746 | text for standalone vs Emacs info. | ||
| 1747 | (Help): Clarify header line description. Use mouse-1 for clicks. | ||
| 1748 | (Help-P): Use mouse-1 for clicks. | ||
| 1749 | (Help-^L): "Top" and "All" not displayed with dashes in Emacs. | ||
| 1750 | (Help-^L, Help-M, Help-Int, Search Index, Go to node) | ||
| 1751 | (Choose menu subtopic): Remove gratuitous Emacs command names. | ||
| 1752 | (Help-FOO): Put usual behavior first. | ||
| 1753 | (Help-Xref): Clicking on xrefs works in Emacs. | ||
| 1754 | (Search Text): Clarify what the default behavior is. | ||
| 1755 | (Create Info buffer): Fix Emacs window/X window confusion. | ||
| 1756 | (Emacs Info Variables): Fix for new Emacs init file behavior. | ||
| 1757 | |||
| 1758 | 2006-06-27 Richard Stallman <rms@gnu.org> | ||
| 1759 | |||
| 1760 | * mini.texi (Minibuffer File): Minor cleanup. | ||
| 1761 | |||
| 1762 | 2006-06-25 Nick Roberts <nickrob@snap.net.nz> | ||
| 1763 | |||
| 1764 | * frames.texi (XTerm Mouse): Rename to... | ||
| 1765 | (Text-Only Mouse): ...this. Mention t-mouse-mode. | ||
| 1766 | |||
| 1767 | * emacs.texi (Top): Use new node name. | ||
| 1768 | |||
| 1769 | 2006-06-24 Eli Zaretskii <eliz@gnu.org> | ||
| 1770 | |||
| 1771 | * emacs.texi (Top): Update the detailed menu according to changes in | ||
| 1772 | msdog.texi. | ||
| 1773 | |||
| 1774 | * msdog.texi (Windows Keyboard): New section. | ||
| 1775 | (Windows Mouse): New section. | ||
| 1776 | (Windows System Menu): Remove section (text merged with "Windows | ||
| 1777 | Keyboard"). | ||
| 1778 | (Windows Misc): New section. | ||
| 1779 | |||
| 1780 | * dired.texi (Dired Enter): Refer to msdog.texi for ls-lisp emulation. | ||
| 1781 | |||
| 1782 | * msdog.texi (ls in Lisp): New section. | ||
| 1783 | |||
| 1784 | * files.texi (Visiting): Document case-insensitive wildcard matching | ||
| 1785 | under find-file-wildcards. | ||
| 1786 | |||
| 1787 | 2006-06-24 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> | ||
| 1788 | |||
| 1789 | * gnus.texi (Summary Buffer Lines): Fix typo. | ||
| 1790 | |||
| 1791 | 2006-06-23 Carsten Dominik <dominik@science.uva.nl> | ||
| 1792 | |||
| 1793 | * org.texi (Embedded LaTeX): New chapter. | ||
| 1794 | (Archiving): Section rewritten. | ||
| 1795 | (Enhancing text): Some parts moved to the new chapter about LaTeX. | ||
| 1796 | |||
| 1797 | 2006-06-20 Bill Wohler <wohler@newt.com> | ||
| 1798 | |||
| 1799 | Release MH-E manual version 8.0.1. | ||
| 1800 | |||
| 1801 | * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for | ||
| 1802 | release 8.0.1. | ||
| 1803 | (Preface): Depend on GNU mailutils 1.0 and higher. | ||
| 1804 | |||
| 1805 | 2006-06-19 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 1806 | |||
| 1807 | * message.texi (News Headers): Update message-syntax-checks section. | ||
| 1808 | |||
| 1809 | 2006-06-19 Karl Berry <karl@gnu.org> | ||
| 1810 | |||
| 1811 | * info.texi (Advanced): Mention C-q, especially with ?. | ||
| 1812 | |||
| 1813 | 2006-06-19 Carsten Dominik <dominik@science.uva.nl> | ||
| 1814 | |||
| 1815 | * org.texi (Publishing links): Document the `:link-validation-function' | ||
| 1816 | property. | ||
| 1817 | (Extensions and Hacking): New chapter, includes some sections of the | ||
| 1818 | "Miscellaneous" chapter. | ||
| 1819 | |||
| 1820 | 2006-06-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 1821 | |||
| 1822 | * macos.texi (Mac Input): Add description of mac-function-modifier. | ||
| 1823 | Now Unicode keyboard layouts work. | ||
| 1824 | |||
| 1825 | 2006-06-10 Carsten Dominik <dominik@science.uva.nl> | ||
| 1826 | |||
| 1827 | * org.texi (Progress logging): New section. | ||
| 1828 | |||
| 1829 | 2006-06-10 Richard Stallman <rms@gnu.org> | ||
| 1830 | |||
| 1831 | * mule.texi (Recognize Coding): Clarify previous change. | ||
| 1832 | |||
| 1833 | 2006-06-09 Kenichi Handa <handa@m17n.org> | ||
| 1834 | |||
| 1835 | * mule.texi (Recognize Coding): Describe the convention of "CODING!" | ||
| 1836 | notation. | ||
| 1837 | |||
| 1838 | 2006-06-07 Kevin Ryde <user42@zip.com.au> | ||
| 1839 | |||
| 1840 | * mule.texi (Coding Systems): Footnote xref "MS-DOS and MULE" in main | ||
| 1841 | manual for @ifnottex, but in emacs-extra for @iftex. | ||
| 1842 | |||
| 1843 | * cmdargs.texi (General Variables): Fix smtpmail xref. | ||
| 1844 | |||
| 1845 | 2006-05-29 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 1846 | |||
| 1847 | * viper.texi (Viper Specials): | ||
| 1848 | * programs.texi (Comment Commands): | ||
| 1849 | * gnus.texi (Example Setup): | ||
| 1850 | * faq.texi (Backspace invokes help): | ||
| 1851 | * dired-x.texi (Optional Installation Dired Jump): | ||
| 1852 | * custom.texi (Specifying File Variables): | ||
| 1853 | * calc.texi (Defining Simple Commands): Use ;; instead of ;;; to better | ||
| 1854 | follow coding conventions. | ||
| 1855 | |||
| 1856 | 2006-05-18 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 1857 | |||
| 1858 | * gnus.texi (Saving Articles): Clarify gnus-summary-save-article-mail. | ||
| 1859 | |||
| 1860 | 2006-06-07 Nick Roberts <nickrob@snap.net.nz> | ||
| 1861 | |||
| 1862 | * building.texi (Watch Expressions): Move node to end. | ||
| 1863 | (GDB Graphical Interface): Move description of clicks in fringe... | ||
| 1864 | (GDB commands in the Fringe): ...to here. New node. | ||
| 1865 | |||
| 1866 | 2006-06-06 Carsten Dominik <dominik@science.uva.nl> | ||
| 1867 | |||
| 1868 | * org.texi (ASCII export): Document indentation adaptation. | ||
| 1869 | (Setting tags): Document mutually-exclusive tags. | ||
| 1870 | |||
| 1871 | 2006-06-05 Romain Francoise <romain@orebokech.com> | ||
| 1872 | |||
| 1873 | * url.texi (irc): Mention new funs `url-irc-rcirc' and `url-irc-erc'. | ||
| 1874 | Fix typo. | ||
| 1875 | |||
| 1876 | * gnus-faq.texi (Question 8.6): Update reference to the Gnus | ||
| 1877 | channel (#gnus@irc.freenode.net). | ||
| 1878 | Fix typos. Update copyright notice. | ||
| 1879 | |||
| 1880 | * cc-mode.texi (Getting Started, Indentation Commands, Config Basics) | ||
| 1881 | (Custom Filling and Breaking, Custom Braces, Syntactic Symbols) | ||
| 1882 | (Line-Up Functions, Custom Macros): | ||
| 1883 | * ediff.texi (Window and Frame Configuration) | ||
| 1884 | (Highlighting Difference Regions, Highlighting Difference Regions): | ||
| 1885 | * emacs-mime.texi (Display Customization): | ||
| 1886 | * erc.texi (History): | ||
| 1887 | * eshell.texi (Known problems): | ||
| 1888 | * eudc.texi (Overview, BBDB): | ||
| 1889 | * gnus.texi (NNTP, IMAP, Advanced Scoring Examples) | ||
| 1890 | (The problem of spam, SpamOracle, Extending the Spam package) | ||
| 1891 | (Conformity, Terminology): | ||
| 1892 | * idlwave.texi (Routine Info, Routine Info) | ||
| 1893 | (Class and Keyword Inheritance, Padding Operators) | ||
| 1894 | (Breakpoints and Stepping, Electric Debug Mode) | ||
| 1895 | (Examining Variables, Troubleshooting): | ||
| 1896 | * org.texi (Creating timestamps): | ||
| 1897 | * reftex.texi (Commands, Options, Changes): | ||
| 1898 | * tramp.texi (Inline methods, Password caching) | ||
| 1899 | (Auto-save and Backup, Issues): | ||
| 1900 | * vip.texi (Files, Commands in Insert Mode): | ||
| 1901 | * viper.texi (Emacs Preliminaries, States in Viper) | ||
| 1902 | (Packages that Change Keymaps, Viper Specials, Groundwork): | ||
| 1903 | * xresmini.texi (GTK resources): | ||
| 1904 | Fix various typos. | ||
| 1905 | |||
| 1906 | 2006-06-05 Nick Roberts <nickrob@snap.net.nz> | ||
| 1907 | |||
| 1908 | * building.texi (GDB Graphical Interface): Update bindings. | ||
| 1909 | (Commands of GUD): Add gud-print. Remove gud-run. | ||
| 1910 | Restate availability more generally. | ||
| 1911 | |||
| 1912 | 2006-06-03 Ted Zlatanov <tzz@lifelogs.com> | ||
| 1913 | |||
| 1914 | * mini.texi: Lots of cleanups. | ||
| 1915 | |||
| 1916 | 2006-06-01 Luc Teirlinck <teirllm@auburn.edu> | ||
| 1917 | |||
| 1918 | * misc.texi (Shell History Copying): Update descriptions of `C-c RET' | ||
| 1919 | and Mouse-2. | ||
| 1920 | |||
| 1921 | 2006-06-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 1922 | |||
| 1923 | * screen.texi (Menu Bar): Change menu-bar-start to menu-bar-open. | ||
| 1924 | |||
| 1925 | 2006-05-31 Michael Ernst <mernst@alum.mit.edu> | ||
| 1926 | |||
| 1927 | * ediff.texi: Fix typos. | ||
| 1928 | |||
| 1929 | 2006-05-31 Richard Stallman <rms@gnu.org> | ||
| 1930 | |||
| 1931 | * basic.texi (Moving Point): Fix previous change. | ||
| 1932 | |||
| 1933 | 2006-05-30 Carsten Dominik <dominik@science.uva.nl> | ||
| 1934 | |||
| 1935 | * org.texi: Small typo fixes. | ||
| 1936 | |||
| 1937 | 2006-05-29 Michael Albinus <michael.albinus@gmx.de> | ||
| 1938 | |||
| 1939 | * tramp.texi (Frequently Asked Questions): Disable zsh zle. | ||
| 1940 | |||
| 1941 | 2006-05-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 1942 | |||
| 1943 | * screen.texi (Menu Bar): F10 for Gtk+/Lesstif/Lucid menus. | ||
| 1944 | |||
| 1945 | 2006-05-28 Ted Zlatanov <tzz@lifelogs.com> | ||
| 1946 | |||
| 1947 | * basic.texi: Many simplifications and improvements in wording. | ||
| 1948 | |||
| 1949 | 2006-05-27 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 1950 | |||
| 1951 | * pcl-cvs.texi: Fix typos. | ||
| 1952 | (Customization): Say "us". | ||
| 1953 | |||
| 1954 | 2006-05-26 Eli Zaretskii <eliz@gnu.org> | ||
| 1955 | |||
| 1956 | * org.texi: Remove bogus @setfilename. | ||
| 1957 | |||
| 1958 | 2006-05-26 Carsten Dominik <dominik@science.uva.nl> | ||
| 1959 | |||
| 1960 | * org.texi (ASCII export): Omit command name. | ||
| 1961 | (HTML export): Add prefix to all lines in Local Variable example. | ||
| 1962 | (Acknowledgments): Typeset names in italics. | ||
| 1963 | |||
| 1964 | 2006-05-26 Nick Roberts <nickrob@snap.net.nz> | ||
| 1965 | |||
| 1966 | * anti.texi (Antinews): Create a node for gdb-ui. | ||
| 1967 | |||
| 1968 | 2006-05-24 Carsten Dominik <dominik@science.uva.nl> | ||
| 1969 | |||
| 1970 | * org.texi (Plain lists): Add new item navigation commands. | ||
| 1971 | (External links): Document elisp and info links. | ||
| 1972 | (Custom searches): New section. | ||
| 1973 | (Publishing): New chapter. | ||
| 1974 | (HTML export): Include a list of supported CSS classes. | ||
| 1975 | (Setting tags): Describe the fast-tag-setting interface. | ||
| 1976 | |||
| 1977 | 2006-05-22 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 1978 | |||
| 1979 | * frames.texi (Menu Bars, Tool Bars): Add index entries. | ||
| 1980 | |||
| 1981 | 2006-05-20 Richard Stallman <rms@gnu.org> | ||
| 1982 | |||
| 1983 | * dired.texi (Dired Navigation): dired-goto-file is now j. | ||
| 1984 | |||
| 1985 | 2006-05-20 Luc Teirlinck <teirllm@auburn.edu> | ||
| 1986 | |||
| 1987 | * dired-x.texi: ifinfo -> ifnottex. | ||
| 1988 | |||
| 1989 | 2006-05-20 Eli Zaretskii <eliz@gnu.org> | ||
| 1990 | |||
| 1991 | * mule.texi (Coding Systems): Mention the undecided-* coding systems | ||
| 1992 | and their aliases. | ||
| 1993 | |||
| 1994 | * msdog.texi (Windows Printing): Mention non-support of plain text | ||
| 1995 | printing with some el-cheapo printers, and suggest a workaround. | ||
| 1996 | |||
| 1997 | 2006-05-20 Kevin Ryde <user42@zip.com.au> | ||
| 1998 | |||
| 1999 | * text.texi (TeX Print): tex-dvi-view-command has a default value, | ||
| 2000 | remove the bit saying you must set it. | ||
| 2001 | |||
| 2002 | 2006-05-19 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2003 | |||
| 2004 | * trouble.texi (Checklist): | ||
| 2005 | * text.texi (Text, Auto Fill, Text Mode): | ||
| 2006 | * search.texi (Nonincremental Search): | ||
| 2007 | * rmail.texi (Rmail Labels): | ||
| 2008 | * mule.texi (Input Methods, Multibyte Conversion): | ||
| 2009 | * misc.texi (Gnus, Where to Look, PostScript): | ||
| 2010 | * maintaining.texi (Create Tags Table): | ||
| 2011 | * indent.texi (Indentation Commands): | ||
| 2012 | * fixit.texi (Spelling): | ||
| 2013 | * emacs.texi (Copying): | ||
| 2014 | * custom.texi (Init File): ifinfo -> ifnottex. | ||
| 2015 | |||
| 2016 | 2006-05-18 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2017 | |||
| 2018 | * gnus.texi (Saving Articles): Clarify gnus-summary-save-article-mail. | ||
| 2019 | |||
| 2020 | 2006-05-17 Richard Stallman <rms@gnu.org> | ||
| 2021 | |||
| 2022 | * files.texi (Diff Mode): Mention C-x `. | ||
| 2023 | |||
| 2024 | 2006-05-08 Richard Stallman <rms@gnu.org> | ||
| 2025 | |||
| 2026 | * custom.texi (Disabling): Textual cleanups. | ||
| 2027 | |||
| 2028 | 2006-05-12 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2029 | |||
| 2030 | * message.texi (Interface): Add tool bar customization. | ||
| 2031 | (MIME): Index and text additions for mml-attach. | ||
| 2032 | (MIME): Describe mml-dnd-protocol-alist and | ||
| 2033 | mml-dnd-attach-options. | ||
| 2034 | |||
| 2035 | * gnus.texi (Oort Gnus): Reorder entries in sections. | ||
| 2036 | Fix some entries. | ||
| 2037 | (Starting Up): Add references to "Emacs for Heathens" and to | ||
| 2038 | "Finding the News". Add user-full-name and user-mail-address. | ||
| 2039 | (Group Buffer Format): Add tool bar customization and update. | ||
| 2040 | (Summary Buffer): Add tool bar customization. | ||
| 2041 | (Posting Styles): Add message-alternative-emails. | ||
| 2042 | |||
| 2043 | 2006-05-12 Glenn Morris <rgm@gnu.org> | ||
| 2044 | |||
| 2045 | * calendar.texi (Displaying the Diary, Format of Diary File): | ||
| 2046 | Refer to diary-view-entries, diary-list-entries, | ||
| 2047 | diary-show-all-entries rather than obsolete aliases. | ||
| 2048 | |||
| 2049 | 2006-05-12 Eli Zaretskii <eliz@gnu.org> | ||
| 2050 | |||
| 2051 | * calendar.texi (Calendar/Diary, Holidays, Displaying the Diary) | ||
| 2052 | (Displaying the Diary, Special Diary Entries, Importing Diary): | ||
| 2053 | * building.texi (Compilation Shell): | ||
| 2054 | * buffers.texi (Several Buffers) [iftex]: Replace @xref's to | ||
| 2055 | emacs-xtra with @inforef's. | ||
| 2056 | |||
| 2057 | * files.texi (Visiting): Fix wording. | ||
| 2058 | |||
| 2059 | * mule.texi (Coding Systems, Text Coding): More indexing. | ||
| 2060 | Mention that C-x RET f can set eol conversion. | ||
| 2061 | |||
| 2062 | 2006-05-09 Michael Albinus <michael.albinus@gmx.de> | ||
| 2063 | |||
| 2064 | * tramp.texi (Filename completion): Improve wording. | ||
| 2065 | |||
| 2066 | 2006-05-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2067 | |||
| 2068 | * xresmini.texi (GTK resources): Insert GTK description. | ||
| 2069 | |||
| 2070 | * xresources.texi (GTK resources): metafont should be menufont. | ||
| 2071 | |||
| 2072 | 2006-05-07 Romain Francoise <romain@orebokech.com> | ||
| 2073 | |||
| 2074 | * faq.texi (Using regular expressions): Fix typo. | ||
| 2075 | (Packages that do not come with Emacs): Fix capitalization. | ||
| 2076 | (Replacing text across multiple files): Expand node to explain how | ||
| 2077 | to use `dired-do-query-replace-regexp' in more detail, based on | ||
| 2078 | suggestion by Eric Hanchrow <offby1@blarg.net>. | ||
| 2079 | |||
| 2080 | 2006-05-06 Michael Albinus <michael.albinus@gmx.de> | ||
| 2081 | |||
| 2082 | * mini.texi (Completion Options): | ||
| 2083 | * tramp.texi (Filename completion): Completion of remote files' | ||
| 2084 | method, user name and host name is active only in partial | ||
| 2085 | completion mode. | ||
| 2086 | |||
| 2087 | 2006-05-06 Bill Wohler <wohler@newt.com> | ||
| 2088 | |||
| 2089 | Release MH-E manual version 8.0. | ||
| 2090 | |||
| 2091 | * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for | ||
| 2092 | release 8.0. | ||
| 2093 | |||
| 2094 | 2006-05-06 Bill Wohler <wohler@newt.com> | ||
| 2095 | |||
| 2096 | * mh-e.texi (MH-BOOK-HOME): Change from | ||
| 2097 | http://www.ics.uci.edu/~mh/book/mh to | ||
| 2098 | http://rand-mh.sourceforge.net/book/mh. | ||
| 2099 | Replace .htm suffix with .html for MH book files. | ||
| 2100 | (Using This Manual): Update key binding for getting relevant | ||
| 2101 | chapter in Info from command key. | ||
| 2102 | (Ranges): Fix itemx. | ||
| 2103 | |||
| 2104 | 2006-05-06 Eli Zaretskii <eliz@gnu.org> | ||
| 2105 | |||
| 2106 | * makefile.w32-in (emacs.dvi): | ||
| 2107 | * Makefile.in (emacs.dvi): Add xresmini.texi. | ||
| 2108 | |||
| 2109 | * xresmini.texi (Table of Resources): Remove xref to non-existent | ||
| 2110 | node "LessTif Resources". | ||
| 2111 | |||
| 2112 | * msdog.texi (Microsoft Windows): | ||
| 2113 | * calendar.texi (Calendar/Diary, Displaying the Diary) | ||
| 2114 | (Special Diary Entries, Importing Diary, Holidays): | ||
| 2115 | * programs.texi (Program Modes): | ||
| 2116 | * text.texi (Text): | ||
| 2117 | * buffers.texi (Several Buffers): | ||
| 2118 | * files.texi (Comparing Files): Fix cross-references to emacs-xtra. | ||
| 2119 | |||
| 2120 | 2006-05-06 Eli Zaretskii <eliz@gnu.org> | ||
| 2121 | |||
| 2122 | The following changes merge the emacs-xtra manual into the main | ||
| 2123 | manual, but only for on-line version of the manual. | ||
| 2124 | |||
| 2125 | * vc2-xtra.texi (Version Backups, Local Version Control) | ||
| 2126 | (Making Snapshots, Change Logs and VC, Version Headers) | ||
| 2127 | (Customizing VC, CVS Options) [ifnottex]: Conditional xref's for | ||
| 2128 | on-line manual. | ||
| 2129 | |||
| 2130 | * vc1-xtra.texi (VC Dired Mode) [ifnottex]: Conditional xref's | ||
| 2131 | for on-line manual. | ||
| 2132 | |||
| 2133 | * msdog-xtra.texi (MS-DOS, MS-DOS Keyboard, MS-DOS Mouse) | ||
| 2134 | (MS-DOS Display, MS-DOS File Names, MS-DOS Printing) | ||
| 2135 | (MS-DOS and MULE, MS-DOS Processes) [ifnottex]: Conditional xref's | ||
| 2136 | for on-line manual. | ||
| 2137 | |||
| 2138 | * fortran-xtra.texi (Fortran, Fortran Autofill) | ||
| 2139 | (Fortran Autofill, Fortran Abbrev) [ifnottex]: Conditional xref's | ||
| 2140 | for on-line manual. | ||
| 2141 | |||
| 2142 | * picture-xtra.texi (Basic Picture, Rectangles in Picture) [ifnottex]: | ||
| 2143 | Conditional xref's for on-line manual. | ||
| 2144 | |||
| 2145 | * emerge-xtra.texi (Emerge, Overview of Emerge) | ||
| 2146 | (Fine Points of Emerge) [ifnottex]: Conditional xref's for on-line | ||
| 2147 | manual. | ||
| 2148 | |||
| 2149 | * Makefile.in (INFO_TARGETS): Remove ../info/emacs-xtra. | ||
| 2150 | (EMACS_XTRA): New variable, lists the new *-xtra.texi files. | ||
| 2151 | (EMACSSOURCES): Use EMACS_XTRA. | ||
| 2152 | (../info/emacs-xtra): Remove. | ||
| 2153 | (emacs-xtra.dvi): Add EMACS_XTRA to prerequisites. | ||
| 2154 | |||
| 2155 | * makefile.w32-in (INFO_TARGETS): Remove $(infodir)/emacs-xtra. | ||
| 2156 | (EMACS_XTRA): New variable, lists the new *-xtra.texi files. | ||
| 2157 | (EMACSSOURCES): Use EMACS_XTRA. | ||
| 2158 | ($(infodir)/emacs-xtra): Remove. | ||
| 2159 | (emacs-xtra.dvi): Add EMACS_XTRA to prerequisites. | ||
| 2160 | |||
| 2161 | * trouble.texi (Quitting): | ||
| 2162 | * text.texi (Text): | ||
| 2163 | * programs.texi (Program Modes): | ||
| 2164 | * msdog.texi (Microsoft Windows): | ||
| 2165 | * frames.texi (Frames): | ||
| 2166 | * files.texi (Backup, Version Control, VC Concepts) | ||
| 2167 | (Types of Log File, Advanced C-x v v, Log Buffer, Old Versions) | ||
| 2168 | (Registering, VC Status, VC Undo, Multi-User Branching) | ||
| 2169 | (Comparing Files): | ||
| 2170 | * calendar.texi (Calendar/Diary, Holidays, Displaying the Diary) | ||
| 2171 | (Displaying the Diary, Special Diary Entries, Importing Diary): | ||
| 2172 | * buffers.texi (Several Buffers): Replace inforef to emacs-xtra by | ||
| 2173 | conditional xref's, depending on @iftex/@ifnottex. | ||
| 2174 | |||
| 2175 | * msdog.texi (Microsoft Windows) [ifnottex]: Add menu entry for | ||
| 2176 | "MS-DOS". @include msdog-xtra.texi. | ||
| 2177 | |||
| 2178 | * programs.texi (Programs) [ifnottex]: Add menu entry for "Fortran". | ||
| 2179 | <Top Level> [ifnottex]: @include fortran-xtra.texi. | ||
| 2180 | |||
| 2181 | * files.texi (Secondary VC Commands) [ifnottex]: Add menu entries | ||
| 2182 | for vc-xtra.texi subsections. | ||
| 2183 | (VC Undo) [ifnottex]: @include vc1-xtra.texi and @lowersections it. | ||
| 2184 | (Multi-User Branching) [ifnottex]: @include vc2-xtra.texi. | ||
| 2185 | |||
| 2186 | * sending.texi (Sending Mail): A @node line without explicit Prev, | ||
| 2187 | Next, and Up links. | ||
| 2188 | |||
| 2189 | * abbrevs.texi (Abbrevs): A @node line without explicit Prev, | ||
| 2190 | Next, and Up links. | ||
| 2191 | |||
| 2192 | * emacs.texi (Top) [ifnottex]: Add menu entries for "Picture Mode" | ||
| 2193 | and its sections. @include picture-xtra.texi. | ||
| 2194 | |||
| 2195 | * maintaining.texi (Maintaining) [ifnottex]: Add menu entry for | ||
| 2196 | "Emerge". | ||
| 2197 | (List Tags) [ifnottex]: @include emerge-xtra.texi. | ||
| 2198 | |||
| 2199 | * cal-xtra.texi (Daylight Savings): Remove this node: it is an | ||
| 2200 | exact duplicate of its name-sake in calendar.texi. | ||
| 2201 | |||
| 2202 | * calendar.texi (Calendar/Diary) [ifnottex]: Add menu item for | ||
| 2203 | "Advanced Calendar/Diary Usage". | ||
| 2204 | (Time Intervals) [ifnottex]: @include cal-xtra.texi. | ||
| 2205 | |||
| 2206 | * dired.texi (Subdirectories in Dired) [ifnottex]: @include | ||
| 2207 | dired-xtra.texi. | ||
| 2208 | (Dired) [ifnottex]: Add menu entry for "Subdir Switches". | ||
| 2209 | |||
| 2210 | * files.texi (Reverting) [ifnottex]: @include arevert-xtra.texi. | ||
| 2211 | (Files) [ifnottex]: Add menu entry for Autorevert. | ||
| 2212 | |||
| 2213 | * emacs-xtra.texi (Introduction): Reword to make consistent with | ||
| 2214 | printed version only. | ||
| 2215 | <Top level>: Remove the body of all chapters and move them to the | ||
| 2216 | new *-xtra.texi files. Use @raisesections and @lowersections to | ||
| 2217 | convert sections to chapters etc. | ||
| 2218 | |||
| 2219 | * msdog-xtra.texi: | ||
| 2220 | * fortran-xtra.texi: | ||
| 2221 | * vc-xtra.texi: | ||
| 2222 | * vc1-xtra.texi: | ||
| 2223 | * vc2-xtra.texi: | ||
| 2224 | * emerge-xtra.texi: | ||
| 2225 | * cal-xtra.texi: | ||
| 2226 | * dired-xtra.texi: | ||
| 2227 | * arevert-xtra.texi: New files, with text from respective chapters | ||
| 2228 | of emacs-xtra.texi. Convert each @chapter into @section, @section | ||
| 2229 | into @subsection, etc. | ||
| 2230 | |||
| 2231 | * emacs-xtra.texi (MS-DOS): Renamed from "MS-DOG". All references | ||
| 2232 | updated. | ||
| 2233 | |||
| 2234 | * msdog.texi (Microsoft Windows): Rename from "Emacs and Microsoft | ||
| 2235 | Windows". All references updated. | ||
| 2236 | |||
| 2237 | 2006-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2238 | |||
| 2239 | * macos.texi (Mac Input): Mention input from Character Palette. | ||
| 2240 | (Mac Font Specs): Fix typo. | ||
| 2241 | |||
| 2242 | 2006-05-05 Richard Stallman <rms@gnu.org> | ||
| 2243 | |||
| 2244 | * files.texi (Diff Mode): Minor cleanup. | ||
| 2245 | |||
| 2246 | 2006-05-05 Karl Berry <karl@gnu.org> | ||
| 2247 | |||
| 2248 | * texinfo.tex (\definetextfonsizexi, \definetextfonsizex): New cmds. | ||
| 2249 | (\fonttextsize): New user-level command to change text font size. | ||
| 2250 | * emacs.texi: Call @fonttextsize 10, inside @tex to avoid | ||
| 2251 | errors from the current release of makeinfo (4.8). | ||
| 2252 | * help.texi (Library Keywords): Change widest word in multitable | ||
| 2253 | template from `emulations' to `convenience'. (Not sure if this is | ||
| 2254 | related to the font change.) | ||
| 2255 | |||
| 2256 | 2006-05-05 Eli Zaretskii <eliz@gnu.org> | ||
| 2257 | |||
| 2258 | * files.texi (File Names): Add a footnote about limited support of | ||
| 2259 | ~USER on MS-Windows. | ||
| 2260 | |||
| 2261 | * cmdargs.texi (Initial Options): Add a footnote about limited | ||
| 2262 | support of ~USER on MS-Windows. | ||
| 2263 | |||
| 2264 | 2006-05-03 Richard Stallman <rms@gnu.org> | ||
| 2265 | |||
| 2266 | * files.texi (Diff Mode): Node moved here. | ||
| 2267 | (Comparing Files): Delete what duplicates new node. | ||
| 2268 | (Files): Put Diff Mode in menu. | ||
| 2269 | |||
| 2270 | * misc.texi (Diff Mode): Moved to files.texi. | ||
| 2271 | |||
| 2272 | * emacs.texi (Top): Update menu for Diff Mode. | ||
| 2273 | |||
| 2274 | * trouble.texi (Emergency Escape): Simplify. | ||
| 2275 | |||
| 2276 | * emacs.texi (Top): Minor clarification. | ||
| 2277 | |||
| 2278 | 2006-05-03 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 2279 | |||
| 2280 | * commands.texi, entering.texi, screen.texi: Many simplifications. | ||
| 2281 | |||
| 2282 | 2006-05-03 Richard Stallman <rms@gnu.org> | ||
| 2283 | |||
| 2284 | * commands.texi (Text Characters): Delete paragraph about unibyte | ||
| 2285 | non-ASCII printing chars. | ||
| 2286 | |||
| 2287 | * killing.texi (Killing): Say "graphical displays". | ||
| 2288 | * display.texi: Say "graphical displays". | ||
| 2289 | |||
| 2290 | * cmdargs.texi (Misc X): Say "graphical displays". | ||
| 2291 | |||
| 2292 | 2006-05-01 Richard Stallman <rms@gnu.org> | ||
| 2293 | |||
| 2294 | * emacs.texi (Top): Add Diff Mode to menu. | ||
| 2295 | |||
| 2296 | 2006-05-01 Aaron S. Hawley <Aaron.Hawley@uvm.edu> | ||
| 2297 | |||
| 2298 | * misc.texi (Diff Mode): New node. | ||
| 2299 | |||
| 2300 | 2006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2301 | |||
| 2302 | * macos.texi (Mac International): Now Carbon Emacs has ATSUI support. | ||
| 2303 | (Mac Environment Variables): Shorten example line. | ||
| 2304 | (Mac Font Specs): Shorten lisp lines. Add descriptions for ATSUI. | ||
| 2305 | |||
| 2306 | 2006-05-01 Nick Roberts <nickrob@snap.net.nz> | ||
| 2307 | |||
| 2308 | * building.texi (GUD Customization): Describe cases %d and %c. | ||
| 2309 | Update description for %e. | ||
| 2310 | |||
| 2311 | 2006-04-30 Glenn Morris <rgm@gnu.org> | ||
| 2312 | |||
| 2313 | * calendar.texi (LaTeX Calendar): Mention cal-tex-preamble-extra. | ||
| 2314 | |||
| 2315 | 2006-04-29 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2316 | |||
| 2317 | * custom.texi (Examining): Update C-h v output example. | ||
| 2318 | |||
| 2319 | 2006-04-29 Kim F. Storm <storm@cua.dk> | ||
| 2320 | |||
| 2321 | * building.texi (Grep Searching): Add lgrep and rgrep. | ||
| 2322 | |||
| 2323 | 2006-04-26 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2324 | |||
| 2325 | * pgg.texi (Caching passphrase): Fix markup and typos. Simplify. | ||
| 2326 | |||
| 2327 | 2006-04-26 Sascha Wilde <wilde@sha-bang.de> (tiny change) | ||
| 2328 | |||
| 2329 | * pgg.texi (Caching passphrase): Add pgg-gpg-use-agent. | ||
| 2330 | |||
| 2331 | 2006-04-24 Bill Wohler <wohler@newt.com> | ||
| 2332 | |||
| 2333 | * mh-e.texi (Getting Started): Make it more explicit that you need | ||
| 2334 | to install MH. Add pointers to current MH implementations. | ||
| 2335 | |||
| 2336 | 2006-04-23 Richard Stallman <rms@gnu.org> | ||
| 2337 | |||
| 2338 | * emacs.texi [TeX]: Use xresmini.texi instead of xresources.texi. | ||
| 2339 | |||
| 2340 | * xresmini.texi: New file. | ||
| 2341 | |||
| 2342 | * xresources.texi (Face Resources): Split table into font resources | ||
| 2343 | and the rest. Combine similar attributes for brevity. | ||
| 2344 | |||
| 2345 | 2006-04-21 Bill Wohler <wohler@newt.com> | ||
| 2346 | |||
| 2347 | Release MH-E manual version 7.94. | ||
| 2348 | |||
| 2349 | * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for | ||
| 2350 | release 7.94. | ||
| 2351 | |||
| 2352 | 2006-04-21 Carsten Dominik <dominik@science.uva.nl> | ||
| 2353 | |||
| 2354 | * org.texi: Many small fixes. | ||
| 2355 | (Handling links): Rename from "Managing links". | ||
| 2356 | |||
| 2357 | 2006-04-21 Eli Zaretskii <eliz@gnu.org> | ||
| 2358 | |||
| 2359 | * emacs-xtra.texi (MS-DOS File Names): Remove section about | ||
| 2360 | backslashes and case-insensitivity in file names (moved to the | ||
| 2361 | main manual). | ||
| 2362 | (MS-DOS Printing): Move most of the text to the main manual. | ||
| 2363 | |||
| 2364 | * msdog.texi (Windows Files, Windows HOME, MS-Windows Printing): | ||
| 2365 | New nodes. | ||
| 2366 | (Windows Processes, Windows System Menu): Add index entries and | ||
| 2367 | fix wording. | ||
| 2368 | |||
| 2369 | 2006-04-20 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2370 | |||
| 2371 | * gnus.texi (Spam Statistics Package): Fix typo in @pxref. | ||
| 2372 | (Splitting mail using spam-stat): Fix @xref. | ||
| 2373 | |||
| 2374 | 2006-04-20 Chong Yidong <cyd@stupidchicken.com> | ||
| 2375 | |||
| 2376 | * gnus.texi (Spam Package): Major revision of the text. | ||
| 2377 | Previouly this node was "Filtering Spam Using The Spam ELisp Package". | ||
| 2378 | |||
| 2379 | 2006-04-20 Carsten Dominik <dominik@science.uva.nl> | ||
| 2380 | |||
| 2381 | * org.texi (Time stamps): Better explanation of the purpose of | ||
| 2382 | different time stamps. | ||
| 2383 | (Structure editing, Plain lists): More details on how new items | ||
| 2384 | and headings are inserted. | ||
| 2385 | |||
| 2386 | 2006-04-18 J.D. Smith <jdsmith@as.arizona.edu> | ||
| 2387 | |||
| 2388 | * misc.texi (Shell Ring): Add notes on saved input when | ||
| 2389 | navigating off the end of the history list. | ||
| 2390 | |||
| 2391 | 2006-04-18 Chong Yidong <cyd@mit.edu> | ||
| 2392 | |||
| 2393 | * misc.texi (Shell Options): Correct default value of | ||
| 2394 | comint-scroll-show-maximum-output. | ||
| 2395 | |||
| 2396 | 2006-04-18 Carsten Dominik <dominik@science.uva.nl> | ||
| 2397 | |||
| 2398 | * org.texi (Formula syntax): Fix link to Calc Manual. | ||
| 2399 | |||
| 2400 | 2006-04-17 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2401 | |||
| 2402 | * gnus.texi (Emacsen): Don't support Emacs 20.7 and XEmacs 21.1. | ||
| 2403 | |||
| 2404 | 2006-04-17 Bill Wohler <wohler@newt.com> | ||
| 2405 | |||
| 2406 | * mh-e.texi (Folders): Update mh-before-quit-hook and | ||
| 2407 | mh-quit-hook example with code that removes the buffers rather | ||
| 2408 | than just bury them. | ||
| 2409 | |||
| 2410 | 2006-04-18 Nick Roberts <nickrob@snap.net.nz> | ||
| 2411 | |||
| 2412 | * building.texi (Watch Expressions): Update. | ||
| 2413 | |||
| 2414 | 2006-04-17 Michael Albinus <michael.albinus@gmx.de> | ||
| 2415 | |||
| 2416 | Sync with Tramp 2.0.53. | ||
| 2417 | |||
| 2418 | 2006-04-13 Carsten Dominik <dominik@science.uva.nl> | ||
| 2419 | |||
| 2420 | * org.texi (Updating settings): New section. | ||
| 2421 | (Visibility cycling): Better names for the startup folding | ||
| 2422 | options. | ||
| 2423 | (Exporting): Completely restructured. | ||
| 2424 | (The very busy C-c C-c key): New section. | ||
| 2425 | (Summary of in-buffer settings): New section. | ||
| 2426 | |||
| 2427 | 2006-04-12 Richard Stallman <rms@gnu.org> | ||
| 2428 | |||
| 2429 | * search.texi: Clean up previous change. | ||
| 2430 | |||
| 2431 | 2006-04-12 Eli Zaretskii <eliz@gnu.org> | ||
| 2432 | |||
| 2433 | * search.texi (Regexp Backslash, Regexp Replace): Add index | ||
| 2434 | entries for ``back reference'' and mention the term itself in the | ||
| 2435 | text. | ||
| 2436 | |||
| 2437 | 2006-04-11 Richard Stallman <rms@gnu.org> | ||
| 2438 | |||
| 2439 | * custom.texi (Safe File Variables): | ||
| 2440 | Document enable-local-variables = :safe. | ||
| 2441 | |||
| 2442 | 2006-04-11 Karl Berry <karl@gnu.org> | ||
| 2443 | |||
| 2444 | * emacs-xtra.texi, emacs.texi (Dired under VC, VC Dired Commands) | ||
| 2445 | (Remote Repositories, Version Backups, Local Version Control) | ||
| 2446 | (Snapshots, Making and Using Snapshots, Snapshot Caveats) | ||
| 2447 | (Miscellaneous Commands and Features of VC, Change Logs and VC) | ||
| 2448 | (Renaming VC Work Files and Master Files) | ||
| 2449 | (Inserting Version Control Headers, Customizing VC, General Options) | ||
| 2450 | (Options for RCS and SCCS, Options specific for CVS): Move all | ||
| 2451 | these nodes to emacs-xtra.texi, for brevity. | ||
| 2452 | * cmdargs.texi, files.texi: Change cross-references. | ||
| 2453 | |||
| 2454 | 2006-04-11 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2455 | |||
| 2456 | * gnus.texi, gnus-faq.texi, message.texi: Gnus v5.10.8 is released. | ||
| 2457 | |||
| 2458 | 2006-04-10 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2459 | |||
| 2460 | * gnus.texi (Misc Group Stuff, Summary Buffer, Article Keymap) | ||
| 2461 | (Server Commands): Key `v' is reserved for users. | ||
| 2462 | |||
| 2463 | 2006-04-11 J.D. Smith <jdsmith@as.arizona.edu> | ||
| 2464 | |||
| 2465 | * files.texi (Old Versions): Update description of vc-annotate's | ||
| 2466 | use of color to indicate date ranges. | ||
| 2467 | |||
| 2468 | 2006-04-11 Carsten Dominik <dominik@science.uva.nl> | ||
| 2469 | |||
| 2470 | * org.texi (Link format): New section, emphasis on bracket links. | ||
| 2471 | (External links): Document bracket links. | ||
| 2472 | (FAQ): Expand to cover shell links and the new link format. | ||
| 2473 | |||
| 2474 | 2006-04-09 Kevin Ryde <user42@zip.com.au> | ||
| 2475 | |||
| 2476 | * org.texi (Formula syntax): Typo in node name of calc-eval xref. | ||
| 2477 | |||
| 2478 | * sending.texi (Mail Sending): In send-mail-function @pxref smtpmail, | ||
| 2479 | put info and printed manual names the right way around. | ||
| 2480 | |||
| 2481 | 2006-04-09 Karl Berry <karl@gnu.org> | ||
| 2482 | |||
| 2483 | * msdog.texi, emacs-xtra.texi: Move all the MS-DOS material to | ||
| 2484 | emacs-xtra.texi, leaving only MS Windows information. | ||
| 2485 | * building.texi, emacs.texi, frames.texi, gnu.texi, macos.texi, | ||
| 2486 | * msdog.texi, mule.texi, trouble.texi: Change cross-references and | ||
| 2487 | node names. | ||
| 2488 | |||
| 2489 | * emacs.texi: Move @summarycontents and @contents to the beginning | ||
| 2490 | of the file. | ||
| 2491 | |||
| 2492 | 2006-04-07 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2493 | |||
| 2494 | * gnus.texi (Summary Buffer Lines): Add `*'. | ||
| 2495 | |||
| 2496 | 2006-04-07 Jochen K,A|(Bpper <jochen@fhi-berlin.mpg.de> | ||
| 2497 | |||
| 2498 | * gnus.texi (Group Parameters): | ||
| 2499 | Mention gnus-permanently-visible-groups. | ||
| 2500 | |||
| 2501 | 2006-04-06 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2502 | |||
| 2503 | * gnus.texi (Face): Fix typo. | ||
| 2504 | |||
| 2505 | 2006-04-05 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2506 | |||
| 2507 | * gnus.texi (X-Face): Clarify. | ||
| 2508 | (Face): Need Emacs with PNG support. | ||
| 2509 | |||
| 2510 | 2006-04-08 Kevin Ryde <user42@zip.com.au> | ||
| 2511 | |||
| 2512 | * text.texi (Fill Commands): fill-nobreak-predicate is now a hook. | ||
| 2513 | |||
| 2514 | 2006-04-07 Richard Stallman <rms@gnu.org> | ||
| 2515 | |||
| 2516 | * programs.texi (Comments, Comment Commands, Options for Comments) | ||
| 2517 | (Multi-Line Comments): "Align", not "indent". | ||
| 2518 | (Basic Indent): C-j deletes trailing whitespace before the newline. | ||
| 2519 | |||
| 2520 | 2006-04-06 Richard Stallman <rms@gnu.org> | ||
| 2521 | |||
| 2522 | * idlwave.texi: Delete the blocks "not suitable for inclusion with | ||
| 2523 | Emacs". | ||
| 2524 | |||
| 2525 | * programs.texi (Basic Indent): Clarify relationship of C-j to TAB. | ||
| 2526 | |||
| 2527 | 2006-04-06 Eli Zaretskii <eliz@gnu.org> | ||
| 2528 | |||
| 2529 | * killing.texi (Rectangles): Add index entry for marking a rectangle. | ||
| 2530 | |||
| 2531 | 2006-04-06 J.D. Smith <jdsmith@as.arizona.edu> | ||
| 2532 | |||
| 2533 | * idlwave.texi: Updated for IDLWAVE version 6.0, factoring out | ||
| 2534 | blocks not suitable for inclusion with Emacs using variable | ||
| 2535 | PARTOFEMACS. | ||
| 2536 | |||
| 2537 | 2006-04-05 Richard Stallman <rms@gnu.org> | ||
| 2538 | |||
| 2539 | * emacs.texi (Top): Update subnode menu. | ||
| 2540 | |||
| 2541 | * trouble.texi (Unasked-for Search): Node deleted. | ||
| 2542 | (Lossage): Delete from menu. | ||
| 2543 | |||
| 2544 | 2006-04-04 Richard Stallman <rms@gnu.org> | ||
| 2545 | |||
| 2546 | * trouble.texi: Various cleanups. | ||
| 2547 | (Checklist): Don't bother saying how to snail a bug report. | ||
| 2548 | (Emergency Escape): Much rewriting. | ||
| 2549 | (After a Crash): Rename the core dump immediately. | ||
| 2550 | (Total Frustration): Call it a psychotherapist. | ||
| 2551 | (Bug Criteria): Avoid "illegal instruction". | ||
| 2552 | (Sending Patches): We always put the contributor's name in. | ||
| 2553 | |||
| 2554 | * misc.texi (Thumbnails): Minor correction. | ||
| 2555 | |||
| 2556 | 2006-04-04 Simon Josefsson <jas@extundo.com> | ||
| 2557 | |||
| 2558 | * gnus.texi (Security): Improve. | ||
| 2559 | |||
| 2560 | 2006-04-03 Richard Stallman <rms@gnu.org> | ||
| 2561 | |||
| 2562 | * misc.texi (Thumbnails): Minor cleanup. | ||
| 2563 | |||
| 2564 | 2006-04-02 Karl Berry <karl@gnu.org> | ||
| 2565 | |||
| 2566 | * sending.texi (Mail Sending): pxref to Top needs five args. | ||
| 2567 | |||
| 2568 | * texinfo.tex: Update to current version (2006-03-21.13). | ||
| 2569 | |||
| 2570 | 2006-04-02 Bill Wohler <wohler@newt.com> | ||
| 2571 | |||
| 2572 | * mh-e.texi (Getting Started, Junk, Bug Reports) | ||
| 2573 | (MH FAQ and Support): Fix URLs. | ||
| 2574 | |||
| 2575 | 2006-03-31 Romain Francoise <romain@orebokech.com> | ||
| 2576 | |||
| 2577 | * gnus.texi (Virtual Groups): `nnvirtual-always-rescan' defaults | ||
| 2578 | to t, not nil (and has for the past eight years). | ||
| 2579 | |||
| 2580 | 2006-03-31 Richard Stallman <rms@gnu.org> | ||
| 2581 | |||
| 2582 | * emacs.texi (Top): Update subnode menu. | ||
| 2583 | |||
| 2584 | * help.texi (Help Mode): Cleanup. | ||
| 2585 | |||
| 2586 | * dired.texi: Many cleanups. | ||
| 2587 | (Dired Deletion): Describe dired-recursive-deletes. | ||
| 2588 | (Operating on Files): dired-create-directory moved. | ||
| 2589 | (Misc Dired Features): Move to here. | ||
| 2590 | (Tumme): Node moved to misc.texi. | ||
| 2591 | |||
| 2592 | * custom.texi: Many cleanups. | ||
| 2593 | (Minor Modes): Don't mention ISO Accents Mode. | ||
| 2594 | (Examining): Update C-h v output example. | ||
| 2595 | (Hooks): Add index and xref for add-hook. | ||
| 2596 | (Locals): Delete list of vars that are always per-buffer. Rearrange. | ||
| 2597 | (Local Keymaps): Don't mention lisp-mode-map, c-mode-map. | ||
| 2598 | |||
| 2599 | * misc.texi: Many cleanups. | ||
| 2600 | (beginning): Add to summary of topics. | ||
| 2601 | (Shell): Put eshell xref at the end. Remove eshell from table. | ||
| 2602 | (Thumbnails): New node. | ||
| 2603 | |||
| 2604 | 2006-03-31 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2605 | |||
| 2606 | * message.texi, gnus.texi: Bump version to 5.11. | ||
| 2607 | |||
| 2608 | 2006-03-29 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2609 | |||
| 2610 | * gnus.texi (Top): Add comment about version line. | ||
| 2611 | |||
| 2612 | * message.texi (Top): Ditto. Change to take named versions into | ||
| 2613 | account. | ||
| 2614 | |||
| 2615 | 2006-03-28 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2616 | |||
| 2617 | * gnus.texi (Posting Styles): Add x-face-file to example. | ||
| 2618 | (X-Face): Refer to posting styles. | ||
| 2619 | |||
| 2620 | * gnus-faq.texi ([5.8]): Add x-face-file. | ||
| 2621 | ([8.4]): Add links to gmane.emacs.gnus.user and | ||
| 2622 | gmane.emacs.gnus.general. | ||
| 2623 | |||
| 2624 | 2006-03-28 Eli Zaretskii <eliz@gnu.org> | ||
| 2625 | |||
| 2626 | * files.texi (File Name Cache): Make it clear that the cache is | ||
| 2627 | not persistent. | ||
| 2628 | |||
| 2629 | 2006-03-27 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2630 | |||
| 2631 | * gnus-faq.texi: Use .invalid. | ||
| 2632 | ([5.4]): Fix gnus-posting-styles example. | ||
| 2633 | |||
| 2634 | 2006-03-27 Romain Francoise <romain@orebokech.com> | ||
| 2635 | |||
| 2636 | * faq.texi (Emacs/W3): Rename from `w3-mode'. Mention that | ||
| 2637 | Emacs/W3 needs a new maintainer. | ||
| 2638 | (Ispell): Update author and version info. | ||
| 2639 | (Mailcrypt): Mention PGG. | ||
| 2640 | (New in Emacs 22): Add PGG to the list of new packages. | ||
| 2641 | Include minor changes from "Ramprasad B" <ramprasad_i82@yahoo.com> | ||
| 2642 | updating dead URLs. | ||
| 2643 | |||
| 2644 | 2006-03-25 Karl Berry <karl@gnu.org> | ||
| 2645 | |||
| 2646 | * ada-mode.texi, autotype.texi, calc.texi, cc-mode.texi, cl.texi, | ||
| 2647 | * dired-x.texi, ebrowse.texi, ediff.texi, emacs-mime.texi, | ||
| 2648 | * emacs-xtra.texi, emacs.texi, erc.texi, eshell.texi, eudc.texi, | ||
| 2649 | * faq.texi, forms.texi, gnu.texi, gnus.texi, idlwave.texi, | ||
| 2650 | * info.texi, message.texi, mh-e.texi, pcl-cvs.texi, pgg.texi, | ||
| 2651 | * rcirc.texi, reftex.texi, sc.texi, ses.texi, sieve.texi, | ||
| 2652 | * speedbar.texi, url.texi, vip.texi, viper.texi, widget.texi, | ||
| 2653 | * woman.texi: (1) use @copyright{} instead of (C) in typeset text; | ||
| 2654 | (2) do not indent copyright year list (or anything else). | ||
| 2655 | |||
| 2656 | 2006-03-21 Bill Wohler <wohler@newt.com> | ||
| 2657 | |||
| 2658 | * mh-e.texi (Folders): Various edits. | ||
| 2659 | |||
| 2660 | 2006-03-20 Romain Francoise <romain@orebokech.com> | ||
| 2661 | |||
| 2662 | * gnus.texi (Mail Folders): Grammar fix. | ||
| 2663 | |||
| 2664 | 2006-03-21 Juanma Barranquero <lekktu@gmail.com> | ||
| 2665 | |||
| 2666 | * files.texi (VC Dired Mode): Remove misplaced brackets. | ||
| 2667 | |||
| 2668 | 2006-03-21 Andre Spiegel <spiegel@gnu.org> | ||
| 2669 | |||
| 2670 | * files.texi: Various updates and clarifications in the VC chapter. | ||
| 2671 | |||
| 2672 | 2006-03-19 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2673 | |||
| 2674 | * help.texi (Help Mode): Document "C-c C-c". | ||
| 2675 | |||
| 2676 | 2006-03-19 Bill Wohler <wohler@newt.com> | ||
| 2677 | |||
| 2678 | * mh-e.texi (Replying): Document Mail-Followup-To. | ||
| 2679 | Change manually-formatted table to multitable. Add debugging info. | ||
| 2680 | Move description of mh-reply-default-reply-to into paragraph | ||
| 2681 | that describes its values. | ||
| 2682 | |||
| 2683 | 2006-03-17 Bill Wohler <wohler@newt.com> | ||
| 2684 | |||
| 2685 | * mh-e.texi: Use smallexample and smalllisp consistenly. | ||
| 2686 | (Sending Mail Tour): Update method of entering | ||
| 2687 | addresses and subject. | ||
| 2688 | (Sending Mail Tour, Reading Mail Tour, Processing Mail Tour) | ||
| 2689 | (Adding Attachments, Searching): Update screenshots for Emacs 22. | ||
| 2690 | |||
| 2691 | 2006-03-16 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2692 | |||
| 2693 | * emacs-xtra.texi (Top): Avoid ugly continuation line in | ||
| 2694 | menu in the standalone Info reader. | ||
| 2695 | |||
| 2696 | 2006-03-15 Chong Yidong <cyd@stupidchicken.com> | ||
| 2697 | |||
| 2698 | * emacs-xtra.texi (Emerge, Picture Mode, Fortran): New chapters, | ||
| 2699 | moved here from Emacs manual. | ||
| 2700 | |||
| 2701 | * programs.texi (Fortran): Section moved to emacs-xtra. | ||
| 2702 | (Program Modes): Xref to Fortran in emacs-xtra. | ||
| 2703 | |||
| 2704 | * maintaining.texi (Emerge): Move to emacs-xtra. | ||
| 2705 | * files.texi (Comparing Files): Xref to Emerge in emacs-xtra. | ||
| 2706 | |||
| 2707 | * picture.texi: File deleted. | ||
| 2708 | * Makefile.in: | ||
| 2709 | * makefile.w32-in: Remove picture.texi. | ||
| 2710 | |||
| 2711 | * text.texi (Text): Xref to Picture Mode in emacs-xtra. | ||
| 2712 | * abbrevs.texi (Abbrevs): | ||
| 2713 | * sending.texi (Sending Mail): Picture node removed. | ||
| 2714 | |||
| 2715 | * emacs.texi (Top): Update node listings. | ||
| 2716 | |||
| 2717 | 2006-03-15 Carsten Dominik <dominik@science.uva.nl> | ||
| 2718 | |||
| 2719 | * org.texi: Version number change only. | ||
| 2720 | |||
| 2721 | 2006-03-14 Bill Wohler <wohler@newt.com> | ||
| 2722 | |||
| 2723 | * mh-e.texi: Add index entries around each paragraph rather than | ||
| 2724 | depend on entries from beginning of node. Doing so ensures that | ||
| 2725 | index entries are less likely to be forgotten if text is cut and | ||
| 2726 | pasted, and are necessary anyway if the references are on a | ||
| 2727 | separate page. It seems that makeinfo is now (v. 4.8) only | ||
| 2728 | producing one index entry per node, so there is no longer any | ||
| 2729 | excuse not to. Use subheading instead of heading. The incorrect | ||
| 2730 | use of heading produced very large fonts in Info--as large as the | ||
| 2731 | main heading. | ||
| 2732 | (From Bill Wohler): MH-E never did appear in Emacs 21--MH-E | ||
| 2733 | versions 6 and 7 appeared *around* the time of these Emacs releases. | ||
| 2734 | |||
| 2735 | 2006-03-13 Carsten Dominik <dominik@science.uva.nl> | ||
| 2736 | |||
| 2737 | * org.texi (Clean view): Document new startup options. | ||
| 2738 | |||
| 2739 | 2006-03-12 Richard Stallman <rms@gnu.org> | ||
| 2740 | |||
| 2741 | * calendar.texi: Various cleanups. | ||
| 2742 | |||
| 2743 | 2006-03-11 Bill Wohler <wohler@newt.com> | ||
| 2744 | |||
| 2745 | * mh-e.texi (Preface, More About MH-E, Options, HTML, Folders) | ||
| 2746 | (Composing, Scan Line Formats): Fix @refs. | ||
| 2747 | (Getting Started): Define MH profile and MH profile components. | ||
| 2748 | (Incorporating Mail, Reading Mail, Viewing, Printing) | ||
| 2749 | (Sending Mail, Forwarding, Editing Drafts, Inserting Letter) | ||
| 2750 | (Signature, Aliases, Scan Line Formats): Use @code instead of @samp | ||
| 2751 | for string constants. | ||
| 2752 | (Tool Bar): Remove spurious quote. | ||
| 2753 | (Junk): Use ``...'' instead of "...". | ||
| 2754 | (Scan Line Formats): Replace @samp with @kbd. | ||
| 2755 | |||
| 2756 | 2006-03-11 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2757 | |||
| 2758 | * search.texi (Regexps): Use @samp for regexp that is not in Lisp | ||
| 2759 | syntax. | ||
| 2760 | |||
| 2761 | 2006-03-10 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2762 | |||
| 2763 | * gnus.texi (NoCeM): Mention gnus-use-nocem can also be a number. | ||
| 2764 | |||
| 2765 | 2006-03-10 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2766 | |||
| 2767 | * gnus.texi (Fancy Mail Splitting): Improve sentences so as to be | ||
| 2768 | easy to understand. | ||
| 2769 | |||
| 2770 | 2006-03-09 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2771 | |||
| 2772 | * gnus.texi: Markup fix. | ||
| 2773 | (Fancy Mail Splitting): Specify new feature. | ||
| 2774 | |||
| 2775 | 2006-03-08 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2776 | |||
| 2777 | * gnus.texi (Fancy Mail Splitting): Improve descriptions about | ||
| 2778 | partial-words matching. | ||
| 2779 | |||
| 2780 | 2006-03-07 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2781 | |||
| 2782 | * emacs-mime.texi (Display Customization): Reword image/.* stuff. | ||
| 2783 | |||
| 2784 | * gnus.texi (Oort Gnus): Add note about `gnus-load'. | ||
| 2785 | (MIME Commands): Fix mm-discouraged-alternatives. | ||
| 2786 | |||
| 2787 | 2006-03-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2788 | |||
| 2789 | * search.texi (Regexps): More accurately describe which characters | ||
| 2790 | are special in which situations. Recommend _not_ to quote `]' or | ||
| 2791 | `-' when they are not special. | ||
| 2792 | |||
| 2793 | 2006-03-07 Carsten Dominik <dominik@science.uva.nl> | ||
| 2794 | |||
| 2795 | * org.texi: Version number change only. | ||
| 2796 | |||
| 2797 | 2006-03-06 Bill Wohler <wohler@newt.com> | ||
| 2798 | |||
| 2799 | * mh-e.texi: Move from SourceForge repository to Savannah. | ||
| 2800 | This is version 7.93, which is a total rewrite from the previous | ||
| 2801 | edition 1.3 for MH-E version 5.0.2, and corresponds to MH-E | ||
| 2802 | version 7.93. | ||
| 2803 | |||
| 2804 | 2006-03-03 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2805 | |||
| 2806 | * gnus.texi (Oort Gnus): Add `mm-fill-flowed'. | ||
| 2807 | |||
| 2808 | 2006-03-01 Carsten Dominik <dominik@science.uva.nl> | ||
| 2809 | |||
| 2810 | * org.texi (Interaction): Add item about `org-mouse.el' by | ||
| 2811 | Piotr Zielinski. | ||
| 2812 | (Managing links): Document that also mouse-1 can be used to | ||
| 2813 | activate a link. | ||
| 2814 | (Headlines, FAQ): Add entry about hiding leading stars. | ||
| 2815 | (Miscellaneous): Resort the sections in this chapter to a more | ||
| 2816 | logical sequence. | ||
| 2817 | |||
| 2818 | 2006-02-28 Andre Spiegel <spiegel@gnu.org> | ||
| 2819 | |||
| 2820 | * files.texi (Old Versions): Clarify operation of C-x v =. | ||
| 2821 | |||
| 2822 | 2006-02-27 Simon Josefsson <jas@extundo.com> | ||
| 2823 | |||
| 2824 | * emacs-mime.texi (Flowed text): Add mm-fill-flowed. (Sync | ||
| 2825 | 2004-01-27 from the trunk). | ||
| 2826 | |||
| 2827 | 2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org> | ||
| 2828 | |||
| 2829 | * cc-mode.texi: Rename c-hungry-backspace to | ||
| 2830 | c-hungry-delete-backwards, at the request of RMS. Leave the old | ||
| 2831 | name as an alias. | ||
| 2832 | |||
| 2833 | 2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org> | ||
| 2834 | |||
| 2835 | * cc-mode.texi: Correct the definition of c-beginning-of-defun, to | ||
| 2836 | include the function header within the defun. | ||
| 2837 | |||
| 2838 | 2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org> | ||
| 2839 | |||
| 2840 | * cc-mode.texi: Correct two typos. | ||
| 2841 | |||
| 2842 | 2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org> | ||
| 2843 | |||
| 2844 | * cc-mode.texi (Comment Commands): State that C-u M-; kills any | ||
| 2845 | existing comment. | ||
| 2846 | (Electric Keys): Add a justification for electric indentation. | ||
| 2847 | (Hungry WS Deletion): Clear up the names and complications of the | ||
| 2848 | BACKSPACE and DELETE keys. | ||
| 2849 | |||
| 2850 | 2006-02-23 Juri Linkov <juri@jurta.org> | ||
| 2851 | |||
| 2852 | * faq.texi (Common requests): Move `Turning on auto-fill by | ||
| 2853 | default' after `Wrapping words automatically'. Move `Working with | ||
| 2854 | unprintable characters' before `Searching for/replacing newlines'. | ||
| 2855 | Move `Replacing highlighted text' after `Highlighting a region'. | ||
| 2856 | Merge `Repeating commands' and `Repeating a command as many times | ||
| 2857 | as possible' into the former. | ||
| 2858 | (Packages that do not come with Emacs): Add refs to Gmane and | ||
| 2859 | etc/MORE.STUFF. | ||
| 2860 | |||
| 2861 | 2006-02-23 Juri Linkov <juri@jurta.org> | ||
| 2862 | |||
| 2863 | * faq.texi (Newsgroup archives): Update URLs of GNU mail archives. | ||
| 2864 | (Reporting bugs): Suggest using `M-x report-emacs-bug'. | ||
| 2865 | Add xref to `(emacs)Reporting Bugs'. | ||
| 2866 | (Getting a printed manual): Add URL to other formats of the manual. | ||
| 2867 | (Common requests): Fix menu. | ||
| 2868 | (Highlighting a region): Remove ref to `Turning on syntax highlighting'. | ||
| 2869 | (Horizontal scrolling): Mention `truncate-partial-width-windows'. | ||
| 2870 | (Inserting text at the beginning of each line): Add pxref to | ||
| 2871 | `Changing the included text prefix'. | ||
| 2872 | (Forcing the cursor to remain in the same column): Mention `track-eol' | ||
| 2873 | and `set-goal-column'. Add pxref to `(emacs)Moving Point'. | ||
| 2874 | (Replacing text across multiple files): Add keybinding `Q' for | ||
| 2875 | `dired-do-query-replace'. | ||
| 2876 | |||
| 2877 | 2006-02-22 Carsten Dominik <dominik@science.uva.nl> | ||
| 2878 | |||
| 2879 | * reftex.texi: Version number and date change only. | ||
| 2880 | |||
| 2881 | * org.texi (Internal Links): Rewrite to cover the modified | ||
| 2882 | linking system. | ||
| 2883 | |||
| 2884 | 2006-02-21 Nick Roberts <nickrob@snap.net.nz> | ||
| 2885 | |||
| 2886 | * building.texi (Watch Expressions): Update and describe | ||
| 2887 | gdb-speedbar-auto-raise. | ||
| 2888 | |||
| 2889 | 2006-02-19 Richard M. Stallman <rms@gnu.org> | ||
| 2890 | |||
| 2891 | * emacs.texi: Use @smallbook. | ||
| 2892 | (Top): Update ref to Emacs paper, delete ref to Cookbook. | ||
| 2893 | Update subnode menu. | ||
| 2894 | |||
| 2895 | * building.texi (Lisp Interaction): Minor addition. | ||
| 2896 | |||
| 2897 | 2006-02-18 Nick Roberts <nickrob@snap.net.nz> | ||
| 2898 | |||
| 2899 | * building.texi (Watch Expressions): Update and be more precise. | ||
| 2900 | |||
| 2901 | 2006-02-17 Eli Zaretskii <eliz@gnu.org> | ||
| 2902 | |||
| 2903 | * faq.texi: Remove the coding cookie, it's not needed anymore. | ||
| 2904 | |||
| 2905 | 2006-02-15 Francesco Potort,Al(B <pot@gnu.org> | ||
| 2906 | |||
| 2907 | * maintaining.texi (Create Tags Table): Explain why the | ||
| 2908 | exception when etags writes to files under the /dev tree. | ||
| 2909 | |||
| 2910 | 2006-02-14 Richard M. Stallman <rms@gnu.org> | ||
| 2911 | |||
| 2912 | * custom.texi (Safe File Variables): Lots of clarification. | ||
| 2913 | Renamed from Unsafe File Variables. | ||
| 2914 | |||
| 2915 | 2006-02-14 Chong Yidong <cyd@stupidchicken.com> | ||
| 2916 | |||
| 2917 | * custom.texi (Unsafe File Variables): File variable confirmation | ||
| 2918 | assumed denied in batch mode. | ||
| 2919 | |||
| 2920 | 2006-02-14 Richard M. Stallman <rms@gnu.org> | ||
| 2921 | |||
| 2922 | * building.texi (GDB User Interface Layout): Don't say `inferior' | ||
| 2923 | for program being debugged. | ||
| 2924 | |||
| 2925 | 2006-02-15 Nick Roberts <nickrob@snap.net.nz> | ||
| 2926 | |||
| 2927 | * building.texi (GDB Graphical Interface): | ||
| 2928 | Replace gdb-use-inferior-io-buffer with gdb-use-separate-io-buffer. | ||
| 2929 | |||
| 2930 | 2006-02-13 Chong Yidong <cyd@stupidchicken.com> | ||
| 2931 | |||
| 2932 | * custom.texi (Specifying File Variables, Unsafe File Variables): | ||
| 2933 | New nodes, split from File Variables. Document new file local | ||
| 2934 | variable behavior. | ||
| 2935 | |||
| 2936 | 2006-02-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2937 | |||
| 2938 | * display.texi (Standard Faces): | ||
| 2939 | * faq.texi (Colors on a TTY): | ||
| 2940 | * files.texi (Visiting): | ||
| 2941 | * frames.texi (Clipboard): | ||
| 2942 | * glossary.texi (Glossary) <Clipboard>: | ||
| 2943 | * xresources.texi (X Resources): Mention Mac OS port. | ||
| 2944 | |||
| 2945 | 2006-02-12 Karl Berry <karl@gnu.org> | ||
| 2946 | |||
| 2947 | * faq.texi (Emacs for Atari ST): Use Sch@"auble instead of the | ||
| 2948 | 8-bit accented a. | ||
| 2949 | |||
| 2950 | 2006-02-12 Richard M. Stallman <rms@gnu.org> | ||
| 2951 | |||
| 2952 | * building.texi (Building): Clarify topic in intro. | ||
| 2953 | |||
| 2954 | * maintaining.texi (Maintaining): Change title; clarify topic. | ||
| 2955 | Delete duplicate index entries. | ||
| 2956 | |||
| 2957 | * building.texi (Other GDB User Interface Buffers): Clarifications. | ||
| 2958 | |||
| 2959 | * text.texi (Cell Commands): Clarifications. | ||
| 2960 | |||
| 2961 | * programs.texi (Defuns): Delete duplicate explanation of | ||
| 2962 | left-margin paren convention. | ||
| 2963 | (Hungry Delete): Minor cleanup. | ||
| 2964 | |||
| 2965 | 2006-02-11 Mathias Dahl <mathias.dahl@gmail.com> | ||
| 2966 | |||
| 2967 | * dired.texi (Tumme): More tumme documentation. | ||
| 2968 | |||
| 2969 | 2006-02-11 Alan Mackenzie <acm@muc.de> | ||
| 2970 | |||
| 2971 | * programs.texi ("Hungry Delete"): Correct the appellation of the | ||
| 2972 | backspace and delete keys to @kbd{DEL} and @kbd{DELETE}. | ||
| 2973 | |||
| 2974 | 2006-02-11 Mathias Dahl <mathias.dahl@gmail.com> | ||
| 2975 | |||
| 2976 | * dired.texi (Tumme): Fix small bug. | ||
| 2977 | |||
| 2978 | 2006-02-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2979 | |||
| 2980 | * macos.texi (Mac International): Rename "fontset-mac" to | ||
| 2981 | "fontset-standard". | ||
| 2982 | |||
| 2983 | 2006-02-09 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2984 | |||
| 2985 | * gnus.texi (Gnus Versions): Add history beyond start of Oort. | ||
| 2986 | |||
| 2987 | 2006-02-09 Mathias Dahl <mathias.dah@gmail.com> | ||
| 2988 | |||
| 2989 | * dired.texi (Tumme): Basic documentation for Tumme added. | ||
| 2990 | |||
| 2991 | 2006-02-08 Romain Francoise <romain@orebokech.com> | ||
| 2992 | |||
| 2993 | * faq.texi (Top): Remove paragraph about the FAQ being a | ||
| 2994 | transitional document, etc. | ||
| 2995 | (Searching for/replacing newlines): New node. | ||
| 2996 | (Yanking text in isearch): New node. | ||
| 2997 | (Inserting text at the beginning of each line): Rename and make | ||
| 2998 | more general, mention `M-;' in Message mode. | ||
| 2999 | |||
| 3000 | 2006-02-07 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3001 | |||
| 3002 | * mule.texi (International): | ||
| 3003 | * programs.texi (Basic Indent): Fix typos. | ||
| 3004 | |||
| 3005 | * faq.texi (Meta key does not work in xterm) | ||
| 3006 | (Emacs does not display 8-bit characters) | ||
| 3007 | (Inputting eight-bit characters): | ||
| 3008 | * custom.texi (Minor Modes): | ||
| 3009 | * display.texi (Text Display): | ||
| 3010 | * commands.texi (Text Characters): Update xrefs. | ||
| 3011 | |||
| 3012 | 2006-02-07 Richard M. Stallman <rms@gnu.org> | ||
| 3013 | |||
| 3014 | * emacs.texi (Top): Update subnode menu. | ||
| 3015 | Update info on old Emacs papers. | ||
| 3016 | (Intro): "Graphical display", not window system. | ||
| 3017 | |||
| 3018 | * xresources.texi (GTK styles): Minor clarifications. | ||
| 3019 | |||
| 3020 | * trouble.texi: "Graphical display", not window system. | ||
| 3021 | (Stuck Recursive): Minor clarification. | ||
| 3022 | |||
| 3023 | * text.texi: Minor clarifications. | ||
| 3024 | (Sentences): Explain why two-space convention is better. | ||
| 3025 | Explain sentence-end-without-period here. | ||
| 3026 | (Fill Commands): Not here. | ||
| 3027 | (Refill): Node moved down. | ||
| 3028 | (Filling): Update menu. | ||
| 3029 | (Table Creation, Cell Justification, Column Commands): Clarify. | ||
| 3030 | |||
| 3031 | * sending.texi: Minor clarifications. | ||
| 3032 | |||
| 3033 | * search.texi (Regexp Backslash): Clarification. | ||
| 3034 | |||
| 3035 | * rmail.texi: Minor cleanups. | ||
| 3036 | (Rmail): Delete digression about `rmail-mode'. | ||
| 3037 | (Rmail Inbox): Delete false advice wrt rmail-primary-inbox-list. | ||
| 3038 | (Rmail Files): Mention C-u M-x rmail. | ||
| 3039 | (Rmail Reply): Mention References. | ||
| 3040 | (Rmail Display): Mention rmail-nonignored-headers. | ||
| 3041 | |||
| 3042 | * programs.texi: Minor cleanups. | ||
| 3043 | (Comment Commands): Mention momentary Transient Mark mode. | ||
| 3044 | (Matching): Be more specific about customizing show-paren-mode. | ||
| 3045 | (Info Lookup): Don't list the modes that support C-h S. | ||
| 3046 | Just say what it does in an unsupported mode. | ||
| 3047 | (Man Page): Delete excessive info on customizing woman. | ||
| 3048 | (Motion in C): Don't mention c-for/backward-into-nomenclature. | ||
| 3049 | |||
| 3050 | * abbrevs.texi: Minor clarifications. | ||
| 3051 | (Dabbrev Customization): Talk about "dynamic abbrev expansion", | ||
| 3052 | not "dynamic abbrevs" as if they were a kind of abbrev. | ||
| 3053 | |||
| 3054 | * picture.texi (Picture): Minor cleanup. | ||
| 3055 | |||
| 3056 | * mule.texi (Communication Coding): Say "other applications". | ||
| 3057 | (Fontsets): Not specific to X. Add xref to X Resources. | ||
| 3058 | (Unibyte Mode): Rename from Single-Byte Character Support. | ||
| 3059 | "Graphical display", not window system. | ||
| 3060 | (International): Update menu. | ||
| 3061 | |||
| 3062 | * maintaining.texi (Format of ChangeLog): | ||
| 3063 | New node, split out from ChangeLog. | ||
| 3064 | (ChangeLog): Clarifications in the remaining text. | ||
| 3065 | (Create Tags Table, Etags Regexps, Select Tags Table): Cleanups. | ||
| 3066 | (Find Tag): Add @w. | ||
| 3067 | (Tags Search): Explain tag table order here. Simplify grep ref. | ||
| 3068 | (List Tags): tags-tag-face is a variable, not a face. | ||
| 3069 | (Emerge): Cleanups. | ||
| 3070 | |||
| 3071 | * kmacro.texi (Keyboard Macro Counter): Rewrite for clarity. | ||
| 3072 | (Keyboard Macros): Avoid "the user". | ||
| 3073 | |||
| 3074 | * killing.texi: "Graphical display", not window system. | ||
| 3075 | |||
| 3076 | * help.texi (Help Echo): "Graphical display", not window system. | ||
| 3077 | |||
| 3078 | * glossary.texi: Say "you", not "the user". Say "graphical display". | ||
| 3079 | |||
| 3080 | * frames.texi: Minor cleanups. "Graphical display", not window system. | ||
| 3081 | |||
| 3082 | * files.texi (Visiting): Make drag-and-drop not X-specific. | ||
| 3083 | |||
| 3084 | * custom.texi: Minor cleanups. "Graphical display", not window system. | ||
| 3085 | |||
| 3086 | * cmdargs.texi: Minor cleanups. | ||
| 3087 | |||
| 3088 | * building.texi (Compilation): Move and split kill-compilation para. | ||
| 3089 | Add para about multiple compilers. | ||
| 3090 | (Compilation Mode): Commands also available in grep mode and others. | ||
| 3091 | Mention C-u C-x ` more tutorially. Clarify C-x `. | ||
| 3092 | (Compilation Shell): Clarify. Put Bash example first. | ||
| 3093 | (Grep Searching): Minor cleanups; add @w. | ||
| 3094 | (Debuggers): Minor cleanups. | ||
| 3095 | (Starting GUD): Make GDB xgraphical mode issue clearer. | ||
| 3096 | (Debugger Operation): Lots of clarifications including | ||
| 3097 | GDB tooltip side-effect issue. | ||
| 3098 | (Commands of GUD): Clarify. | ||
| 3099 | (GUD Customization): Add bashdb-mode-hook. | ||
| 3100 | (GDB Graphical Interface): Rewrite for clarity. | ||
| 3101 | (GDB User Interface Layout): Rewrite for clarity. | ||
| 3102 | (Stack Buffer, Watch Expressions): Likewise. | ||
| 3103 | (Other GDB User Interface Buffers): Cleanups. | ||
| 3104 | (Lisp Libraries, External Lisp): Cleanup. | ||
| 3105 | |||
| 3106 | * basic.texi (Position Info): "Graphical displays", rather than | ||
| 3107 | window systems. | ||
| 3108 | |||
| 3109 | * anti.texi: Minor cleanup. | ||
| 3110 | |||
| 3111 | 2006-02-06 Romain Francoise <romain@orebokech.com> | ||
| 3112 | |||
| 3113 | * faq.texi (VM): VM now at version 7.19. | ||
| 3114 | Set myself as maintainer of this file. | ||
| 3115 | |||
| 3116 | 2006-02-04 Michael Olson <mwolson@gnu.org> | ||
| 3117 | |||
| 3118 | * erc.texi (History): Note that ERC is now included with Emacs. | ||
| 3119 | |||
| 3120 | 2006-02-03 Eli Zaretskii <eliz@gnu.org> | ||
| 3121 | |||
| 3122 | * custom.texi (Init File, Find Init): Add cross-references to | ||
| 3123 | where $HOME is described. | ||
| 3124 | |||
| 3125 | 2006-02-01 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3126 | |||
| 3127 | * frames.texi (Frame Parameters): Remove @item for S-Mouse-1; it | ||
| 3128 | is not inside the @table. | ||
| 3129 | |||
| 3130 | * emacs.texi (Top): Correct node name. | ||
| 3131 | |||
| 3132 | * files.texi (File Names): Fix @xref. | ||
| 3133 | (Reverting): Fix typo. | ||
| 3134 | |||
| 3135 | * mule.texi (International): Correct node name. | ||
| 3136 | |||
| 3137 | * kmacro.texi (Save Keyboard Macro): Add missing @kbd to @table. | ||
| 3138 | |||
| 3139 | 2006-02-01 Richard M. Stallman <rms@gnu.org> | ||
| 3140 | |||
| 3141 | * emacs.texi (Top): Update subnode menu. | ||
| 3142 | |||
| 3143 | * mule.texi: Minor clarifications. | ||
| 3144 | Reduce the specific references to X Windows. | ||
| 3145 | Refer to "graphical" terminals, rather than window systems. | ||
| 3146 | (Text Coding): Rename from Specify Coding. | ||
| 3147 | (Communication Coding, File Name Coding, Terminal Coding): | ||
| 3148 | New nodes split out from Text Coding. | ||
| 3149 | |||
| 3150 | * kmacro.texi: Minor clarifications. | ||
| 3151 | (Keyboard Macro Ring): Comment out some excessive commands. | ||
| 3152 | (Basic Keyboard Macro): Split up the table, putting part in each node. | ||
| 3153 | |||
| 3154 | * major.texi: Minor clarifications. | ||
| 3155 | |||
| 3156 | * misc.texi (Single Shell, Interactive Shell): Fix xrefs. | ||
| 3157 | |||
| 3158 | * windows.texi: Minor clarifications. | ||
| 3159 | (Change Window): Don't describe mode-line mouse cmds here. | ||
| 3160 | Add xref to Mode Line Mouse. | ||
| 3161 | |||
| 3162 | * msdog.texi (Text and Binary, MS-DOS and MULE): Fix xrefs. | ||
| 3163 | |||
| 3164 | * macos.texi (Mac International): Fix xref. | ||
| 3165 | |||
| 3166 | * indent.texi: Minor clarifications. | ||
| 3167 | |||
| 3168 | * frames.texi: Minor clarifications. | ||
| 3169 | Reduce the specific references to X Windows. | ||
| 3170 | Refer to "graphical" terminals, rather than window systems. | ||
| 3171 | (Frame Parameters): Don't mention commands like | ||
| 3172 | set-foreground-color. Just say to customize a face. | ||
| 3173 | (Drag and Drop): Lisp-level stuff moved to Emacs Lisp manual. | ||
| 3174 | |||
| 3175 | * files.texi: Minor clarifications. | ||
| 3176 | (Numbered Backups): New node, split out from Backup Names. | ||
| 3177 | |||
| 3178 | * display.texi (Font Lock): C mode no longer depends on (-in-col-0. | ||
| 3179 | |||
| 3180 | * cmdargs.texi (General Variables): Fix xref. | ||
| 3181 | |||
| 3182 | * buffers.texi: Minor clarifications. | ||
| 3183 | |||
| 3184 | 2006-01-31 Romain Francoise <romain@orebokech.com> | ||
| 3185 | |||
| 3186 | * message.texi (Message Headers): Explain what | ||
| 3187 | `message-alternative-emails' does in more detail. | ||
| 3188 | Update copyright year. | ||
| 3189 | |||
| 3190 | 2006-01-31 Richard M. Stallman <rms@gnu.org> | ||
| 3191 | |||
| 3192 | * display.texi (Scrolling, Horizontal Scrolling, Follow Mode): | ||
| 3193 | Nodes moved to top. | ||
| 3194 | |||
| 3195 | * display.texi: Minor clarifications. | ||
| 3196 | (Display): Rearrange menu. | ||
| 3197 | (Standard Faces): Mention query-replace face. | ||
| 3198 | (Faces): Simplify. | ||
| 3199 | (Font Lock): Simplify face customization info. | ||
| 3200 | (Highlight Changes): Node merged into Highlight Interactively. | ||
| 3201 | (Highlight Interactively): Much rewriting and cleanup. | ||
| 3202 | (Optional Mode Line): Narrowed line number not good for goto-line. | ||
| 3203 | Simplify face customization advice. | ||
| 3204 | (Text Display): Mention use of escape-glyph face. | ||
| 3205 | Move ctl-arrow and tab-width here. | ||
| 3206 | (Display Custom): Move no-redraw-on-reenter to end of node. | ||
| 3207 | |||
| 3208 | * search.texi: Minor clarifications. | ||
| 3209 | (Isearch Scroll): Simplify. | ||
| 3210 | (Other Repeating Search): Document multi-occur-in-matching-buffers. | ||
| 3211 | |||
| 3212 | * regs.texi (Registers): Mention bookmarks here. | ||
| 3213 | |||
| 3214 | * mark.texi: Minor clarifications. | ||
| 3215 | (Selective Undo): Node deleted. | ||
| 3216 | |||
| 3217 | * m-x.texi: Minor clarifications. | ||
| 3218 | |||
| 3219 | * killing.texi: Minor clarifications. | ||
| 3220 | Refer to "graphical" terminals, rather than window systems. | ||
| 3221 | |||
| 3222 | * help.texi: Clarifications. | ||
| 3223 | (Help): Don't describe C-h F and C-h K here. | ||
| 3224 | (Key Help): Describe C-h K here. | ||
| 3225 | (Name Help): Mention Emacs Lisp Intro. | ||
| 3226 | Describe C-h F here. | ||
| 3227 | (Misc Help): Mention C-h F and C-h K only briefly. | ||
| 3228 | |||
| 3229 | * fixit.texi (Undo): New node, mostly copied from basic.texi. | ||
| 3230 | Selective undo text merged in. | ||
| 3231 | (Spelling): Mention Aspell along with Ispell. | ||
| 3232 | |||
| 3233 | * emacs.texi (Top): Update subnode menus. | ||
| 3234 | |||
| 3235 | * basic.texi (Basic Undo): Rename from Undo. Most of text | ||
| 3236 | moved to new Undo node. | ||
| 3237 | |||
| 3238 | 2006-01-30 Juanma Barranquero <lekktu@gmail.com> | ||
| 3239 | |||
| 3240 | * makefile.w32-in (clean): Add newsticker, sieve, pgg, erc and rcirc. | ||
| 3241 | |||
| 3242 | 2006-01-29 Chong Yidong <cyd@stupidchicken.com> | ||
| 3243 | |||
| 3244 | * basic.texi (Continuation Lines, Inserting Text): | ||
| 3245 | Mention longlines mode. | ||
| 3246 | |||
| 3247 | 2006-01-29 Richard M. Stallman <rms@gnu.org> | ||
| 3248 | |||
| 3249 | * screen.texi: Minor cleaups. | ||
| 3250 | (Screen): Clean up the intro paragraphs. | ||
| 3251 | (Mode Line): Lots of rewriting. Handle frame-name better. | ||
| 3252 | eol-mnemonic-... vars moved out. | ||
| 3253 | |||
| 3254 | * emacs.texi (Top): Change menu item for MS-DOS node. | ||
| 3255 | Update subnode menu. | ||
| 3256 | |||
| 3257 | * msdog.texi (MS-DOS): Rewrite intro to explain how this | ||
| 3258 | chapter relates to Windows. Title changed. | ||
| 3259 | |||
| 3260 | * mini.texi: Minor cleanups. | ||
| 3261 | |||
| 3262 | * mark.texi (Selective Undo): New node, text moved from basic.texi. | ||
| 3263 | (Mark): Put it in the menu. | ||
| 3264 | |||
| 3265 | * entering.texi: Minor cleanups. | ||
| 3266 | |||
| 3267 | * emacs.texi (Top): Add xref to Mac chapter; explain Windows better. | ||
| 3268 | (Intro): Refer to "graphical" terminals, rather than X. | ||
| 3269 | |||
| 3270 | * display.texi (Display Custom): Add xref to Variables. | ||
| 3271 | (Optional Mode Line): eol-mnemonic-... vars moved here. | ||
| 3272 | |||
| 3273 | * commands.texi: Minor cleanups. Refer to "graphical" terminals, | ||
| 3274 | rather than X. | ||
| 3275 | |||
| 3276 | * cc-mode.texi (Indentation Commands): Inserts newline, not "linefeed". | ||
| 3277 | |||
| 3278 | * basic.texi: Minor cleanups. | ||
| 3279 | (Undo): selective-undo moved. | ||
| 3280 | |||
| 3281 | 2006-01-29 Michael Olson <mwolson@gnu.org> | ||
| 3282 | |||
| 3283 | * makefile.w32-in ($(infodir)/erc, erc.dvi): New targets. | ||
| 3284 | |||
| 3285 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add ERC. | ||
| 3286 | |||
| 3287 | * faq.texi (New in Emacs 22): Mention ERC. | ||
| 3288 | |||
| 3289 | 2006-01-28 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3290 | |||
| 3291 | * rcirc.texi: Capitalize dir entry for consistency with the entry | ||
| 3292 | in info/dir and other entries in the Emacs category. | ||
| 3293 | Fix typos. Delete trailing whitespace. | ||
| 3294 | |||
| 3295 | 2006-01-28 Bj,Av(Brn Lindstr,Av(Bm <bkhl@elektrubadur.se> | ||
| 3296 | |||
| 3297 | * rcirc.texi: Some @cindex changes, some changes from @kbd to @key. | ||
| 3298 | |||
| 3299 | 2006-01-27 Eli Zaretskii <eliz@gnu.org> | ||
| 3300 | |||
| 3301 | * makefile.w32-in ($(infodir)/rcirc, rcirc.dvi): New targets. | ||
| 3302 | (INFO_TARGETS, DVI_TARGETS): Add rcirc. | ||
| 3303 | |||
| 3304 | * Makefile.in (../info/rcirc, rcirc.dvi): New targets. | ||
| 3305 | (INFO_TARGETS, DVI_TARGETS): Add rcirc. | ||
| 3306 | |||
| 3307 | 2006-01-27 Alex Schroeder <alex@gnu.org> | ||
| 3308 | |||
| 3309 | * rcirc.texi: New file. | ||
| 3310 | |||
| 3311 | 2006-01-25 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3312 | |||
| 3313 | * anti.texi (Antinews): Various corrections and additions. | ||
| 3314 | |||
| 3315 | 2006-01-23 Juri Linkov <juri@jurta.org> | ||
| 3316 | |||
| 3317 | * custom.texi (Easy Customization, Customization Groups) | ||
| 3318 | (Browsing Custom): Mention links along with buttons. | ||
| 3319 | |||
| 3320 | * widget.texi (User Interface): Add S-TAB for widget-backward. | ||
| 3321 | |||
| 3322 | 2006-01-22 Michael Albinus <michael.albinus@gmx.de> | ||
| 3323 | |||
| 3324 | Sync with Tramp 2.0.52. | ||
| 3325 | |||
| 3326 | * tramp.texi (Frequently Asked Questions): Remove Ange-FTP item. | ||
| 3327 | Add Tramp disabling item. New item for common connection problems. | ||
| 3328 | (various): Apply "ftp" as method for the download URL. | ||
| 3329 | (Bug Reports): Refer to FAQ for common problems. | ||
| 3330 | |||
| 3331 | 2006-01-21 Eli Zaretskii <eliz@gnu.org> | ||
| 3332 | |||
| 3333 | * widget.texi (User Interface): Use @key for TAB. | ||
| 3334 | |||
| 3335 | * text.texi (TeX Print): Use @key for TAB. | ||
| 3336 | |||
| 3337 | * ses.texi (Formulas, Printer functions): Use @key for TAB. | ||
| 3338 | |||
| 3339 | * kmacro.texi (Keyboard Macro Step-Edit): Use @key for TAB. | ||
| 3340 | |||
| 3341 | * ebrowse.texi (Switching to Tree, Symbol Completion): Use @key | ||
| 3342 | for TAB. | ||
| 3343 | |||
| 3344 | * cc-mode.texi (Indentation Calculation): Use @key for TAB. | ||
| 3345 | |||
| 3346 | 2006-01-15 Sven Joachim <svenjoac@gmx.de> (tiny change) | ||
| 3347 | |||
| 3348 | * files.texi (File Aliases): Don't claim that usually separate | ||
| 3349 | buffers are created for two file names that name the same data. | ||
| 3350 | Mention additional situations where different names mean the same | ||
| 3351 | file on disk. | ||
| 3352 | |||
| 3353 | 2006-01-19 Richard M. Stallman <rms@gnu.org> | ||
| 3354 | |||
| 3355 | * killing.texi (Deletion): Upcase @key argument. | ||
| 3356 | |||
| 3357 | * custom.texi (Custom Themes): Minor cleanup. | ||
| 3358 | |||
| 3359 | * programs.texi (Hungry Delete): Upcase @key argument. | ||
| 3360 | |||
| 3361 | 2006-01-16 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3362 | |||
| 3363 | * gnus.texi: Update copyright. | ||
| 3364 | |||
| 3365 | 2006-01-16 Juri Linkov <juri@jurta.org> | ||
| 3366 | |||
| 3367 | * display.texi (Standard Faces): Add `mode-line-buffer-id'. | ||
| 3368 | Move `mode-line-highlight' before `mode-line-buffer-id'. | ||
| 3369 | |||
| 3370 | 2006-01-13 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3371 | |||
| 3372 | * gnus.texi (Article Washing): Additions. | ||
| 3373 | |||
| 3374 | 2006-01-08 Alex Schroeder <alex@gnu.org> | ||
| 3375 | |||
| 3376 | * pgg.texi (Caching passphrase): Rewording. | ||
| 3377 | |||
| 3378 | 2006-01-14 Richard M. Stallman <rms@gnu.org> | ||
| 3379 | |||
| 3380 | * basic.texi (Inserting Text): Minor cleanup. | ||
| 3381 | |||
| 3382 | 2006-01-13 Carsten Dominik <dominik@science.uva.nl> | ||
| 3383 | |||
| 3384 | * org.texi (Agenda commands): Document tags command. | ||
| 3385 | |||
| 3386 | 2006-01-11 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3387 | |||
| 3388 | * custom.texi (Changing a Variable, Face Customization): | ||
| 3389 | Update for changes in Custom menus. | ||
| 3390 | |||
| 3391 | 2006-01-10 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3392 | |||
| 3393 | * gnus.texi (RSS): Document nnrss-wash-html-in-text-plain-parts. | ||
| 3394 | |||
| 3395 | 2006-01-06 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3396 | |||
| 3397 | * gnus.texi (RSS): Addition. | ||
| 3398 | |||
| 3399 | 2005-12-22 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3400 | |||
| 3401 | * gnus.texi (Summary Post Commands): Fix function bound to `S O p'. | ||
| 3402 | |||
| 3403 | 2005-12-19 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3404 | |||
| 3405 | * emacs-mime.texi (Display Customization): Add setting example to | ||
| 3406 | mm-discouraged-alternatives. | ||
| 3407 | |||
| 3408 | 2006-01-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 3409 | |||
| 3410 | * flymake.texi (Obtaining Flymake): Remove chapter since Emacs's | ||
| 3411 | version is the canonical version. | ||
| 3412 | |||
| 3413 | 2006-01-08 Alex Schroeder <alex@gnu.org> | ||
| 3414 | |||
| 3415 | * pgg.texi (Caching passphrase): Rewording. | ||
| 3416 | |||
| 3417 | 2006-01-06 Eli Zaretskii <eliz@gnu.org> | ||
| 3418 | |||
| 3419 | * flymake.texi (Obtaining Flymake): Update Flymake's CVS | ||
| 3420 | repository URL. | ||
| 3421 | |||
| 3422 | 2006-01-06 Carsten Dominik <dominik@science.uva.nl> | ||
| 3423 | |||
| 3424 | * org.texi: Removed the accidentally re-added empty line in the | ||
| 3425 | direntry. | ||
| 3426 | |||
| 3427 | 2006-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 3428 | |||
| 3429 | * macos.texi (Mac International): Undo last change. | ||
| 3430 | |||
| 3431 | 2006-01-05 Carsten Dominik <dominik@science.uva.nl> | ||
| 3432 | |||
| 3433 | * org.texi (Agenda Views): Chapter reorganized. | ||
| 3434 | |||
| 3435 | 2006-01-02 Chong Yidong <cyd@stupidchicken.com> | ||
| 3436 | |||
| 3437 | * custom.texi (Custom Themes): Describe the new | ||
| 3438 | customize-create-theme interface. | ||
| 3439 | |||
| 3440 | 2005-12-30 Juri Linkov <juri@jurta.org> | ||
| 3441 | |||
| 3442 | * basic.texi (Position Info): Update example. | ||
| 3443 | |||
| 3444 | 2005-12-29 Romain Francoise <romain@orebokech.com> | ||
| 3445 | |||
| 3446 | * faq.texi (Using Customize): New node. | ||
| 3447 | |||
| 3448 | 2005-12-28 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3449 | |||
| 3450 | * org.texi: Remove blank line in @direntry. It is non-standard | ||
| 3451 | and recursively produces blank lines all over the dir file (when | ||
| 3452 | using Texinfo 4.8). | ||
| 3453 | |||
| 3454 | 2005-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 3455 | |||
| 3456 | * frames.texi (Dialog Boxes): Add x-gtk-show-hidden-files. | ||
| 3457 | |||
| 3458 | 2005-12-24 Chong Yidong <cyd@stupidchicken.com> | ||
| 3459 | |||
| 3460 | * custom.texi (Custom Themes): `load-theme' always loads. | ||
| 3461 | |||
| 3462 | 2005-12-23 Juri Linkov <juri@jurta.org> | ||
| 3463 | |||
| 3464 | * display.texi (Highlight Interactively): Use double space to | ||
| 3465 | separate sentences. Replace C-p with M-p, and C-n with M-n. | ||
| 3466 | |||
| 3467 | 2005-12-22 Richard M. Stallman <rms@gnu.org> | ||
| 3468 | |||
| 3469 | * custom.texi (Easy Customization and subnodes): | ||
| 3470 | Replace "active field" with "button". | ||
| 3471 | Use "user option" only for variables. | ||
| 3472 | Use "setting" for variable-or-face. | ||
| 3473 | |||
| 3474 | 2005-12-22 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3475 | |||
| 3476 | * buffers.texi (Select Buffer): Change order in table to make | ||
| 3477 | "Similar" refer to the correct item. | ||
| 3478 | (Indirect Buffers): Minor rewording. | ||
| 3479 | |||
| 3480 | 2005-12-21 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3481 | |||
| 3482 | * widget.texi (atoms): Delete obsolete remark about `file' widget. | ||
| 3483 | |||
| 3484 | 2005-12-20 Juri Linkov <juri@jurta.org> | ||
| 3485 | |||
| 3486 | * files.texi (VC Status): Put P and N near p and n. | ||
| 3487 | |||
| 3488 | 2005-12-20 Carsten Dominik <dominik@science.uva.nl> | ||
| 3489 | |||
| 3490 | * org.texi (Tags): Boolean logic documented. | ||
| 3491 | (Agenda Views): Document custom commands. | ||
| 3492 | |||
| 3493 | 2005-12-20 David Kastrup <dak@gnu.org> | ||
| 3494 | |||
| 3495 | * faq.texi (AUCTeX): Update version and mailing list info. | ||
| 3496 | |||
| 3497 | 2005-12-19 Richard M. Stallman <rms@gnu.org> | ||
| 3498 | |||
| 3499 | * programs.texi (Electric C): Delete the info about newline control. | ||
| 3500 | (Other C Commands): Minor cleanup. | ||
| 3501 | (Left Margin Paren): Minor cleanup. | ||
| 3502 | |||
| 3503 | 2005-12-19 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3504 | |||
| 3505 | * custom.texi (Easy Customization): Add "Browsing Custom" to menu. | ||
| 3506 | (Customization Groups): Delete text moved to "Browsing Custom". | ||
| 3507 | (Browsing Custom): New node. | ||
| 3508 | (Specific Customization): Clarify which commands only work for | ||
| 3509 | loaded options. | ||
| 3510 | |||
| 3511 | 2005-12-18 Bill Wohler <wohler@newt.com> | ||
| 3512 | |||
| 3513 | * frames.texi (Tool Bars): Shorten text of previous change. | ||
| 3514 | |||
| 3515 | 2005-12-18 Aaron S. Hawley <Aaron.Hawley@uvm.edu> | ||
| 3516 | |||
| 3517 | * files.texi (VC Status): Document log-view mode. | ||
| 3518 | |||
| 3519 | 2005-12-18 Bill Wohler <wohler@newt.com> | ||
| 3520 | |||
| 3521 | * frames.texi (Tool Bars): Mention that you can turn off tool bars | ||
| 3522 | permanently via the customize interface. | ||
| 3523 | |||
| 3524 | 2005-12-17 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3525 | |||
| 3526 | * gnus.texi (MIME Commands): Mention addition of | ||
| 3527 | multipart/alternative to gnus-buttonized-mime-types and add xref | ||
| 3528 | to mm-discouraged-alternatives. | ||
| 3529 | |||
| 3530 | * emacs-mime.texi (Display Customization): Mention addition of | ||
| 3531 | "image/.*" and add xref to gnus-buttonized-mime-types in the | ||
| 3532 | mm-discouraged-alternatives section. | ||
| 3533 | |||
| 3534 | 2005-12-16 Carsten Dominik <dominik@science.uva.nl> | ||
| 3535 | |||
| 3536 | * org.texi (Tags): New section. | ||
| 3537 | (Agenda Views): Chapter reorganized. | ||
| 3538 | |||
| 3539 | 2005-12-16 Ralf Angeli <angeli@iwi.uni-sb.de> | ||
| 3540 | |||
| 3541 | * killing.texi (Killing by Lines): Document `kill-whole-line' | ||
| 3542 | function. | ||
| 3543 | |||
| 3544 | 2005-12-16 Eli Zaretskii <eliz@gnu.org> | ||
| 3545 | |||
| 3546 | * org.texi (Internal Links): Add a missing comma after an @xref. | ||
| 3547 | |||
| 3548 | 2005-12-16 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> | ||
| 3549 | |||
| 3550 | * buffers.texi (Select Buffer): Change `prev-buffer' to | ||
| 3551 | `previous-buffer'. Indicate that these functions use a frame | ||
| 3552 | local buffer list. | ||
| 3553 | |||
| 3554 | 2005-12-14 Chong Yidong <cyd@stupidchicken.com> | ||
| 3555 | |||
| 3556 | * faq.texi (Filling paragraphs with a single space): No need to | ||
| 3557 | change sentence-end now. | ||
| 3558 | |||
| 3559 | 2005-12-13 Romain Francoise <romain@orebokech.com> | ||
| 3560 | |||
| 3561 | * faq.texi (Scrolling only one line): Use `scroll-conservatively'. | ||
| 3562 | |||
| 3563 | 2005-12-12 Jay Belanger <belanger@truman.edu> | ||
| 3564 | |||
| 3565 | * faq.texi (Calc): Update version number. | ||
| 3566 | |||
| 3567 | 2005-12-12 Carsten Dominik <dominik@science.uva.nl> | ||
| 3568 | |||
| 3569 | * org.texi (Progress Logging): New section. | ||
| 3570 | |||
| 3571 | 2005-12-12 Richard M. Stallman <rms@gnu.org> | ||
| 3572 | |||
| 3573 | * custom.texi (Easy Customization): Change menu comment. | ||
| 3574 | (Prefix Keymaps): Fix spelling of Control-X-prefix. | ||
| 3575 | |||
| 3576 | * help.texi (Apropos): Rewrite. Talk about "apropos patterns". | ||
| 3577 | (Help): Among the Apropos commands, describe only C-h a here. | ||
| 3578 | |||
| 3579 | 2005-12-11 Richard M. Stallman <rms@gnu.org> | ||
| 3580 | |||
| 3581 | * programs.texi (Options for Comments): Comment-end starts with space. | ||
| 3582 | |||
| 3583 | * glossary.texi (Glossary): Minor cleanup. | ||
| 3584 | |||
| 3585 | * files.texi (Old Versions): Use @table. | ||
| 3586 | |||
| 3587 | 2005-12-10 Romain Francoise <romain@orebokech.com> | ||
| 3588 | |||
| 3589 | Update the Emacs FAQ for the 22.1 release. | ||
| 3590 | |||
| 3591 | * faq.texi: Set VER to `22.1'. | ||
| 3592 | (Basic editing): Explain how to use localized versions of the | ||
| 3593 | Tutorial. Mention that `C-h r' displays the manual. Delete | ||
| 3594 | obsolete WWW link to an Emacs 18 tutorial. | ||
| 3595 | (Getting a printed manual): Point to the new locations of the | ||
| 3596 | manuals on the GNU Web site. | ||
| 3597 | (Emacs Lisp documentation): Explain that the Emacs Lisp manual is | ||
| 3598 | available via Info (it was previously distributed separately). | ||
| 3599 | (Installing Texinfo documentation): The latest version of Texinfo | ||
| 3600 | is 4.8, not 4.0. | ||
| 3601 | (Informational files for Emacs): COPYING is the GNU General Public | ||
| 3602 | License, not the Emacs General Public License. | ||
| 3603 | (Informational files for Emacs): Delete obsolete link to the | ||
| 3604 | GNUinfo pages as they have been removed from the GNU Web site. | ||
| 3605 | (New in Emacs 22): New node. | ||
| 3606 | (Setting up a customization file): Say that most packages support | ||
| 3607 | Customize nowadays. | ||
| 3608 | (Colors on a TTY): Delete reference to instructions on how to | ||
| 3609 | enable syntax highlighting, it is now enabled by default. | ||
| 3610 | (Turning on abbrevs by default): Emacs now reads the abbrevs file | ||
| 3611 | at startup automatically. | ||
| 3612 | (Controlling case sensitivity): Mention `M-c' in isearch. | ||
| 3613 | (Using an already running Emacs process): Emacs now creates the | ||
| 3614 | socket in `/tmp/emacsUID'. Fix typos. Change default location of | ||
| 3615 | gnuserv. As emacsclient can now run Lisp code as well, delete a | ||
| 3616 | sentence praising gnuserv for that. Simplify description of how | ||
| 3617 | the client/server operation works. | ||
| 3618 | (Compiler error messages): Delete obsolete text (compile.el has | ||
| 3619 | been rewritten). | ||
| 3620 | (Indenting switch statements): Fix typo. | ||
| 3621 | (Matching parentheses): Simplify setup instructions, mention the | ||
| 3622 | menu bar item in the Options menu. | ||
| 3623 | (Repeating a command as many times as possible): Mention `C-x e'. | ||
| 3624 | (Going to a line by number): Mention new keymap and bindings | ||
| 3625 | `M-g M-g', `M-g M-p' and `M-g M-n'. | ||
| 3626 | (Turning on syntax highlighting): Now on by default. Simplify. | ||
| 3627 | (Replacing highlighted text): Use `1', not `t'. | ||
| 3628 | (Problems with very large files): The maximum size is now 256MB on | ||
| 3629 | 32-bit machines. | ||
| 3630 | (^M in the shell buffer): Mention `comint-process-echoes'. | ||
| 3631 | (Emacs for Apple computers): Emacs 22 has native support for Mac | ||
| 3632 | OS X. | ||
| 3633 | (Translating names to IP addresses): Delete node. | ||
| 3634 | (Binding keys to commands): Fix typo. | ||
| 3635 | (SPC no longer completes file names): New node. | ||
| 3636 | (MIME with Emacs mail packages): Delete section about the Emacs | ||
| 3637 | MIME FAQ (it's not reachable anymore). | ||
| 3638 | |||
| 3639 | 2005-12-10 David Koppelman <koppel@ece.lsu.edu> | ||
| 3640 | |||
| 3641 | * display.texi (Highlight Interactively): Include | ||
| 3642 | global-hi-lock-mode. Add miscellaneous details and elaborations. | ||
| 3643 | |||
| 3644 | 2005-12-09 Richard M. Stallman <rms@gnu.org> | ||
| 3645 | |||
| 3646 | * display.texi (Font Lock): Delete the Global FL menu item. | ||
| 3647 | |||
| 3648 | 2005-12-09 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3649 | |||
| 3650 | * custom.texi (Minibuffer Maps): Mention the maps for file name | ||
| 3651 | completion. | ||
| 3652 | |||
| 3653 | 2005-12-09 Kim F. Storm <storm@cua.dk> | ||
| 3654 | |||
| 3655 | * killing.texi (CUA Bindings): Describe how to use C-x and C-c as | ||
| 3656 | prefix keys even when mark is active. Decribe that RET moves | ||
| 3657 | cursor to next corner in rectangle; clarify insert around rectangle. | ||
| 3658 | |||
| 3659 | 2005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org> | ||
| 3660 | |||
| 3661 | * cc-mode.texi: The manual has been extensively revised: the | ||
| 3662 | information about using CC Mode has been separated from the larger | ||
| 3663 | and more difficult chapters about configuration. It has been | ||
| 3664 | updated for CC Mode 5.31. | ||
| 3665 | |||
| 3666 | 2005-12-05 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3667 | |||
| 3668 | * pgg.texi (User Commands): Fix description of pgg-verify-region. | ||
| 3669 | (Selecting an implementation): Fix descriptions. | ||
| 3670 | |||
| 3671 | 2005-11-30 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3672 | |||
| 3673 | * message.texi (Various Message Variables): Addition. | ||
| 3674 | |||
| 3675 | 2005-11-29 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3676 | |||
| 3677 | * message.texi: Fix default values. | ||
| 3678 | |||
| 3679 | 2005-11-25 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3680 | |||
| 3681 | * message.texi (Header Commands): Clarify descriptions of | ||
| 3682 | message-cross-post-followup-to, message-reduce-to-to-cc, and | ||
| 3683 | message-insert-wide-reply. | ||
| 3684 | (Various Commands): Fix kindex for message-kill-to-signature; | ||
| 3685 | clarify description of message-tab. | ||
| 3686 | |||
| 3687 | 2005-11-22 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3688 | |||
| 3689 | * message.texi (Mailing Lists): Fix description about MFT. | ||
| 3690 | |||
| 3691 | * gnus.texi (Emacs Lisp): Use ~/.gnus.el instead of ~/.emacs. | ||
| 3692 | |||
| 3693 | 2005-11-17 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3694 | |||
| 3695 | * gnus.texi (Slow Terminal Connection): Replace old description | ||
| 3696 | with new one. | ||
| 3697 | |||
| 3698 | 2005-11-16 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3699 | |||
| 3700 | * gnus.texi (Oort Gnus): Use ~/.gnus.el instead of ~/.emacs; | ||
| 3701 | replace X-Draft-Headers with X-Draft-From. | ||
| 3702 | |||
| 3703 | 2005-11-14 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3704 | |||
| 3705 | * gnus.texi (Various Various): Fix the default value of | ||
| 3706 | nnheader-max-head-length. | ||
| 3707 | (Gnus Versions): Fix typo. | ||
| 3708 | |||
| 3709 | 2005-12-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3710 | |||
| 3711 | * custom.texi (Customization): Use xref to elisp manual for | ||
| 3712 | non-TeX output. | ||
| 3713 | (Minor Modes): Update. | ||
| 3714 | (Customization Groups, Changing a Variable, Face Customization): | ||
| 3715 | Update for new appearance of Custom buffers. | ||
| 3716 | (Changing a Variable): `custom-buffer-done-function' has been | ||
| 3717 | replaced by `custom-buffer-done-kill'. | ||
| 3718 | (Specific Customization): In the `customize-group' buffer, a | ||
| 3719 | subgroup's contents are not "hidden". They are not included at | ||
| 3720 | all. They have no [Show] button. | ||
| 3721 | (Mouse Buttons): Add pxref to description of mouse event lists in | ||
| 3722 | Elisp manual. Add `menu-bar' and `header-line' dummy prefix keys. | ||
| 3723 | (Find Init): Emacs now looks for ~/.emacs.d/init.el instead of | ||
| 3724 | ~/.emacs.d/.emacs, if it can not find ~/.emacs(.el). | ||
| 3725 | |||
| 3726 | 2005-12-08 Richard M. Stallman <rms@gnu.org> | ||
| 3727 | |||
| 3728 | * mini.texi (Completion Commands, Completion): | ||
| 3729 | In file name input, SPC does not do completion. | ||
| 3730 | |||
| 3731 | 2005-12-08 Carsten Dominik <dominik@science.uva.nl> | ||
| 3732 | |||
| 3733 | * org.texi (Structure editing): Document new functionality of | ||
| 3734 | M-RET. | ||
| 3735 | |||
| 3736 | 2005-12-08 Nick Roberts <nickrob@snap.net.nz> | ||
| 3737 | |||
| 3738 | * building.texi (GDB Graphical Interface): Explain screen size | ||
| 3739 | setting. | ||
| 3740 | (Other GDB User Interface Buffers): Describe features specific to | ||
| 3741 | GDB 6.4. | ||
| 3742 | |||
| 3743 | 2005-12-06 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3744 | |||
| 3745 | * org.texi (Internal Links): Fix Texinfo usage. | ||
| 3746 | |||
| 3747 | 2005-12-06 Carsten Dominik <dominik@science.uva.nl> | ||
| 3748 | |||
| 3749 | * org.texi (TODO basics): Document the global todo list. | ||
| 3750 | (TODO items): Documents sparse tree for specific TODO | ||
| 3751 | keywords. | ||
| 3752 | |||
| 3753 | 2005-12-01 Nick Roberts <nickrob@snap.net.nz> | ||
| 3754 | |||
| 3755 | * building.texi (GDB User Interface Layout): Describe how to | ||
| 3756 | kill associated buffers. | ||
| 3757 | (Breakpoints Buffer): Use D instead of d for gdb-delete-breakpoint. | ||
| 3758 | (Watch Expressions): Be more precise. | ||
| 3759 | (Other GDB User Interface Buffers): Describe how to change a | ||
| 3760 | register value. | ||
| 3761 | |||
| 3762 | 2005-11-30 Carsten Dominik <dominik@science.uva.nl> | ||
| 3763 | |||
| 3764 | * org.texi (Plain Lists): Typos fixed. | ||
| 3765 | |||
| 3766 | 2005-11-28 Jay Belanger <belanger@truman.edu> | ||
| 3767 | |||
| 3768 | * calc.texi: Change references of `M-#' to `C-x *' prefix. | ||
| 3769 | |||
| 3770 | 2005-11-24 Carsten Dominik <dominik@science.uva.nl> | ||
| 3771 | |||
| 3772 | * org.texi (Structure editing): New item moving commands added. | ||
| 3773 | (Plain Lists): New section. | ||
| 3774 | |||
| 3775 | 2005-11-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 3776 | |||
| 3777 | * macos.texi (Mac Input): Remove description of | ||
| 3778 | mac-command-key-is-meta. Add descriptions of | ||
| 3779 | mac-control-modifier, mac-command-modifier, and | ||
| 3780 | mac-option-modifier. | ||
| 3781 | (Mac International): Fix description of conversion of clipboard data. | ||
| 3782 | (Mac Font Specs): Add example of font customization by face attributes. | ||
| 3783 | |||
| 3784 | 2005-11-22 Nick Roberts <nickrob@snap.net.nz> | ||
| 3785 | |||
| 3786 | * building.texi (Watch Expressions): Expand description. | ||
| 3787 | (Other GDB User Interface Buffers): Describe local map for | ||
| 3788 | gud-watch. | ||
| 3789 | |||
| 3790 | 2005-11-21 Chong Yidong <cyd@stupidchicken.com> | ||
| 3791 | |||
| 3792 | * display.texi (Font Lock): Font lock is enabled by default now. | ||
| 3793 | |||
| 3794 | 2005-11-20 Juri Linkov <juri@jurta.org> | ||
| 3795 | |||
| 3796 | * basic.texi (Position Info): Update examples of the output. | ||
| 3797 | Remove the fact that examples are produced in the TeXinfo buffer, | ||
| 3798 | because in the Info reader users will get a different output from | ||
| 3799 | `C-x ='. | ||
| 3800 | |||
| 3801 | * building.texi (Compilation Mode): Remove paragraph duplicated | ||
| 3802 | from the node `Compilation'. Add `compilation-skip-threshold'. | ||
| 3803 | |||
| 3804 | * display.texi (Font Lock): Suggest more user-friendly method of | ||
| 3805 | finding all Font Lock faces (M-x customize-group RET font-lock-faces). | ||
| 3806 | |||
| 3807 | 2005-11-18 Richard M. Stallman <rms@gnu.org> | ||
| 3808 | |||
| 3809 | * files.texi (Registering): Mention @@ in mode line. | ||
| 3810 | |||
| 3811 | * mini.texi (Minibuffer File): Clarify previous change. Add @findex. | ||
| 3812 | |||
| 3813 | 2005-11-08 Aaron S. Hawley <Aaron.Hawley@uvm.edu> | ||
| 3814 | |||
| 3815 | * files.texi (Renaming and VC): Some back-ends don't | ||
| 3816 | handle renaming. | ||
| 3817 | |||
| 3818 | 2005-11-18 Carsten Dominik <dominik@science.uva.nl> | ||
| 3819 | |||
| 3820 | * org.texi (FAQ): Document `org-table-tab-jumps-over-hlines'. | ||
| 3821 | (Agenda): Document commands `org-cycle-agenda-files' and | ||
| 3822 | `org-agenda-file-to-front' | ||
| 3823 | (Built-in table editor): Document `org-table-sort-lines'. | ||
| 3824 | (HTML formatting): Export of hand-formatted lists. | ||
| 3825 | |||
| 3826 | 2005-11-17 Juri Linkov <juri@jurta.org> | ||
| 3827 | |||
| 3828 | * emacs.texi (Top): | ||
| 3829 | * display.texi (Highlight Interactively): Put this font-lock based | ||
| 3830 | mode near Font Lock node. | ||
| 3831 | |||
| 3832 | 2005-11-16 Chong Yidong <cyd@stupidchicken.com> | ||
| 3833 | |||
| 3834 | * ack.texi (Acknowledgments): Acknowledge Andrew Zhilin for Emacs | ||
| 3835 | icons. | ||
| 3836 | |||
| 3837 | 2005-11-12 Kim F. Storm <storm@cua.dk> | ||
| 3838 | |||
| 3839 | * help.texi (Help): Fix C-h a entry. Add C-h d entry. | ||
| 3840 | (Help Summary): Add C-h d and C-h e. | ||
| 3841 | (Apropos): Clarify that all apropos commands may search for either | ||
| 3842 | list of words or a regexp. Add C-h d for apropos-documentation. | ||
| 3843 | Describe apropos-documentation-sort-by-scores user option. | ||
| 3844 | |||
| 3845 | 2005-11-10 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3846 | |||
| 3847 | * gnus.texi (XVarious): Fix description of gnus-use-toolbar; add | ||
| 3848 | new variable gnus-toolbar-thickness. | ||
| 3849 | |||
| 3850 | 2005-11-08 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3851 | |||
| 3852 | * gnus.texi (XVarious): Revert description of gnus-use-toolbar. | ||
| 3853 | |||
| 3854 | 2005-11-07 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3855 | |||
| 3856 | * gnus.texi (X-Face): Fix description. | ||
| 3857 | (XVarious): Remove gnus-xmas-logo-color-alist and | ||
| 3858 | gnus-xmas-logo-color-style; fix description of gnus-use-toolbar. | ||
| 3859 | |||
| 3860 | 2005-11-01 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 3861 | |||
| 3862 | * gnus.texi (Group Parameters): Mention new variable | ||
| 3863 | gnus-parameters-case-fold-search. | ||
| 3864 | (Home Score File): Addition. | ||
| 3865 | |||
| 3866 | 2005-11-09 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3867 | |||
| 3868 | * killing.texi (CUA Bindings): Add @section. | ||
| 3869 | |||
| 3870 | 2005-11-10 Kim F. Storm <storm@cua.dk> | ||
| 3871 | |||
| 3872 | * emacs.texi (Top): Add CUA Bindings entry to menu. | ||
| 3873 | |||
| 3874 | * killing.texi (CUA Bindings): New node. Moved here from | ||
| 3875 | misc.texi and extended with info on rectangle commands and | ||
| 3876 | rectangle highlighting, interface to registers, and the global | ||
| 3877 | mark feature. | ||
| 3878 | |||
| 3879 | * misc.texi (Emulation): Move CUA bindings item to killing.texi. | ||
| 3880 | |||
| 3881 | * regs.texi: Prev link points to CUA Bindings node. | ||
| 3882 | |||
| 3883 | 2005-11-07 Luc Teirlinck <teirllm@auburn.edu> | ||
| 3884 | |||
| 3885 | * help.texi (Help Echo): By default, help echos are only shown on | ||
| 3886 | mouse-over, not on point-over. | ||
| 3887 | |||
| 3888 | 2005-11-04 J,Ai(Br,At(Bme Marant <jerome@marant.org> | ||
| 3889 | |||
| 3890 | * misc.texi (Shell Mode): Describe how to activate password echoing. | ||
| 3891 | |||
| 3892 | 2005-11-04 Ulf Jasper <ulf.jasper@web.de> | ||
| 3893 | |||
| 3894 | * newsticker.texi: VERSION changed to 1.9. Updated UPDATED. | ||
| 3895 | (Overview): List supported feed types. | ||
| 3896 | (Installation): No installation necessary when using autoload. | ||
| 3897 | (Configuration): Rename "RSS" to "news". | ||
| 3898 | |||
| 3899 | 2005-11-04 Ken Manheimer <ken.manheimer@gmail.com> | ||
| 3900 | |||
| 3901 | * pgg.texi (User Commands): Document additional passphrase | ||
| 3902 | argument for pgg-encrypt-*, pgg-decrypt-*, and pgg-sign-* functions. | ||
| 3903 | (Backend methods): Likewise for corresponding pgg-scheme-* functions. | ||
| 3904 | |||
| 3905 | 2005-11-04 Carsten Dominik <dominik@science.uva.nl> | ||
| 3906 | |||
| 3907 | * org.texi: Version number changed to 3.19. | ||
| 3908 | |||
| 3909 | 2005-11-04 Romain Francoise <romain@orebokech.com> | ||
| 3910 | |||
| 3911 | * mark.texi (Mark Ring): Fix typo. | ||
| 3912 | |||
| 3913 | 2005-11-03 Richard M. Stallman <rms@gnu.org> | ||
| 3914 | |||
| 3915 | * mark.texi (Mark Ring): Mention set-mark-command-repeat-pop. | ||
| 3916 | |||
| 3917 | 2005-11-01 Bill Wohler <wohler@newt.com> | ||
| 3918 | |||
| 3919 | * help.texi (Help Mode): Fix typo. | ||
| 3920 | |||
| 3921 | 2005-11-01 Nick Roberts <nickrob@snap.net.nz> | ||
| 3922 | |||
| 3923 | * building.texi (Other GDB User Interface Buffers): Describe | ||
| 3924 | the command gdb-use-inferior-io-buffer. | ||
| 3925 | |||
| 3926 | 2005-10-31 Romain Francoise <romain@orebokech.com> | ||
| 3927 | |||
| 3928 | * files.texi (Compressed Files): Fix typo. | ||
| 3929 | |||
| 3930 | * buffers.texi (Misc Buffer): Downcase `*shell*'. | ||
| 3931 | |||
| 3932 | * windows.texi (Force Same Window): Likewise. | ||
| 3933 | |||
| 3934 | 2005-10-30 Bill Wohler <wohler@newt.com> | ||
| 3935 | |||
| 3936 | * help.texi (Help Mode): URLs viewed with browse-url. | ||
| 3937 | |||
| 3938 | 2005-10-31 Nick Roberts <nickrob@snap.net.nz> | ||
| 3939 | |||
| 3940 | * building.texi (GDB Graphical Interface): Don't reference | ||
| 3941 | gdb-mouse-set-clear-breakpoint. Explain gdb-mouse-until | ||
| 3942 | must stay in same frame. | ||
| 3943 | |||
| 3944 | 2005-10-29 Chong Yidong <cyd@stupidchicken.com> | ||
| 3945 | |||
| 3946 | * custom.texi (Init File): Document ~/.emacs.d/init.el. | ||
| 3947 | |||
| 3948 | * anti.texi (Antinews): Likewise. | ||
| 3949 | |||
| 3950 | 2005-10-29 Sascha Wilde <wilde@sha-bang.de> | ||
| 3951 | |||
| 3952 | * pgg.texi (How to use): Update the example to add autoload of | ||
| 3953 | pgg-encrypt-symmetric-region. | ||
| 3954 | (User Commands): Document pgg-encrypt-symmetric-region. | ||
| 3955 | (Backend methods): Document pgg-scheme-encrypt-symmetric-region. | ||
| 3956 | |||
| 3957 | 2005-10-28 Bill Wohler <wohler@newt.com> | ||
| 3958 | |||
| 3959 | * help.texi (Help): Help mode now creates hyperlinks for URLs. | ||
| 3960 | |||
| 3961 | 2005-10-28 Richard M. Stallman <rms@gnu.org> | ||
| 3962 | |||
| 3963 | * files.texi (Visiting): Explain how to enter ? in a file name. | ||
| 3964 | |||
| 3965 | * trouble.texi (Memory Full): Mention !MEM FULL! in mode line. | ||
| 3966 | |||
| 3967 | 2005-10-27 Jay Belanger <belanger@truman.edu> | ||
| 3968 | |||
| 3969 | * calc.texi (Predefined Units): Fix the symbol for a TeX points, | ||
| 3970 | mention other TeX-related units. | ||
| 3971 | |||
| 3972 | 2005-10-25 Nick Roberts <nickrob@snap.net.nz> | ||
| 3973 | |||
| 3974 | * building.texi (GDB Graphical Interface): Describe | ||
| 3975 | gdb-mouse-until. | ||
| 3976 | |||
| 3977 | 2005-10-23 Richard M. Stallman <rms@gnu.org> | ||
| 3978 | |||
| 3979 | * custom.texi (Init File): Recommend when to use site-start.el. | ||
| 3980 | |||
| 3981 | 2005-10-23 Lars Hansen <larsh@soem.dk> | ||
| 3982 | |||
| 3983 | * dired-x.texi (Miscellaneous Commands): Replace | ||
| 3984 | dired-do-relative-symlink by dired-do-relsymlink and | ||
| 3985 | dired-do-relative-symlink-regexp by dired-do-relsymlink-regexp. | ||
| 3986 | |||
| 3987 | 2005-10-23 Jay Belanger <belanger@truman.edu> | ||
| 3988 | |||
| 3989 | * calc.texi (Predefined Units): Use `alpha' for the fine structure | ||
| 3990 | constant. | ||
| 3991 | |||
| 3992 | 2005-10-23 Michael Albinus <michael.albinus@gmx.de> | ||
| 3993 | |||
| 3994 | * faq.texi (Bugs and problems): Replace | ||
| 3995 | `dired-move-to-filename-regexp' by | ||
| 3996 | `directory-listing-before-filename-regexp'. | ||
| 3997 | |||
| 3998 | 2005-10-22 Eli Zaretskii <eliz@gnu.org> | ||
| 3999 | |||
| 4000 | * newsticker.texi (UPDATED): Set value. | ||
| 4001 | |||
| 4002 | 2005-10-17 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4003 | |||
| 4004 | * gnus.texi (Document Groups): Remove duplicate item. | ||
| 4005 | |||
| 4006 | 2005-10-21 Juri Linkov <juri@jurta.org> | ||
| 4007 | |||
| 4008 | * custom.texi (Examining): Mention accessing the old variable | ||
| 4009 | value via M-n in set-variable. | ||
| 4010 | |||
| 4011 | 2005-10-21 Carsten Dominik <dominik@science.uva.nl> | ||
| 4012 | |||
| 4013 | * org.texi (Summary): Mention iCalendar support. | ||
| 4014 | (Exporting): Document iCalendar support. | ||
| 4015 | |||
| 4016 | 2005-10-18 Romain Francoise <romain@orebokech.com> | ||
| 4017 | |||
| 4018 | * files.texi (Version Systems): Capitalize GNU. | ||
| 4019 | |||
| 4020 | * viper.texi (Viper Specials): Likewise. | ||
| 4021 | |||
| 4022 | 2005-10-18 Nick Roberts <nickrob@snap.net.nz> | ||
| 4023 | |||
| 4024 | * building.texi (Compilation Mode): Remove redundant paragraph. | ||
| 4025 | (Watch Expressions): Remove paragraph to reflect code change. | ||
| 4026 | |||
| 4027 | 2005-10-17 Juri Linkov <juri@jurta.org> | ||
| 4028 | |||
| 4029 | * info.texi (Getting Started, Search Index, Expert Info): | ||
| 4030 | Fix wording. | ||
| 4031 | (Search Text): Replace `echo area' with `mode line'. | ||
| 4032 | (Search Index): Both `i' and `,' find all index entries. | ||
| 4033 | Replace example `C-f' with `C-l' (which exists in index of Info | ||
| 4034 | manual) and delete spaces in its keyboard input sequence. | ||
| 4035 | Delete unnecessary explanations about literal characters. | ||
| 4036 | |||
| 4037 | 2005-10-16 Richard M. Stallman <rms@gnu.org> | ||
| 4038 | |||
| 4039 | * building.texi (Compilation Mode, Compilation): Clarified. | ||
| 4040 | |||
| 4041 | 2005-10-15 Richard M. Stallman <rms@gnu.org> | ||
| 4042 | |||
| 4043 | * misc.texi (Saving Emacs Sessions): Mention savehist library. | ||
| 4044 | |||
| 4045 | 2005-10-14 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4046 | |||
| 4047 | * gnus.texi (Document Server Internals): Addition. | ||
| 4048 | |||
| 4049 | 2005-10-13 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4050 | |||
| 4051 | * gnus.texi (A note on namespaces): Fix RFC reference. | ||
| 4052 | |||
| 4053 | 2005-10-12 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4054 | |||
| 4055 | * gnus.texi (RSS): Fix key description. | ||
| 4056 | |||
| 4057 | 2005-10-11 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4058 | |||
| 4059 | * gnus.texi: Emacs/w3 -> Emacs/W3. | ||
| 4060 | (Browsing the Web): Fix description. | ||
| 4061 | (Web Searches): Ditto. | ||
| 4062 | (Customizing W3): Ditto. | ||
| 4063 | |||
| 4064 | 2005-10-07 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4065 | |||
| 4066 | * gnus.texi (Maildir): Clarify expire-age and expire-group. | ||
| 4067 | |||
| 4068 | 2005-10-13 Kenichi Handa <handa@m17n.org> | ||
| 4069 | |||
| 4070 | * basic.texi (Position Info): Fix previous change. | ||
| 4071 | |||
| 4072 | 2005-10-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 4073 | |||
| 4074 | * cmdargs.texi (Icons X): Fix typo. | ||
| 4075 | |||
| 4076 | 2005-10-12 Kenichi Handa <handa@m17n.org> | ||
| 4077 | |||
| 4078 | * basic.texi (Position Info): Describe the case that Emacs shows | ||
| 4079 | "part of display ...". | ||
| 4080 | |||
| 4081 | 2005-10-11 Jay Belanger <belanger@truman.edu> | ||
| 4082 | |||
| 4083 | * calc.texi (Integration): Mention using `a i' to compute definite | ||
| 4084 | integrals. | ||
| 4085 | |||
| 4086 | 2005-10-11 Juri Linkov <juri@jurta.org> | ||
| 4087 | |||
| 4088 | * info.texi: Rearrange nodes. | ||
| 4089 | (Top): Update menu. Change ref `Info for Experts' to | ||
| 4090 | `Advanced Info Commands'. | ||
| 4091 | (Getting Started): Fix description of manual's parts. | ||
| 4092 | (Help-Int): Change xref `Info Search' to `Search Index', and | ||
| 4093 | `Expert Info' to `Advanced'. | ||
| 4094 | (Advanced): Move node one level up. | ||
| 4095 | (Search Text, Search Index): New nodes split out from `Info Search'. | ||
| 4096 | (Go to node, Choose menu subtopic, Create Info buffer): New nodes | ||
| 4097 | split out from `Advanced'. | ||
| 4098 | (Advanced, Emacs Info Variables): De-document editing an Info file | ||
| 4099 | in Info. | ||
| 4100 | (Emacs Info Variables): Move node from `Expert Info' to `Advanced'. | ||
| 4101 | (Creating an Info File): Delete node and move its text to | ||
| 4102 | `Expert Info'. | ||
| 4103 | |||
| 4104 | 2005-10-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 4105 | |||
| 4106 | * cmdargs.texi (Icons X): -nb => -nbi. | ||
| 4107 | |||
| 4108 | 2005-10-10 Chong Yidong <cyd@stupidchicken.com> | ||
| 4109 | |||
| 4110 | * frames.texi (Speedbar): A couple more clarifications. | ||
| 4111 | |||
| 4112 | 2005-10-11 Nick Roberts <nickrob@snap.net.nz> | ||
| 4113 | |||
| 4114 | * building.texi (GDB User Interface Layout): Improve diagram. | ||
| 4115 | (Watch Expressions): Explain how to make speedbar global. | ||
| 4116 | (Other GDB User Interface Buffers): Make references more precise. | ||
| 4117 | |||
| 4118 | 2005-10-10 Carsten Dominik <dominik@science.uva.nl> | ||
| 4119 | |||
| 4120 | * org.texi (Workflow states): Documented that change in keywords | ||
| 4121 | becomes active only after restart of Emacs. | ||
| 4122 | |||
| 4123 | 2005-10-09 Richard M. Stallman <rms@gnu.org> | ||
| 4124 | |||
| 4125 | * frames.texi (Speedbar): Clarify the text. | ||
| 4126 | |||
| 4127 | 2005-10-09 Chong Yidong <cyd@stupidchicken.com> | ||
| 4128 | |||
| 4129 | * frames.texi (Speedbar): Add information on keybindings, | ||
| 4130 | dismissing the speedbar, and buffer display mode. Link to | ||
| 4131 | speedbar manual. | ||
| 4132 | |||
| 4133 | 2005-10-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 4134 | |||
| 4135 | * cmdargs.texi (Icons X): Removed options -i, -itype, --icon-type, | ||
| 4136 | added -nb, --no-bitmap-icon. | ||
| 4137 | |||
| 4138 | 2005-10-08 Michael Albinus <michael.albinus@gmx.de> | ||
| 4139 | |||
| 4140 | Sync with Tramp 2.0.51. | ||
| 4141 | |||
| 4142 | 2005-10-08 Nick Roberts <nickrob@snap.net.nz> | ||
| 4143 | |||
| 4144 | * speedbar.texi (Introduction): Describe new location of speedbar | ||
| 4145 | on menubar. | ||
| 4146 | (Basic Key Bindings): Remove descriptions of bindings that have | ||
| 4147 | been removed. | ||
| 4148 | |||
| 4149 | 2005-10-07 Nick Roberts <nickrob@snap.net.nz> | ||
| 4150 | |||
| 4151 | * building.texi (GDB Graphical Interface): Add variables and | ||
| 4152 | functions to indices. Be more precise. | ||
| 4153 | |||
| 4154 | 2005-10-05 Nick Roberts <nickrob@snap.net.nz> | ||
| 4155 | |||
| 4156 | * speedbar.texi (GDB): Describe use of watch expressions. | ||
| 4157 | |||
| 4158 | 2005-10-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 4159 | |||
| 4160 | * frames.texi (Drag and Drop): Remove the x- from | ||
| 4161 | x-dnd-open-file-other-window and xdnd-protocol-alist. | ||
| 4162 | |||
| 4163 | 2005-09-30 Romain Francoise <romain@orebokech.com> | ||
| 4164 | |||
| 4165 | * mini.texi (Minibuffer): The default value now appears before the | ||
| 4166 | colon in minibuffer prompts. | ||
| 4167 | |||
| 4168 | 2005-09-28 Simon Josefsson <jas@extundo.com> | ||
| 4169 | |||
| 4170 | * message.texi (IDNA): Fix. | ||
| 4171 | |||
| 4172 | 2005-09-28 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4173 | |||
| 4174 | * gnus.texi (NNTP): Remove nntp-buggy-select, nntp-read-timeout, | ||
| 4175 | nntp-server-hook, and nntp-warn-about-losing-connection; fix | ||
| 4176 | description of nntp-open-connection-function. | ||
| 4177 | (Common Variables): Fix descriptions. | ||
| 4178 | |||
| 4179 | 2005-09-26 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4180 | |||
| 4181 | * gnus.texi (Server Buffer Format): Document the %a format spec. | ||
| 4182 | |||
| 4183 | 2005-09-25 Richard M. Stallman <rms@gnu.org> | ||
| 4184 | |||
| 4185 | * search.texi (Regexp Search): Doc search-whitespace-regexp. | ||
| 4186 | |||
| 4187 | 2005-09-22 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4188 | |||
| 4189 | * gnus.texi (Mail): Fix gnus-confirm-mail-reply-to-news entry. | ||
| 4190 | |||
| 4191 | 2005-09-20 Emanuele Giaquinta <emanuele.giaquinta@gmail.com> (tiny change) | ||
| 4192 | |||
| 4193 | * text.texi (Paragraphs): Correction about Paragraph-Indent Text mode. | ||
| 4194 | |||
| 4195 | 2005-09-23 Carsten Dominik <dominik@science.uva.nl> | ||
| 4196 | |||
| 4197 | * org.texi Version 3.16. | ||
| 4198 | |||
| 4199 | 2005-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 4200 | |||
| 4201 | * emacs.texi (Top): Update submenus from macos.texi. | ||
| 4202 | |||
| 4203 | * macos.texi: Change `Mac OS 8 or 9' to `Mac OS Classic'. | ||
| 4204 | (Mac OS): Update feature support status. | ||
| 4205 | (Mac Input): List supported input scripts. Remove description | ||
| 4206 | about `mac-keyboard-text-encoding'. Mention mouse button | ||
| 4207 | emulation and related variables. | ||
| 4208 | (Mac International): Mention Central European and Cyrillic | ||
| 4209 | support. Now `keyboard-coding-system' is dynamically changed. | ||
| 4210 | Add description about coding system for selection. Add | ||
| 4211 | description about language environment. | ||
| 4212 | (Mac Environment Variables): Mention | ||
| 4213 | `~/.MacOSX/environment.plist'. Give example of command line | ||
| 4214 | arguments. Add Preferences support. | ||
| 4215 | (Mac Directories): Explicitly state that this node is for Mac OS | ||
| 4216 | Classic only. | ||
| 4217 | (Mac Font Specs): Mention specification for scalable fonts. List | ||
| 4218 | supported charsets. Add preferred way of creating fontsets. Add | ||
| 4219 | description about `mac-allow-anti-aliasing'. | ||
| 4220 | (Mac Functions): Add descriptions about `mac-set-file-creator', | ||
| 4221 | `mac-get-file-creator', `mac-set-file-type', `mac-get-file-type', | ||
| 4222 | and `mac-get-preference'. | ||
| 4223 | |||
| 4224 | 2005-09-19 Miles Bader <miles@gnu.org> | ||
| 4225 | |||
| 4226 | * newsticker.texi: Get rid of CVS keywords. | ||
| 4227 | |||
| 4228 | 2005-09-15 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4229 | |||
| 4230 | * gnus.texi (Finding the Parent): Fix description of how Gnus | ||
| 4231 | finds article. | ||
| 4232 | |||
| 4233 | 2005-09-14 Jari Aalto <jari.aalto@cante.net> | ||
| 4234 | |||
| 4235 | * gnus.texi (Advanced Scoring Examples): New examples to teach how | ||
| 4236 | to drop off non-answered articles. | ||
| 4237 | |||
| 4238 | 2005-09-19 Juanma Barranquero <lekktu@gmail.com> | ||
| 4239 | |||
| 4240 | * makefile.w32-in (newsticker.dvi): Use parentheses instead of curly | ||
| 4241 | braces (which are unsupported by NMAKE) for macro `srcdir'. | ||
| 4242 | |||
| 4243 | 2005-09-17 Eli Zaretskii <eliz@gnu.org> | ||
| 4244 | |||
| 4245 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS): Add newsticker targets. | ||
| 4246 | (../info/newsticker, newsticker.dvi): New targets. | ||
| 4247 | |||
| 4248 | 2005-09-17 Ulf Jasper <ulf.jasper@web.de> | ||
| 4249 | |||
| 4250 | * newsticker.texi: Replace @command with @code. Replace @example | ||
| 4251 | with @lisp. | ||
| 4252 | (Top): Added explanations to menu items. | ||
| 4253 | (GNU Free Documentation License): Removed. | ||
| 4254 | |||
| 4255 | 2005-09-16 Romain Francoise <romain@orebokech.com> | ||
| 4256 | |||
| 4257 | Update all files to specify GFDL version 1.2. | ||
| 4258 | |||
| 4259 | * doclicense.texi (GNU Free Documentation License): Update to | ||
| 4260 | version 1.2. | ||
| 4261 | |||
| 4262 | 2005-09-15 Richard M. Stallman <rms@gnu.org> | ||
| 4263 | |||
| 4264 | * buffers.texi (List Buffers): Fix xref. | ||
| 4265 | |||
| 4266 | * rmail.texi (Rmail Basics): Fix xref. | ||
| 4267 | |||
| 4268 | * emacs.texi (Top): Update subnode menus. | ||
| 4269 | |||
| 4270 | * files.texi (Saving Commands): New node, broken out of Saving. | ||
| 4271 | (Customize Save): New node, broken out of Saving. | ||
| 4272 | Clarify effect of write-region-inhibit-fsync. | ||
| 4273 | (Misc File Ops): Say write-region-inhibit-fsync affects write-region. | ||
| 4274 | |||
| 4275 | * newsticker.texi: Fix @setfilename. | ||
| 4276 | |||
| 4277 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add newsticker targets. | ||
| 4278 | (../info/newsticker, newsticker.dvi): New targets. | ||
| 4279 | |||
| 4280 | 2005-09-14 Romain Francoise <romain@orebokech.com> | ||
| 4281 | |||
| 4282 | * files.texi (Saving): Mention write-region-inhibit-fsync. | ||
| 4283 | |||
| 4284 | 2005-09-05 Chong Yidong <cyd@stupidchicken.com> | ||
| 4285 | |||
| 4286 | * custom.texi (Custom Themes): New node. | ||
| 4287 | |||
| 4288 | 2005-09-03 Richard M. Stallman <rms@gnu.org> | ||
| 4289 | |||
| 4290 | * search.texi (Search Case): Mention vars that control | ||
| 4291 | case-fold-search for various operations. | ||
| 4292 | |||
| 4293 | 2005-08-30 Carsten Dominik <dominik@science.uva.nl> | ||
| 4294 | |||
| 4295 | * org.texi: Version 3.15. | ||
| 4296 | |||
| 4297 | 2005-08-29 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4298 | |||
| 4299 | * ses.texi: Combine all three indices into one. | ||
| 4300 | Correct a few typos. | ||
| 4301 | |||
| 4302 | 2005-08-19 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4303 | |||
| 4304 | * emacs-mime.texi (time-date): Fix description of safe-date-to-time. | ||
| 4305 | |||
| 4306 | 2005-08-18 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4307 | |||
| 4308 | * emacs-mime.texi (Handles): Remove duplicate item. | ||
| 4309 | (Encoding Customization): Fix the default value for | ||
| 4310 | mm-coding-system-priorities. | ||
| 4311 | (Charset Translation): Emacs doesn't use mm-mime-mule-charset-alist. | ||
| 4312 | (Basic Functions): Fix reference. | ||
| 4313 | |||
| 4314 | 2005-08-09 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4315 | |||
| 4316 | * gnus.texi (Charsets): Fj hierarchy uses iso-2022-jp. | ||
| 4317 | |||
| 4318 | 2005-08-22 Juri Linkov <juri@jurta.org> | ||
| 4319 | |||
| 4320 | * display.texi (Standard Faces): Merge the text from | ||
| 4321 | `(elisp)Standard Faces' into this node. | ||
| 4322 | |||
| 4323 | 2005-08-18 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4324 | |||
| 4325 | * emacs.texi (Top): Delete menu item for deleted node | ||
| 4326 | Keyboard Translations. | ||
| 4327 | |||
| 4328 | 2005-08-18 Richard M. Stallman <rms@gnu.org> | ||
| 4329 | |||
| 4330 | * faq.texi (Obtaining the FAQ): Delete refs to Lerner's email | ||
| 4331 | and web site. | ||
| 4332 | |||
| 4333 | * trouble.texi (Unasked-for Search): | ||
| 4334 | Delete xref to Keyboard Translations. | ||
| 4335 | |||
| 4336 | * glossary.texi (Glossary): Delete xref. | ||
| 4337 | |||
| 4338 | * faq.texi (Swapping keys): Xref for normal-erase-is-backspace-mode, | ||
| 4339 | not keyboard-translate. | ||
| 4340 | |||
| 4341 | * custom.texi (Minor Modes): Say that the list here is not complete. | ||
| 4342 | (Keyboard Translations): Node deleted. | ||
| 4343 | (Disabling): Delete xref to it. | ||
| 4344 | (Customization Groups): Fix Custom buffer example. | ||
| 4345 | (Hooks): Mention remove-hooks. | ||
| 4346 | |||
| 4347 | 2005-08-17 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4348 | |||
| 4349 | * building.texi (GDB Graphical Interface): Improve filling of menu | ||
| 4350 | item. | ||
| 4351 | |||
| 4352 | 2005-08-18 Nick Roberts <nickrob@snap.net.nz> | ||
| 4353 | |||
| 4354 | * building.texi (GDB Graphical Interface): Use better node names. | ||
| 4355 | |||
| 4356 | 2005-08-14 Richard M. Stallman <rms@gnu.org> | ||
| 4357 | |||
| 4358 | * text.texi (Sentences): Fix xref. | ||
| 4359 | |||
| 4360 | 2005-08-14 Juri Linkov <juri@jurta.org> | ||
| 4361 | |||
| 4362 | * building.texi (Compilation, Grep Searching): Move grep command | ||
| 4363 | headings from `Compilation' to `Grep Searching'. | ||
| 4364 | |||
| 4365 | * dired.texi (Dired and Find): | ||
| 4366 | * maintaining.texi (Tags Search): Replace grep xref to | ||
| 4367 | `Compilation' node with `Grep Searching'. | ||
| 4368 | |||
| 4369 | * files.texi (Comparing Files): Replace xref to `Compilation' with | ||
| 4370 | `Compilation Mode'. | ||
| 4371 | |||
| 4372 | 2005-08-13 Alan Mackenzie <acm@muc.de> | ||
| 4373 | |||
| 4374 | * search.texi (Non-ASCII Isearch): Correct a typo. | ||
| 4375 | (Replacement Commands): Mention query-replace key binding. | ||
| 4376 | |||
| 4377 | 2005-08-11 Richard M. Stallman <rms@gnu.org> | ||
| 4378 | |||
| 4379 | * programs.texi (Options for Comments): Fix xref. | ||
| 4380 | |||
| 4381 | * search.texi (Regexp Backslash, Regexp Example): New nodes split | ||
| 4382 | out of Regexps. | ||
| 4383 | |||
| 4384 | * faq.texi (Using regular expressions): Fix xref. | ||
| 4385 | |||
| 4386 | 2005-08-09 Juri Linkov <juri@jurta.org> | ||
| 4387 | |||
| 4388 | * building.texi (Compilation): Use `itemx' instead of `item'. | ||
| 4389 | (Grep Searching): Simplify phrase. | ||
| 4390 | |||
| 4391 | * display.texi (Standard Faces): Describe vertical-border on | ||
| 4392 | window systems. | ||
| 4393 | |||
| 4394 | * windows.texi (Split Window): Simplify phrase and mention | ||
| 4395 | vertical-border face. | ||
| 4396 | |||
| 4397 | 2005-08-09 Richard M. Stallman <rms@gnu.org> | ||
| 4398 | |||
| 4399 | * files.texi (Comparing Files): Clarify compare-windows. | ||
| 4400 | |||
| 4401 | * calendar.texi (Scroll Calendar): Document < and > in calendar. | ||
| 4402 | |||
| 4403 | 2005-08-09 Juri Linkov <juri@jurta.org> | ||
| 4404 | |||
| 4405 | * info.texi (Help-P): Replace `Prev' with `Previous'. | ||
| 4406 | (Help-M, Help-Xref): Add S-TAB. | ||
| 4407 | (Help-FOO): Update `u' command. | ||
| 4408 | (Help-Xref): Move info about Mouse-2 from `Help-Int'. | ||
| 4409 | Update info about visibility of xref parts. | ||
| 4410 | (Help-Int): Fix `m' command. Rename `Info-last' to | ||
| 4411 | `Info-history-back'. Add `Info-history-forward'. | ||
| 4412 | (Advanced): Fix `g*' and `M-n' commands. | ||
| 4413 | (Info Search): Add `index-apropos' in stand-alone browser. | ||
| 4414 | Add isearch commands. | ||
| 4415 | (Emacs Info Variables): Remove `Info-fontify'. | ||
| 4416 | Add `Info-mode-hook'. Update face names. | ||
| 4417 | Add `Info-fontify-maximum-menu-size', | ||
| 4418 | `Info-fontify-visited-nodes', `Info-isearch-search'. | ||
| 4419 | |||
| 4420 | 2005-08-07 Michael Albinus <michael.albinus@gmx.de> | ||
| 4421 | |||
| 4422 | Sync with Tramp 2.0.50. | ||
| 4423 | |||
| 4424 | * tramp.texi: Use @option{} consequently for method names. | ||
| 4425 | (Inline methods, External transfer methods): Remove references to | ||
| 4426 | Cygwin. | ||
| 4427 | (Issues with Cygwin ssh): Explain trouble with Cygwin's ssh | ||
| 4428 | implementation. | ||
| 4429 | |||
| 4430 | 2005-08-06 Eli Zaretskii <eliz@gnu.org> | ||
| 4431 | |||
| 4432 | * mule.texi (Coding Systems): Rephrase the paragraph about | ||
| 4433 | codepages: no need for "M-x codepage-setup" anymore, except on | ||
| 4434 | MS-DOS. | ||
| 4435 | |||
| 4436 | * msdog.texi (MS-DOS and MULE): Clarify that this section is for | ||
| 4437 | the MS-DOS port only. | ||
| 4438 | |||
| 4439 | 2005-07-30 Eli Zaretskii <eliz@gnu.org> | ||
| 4440 | |||
| 4441 | * makefile.w32-in (info): Don't run multi-install-info.bat. | ||
| 4442 | ($(infodir)/dir): New target, produced by running | ||
| 4443 | multi-install-info.bat. | ||
| 4444 | |||
| 4445 | 2005-07-27 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 4446 | |||
| 4447 | * gnus.texi (Startup Files): Fix name of gnus-site-init-file. | ||
| 4448 | Mention that gnus-init-file is not read when Emacs is invoked with | ||
| 4449 | --no-init-file or -q. | ||
| 4450 | |||
| 4451 | 2005-07-22 Eli Zaretskii <eliz@gnu.org> | ||
| 4452 | |||
| 4453 | * files.texi (Quoted File Names): Add index entry. | ||
| 4454 | |||
| 4455 | 2005-07-19 Carsten Dominik <dominik@science.uva.nl> | ||
| 4456 | |||
| 4457 | * org.texi: Version 3.14. | ||
| 4458 | |||
| 4459 | 2005-07-04 Carsten Dominik <dominik@science.uva.nl> | ||
| 4460 | |||
| 4461 | * org.texi: Version 3.13. | ||
| 4462 | |||
| 4463 | 2005-07-19 Juri Linkov <juri@jurta.org> | ||
| 4464 | |||
| 4465 | * files.texi (Comparing Files): Mention resync for `compare-windows'. | ||
| 4466 | |||
| 4467 | 2005-07-18 Juri Linkov <juri@jurta.org> | ||
| 4468 | |||
| 4469 | * calc.texi (Time Zones, Logical Operations): | ||
| 4470 | * cl.texi (Overview): | ||
| 4471 | * custom.texi (Easy Customization): | ||
| 4472 | * files.texi (Old Versions): | ||
| 4473 | * frames.texi (Wheeled Mice): | ||
| 4474 | * mule.texi (Specify Coding): | ||
| 4475 | * org.texi (TODO types): | ||
| 4476 | * sc.texi (Emacs 18 MUAs): | ||
| 4477 | * speedbar.texi (Top): | ||
| 4478 | * text.texi (Cell Justification): | ||
| 4479 | * trouble.texi (After a Crash): | ||
| 4480 | * url.texi (History): | ||
| 4481 | * xresources.texi (GTK styles): | ||
| 4482 | Delete duplicate duplicate words. | ||
| 4483 | |||
| 4484 | 2005-07-17 Richard M. Stallman <rms@gnu.org> | ||
| 4485 | |||
| 4486 | * frames.texi (Creating Frames): Fix foreground color example. | ||
| 4487 | |||
| 4488 | * custom.texi (Init Examples): Clean up text about conditionals. | ||
| 4489 | |||
| 4490 | 2005-07-16 Richard M. Stallman <rms@gnu.org> | ||
| 4491 | |||
| 4492 | * mini.texi (Completion Commands): Fix command name for ?. | ||
| 4493 | |||
| 4494 | 2005-07-16 Johan Bockgard <bojohan@users.sourceforge.net> (tiny change) | ||
| 4495 | |||
| 4496 | * cl.texi (Type Predicates): Document `atom' type. | ||
| 4497 | |||
| 4498 | 2005-07-16 Eli Zaretskii <eliz@gnu.org> | ||
| 4499 | |||
| 4500 | * display.texi (Standard Faces): Explain that customization of | ||
| 4501 | `menu' face has no effect on w32 and with GTK. Add | ||
| 4502 | cross-references. | ||
| 4503 | |||
| 4504 | * cmdargs.texi (General Variables): Clarify the default location | ||
| 4505 | of $HOME on w32 systems. | ||
| 4506 | |||
| 4507 | 2005-07-15 Jason Rumney <jasonr@gnu.org> | ||
| 4508 | |||
| 4509 | * cmdargs.texi (General Variables): Default HOME on MS Windows has | ||
| 4510 | changed. | ||
| 4511 | |||
| 4512 | 2005-07-08 Kenichi Handa <handa@m17n.org> | ||
| 4513 | |||
| 4514 | * mule.texi (Recognize Coding): Recommend | ||
| 4515 | revert-buffer-with-coding-system instead of revert-buffer. | ||
| 4516 | |||
| 4517 | 2005-07-07 Richard M. Stallman <rms@gnu.org> | ||
| 4518 | |||
| 4519 | * anti.texi (Antinews): Mention mode-line-inverse-video. | ||
| 4520 | |||
| 4521 | * files.texi (Saving): Minor correction about C-x C-w. | ||
| 4522 | |||
| 4523 | * display.texi (Display Custom): Don't mention mode-line-inverse-video. | ||
| 4524 | |||
| 4525 | 2005-07-07 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4526 | |||
| 4527 | * search.texi (Isearch Scroll): Add example of using the | ||
| 4528 | `isearch-scroll' property. | ||
| 4529 | (Slow Isearch): Reference anchor for `baud-rate' instead of entire | ||
| 4530 | `Display Custom' node. | ||
| 4531 | (Regexp Replace): Put text that requires Emacs Lisp knowledge last | ||
| 4532 | and de-emphasize it. | ||
| 4533 | (Other Repeating Search): `occur' currently can not correctly | ||
| 4534 | handle multiline matches. Correct, clarify and update description | ||
| 4535 | of `flush-lines' and `keep-lines'. | ||
| 4536 | |||
| 4537 | * display.texi (Display Custom): Add anchor for `baud-rate'. | ||
| 4538 | |||
| 4539 | 2005-07-07 Richard M. Stallman <rms@gnu.org> | ||
| 4540 | |||
| 4541 | * gnu.texi: Update where to get GNU status; add refs for how to help. | ||
| 4542 | Add footnotes 6 and 7. | ||
| 4543 | |||
| 4544 | 2005-07-04 Lute Kamstra <lute@gnu.org> | ||
| 4545 | |||
| 4546 | Update FSF's address in GPL notices. | ||
| 4547 | |||
| 4548 | * calc.texi (Copying): | ||
| 4549 | * doclicense.texi (GNU Free Documentation License): | ||
| 4550 | * faq.texi (Contacting the FSF): | ||
| 4551 | * mh-e.texi (Copying): | ||
| 4552 | * trouble.texi (Checklist): Update FSF's address. | ||
| 4553 | |||
| 4554 | 2005-07-03 Richard M. Stallman <rms@gnu.org> | ||
| 4555 | |||
| 4556 | * flymake.texi (Example -- Configuring a tool called directly): | ||
| 4557 | Update name of flymake-build-relative-filename. | ||
| 4558 | |||
| 4559 | 2005-06-29 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 4560 | |||
| 4561 | * gnus.texi (NoCeM): gnus-nocem-verifyer defaults to pgg-verify. | ||
| 4562 | |||
| 4563 | 2005-06-29 Carsten Dominik <dominik@science.uva.nl> | ||
| 4564 | |||
| 4565 | * org.texi: Version 3.12. | ||
| 4566 | |||
| 4567 | 2005-06-24 Richard M. Stallman <rms@gnu.org> | ||
| 4568 | |||
| 4569 | * display.texi (Text Display): Change index entries. | ||
| 4570 | |||
| 4571 | 2005-06-24 Eli Zaretskii <eliz@gnu.org> | ||
| 4572 | |||
| 4573 | * makefile.w32-in (MAKEINFO): Use --force. | ||
| 4574 | (INFO_TARGETS, DVI_TARGETS): Make identical to the lists in | ||
| 4575 | Makefile.in. | ||
| 4576 | (gnus.dvi): Use "..." to quote Sed args, so that it works with | ||
| 4577 | more shells. | ||
| 4578 | |||
| 4579 | 2005-06-23 Richard M. Stallman <rms@gnu.org> | ||
| 4580 | |||
| 4581 | * anti.texi (Antinews): Renamed show-nonbreak-escape to | ||
| 4582 | nobreak-char-display. | ||
| 4583 | |||
| 4584 | * emacs.texi (Top): Update detailed node listing. | ||
| 4585 | |||
| 4586 | * display.texi (Text Display): Renamed show-nonbreak-escape | ||
| 4587 | to nobreak-char-display and no-break-space to nobreak-space. | ||
| 4588 | (Standard Faces): Split up the list of standard faces | ||
| 4589 | and put it in a separate node. Add nobreak-space and | ||
| 4590 | escape-glyph. | ||
| 4591 | |||
| 4592 | * speedbar.texi (Creating a display): Texinfo usage fixes. | ||
| 4593 | |||
| 4594 | * tramp.texi (Customizing Completion, Auto-save and Backup): | ||
| 4595 | Texinfo usage fixes. | ||
| 4596 | |||
| 4597 | 2005-06-23 Lute Kamstra <lute@gnu.org> | ||
| 4598 | |||
| 4599 | * mule.texi (Select Input Method): Fix typo. | ||
| 4600 | |||
| 4601 | 2005-06-23 Kenichi Handa <handa@m17n.org> | ||
| 4602 | |||
| 4603 | * mule.texi (International): List all supported scripts. Adjust | ||
| 4604 | text for that leim is now included in the normal Emacs | ||
| 4605 | distribution. | ||
| 4606 | (Language Environments): List all language environments. | ||
| 4607 | Intlfonts contains fonts for most supported scripts, not all.. | ||
| 4608 | (Select Input Method): Refer to C-u C-x = to see how to type to | ||
| 4609 | input a specifc character. | ||
| 4610 | (Recognize Coding): Fix typo, china-iso-8bit -> chinese-iso-8bit. | ||
| 4611 | |||
| 4612 | 2005-06-23 Juanma Barranquero <lekktu@gmail.com> | ||
| 4613 | |||
| 4614 | * building.texi (Grep Searching): | ||
| 4615 | * dired-x.texi (Miscellaneous Commands): | ||
| 4616 | * ediff.texi (Miscellaneous): | ||
| 4617 | * gnus.texi (MIME Commands, Fancy Mail Splitting, Agent Visuals) | ||
| 4618 | (Agent Variables): | ||
| 4619 | * info.texi (Help-Xref): | ||
| 4620 | * message.texi (Message Headers): | ||
| 4621 | * org.texi (Remember): | ||
| 4622 | * reftex.texi (Options (Defining Label Environments)): | ||
| 4623 | (Options (Index Support)): | ||
| 4624 | (Options (Viewing Cross-References)): | ||
| 4625 | (Options (Misc)): | ||
| 4626 | (Changes): | ||
| 4627 | * speedbar.texi (Creating a display): | ||
| 4628 | * tramp.texi (Customizing Completion, Auto-save and Backup): | ||
| 4629 | Texinfo usage fix. | ||
| 4630 | |||
| 4631 | 2005-06-22 Miles Bader <miles@gnu.org> | ||
| 4632 | |||
| 4633 | * display.texi (Faces): Change `vertical-divider' to `vertical-border'. | ||
| 4634 | |||
| 4635 | 2005-06-20 Miles Bader <miles@gnu.org> | ||
| 4636 | |||
| 4637 | * display.texi (Faces): Add `vertical-divider'. | ||
| 4638 | |||
| 4639 | 2005-06-17 Richard M. Stallman <rms@gnu.org> | ||
| 4640 | |||
| 4641 | * text.texi (Adaptive Fill): Minor clarification. | ||
| 4642 | |||
| 4643 | 2005-06-13 Carsten Dominik <dominik@science.uva.nl> | ||
| 4644 | |||
| 4645 | * org.texi: Version 3.11. | ||
| 4646 | |||
| 4647 | 2005-06-12 Jay Belanger <belanger@truman.edu> | ||
| 4648 | |||
| 4649 | * calc.texi (Getting Started): Remove extra menu item. | ||
| 4650 | |||
| 4651 | 2005-06-10 Lute Kamstra <lute@gnu.org> | ||
| 4652 | |||
| 4653 | * emacs.texi (Top): Correct version number. | ||
| 4654 | * anti.texi (Antinews): Correct version number. Use EMACSVER to | ||
| 4655 | refer to the current version of Emacs. | ||
| 4656 | |||
| 4657 | 2005-06-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4658 | |||
| 4659 | * files.texi (Log Buffer): Document when there can be more than | ||
| 4660 | one file to be committed. | ||
| 4661 | |||
| 4662 | 2005-06-08 Juri Linkov <juri@jurta.org> | ||
| 4663 | |||
| 4664 | * display.texi (Faces): Add `shadow' face. | ||
| 4665 | |||
| 4666 | 2005-06-07 Masatake YAMATO <jet@gyve.org> | ||
| 4667 | |||
| 4668 | * display.texi (Faces): Write about mode-line-highlight. | ||
| 4669 | |||
| 4670 | 2005-06-06 Richard M. Stallman <rms@gnu.org> | ||
| 4671 | |||
| 4672 | * misc.texi (Printing Package): Explain how to initialize | ||
| 4673 | printing package. | ||
| 4674 | |||
| 4675 | * cmdargs.texi (Action Arguments): Clarify directory default for -l. | ||
| 4676 | |||
| 4677 | 2005-06-05 Chong Yidong <cyd@stupidchicken.com> | ||
| 4678 | |||
| 4679 | * emacs.texi: Rename Hardcopy to Printing. | ||
| 4680 | Make PostScript and PostScript Variables subnodes of it. | ||
| 4681 | |||
| 4682 | * misc.texi (Printing): Rename node from Hardcopy. | ||
| 4683 | Mention menu bar options. | ||
| 4684 | Move PostScript and PostScript Variables to submenu. | ||
| 4685 | (Printing package): New node. | ||
| 4686 | |||
| 4687 | * mark.texi (Using Region): Change Hardcopy xref to Printing. | ||
| 4688 | |||
| 4689 | * dired.texi (Operating on Files): Likewise. | ||
| 4690 | |||
| 4691 | * calendar.texi (Displaying the Diary): Likewise. | ||
| 4692 | |||
| 4693 | * msdog.texi (MS-DOS Printing, MS-DOS Processes): Likewise. | ||
| 4694 | |||
| 4695 | * glossary.texi (Glossary): Likewise. | ||
| 4696 | |||
| 4697 | * frames.texi (Mode Line Mouse): Mention mode-line-highlight | ||
| 4698 | effect. | ||
| 4699 | |||
| 4700 | 2005-06-04 Richard M. Stallman <rms@gnu.org> | ||
| 4701 | |||
| 4702 | * trouble.texi (After a Crash): Polish previous change. | ||
| 4703 | |||
| 4704 | 2005-05-31 Jay Belanger <belanger@truman.edu> | ||
| 4705 | |||
| 4706 | * calc.texi (Notations Used in This Manual): Use @kbd for key | ||
| 4707 | sequence. | ||
| 4708 | (Demonstration of Calc): Mention another way of starting Calc. | ||
| 4709 | (Starting Calc): Mention long name of M-#. | ||
| 4710 | (Embedded Mode Overview): Remove unnecessary instruction. | ||
| 4711 | (Other M-# commands): Rephrase `M-# 0' explanation. | ||
| 4712 | (Basic Embedded Mode): Rewrite discussion of prefix arguments to | ||
| 4713 | reflect current behavior. | ||
| 4714 | |||
| 4715 | 2005-05-30 Jay Belanger <belanger@truman.edu> | ||
| 4716 | |||
| 4717 | * calc.texi (Hooks): Change description of calc-window-hook and | ||
| 4718 | calc-trail-window-hook to match usage. | ||
| 4719 | (Computational Functions): Add more constant-generating functions. | ||
| 4720 | (Customizable Variables): Use defvar. | ||
| 4721 | |||
| 4722 | 2005-05-30 Noah Friedman <friedman@splode.com> | ||
| 4723 | |||
| 4724 | * trouble.texi (After a Crash): Mention emacs-buffer.gdb as a | ||
| 4725 | recovery mechanism. | ||
| 4726 | |||
| 4727 | 2005-05-28 Jay Belanger <belanger@truman.edu> | ||
| 4728 | |||
| 4729 | * calc.texi (Assignments in Embedded Mode): Fix variable name. | ||
| 4730 | (Basic Embedded Mode): Explain behavior of arguments to | ||
| 4731 | calc-embedded-mode. | ||
| 4732 | |||
| 4733 | 2005-05-28 Nick Roberts <nickrob@snap.net.nz> | ||
| 4734 | |||
| 4735 | * building.texi (Other Buffers): SPC toggles display of | ||
| 4736 | floating point registers. | ||
| 4737 | |||
| 4738 | 2005-05-27 Jay Belanger <belanger@truman.edu> | ||
| 4739 | |||
| 4740 | * calc.texi (Queries in Keyboard Macros): Rewrite to reflect | ||
| 4741 | current behavior. | ||
| 4742 | |||
| 4743 | 2005-05-27 Nick Roberts <nickrob@snap.net.nz> | ||
| 4744 | |||
| 4745 | * files.texi (Log Buffer): Merge in description of Log Edit | ||
| 4746 | mode from pcl-cvs.texi. | ||
| 4747 | |||
| 4748 | 2005-05-26 Richard M. Stallman <rms@gnu.org> | ||
| 4749 | |||
| 4750 | * building.texi (Lisp Eval): C-M-x with arg runs Edebug. | ||
| 4751 | |||
| 4752 | 2005-05-25 Jay Belanger <belanger@truman.edu> | ||
| 4753 | |||
| 4754 | * calc.texi: Change Calc version number throughout. | ||
| 4755 | (Keypad Mode): Change location in info output. | ||
| 4756 | (Keypad mode overview): Move picture of keypad. | ||
| 4757 | |||
| 4758 | 2005-05-24 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4759 | |||
| 4760 | * fixit.texi (Spelling): Delete confusing sentence; flyspell is | ||
| 4761 | not enabled by default. | ||
| 4762 | When not on a word, `ispell-word' by default checks the word | ||
| 4763 | before point. | ||
| 4764 | |||
| 4765 | 2005-05-24 Nick Roberts <nickrob@snap.net.nz> | ||
| 4766 | |||
| 4767 | * building.texi (Debugger Operation): Simplify last sentence. | ||
| 4768 | |||
| 4769 | 2005-05-23 Lute Kamstra <lute@gnu.org> | ||
| 4770 | |||
| 4771 | * emacs.texi: Update FSF's address throughout. | ||
| 4772 | (Preface): Use @cite. | ||
| 4773 | (Distrib): Add cross reference to the node "Copying". Mention the | ||
| 4774 | FDL. Don't refer to etc/{FTP,ORDERS}. Mention the sale of | ||
| 4775 | printed manuals. | ||
| 4776 | (Intro): Use @xref for the Emacs Lisp Intro. | ||
| 4777 | |||
| 4778 | 2005-05-21 Jay Belanger <belanger@truman.edu> | ||
| 4779 | |||
| 4780 | * calc.texi (Storing variables): Mention that only most variables | ||
| 4781 | are void to begin with. | ||
| 4782 | |||
| 4783 | 2005-05-21 Kevin Ryde <user42@zip.com.au> | ||
| 4784 | |||
| 4785 | * widget.texi (Basic Types): Update cross ref from "Enabling | ||
| 4786 | Mouse-1 to Follow Links" to "Links and Mouse-1" per recent | ||
| 4787 | lispref/text.texi change. | ||
| 4788 | |||
| 4789 | 2005-05-20 Carsten Dominik <dominik@science.uva.nl> | ||
| 4790 | |||
| 4791 | * org.texi: Version 3.09. | ||
| 4792 | |||
| 4793 | 2005-05-18 Carsten Dominik <dominik@science.uva.nl> | ||
| 4794 | |||
| 4795 | * reftex.texi: Version 4.28. | ||
| 4796 | |||
| 4797 | 2005-05-18 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4798 | |||
| 4799 | * buffers.texi (Select Buffer): Document `C-u M-g M-g'. | ||
| 4800 | |||
| 4801 | * basic.texi (Moving Point): Mention default for `goto-line'. | ||
| 4802 | |||
| 4803 | * programs.texi (Lisp Doc): Eldoc mode shows only the first line | ||
| 4804 | of a variable's docstring. | ||
| 4805 | |||
| 4806 | 2005-05-18 Lute Kamstra <lute@gnu.org> | ||
| 4807 | |||
| 4808 | * maintaining.texi (Overview of Emerge): Add cross reference. | ||
| 4809 | Remove duplication. | ||
| 4810 | |||
| 4811 | * emacs.texi (Top): Update to the current structure of the manual. | ||
| 4812 | * misc.texi (Emacs Server): Add menu description. | ||
| 4813 | * files.texi (Saving): Fix menu. | ||
| 4814 | * custom.texi (Customization): Fix menu. | ||
| 4815 | * mule.texi (International): Fix menu. | ||
| 4816 | * kmacro.texi (Keyboard Macros): Fix menu. | ||
| 4817 | |||
| 4818 | 2005-05-16 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4819 | |||
| 4820 | * display.texi: Various minor changes. | ||
| 4821 | (Faces): Delete text that is repeated in the next section. | ||
| 4822 | |||
| 4823 | 2005-05-16 Nick Roberts <nickrob@snap.net.nz> | ||
| 4824 | |||
| 4825 | * building.texi (Debugger Operation): Mention GUD tooltips are | ||
| 4826 | disabled with GDB in text command mode. | ||
| 4827 | |||
| 4828 | 2005-05-16 Jay Belanger <belanger@truman.edu> | ||
| 4829 | |||
| 4830 | * calc.texi (Storing Variables): Mention `calc-copy-special-constant'. | ||
| 4831 | |||
| 4832 | 2005-05-16 Nick Roberts <nickrob@snap.net.nz> | ||
| 4833 | |||
| 4834 | * building.texi: Replace toolbar with "tool bar" for consistency. | ||
| 4835 | (Compilation Mode): Describe compilation-context-lines | ||
| 4836 | and use of arrow in compilation buffer. | ||
| 4837 | (Debugger Operation): Replace help text with variable's value. | ||
| 4838 | |||
| 4839 | * frames.texi (Tooltips): Replace toolbar with "tool bar" for | ||
| 4840 | consistency. | ||
| 4841 | |||
| 4842 | 2005-05-15 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4843 | |||
| 4844 | * major.texi (Choosing Modes): normal-mode processes the -*- line. | ||
| 4845 | Add xref. | ||
| 4846 | |||
| 4847 | 2005-05-14 Jay Belanger <belanger@truman.edu> | ||
| 4848 | |||
| 4849 | * calc.texi (Default Simplifications): Insert missing ! (logical | ||
| 4850 | not operator). | ||
| 4851 | |||
| 4852 | 2005-05-14 Michael Albinus <michael.albinus@gmx.de> | ||
| 4853 | |||
| 4854 | Sync with Tramp 2.0.49. | ||
| 4855 | |||
| 4856 | 2005-05-14 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4857 | |||
| 4858 | * basic.texi (Moving Point): Mention `M-g g' binding for `goto-line'. | ||
| 4859 | (Position Info): Delete discussion of `goto-line'. It is already | ||
| 4860 | described in `Moving point'. | ||
| 4861 | |||
| 4862 | * mini.texi (Completion Commands): Correct reference. | ||
| 4863 | (Completion Options): Fix typo. | ||
| 4864 | |||
| 4865 | * killing.texi (Deletion): Complete description of `C-x C-o'. | ||
| 4866 | |||
| 4867 | 2005-05-10 Jay Belanger <belanger@truman.edu> | ||
| 4868 | |||
| 4869 | * calc.texi (Default Simplifications): Mention that 0^0 simplifies | ||
| 4870 | to 1. | ||
| 4871 | |||
| 4872 | 2005-05-10 Richard M. Stallman <rms@gnu.org> | ||
| 4873 | |||
| 4874 | * building.texi (Compilation): Clarify recompile's directory choice. | ||
| 4875 | |||
| 4876 | * frames.texi (Tooltips): Cleanups. | ||
| 4877 | |||
| 4878 | * basic.texi (Arguments): Fix punctuation. | ||
| 4879 | |||
| 4880 | 2005-05-09 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4881 | |||
| 4882 | * screen.texi (Menu Bar): The up and down (not left and right) | ||
| 4883 | arrow keys move through a keyboard menu. | ||
| 4884 | |||
| 4885 | 2005-05-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4886 | |||
| 4887 | * basic.texi: Various typo and grammar fixes. | ||
| 4888 | (Moving Point): C-a now runs move-beginning-of-line. | ||
| 4889 | |||
| 4890 | 2005-05-08 Nick Roberts <nickrob@snap.net.nz> | ||
| 4891 | |||
| 4892 | * building.texi (Debugger Operation): Describe gud-tooltip-echo-area. | ||
| 4893 | |||
| 4894 | * frames.texi (Tooltips): Describe help tooltips and GUD tooltips | ||
| 4895 | as different animals. | ||
| 4896 | |||
| 4897 | 2005-05-07 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4898 | |||
| 4899 | * frames.texi (Mouse References): Clarify `mouse-1-click-follows-link'. | ||
| 4900 | Correct index entry. | ||
| 4901 | |||
| 4902 | 2005-05-07 Nick Roberts <nickrob@snap.net.nz> | ||
| 4903 | |||
| 4904 | * building.texi (Debugger Operation): Update to reflect changes | ||
| 4905 | in GUD tooltips. | ||
| 4906 | |||
| 4907 | 2005-04-30 Richard M. Stallman <rms@gnu.org> | ||
| 4908 | |||
| 4909 | * files.texi (Compressed Files): Auto Compression normally enabled. | ||
| 4910 | |||
| 4911 | * building.texi (Debugger Operation): Clarify previous change. | ||
| 4912 | |||
| 4913 | 2005-04-29 Carsten Dominik <dominik@science.uva.nl> | ||
| 4914 | |||
| 4915 | * org.texi: Version 3.08, structure reorganized. | ||
| 4916 | |||
| 4917 | 2005-04-28 Nick Roberts <nickrob@snap.net.nz> | ||
| 4918 | |||
| 4919 | * building.texi (Debugger Operation): Add description for | ||
| 4920 | GUD tooltips when program is not running. | ||
| 4921 | |||
| 4922 | 2005-04-26 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4923 | |||
| 4924 | * misc.texi (Shell): Add `Shell Prompts' to menu. | ||
| 4925 | (Shell Mode): Add xref to `Shell Prompts'. Clarify `C-c C-u' | ||
| 4926 | description. Delete remarks moved to new node. | ||
| 4927 | (Shell Prompts): New node. | ||
| 4928 | (History References): Replace remarks moved to `Shell Prompts' | ||
| 4929 | with xref to that node. | ||
| 4930 | (Remote Host): Clarify how to specify the terminal type when | ||
| 4931 | logging in to a different machine. | ||
| 4932 | |||
| 4933 | 2005-04-26 Richard M. Stallman <rms@gnu.org> | ||
| 4934 | |||
| 4935 | * emacs.texi (Top): Update submenus from files.texi. | ||
| 4936 | |||
| 4937 | * files.texi (Filesets): Clarify previous change. | ||
| 4938 | |||
| 4939 | * dired.texi (Misc Dired Features): Clarify previous change. | ||
| 4940 | |||
| 4941 | 2005-04-25 Chong Yidong <cyd@stupidchicken.com> | ||
| 4942 | |||
| 4943 | * ack.texi (Acknowledgments): Delete info about iso-acc.el. | ||
| 4944 | |||
| 4945 | * dired.texi (Misc Dired Features): Document | ||
| 4946 | dired-compare-directories. | ||
| 4947 | |||
| 4948 | * files.texi (Filesets): New node. | ||
| 4949 | (File Conveniences): Document Image mode. | ||
| 4950 | |||
| 4951 | * text.texi (TeX Print): Document tex-compile. | ||
| 4952 | |||
| 4953 | 2005-04-25 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4954 | |||
| 4955 | * frames.texi (Tooltips): Tooltip mode is enabled by default. | ||
| 4956 | Delete redundant reference to tooltip Custom group. It is | ||
| 4957 | referred too again in the next paragraph. | ||
| 4958 | |||
| 4959 | 2005-04-24 Richard M. Stallman <rms@gnu.org> | ||
| 4960 | |||
| 4961 | * ack.texi: Delete info about lazy-lock.el and fast-lock.el. | ||
| 4962 | |||
| 4963 | * faq.texi: Delete info about lazy-lock.el and fast-lock.el. | ||
| 4964 | |||
| 4965 | 2005-04-19 Kim F. Storm <storm@cua.dk> | ||
| 4966 | |||
| 4967 | * building.texi (Compilation Mode): Add M-g M-n and M-g M-p bindings. | ||
| 4968 | |||
| 4969 | 2005-04-18 Lars Hansen <larsh@math.ku.dk> | ||
| 4970 | |||
| 4971 | * misc.texi (Saving Emacs Sessions): Add that "--no-desktop" now | ||
| 4972 | turns off desktop-save-mode. | ||
| 4973 | |||
| 4974 | 2005-04-17 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4975 | |||
| 4976 | * frames.texi (XTerm Mouse): Xterm Mouse mode is no longer enabled | ||
| 4977 | by default in terminals compatible with xterm. Mention that | ||
| 4978 | xterm-mouse-mode is a minor mode and put in pxref to Minor Modes | ||
| 4979 | node. | ||
| 4980 | |||
| 4981 | 2005-04-15 Carsten Dominik <dominik@science.uva.nl> | ||
| 4982 | |||
| 4983 | * org.texi: Update to version 3.06. | ||
| 4984 | |||
| 4985 | 2005-04-13 Lute Kamstra <lute@gnu.org> | ||
| 4986 | |||
| 4987 | * cc-mode.texi: Prevent creating an unnecessary empty cc-mode.ss file. | ||
| 4988 | |||
| 4989 | 2005-04-12 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4990 | |||
| 4991 | * frames.texi (XTerm Mouse): Xterm Mouse mode is now enabled by default. | ||
| 4992 | |||
| 4993 | 2005-04-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 4994 | |||
| 4995 | * xresources.texi (Table of Resources): Add cursorBlink. | ||
| 4996 | |||
| 4997 | 2005-04-11 Luc Teirlinck <teirllm@auburn.edu> | ||
| 4998 | |||
| 4999 | * rmail.texi (Rmail Summary Edit): Explain numeric arguments to | ||
| 5000 | `d', `C-d' and `u'. | ||
| 5001 | |||
| 5002 | 2005-04-11 Richard M. Stallman <rms@gnu.org> | ||
| 5003 | |||
| 5004 | * cmdargs.texi (Initial Options): -Q is now --quick, and does less. | ||
| 5005 | (Misc X): Add -D, --basic-display. | ||
| 5006 | |||
| 5007 | * maintaining.texi (Change Log): Correct the description of | ||
| 5008 | the example. | ||
| 5009 | |||
| 5010 | * major.texi (Choosing Modes): Document magic-mode-alist. | ||
| 5011 | |||
| 5012 | 2005-04-10 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 5013 | |||
| 5014 | * cl.texi (Porting Common Lisp): Fix typo. | ||
| 5015 | |||
| 5016 | 2005-04-10 Luc Teirlinck <teirllm@auburn.edu> | ||
| 5017 | |||
| 5018 | * rmail.texi (Rmail Basics): Clarify description of `q' and `b'. | ||
| 5019 | (Rmail Deletion): `C-d' in RMAIL buffer does not accept a numeric arg. | ||
| 5020 | (Rmail Inbox): Give full name of `rmail-primary-inbox-list'. | ||
| 5021 | (Rmail Output): Clarify which statements apply to `o', `C-o' and | ||
| 5022 | `w', respectively. | ||
| 5023 | (Rmail Labels): Mention `l'. | ||
| 5024 | (Rmail Attributes): Correct pxref. Mention `stored' attribute. | ||
| 5025 | (Rmail Summary Edit): Describe `j' and RET. | ||
| 5026 | |||
| 5027 | 2005-04-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 5028 | |||
| 5029 | * xresources.texi (Lucid Resources): Add fontSet resource. | ||
| 5030 | |||
| 5031 | 2005-04-06 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 5032 | |||
| 5033 | * gnus.texi (RSS): Addition. | ||
| 5034 | |||
| 5035 | 2005-04-09 Luc Teirlinck <teirllm@auburn.edu> | ||
| 5036 | |||
| 5037 | * display.texi (Useless Whitespace): `indicate-unused-lines' is | ||
| 5038 | now called `indicate-empty-lines'. | ||
| 5039 | |||
| 5040 | 2005-04-06 Kim F. Storm <storm@cua.dk> | ||
| 5041 | |||
| 5042 | * cmdargs.texi (Initial Options): Add --bare-bones alias for -Q. | ||
| 5043 | |||
| 5044 | 2005-04-04 Luc Teirlinck <teirllm@auburn.edu> | ||
| 5045 | |||
| 5046 | * dired.texi (Dired Visiting): `dired-view-command-alist' has been | ||
| 5047 | deleted. | ||
| 5048 | (Marks vs Flags): Add some convenient key bindings. | ||
| 5049 | (Hiding Subdirectories): Delete redundant and inaccurate sentence. | ||
| 5050 | (Misc Dired Features): Correct and expand description of `w' command. | ||
| 5051 | |||
| 5052 | * frames.texi (XTerm Mouse): Delete apparently false info. | ||
| 5053 | The GNU/Linux console currently does not appear to support | ||
| 5054 | `xterm-mouse-mode'. | ||
| 5055 | |||
| 5056 | 2005-04-04 Jay Belanger <belanger@truman.edu> | ||
| 5057 | |||
| 5058 | * calc.texi: Change Calc version number. | ||
| 5059 | (Customizable variables): Fix description of calc-language-alist. | ||
| 5060 | (Copying): Put in version 2 of GPL. | ||
| 5061 | |||
| 5062 | 2005-04-03 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 5063 | |||
| 5064 | * calendar.texi (Diary): Mention shell utility `calendar'. | ||
| 5065 | |||
| 5066 | 2005-04-01 Richard M. Stallman <rms@gnu.org> | ||
| 5067 | |||
| 5068 | * cmdargs.texi (Misc X): Explain horizontal scroll bars don't exist. | ||
| 5069 | |||
| 5070 | 2005-04-01 Jay Belanger <belanger@truman.edu> | ||
| 5071 | |||
| 5072 | * calc.texi (Troubleshooting Commands): Remove comment about | ||
| 5073 | installation. | ||
| 5074 | (Installation): Remove section. | ||
| 5075 | (Customizable Variables): New section. | ||
| 5076 | (Basic Embedded Mode, Customizing Embedded Mode, Graphics) | ||
| 5077 | (Graphical Devices): Add references to Customizable Variables. | ||
| 5078 | |||
| 5079 | 2005-04-01 Lute Kamstra <lute@gnu.org> | ||
| 5080 | |||
| 5081 | * maintaining.texi (Change Log): add-change-log-entry uses | ||
| 5082 | add-log-mailing-address. | ||
| 5083 | |||
| 5084 | 2005-03-31 Luc Teirlinck <teirllm@auburn.edu> | ||
| 5085 | |||
| 5086 | * files.texi (Reverting): Move `auto-revert-check-vc-info' to | ||
| 5087 | `VC Mode Line' and put in an xref to that node. | ||
| 5088 | (VC Mode Line): Move `auto-revert-check-vc-info' here and clarify | ||
| 5089 | its description. | ||
| 5090 | |||
| 5091 | 2005-03-31 Paul Eggert <eggert@cs.ucla.edu> | ||
| 5092 | |||
| 5093 | * calendar.texi (Calendar Systems): Say that the Persian calendar | ||
| 5094 | implemented here is the arithmetical one championed by Birashk. | ||
| 5095 | |||
| 5096 | 2005-03-30 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 5097 | |||
| 5098 | * programs.texi (Fortran Motion): Fix previous change. | ||
| 5099 | |||
| 5100 | 2005-03-25 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 5101 | |||
| 5102 | * emacs-mime.texi (Display Customization): Markup fixes. | ||
| 5103 | (rfc2047): Update. | ||
| 5104 | |||
| 5105 | 2005-03-23 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 5106 | |||
| 5107 | * gnus-faq.texi: Replaced with auto-generated version. | ||
| 5108 | |||
| 5109 | 2005-03-29 Richard M. Stallman <rms@gnu.org> | ||
| 5110 | |||
| 5111 | * mule.texi (Single-Byte Character Support): Reinstall the C-x 8 info. | ||
| 5112 | |||
| 5113 | 2005-03-29 Chong Yidong <cyd@stupidchicken.com> | ||
| 5114 | |||
| 5115 | * text.texi (Refill): Refer to Long Lines Mode. | ||
| 5116 | (Longlines): New node. | ||
| 5117 | (Auto Fill): Don't index "word wrap" here. | ||
| 5118 | (Filling): Add Longlines to menu. | ||
| 5119 | |||
| 5120 | 2005-03-29 Richard M. Stallman <rms@gnu.org> | ||
| 5121 | |||
| 5122 | * xresources.texi: Minor fixes. | ||
| 5123 | |||
| 5124 | * misc.texi (Emacs Server): Fix Texinfo usage. | ||
| 5125 | |||
| 5126 | * emacs.texi (Top): Don't use a real section heading for | ||
| 5127 | "Detailed Node Listing". Fake it instead. | ||
| 5128 | |||
| 5129 | * basic.texi (Position Info): Minor cleanup. | ||
| 5130 | |||
| 5131 | * mule.texi (Input Methods): Minor cleanup. | ||
| 5132 | |||
| 5133 | 2005-03-29 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 5134 | |||
| 5135 | * programs.texi (ForIndent Vars): `fortran-if-indent' does other | ||
| 5136 | constructs as well. | ||
| 5137 | (Fortran Motion): Add fortran-end-of-block, fortran-beginning-of-block. | ||
| 5138 | |||
| 5139 | 2005-03-29 Kenichi Handa <handa@m17n.org> | ||
| 5140 | |||
| 5141 | * mule.texi (Input Methods): Refer to the command C-u C-x =. | ||
| 5142 | |||
| 5143 | * basic.texi (Position Info): Update the description about the | ||
| 5144 | command C-u C-x =. | ||
| 5145 | |||
| 5146 | 2005-03-28 Richard M. Stallman <rms@gnu.org> | ||
| 5147 | |||
| 5148 | * emacs.texi (Top): Use @section for the detailed node listing. | ||
| 5149 | |||
| 5150 | * calendar.texi: Minor fixes to previous change. | ||
| 5151 | |||
| 5152 | * programs.texi (Fortran): Small fixes to previous changes. | ||
| 5153 | |||
| 5154 | * emacs.texi (Top): Update list of subnodes of Dired. | ||
| 5155 | Likewise for building.texi. | ||
| 5156 | |||
| 5157 | * files.texi (File Conveniences): Delete Auto Image File mode. | ||
| 5158 | |||
| 5159 | 2005-03-28 Chong Yidong <cyd@stupidchicken.com> | ||
| 5160 | |||
| 5161 | * building.texi (Flymake): New node. | ||
| 5162 | |||
| 5163 | * custom.texi (Function Keys): Document kp- event types and | ||
| 5164 | keypad-setup package. | ||
| 5165 | |||
| 5166 | * dired.texi (Wdired): New node. | ||
| 5167 | |||
| 5168 | * files.texi (File Conveniences): Reorder entries. | ||
| 5169 | Explain how to turn on Auto-image-file mode. | ||
| 5170 | Document Thumbs mode. | ||
| 5171 | |||
| 5172 | * mule.texi (Specify Coding): Document recode-region and | ||
| 5173 | recode-file-name. | ||
| 5174 | |||
| 5175 | * programs.texi (Program Modes): Add Conf mode and DNS mode. | ||
| 5176 | |||
| 5177 | 2005-03-27 Luc Teirlinck <teirllm@auburn.edu> | ||
| 5178 | |||
| 5179 | * commands.texi (Keys): M-o is now a prefix key. | ||
| 5180 | |||
| 5181 | 2005-03-27 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 5182 | |||
| 5183 | * programs.texi: Reformat and update copyright years. | ||
| 5184 | (Fortran): Update section. | ||
| 5185 | |||
| 5186 | 2005-03-26 Luc Teirlinck <teirllm@auburn.edu> | ||
| 5187 | |||
| 5188 | * files.texi: Several small changes in addition to: | ||
| 5189 | (Visiting): Change xref for Dialog Boxes to ref. | ||
| 5190 | (Version Headers): Replace references to obsolete var | ||
| 5191 | `vc-header-alist' with `vc-BACKEND-header'. | ||
| 5192 | (Customizing VC): Update value of `vc-handled-backends'. | ||
| 5193 | |||
| 5194 | 2005-03-26 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 5195 | |||
| 5196 | * emacs-xtra.texi (Advanced Calendar/Diary Usage): New section; | ||
| 5197 | move here from Emacs Lisp Reference Manual. | ||
| 5198 | * calendar.texi (Calendar/Diary, Diary Commands) | ||
| 5199 | (Special Diary Entries, Importing Diary): Change some xrefs to | ||
| 5200 | point to emacs-xtra rather than elisp. | ||
| 5201 | |||
| 5202 | * emacs-xtra.texi (Calendar Customizing): | ||
| 5203 | Move view-diary-entries-initially, view-calendar-holidays-initially, | ||
| 5204 | mark-diary-entries-in-calendar, mark-holidays-in-calendar to main | ||
| 5205 | Emacs Manual. | ||
| 5206 | (Appt Customizing): Merge entire section into main Emacs Manual. | ||
| 5207 | * calendar.texi (Holidays): Move view-calendar-holidays-initially, | ||
| 5208 | mark-holidays-in-calendar here from emacs-xtra. | ||
| 5209 | (Displaying the Diary): Move view-diary-entries-initially, | ||
| 5210 | mark-diary-entries-in-calendar here from emacs-xtra. | ||
| 5211 | (Appointments): Move appt-display-mode-line, | ||
| 5212 | appt-display-duration, appt-disp-window-function, | ||
| 5213 | appt-delete-window-function here from emacs-xtra. | ||
| 5214 | |||
| 5215 | * calendar.texi: Update and reformat copyright. | ||
| 5216 | Change all @xrefs to the non-printing emacs-xtra to @inforefs. | ||
| 5217 | (Calendar/Diary): Menu now only on Mouse-3, not C-Mouse-3. | ||
| 5218 | (Diary): Refer to `diary-file' rather than ~/diary. | ||
| 5219 | (Diary Commands): Rename node to "Displaying the Diary". | ||
| 5220 | * emacs.texi (Top): Rename "Diary Commands" section. | ||
| 5221 | * misc.texi (Hardcopy): Rename "Diary Commands" xref. | ||
| 5222 | |||
| 5223 | 2005-03-26 Eli Zaretskii <eliz@gnu.org> | ||
| 5224 | |||
| 5225 | * misc.texi (Emacs Server): Fix the command for setting | ||
| 5226 | server-name. Add an xref to Invoking emacsclient. | ||
| 5227 | |||
| 5228 | * help.texi (Help Summary): Clarify when "C-h ." will do something | ||
| 5229 | nontrivial. | ||
| 5230 | (Apropos): Add cindex entry for apropos-sort-by-scores. | ||
| 5231 | |||
| 5232 | * display.texi (Text Display): Add index entries for how no-break | ||
| 5233 | characters are displayed. | ||
| 5234 | |||
| 5235 | 2005-03-26 Stephan Stahl <stahl@eos.franken.de> (tiny change) | ||
| 5236 | |||
| 5237 | * dired-x.texi (Multiple Dired Directories): default-directory was | ||
| 5238 | renamed to dired-default-directory. | ||
| 5239 | |||
| 5240 | 2005-03-26 Eli Zaretskii <eliz@gnu.org> | ||
| 5241 | |||
| 5242 | * files.texi (Visiting): Fix cross-references introduced with the | ||
| 5243 | last change. | ||
| 5244 | |||
| 5245 | * xresources.texi (GTK resources): Fix last change. | ||
| 5246 | |||
| 5247 | 2005-03-26 Jay Belanger <belanger@truman.edu> | ||
| 5248 | |||
| 5249 | * calc.texi (Simplifying Formulas, Rewrite Rules): | ||
| 5250 | Change description of top and bottom of fraction. | ||
| 5251 | (Modulo Forms): Move description of how to create modulo forms to | ||
| 5252 | earlier in the section. | ||
| 5253 | (Fraction Mode): Suggest using : to get a fraction by dividing. | ||
| 5254 | (Basic Arithmetic): Adjust placement of command name. | ||
| 5255 | (Truncating the Stack): Emphasize that "hidden" entries are still | ||
| 5256 | visible. | ||
| 5257 | (Installation): Move discussion of printing manual to "About This | ||
| 5258 | Manual". | ||
| 5259 | (About This Manual): Mention how to print the manual. | ||
| 5260 | (Reporting Bugs): Remove first person. | ||
| 5261 | (Building Vectors): Add algebraic version of append. | ||
| 5262 | (Manipulating Vectors): Fix algebraic version of calc-reverse-vector. | ||
| 5263 | (Grouping Digits): Fix typo. | ||
| 5264 | |||
| 5265 | 2005-03-25 Chong Yidong <cyd@stupidchicken.com> | ||
| 5266 | |||
| 5267 | * xresources.texi (X Resources): GTK options documented too. | ||
| 5268 | (Resources): Clarify meaning of program name. | ||
| 5269 | (Table of Resources): Add visualClass. | ||
| 5270 | (GTK resources): Rewrite. | ||
| 5271 | (GTK widget names, GTK Names in Emacs, GTK styles): Cleanups. | ||
| 5272 | |||
| 5273 | * display.texi (Text Display): Mention non-breaking spaces. | ||
| 5274 | |||
| 5275 | * files.texi (Reverting): Document auto-revert-check-vc-info. | ||
| 5276 | |||
| 5277 | * frames.texi (Mouse Commands): Document | ||
| 5278 | x-mouse-click-focus-ignore-position and mouse-drag-copy-region. | ||
| 5279 | |||
| 5280 | * help.texi (Help Summary): Add `C-h .'. | ||
| 5281 | (Apropos): Apropos accepts a list of search terms. | ||
| 5282 | Document apropos-sort-by-scores. | ||
| 5283 | (Help Echo): Document display-local-help. | ||
| 5284 | |||
| 5285 | * misc.texi (Emacs Server): Document server-name. | ||
| 5286 | (Invoking emacsclient): Document -s option for server names. | ||
| 5287 | |||
| 5288 | * text.texi (Outline Visibility): Introduce "current heading | ||
| 5289 | line" (commands can be called with point on a body line). | ||
| 5290 | Re-order table to follow the sequence of discussion. | ||
| 5291 | hide-body won't hide lines before first header line. | ||
| 5292 | (TeX Mode): Add DocTeX mode. | ||
| 5293 | |||
| 5294 | 2005-03-25 Werner Lemberg <wl@gnu.org> | ||
| 5295 | |||
| 5296 | * calc.texi, cl.texi, gnus.texi, idlwave.texi, reftex.texi: | ||
| 5297 | Replace `legal' with `valid'. | ||
| 5298 | |||
| 5299 | 2005-03-25 Werner Lemberg <wl@gnu.org> | ||
| 5300 | |||
| 5301 | * calc.texi, reftex.texi: Replace `illegal' with `invalid'. | ||
| 5302 | |||
| 5303 | 2005-03-24 Jay Belanger <belanger@truman.edu> | ||
| 5304 | |||
| 5305 | * calc.texi (General Mode Commands) | ||
| 5306 | (Mode Settings in Embedded Mode): Add some explanation of | ||
| 5307 | recording mode settings. | ||
| 5308 | |||
| 5309 | 2005-03-24 Richard M. Stallman <rms@gnu.org> | ||
| 5310 | |||
| 5311 | * mule.texi (Single-Byte Character Support): Delete mention | ||
| 5312 | of iso-acc.el and iso-transl.el. | ||
| 5313 | |||
| 5314 | * calc.texi: Remove praise of non-free software. | ||
| 5315 | |||
| 5316 | * idlwave.texi: Don't say where to get IDL or its non-free manual. | ||
| 5317 | (Installation): Node deleted. | ||
| 5318 | |||
| 5319 | 2005-03-23 Lute Kamstra <lute@gnu.org> | ||
| 5320 | |||
| 5321 | * search.texi (Non-ASCII Isearch): Rename from Non-Ascii Isearch. | ||
| 5322 | |||
| 5323 | 2005-03-23 Richard M. Stallman <rms@gnu.org> | ||
| 5324 | |||
| 5325 | * url.texi (HTTP language/coding): Improve last change. | ||
| 5326 | |||
| 5327 | * search.texi: Delete explicit node pointers. | ||
| 5328 | (Incremental Search): New menu. | ||
| 5329 | (Basic Isearch, Repeat Isearch, Error in Isearch) | ||
| 5330 | (Non-Ascii Isearch, Isearch Yank, Highlight Isearch, Isearch Scroll) | ||
| 5331 | (Slow Isearch): New subnodes. | ||
| 5332 | (Configuring Scrolling): Node deleted. | ||
| 5333 | (Search Case): Doc default-case-fold-search. | ||
| 5334 | (Regexp Replace): Move replace-regexp doc here. | ||
| 5335 | |||
| 5336 | * rmail.texi (Movemail): Put commas inside closequotes. | ||
| 5337 | |||
| 5338 | * picture.texi (Insert in Picture): Document C-c arrow combos. | ||
| 5339 | (Basic Picture): Clarify erasure. | ||
| 5340 | |||
| 5341 | * display.texi (Font Lock): Put commas inside closequotes. | ||
| 5342 | |||
| 5343 | * cmdargs.texi (General Variables): Put commas inside closequotes. | ||
| 5344 | |||
| 5345 | 2005-03-23 Nick Roberts <nickrob@snap.net.nz> | ||
| 5346 | |||
| 5347 | * building.texi (Stack Buffer): Mention reverse contrast for | ||
| 5348 | *selected* frame (might not be current frame). | ||
| 5349 | |||
| 5350 | 2005-03-22 Jay Belanger <belanger@truman.edu> | ||
| 5351 | |||
| 5352 | * calc.texi (Embedded Mode): Add new information on changing | ||
| 5353 | modes. | ||
| 5354 | |||
| 5355 | 2005-03-21 Richard M. Stallman <rms@gnu.org> | ||
| 5356 | |||
| 5357 | * building.texi (Starting GUD): Add bashdb. | ||
| 5358 | |||
| 5359 | 2005-03-20 Chong Yidong <cyd@stupidchicken.com> | ||
| 5360 | |||
| 5361 | * basic.texi (Moving Point): Add M-g M-g binding. | ||
| 5362 | (Undo): Document undo-only. | ||
| 5363 | (Position Info): Document M-g M-g and C-u M-g M-g. | ||
| 5364 | |||
| 5365 | * building.texi (Building): Put Grep Searching after Compilation | ||
| 5366 | Shell. | ||
| 5367 | (Compilation Mode): Document M-n, M-p, M-}, M-{, and C-c C-f bindings. | ||
| 5368 | Document next-error-highlight. | ||
| 5369 | (Grep Searching): Document grep-highlight-matches. | ||
| 5370 | (Lisp Eval): Typing C-x C-e twice prints integers specially. | ||
| 5371 | |||
| 5372 | * calendar.texi (Importing Diary): Rename node from iCalendar. | ||
| 5373 | Document diary-from-outlook. | ||
| 5374 | |||
| 5375 | * dired.texi (Misc Dired Features): Rename node from Misc Dired | ||
| 5376 | Commands. | ||
| 5377 | Mention effect of X drag and drop on Dired buffers. | ||
| 5378 | |||
| 5379 | * files.texi (Visiting): Document large-file-warning-threshold. | ||
| 5380 | Move paragraph on file-selection dialog. | ||
| 5381 | Mention visiting files using X drag and drop. | ||
| 5382 | (Reverting): Mention using Auto-Revert mode to tail files. | ||
| 5383 | Document auto-revert-tail-mode. | ||
| 5384 | (Version Systems): Minor correction. | ||
| 5385 | (Comparing Files): Diff-mode is no longer based on Compilation | ||
| 5386 | mode. | ||
| 5387 | Document compare-ignore-whitespace. | ||
| 5388 | (Misc File Ops): Explain passing a directory to rename-file. | ||
| 5389 | Likewise for copy-file and make-symbolic-link. | ||
| 5390 | |||
| 5391 | * frames.texi (Wheeled Mice): Mouse wheel support on by default. | ||
| 5392 | Document mouse-wheel-progressive speed. | ||
| 5393 | |||
| 5394 | * help.texi (Misc Help): Document numeric argument for C-h i. | ||
| 5395 | Correctly explain the effect of just C-u as argument. | ||
| 5396 | |||
| 5397 | * killing.texi (Deletion): Document numeric argument for | ||
| 5398 | just-one-space. | ||
| 5399 | |||
| 5400 | * mini.texi (Completion): Completion acts on text before point. | ||
| 5401 | |||
| 5402 | * misc.texi (Saving Emacs Sessions): Document desktop-restore-eager. | ||
| 5403 | (Emulation): CUA mode replaces pc-bindings-mode, | ||
| 5404 | pc-selection-mode, and s-region. | ||
| 5405 | |||
| 5406 | * mule.texi (Input Methods): Leim is now built-in. | ||
| 5407 | (Select Input Method): Document quail-show-key. | ||
| 5408 | (Specify Coding): Document revert-buffer-with-coding-system. | ||
| 5409 | |||
| 5410 | * programs.texi (Fortran Motion): Document f90-next-statement, | ||
| 5411 | f90-previous-statement, f90-next-block, f90-previous-block, | ||
| 5412 | f90-end-of-block, and f90-beginning-of-block. | ||
| 5413 | |||
| 5414 | * text.texi (Format Faces): Replace old M-g key prefix with M-o. | ||
| 5415 | |||
| 5416 | * emacs.texi (Acknowledgments): Updated. | ||
| 5417 | |||
| 5418 | * anti.texi: Total rewrite. | ||
| 5419 | |||
| 5420 | 2005-03-20 Michael Albinus <michael.albinus@gmx.de> | ||
| 5421 | |||
| 5422 | Sync with Tramp 2.0.48. | ||
| 5423 | |||
| 5424 | * trampver.texi.in: Replace "Emacs" by "GNU Emacs". | ||
| 5425 | |||
| 5426 | * tramp.texi: Replace "Emacs" by "GNU Emacs". Replace "Linux" by | ||
| 5427 | "GNU/Linux". Change all addresses to .gnu.org. | ||
| 5428 | (Default Method): Offer shortened syntax for "su" and "sudo" | ||
| 5429 | methods. | ||
| 5430 | |||
| 5431 | 2005-03-19 Chong Yidong <cyd@stupidchicken.com> | ||
| 5432 | |||
| 5433 | * ack.texi (Acknowledgments): Update. | ||
| 5434 | |||
| 5435 | 2005-03-19 Eli Zaretskii <eliz@gnu.org> | ||
| 5436 | |||
| 5437 | * anti.texi (Antinews): Refer to Emacs 21.4, not 21.3. Update | ||
| 5438 | copyright years. | ||
| 5439 | |||
| 5440 | 2005-03-14 Nick Roberts <nickrob@snap.net.nz> | ||
| 5441 | |||
| 5442 | * building.texi (Commands of GUD): Move paragraph on setting | ||
| 5443 | breakpoints with mouse to the GDB Graphical Interface node. | ||
| 5444 | |||
| 5445 | 2005-03-07 Richard M. Stallman <rms@gnu.org> | ||
| 5446 | |||
| 5447 | * url.texi: Fix usage of "e.g.". | ||
| 5448 | (HTTP language/coding): Explain the rules for these strings. | ||
| 5449 | |||
| 5450 | * misc.texi (Single Shell, Shell Options): Fix previous change. | ||
| 5451 | |||
| 5452 | * building.texi (Debugger Operation): Update GUD tooltip enable info. | ||
| 5453 | |||
| 5454 | 2005-03-06 Richard M. Stallman <rms@gnu.org> | ||
| 5455 | |||
| 5456 | * building.texi (Starting GUD): Don't explain text vs graphical | ||
| 5457 | GDB here. Just mention it and xref. | ||
| 5458 | Delete "just one debugger process". | ||
| 5459 | (Debugger Operation): Move GUD tooltip info here. | ||
| 5460 | (GUD Tooltips): Node deleted. | ||
| 5461 | (GDB Graphical Interface): Explain the two GDB modes here. | ||
| 5462 | |||
| 5463 | * woman.texi (Introduction): Minor cleanups. | ||
| 5464 | |||
| 5465 | * url.texi (HTTP language/coding): Get rid of "Emacs 21". | ||
| 5466 | |||
| 5467 | * sending.texi (Sending Mail): Minor cleanup. | ||
| 5468 | (Mail Aliases): Explain quoting conventions. | ||
| 5469 | Update key rebinding example. | ||
| 5470 | (Header Editing): C-M-i is like M-TAB. | ||
| 5471 | (Mail Mode Misc): mail-attach-file does not do MIME. | ||
| 5472 | |||
| 5473 | * rmail.texi (Rmail Inbox): Move text from Remote Mailboxes | ||
| 5474 | that really belongs here. | ||
| 5475 | (Remote Mailboxes): Text moved to Rmail Inbox. | ||
| 5476 | (Rmail Display): Mention Mouse-1. | ||
| 5477 | (Movemail): Clarify two movemail versions. | ||
| 5478 | Clarify rmail-movemail-program. | ||
| 5479 | |||
| 5480 | * pcl-cvs.texi (About PCL-CVS): Get rid of "Emacs 21". | ||
| 5481 | (Installation): Node deleted. | ||
| 5482 | |||
| 5483 | * misc.texi (Single Shell): Replace uudecode example with gpg example. | ||
| 5484 | Document async shell commands. | ||
| 5485 | (Shell History): Clarify. | ||
| 5486 | (Shell Ring): Mention C-UP an C-DOWN. | ||
| 5487 | (Shell Options): Add comint-prompt-read-only. | ||
| 5488 | (Invoking emacsclient): Set EDITOR to run Emacs. | ||
| 5489 | (Sorting): No need to explain what region is. | ||
| 5490 | (Saving Emacs Sessions): Fix typo. | ||
| 5491 | (Recursive Edit): Fix punctuation. | ||
| 5492 | (Emulation): Don't mention "PC bindings" which are standard. | ||
| 5493 | (Hyperlinking): Explain Mouse-1 convention here. | ||
| 5494 | (Find Func): Node deleted. | ||
| 5495 | |||
| 5496 | * mh-e.texi (Preface): Get rid of "Emacs 21". | ||
| 5497 | |||
| 5498 | * help.texi (Name Help): Xref to Hyperlinking. | ||
| 5499 | |||
| 5500 | * glossary.texi (Glossary): | ||
| 5501 | Rename "Balance Parentheses" to "Balancing...". | ||
| 5502 | Add "Byte Compilation". Correct "Copyleft". | ||
| 5503 | New xref in "Customization". | ||
| 5504 | Clarify "Current Line", "Echoing", "Fringe", "Frame", "Speedbar". | ||
| 5505 | Add "Graphical Terminal" "Keybinding", "Margin", "Window System". | ||
| 5506 | Rename "Registers" to "Register". | ||
| 5507 | Replace "Selecting" with "Selected Frame", | ||
| 5508 | "Selected Window", and "Selecting a Buffer". | ||
| 5509 | |||
| 5510 | * files.texi (Types of Log File): Explain how projects' | ||
| 5511 | methods can vary. | ||
| 5512 | |||
| 5513 | * eshell.texi (Installation): Delete node (for Emacs 20). | ||
| 5514 | |||
| 5515 | * display.texi (Faces): Delete "Emacs 21". | ||
| 5516 | |||
| 5517 | * custom.texi (Changing a Variable): C-M-i like M-TAB. | ||
| 5518 | * fixit.texi (Spelling): C-M-i like M-TAB. | ||
| 5519 | * mini.texi (Completion Options): C-M-i like M-TAB. | ||
| 5520 | * programs.texi (Symbol Completion): C-M-i like M-TAB. | ||
| 5521 | * text.texi (Text Mode): C-M-i like M-TAB. | ||
| 5522 | |||
| 5523 | * commands.texi (Keys): Mention F1 and F2 in list of prefixes. | ||
| 5524 | |||
| 5525 | * calendar.texi (Specified Dates): Mention `g w'. | ||
| 5526 | (Appointments): appt-activate toggles with no arg. | ||
| 5527 | |||
| 5528 | 2005-03-05 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 5529 | |||
| 5530 | * flymake.texi: Refill and tweak style in @lisp blocks. | ||
| 5531 | |||
| 5532 | 2005-03-05 Juri Linkov <juri@jurta.org> | ||
| 5533 | |||
| 5534 | * cmdargs.texi (Emacs Invocation): Add cindex | ||
| 5535 | "invocation (command line arguments)" | ||
| 5536 | (Misc X): Add -nbc, --no-blinking-cursor. | ||
| 5537 | |||
| 5538 | 2005-03-04 Ulf Jasper <ulf.jasper@web.de> | ||
| 5539 | |||
| 5540 | * calendar.texi (iCalendar): No need to require it now. | ||
| 5541 | |||
| 5542 | 2005-03-03 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 5543 | |||
| 5544 | * gnus.texi (Slow/Expensive Connection): Don't abbreviate "very". | ||
| 5545 | |||
| 5546 | 2005-03-03 Nick Roberts <nickrob@snap.net.nz> | ||
| 5547 | |||
| 5548 | * trouble.texi (Contributing): Mention Savannah. Direct users to | ||
| 5549 | emacs-devel. | ||
| 5550 | |||
| 5551 | 2005-03-01 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 5552 | |||
| 5553 | * calendar.texi (Adding to Diary): Mention redrawing of calendar | ||
| 5554 | window. | ||
| 5555 | |||
| 5556 | 2005-03-01 Jay Belanger <belanger@truman.edu> | ||
| 5557 | |||
| 5558 | * calc.texi (Trigonometric and Hyperbolic Functions): | ||
| 5559 | Mention additional functions. | ||
| 5560 | (Algebraic Simplifications): Mention additional simplifications. | ||
| 5561 | |||
| 5562 | 2005-02-27 Richard M. Stallman <rms@gnu.org> | ||
| 5563 | |||
| 5564 | * building.texi (Compilation): Update mode line status info. | ||
| 5565 | |||
| 5566 | 2005-02-27 Matt Hodges <MPHodges@member.fsf.org> | ||
| 5567 | |||
| 5568 | * calendar.texi (General Calendar): Document binding of | ||
| 5569 | scroll-other-window-down. | ||
| 5570 | (Mayan Calendar): Fix earliest date. | ||
| 5571 | (Time Intervals): Document timeclock-change. | ||
| 5572 | Fix timeclock-ask-before-exiting documentation. | ||
| 5573 | |||
| 5574 | 2005-02-26 Kim F. Storm <storm@cua.dk> | ||
| 5575 | |||
| 5576 | * frames.texi (Mouse References): | ||
| 5577 | Add mouse-1-click-in-non-selected-windows. | ||
| 5578 | |||
| 5579 | 2005-02-25 Richard M. Stallman <rms@gnu.org> | ||
| 5580 | |||
| 5581 | * screen.texi (Screen): Explain better about cursors and mode lines; | ||
| 5582 | don't presuppose text terminals. | ||
| 5583 | (Point): Don't assume just one cursor. | ||
| 5584 | Clarify explanation of cursors. | ||
| 5585 | (Echo Area, Menu Bar): Cleanups. | ||
| 5586 | |||
| 5587 | * mini.texi (Minibuffer): Prompts are highlighted. | ||
| 5588 | (Minibuffer Edit): Newline = C-j only on text terminals. | ||
| 5589 | Clarify resize-mini-windows values. | ||
| 5590 | Mention M-PAGEUP and M-PAGEDOWN. | ||
| 5591 | (Completion Commands): Mouse-1 like Mouse-2. | ||
| 5592 | (Minibuffer History): Explain history commands better. | ||
| 5593 | (Repetition): Add xref to Incremental Search. | ||
| 5594 | |||
| 5595 | * mark.texi (Setting Mark): Clarify info about displaying mark. | ||
| 5596 | Clarify explanation of C-@ and C-SPC. | ||
| 5597 | (Transient Mark): Mention Delete Selection mode. | ||
| 5598 | (Marking Objects): Clean up text about extending the region. | ||
| 5599 | |||
| 5600 | * m-x.texi (M-x): One C-g doesn't always go to top level. | ||
| 5601 | No delay before suggest-key-bindings output. | ||
| 5602 | |||
| 5603 | * fixit.texi (Fixit): Mention C-/ for undo. | ||
| 5604 | (Spelling): Mention ESC TAB like M-TAB. | ||
| 5605 | Replacement words with r and R are rechecked. | ||
| 5606 | Say where C-g leaves point. Mention ? as input. | ||
| 5607 | |||
| 5608 | 2005-02-23 Lute Kamstra <lute@gnu.org> | ||
| 5609 | |||
| 5610 | * cmdargs.texi (Initial Options): Add cross reference. | ||
| 5611 | |||
| 5612 | 2005-02-18 Jonathan Yavner <jyavner@member.fsf.org> | ||
| 5613 | |||
| 5614 | * ses.texi: Add concept/function/variable indices (this work was | ||
| 5615 | donated by Brad Collins <brad@chenla.org>, copyright-assignment | ||
| 5616 | papers on file at FSF). | ||
| 5617 | |||
| 5618 | 2005-02-16 Luc Teirlinck <teirllm@auburn.edu> | ||
| 5619 | |||
| 5620 | * emacs.texi (Top): Update menu for splitting of node in | ||
| 5621 | msdog.texi. | ||
| 5622 | * frames.texi (Frames): Update xref for splitting of node in | ||
| 5623 | msdog.texi. | ||
| 5624 | * trouble.texi (Quitting): Ditto. | ||
| 5625 | |||
| 5626 | 2005-02-16 Richard M. Stallman <rms@gnu.org> | ||
| 5627 | |||
| 5628 | * windows.texi (Split Window): Simplify line truncation info | ||
| 5629 | and xref to Display Custom. | ||
| 5630 | |||
| 5631 | * trouble.texi (Quitting): Emergency escape only for text terminal. | ||
| 5632 | (Screen Garbled): C-l for ungarbling is only for text terminal. | ||
| 5633 | |||
| 5634 | * text.texi (Text Mode): ESC TAB alternative for M-TAB. | ||
| 5635 | |||
| 5636 | * sending.texi (Header Editing): ESC TAB alternative for M-TAB. | ||
| 5637 | |||
| 5638 | * programs.texi (Program Modes): Mention Python mode. | ||
| 5639 | (Moving by Defuns): Repeating C-M-h extends region. | ||
| 5640 | (Basic Indent): Clarify. | ||
| 5641 | (Custom C Indent): Clarify. | ||
| 5642 | (Expressions): Repeating C-M-@ extends region. | ||
| 5643 | (Info Lookup): Clarify for C-h S. | ||
| 5644 | (Symbol Completion): ESC TAB alternative for M-TAB. | ||
| 5645 | (Electric C): Clarify. | ||
| 5646 | |||
| 5647 | * emacs.texi (Top): Update display.texi and frames.texi submenu data. | ||
| 5648 | |||
| 5649 | * msdog.texi (MS-DOS Keyboard, MS-DOS Mouse): Split from | ||
| 5650 | MS-DOS Input node. | ||
| 5651 | (MS-DOS Keyboard): Start with explaining DEL and BREAK. | ||
| 5652 | (MS-DOS and MULE): Clarify. | ||
| 5653 | (MS-DOS Processes, Windows Processes): Fix typos. | ||
| 5654 | |||
| 5655 | * major.texi (Choosing Modes): Clarify. | ||
| 5656 | |||
| 5657 | * kmacro.texi (Basic Keyboard Macro): Doc F3, F4. | ||
| 5658 | (Keyboard Macro Step-Edit): Clarify. | ||
| 5659 | |||
| 5660 | * indent.texi (Indentation): Clarifications. | ||
| 5661 | |||
| 5662 | * help.texi (Help): Correct error about C-h in query-replace. | ||
| 5663 | Clarify apropos vs C-h a. Fix how to search in FAQ. | ||
| 5664 | (Key Help): Describe C-h w here. | ||
| 5665 | (Name Help): Minor cleanup. C-h w moved to Key Help. | ||
| 5666 | Clarify the "object" joke. | ||
| 5667 | (Apropos): Clarify. Mouse-1 like Mouse-2. | ||
| 5668 | (Help Mode): Mouse-1 like Mouse-2. | ||
| 5669 | |||
| 5670 | * fixit.texi (Spelling): Mention ESC TAB as alt. for M-TAB. | ||
| 5671 | |||
| 5672 | * display.texi (Display): Reorder menu. | ||
| 5673 | (Faces): Cleanup. | ||
| 5674 | (Font Lock): Cleanup. Mention Options menu. | ||
| 5675 | Delete obsolete text. | ||
| 5676 | (Scrolling): For C-l, don't presume text terminal. | ||
| 5677 | (Horizontal Scrolling): Simplify intro. | ||
| 5678 | (Follow Mode): Clarify. | ||
| 5679 | (Cursor Display): Moved before Display Custom. | ||
| 5680 | (Display Custom): Explain no-redraw-on-reenter is for text terminals. | ||
| 5681 | Doc default-tab-width. Doc line truncation more thoroughly. | ||
| 5682 | |||
| 5683 | * dired.texi (Dired Enter): C-x C-f can run Dired. | ||
| 5684 | (Dired Visiting): Comment out `a' command. | ||
| 5685 | Mouse-1 is like Mouse-2. | ||
| 5686 | (Shell Commands in Dired): ? can be used more than once. | ||
| 5687 | |||
| 5688 | * basic.texi (Continuation Lines): Simplify description of truncation, | ||
| 5689 | and refer to Display Custom for the rest of it. | ||
| 5690 | |||
| 5691 | 2005-02-10 Jay Belanger <belanger@truman.edu> | ||
| 5692 | |||
| 5693 | * calc.texi: Change @LaTeX to La@TeX throughout. | ||
| 5694 | Redefine @expr as @math for TeX output. | ||
| 5695 | Redefine @texline as a no-op for TeX output. | ||
| 5696 | Define @tfn, replace @t by @tfn throughout. | ||
| 5697 | |||
| 5698 | 2005-02-09 Jay Belanger <belanger@truman.edu> | ||
| 5699 | |||
| 5700 | * calc.texi: Add macro for LaTeX for info output. | ||
| 5701 | |||
| 5702 | 2005-02-08 Kim F. Storm <storm@cua.dk> | ||
| 5703 | |||
| 5704 | * texinfo.tex (LaTex): Add def. | ||
| 5705 | |||
| 5706 | 2005-02-06 Jay Belanger <belanger@truman.edu> | ||
| 5707 | |||
| 5708 | * calc.texi (TeX Language Mode): Add mention of LaTeX mode, and | ||
| 5709 | change name to "TeX and LaTeX Language Modes." Mention LaTeX mode | ||
| 5710 | throughout manual. | ||
| 5711 | |||
| 5712 | 2005-02-06 Lute Kamstra <lute@gnu.org> | ||
| 5713 | |||
| 5714 | * basic.texi (Undo): Fix typo. | ||
| 5715 | |||
| 5716 | * cmdargs.texi (Emacs Invocation): Fix typo. | ||
| 5717 | |||
| 5718 | * custom.texi (Init Examples): Fix typo. | ||
| 5719 | |||
| 5720 | * abbrevs.texi (Expanding Abbrevs): Fix typo. | ||
| 5721 | |||
| 5722 | 2005-02-06 Richard M. Stallman <rms@gnu.org> | ||
| 5723 | |||
| 5724 | * regs.texi (Registers): Registers can hold numbers, too. | ||
| 5725 | |||
| 5726 | * killing.texi (Other Kill Commands): Cleanup. | ||
| 5727 | Delete redundant explanation of kill in read-only buffer. | ||
| 5728 | (Yanking): Mention term "copying". | ||
| 5729 | (Accumulating Text): Fix typo. | ||
| 5730 | |||
| 5731 | * entering.texi (Entering Emacs): Update rationale at start. | ||
| 5732 | (Exiting): Treat iconifying on a par with suspension. | ||
| 5733 | |||
| 5734 | * custom.texi (Minor Modes): Fix typo. | ||
| 5735 | (Easy Customization): Fix menu style. | ||
| 5736 | (Variables): Add xref. | ||
| 5737 | (Examining): Setting for future sessions works through .emacs. | ||
| 5738 | (Keymaps): "Text terminals", not "Many". | ||
| 5739 | (Init Rebinding): Explain \C-. Show example of \M-. | ||
| 5740 | Fix minor wording errors. | ||
| 5741 | (Function Keys): Explain vector syntax just once. | ||
| 5742 | (Named ASCII Chars): Clarify history of TAB/C-i connection. | ||
| 5743 | (Init File): Mention .emacs.d directory. | ||
| 5744 | (Init Examples): Add xref. | ||
| 5745 | (Find Init): Mention .emacs.d directory. | ||
| 5746 | |||
| 5747 | * cmdargs.texi (Emacs Invocation): +LINENUM is also an option. | ||
| 5748 | (Action Arguments): Explain which kinds of -l args are found how. | ||
| 5749 | (Initial Options): --batch does not inhibit site-start. | ||
| 5750 | Add xrefs. | ||
| 5751 | (Command Example): Use --batch, not -batch. | ||
| 5752 | |||
| 5753 | * basic.texi (Inserting Text): Cleanup wording. | ||
| 5754 | (Moving Point): Doc PRIOR, PAGEUP, NEXT, PAGEDOWN more systematically. | ||
| 5755 | C-n is not error at end of buffer. | ||
| 5756 | (Undo): Doc C-/ like C-_. Add xrefs. | ||
| 5757 | (Arguments): META key may be labeled ALT. | ||
| 5758 | Peculiar arg meanings are explained in doc strings. | ||
| 5759 | |||
| 5760 | * abbrevs.texi (Expanding Abbrevs): Clarify. | ||
| 5761 | |||
| 5762 | 2005-02-05 Eli Zaretskii <eliz@gnu.org> | ||
| 5763 | |||
| 5764 | * frames.texi (Frame Parameters): Add an xref to the description | ||
| 5765 | of list-colors-display. Add a pointer to the X docs about colors. | ||
| 5766 | |||
| 5767 | * cmdargs.texi (Colors): Mention 16-, 88- and 256-color modes. | ||
| 5768 | Impove docs of list-colors-display. | ||
| 5769 | |||
| 5770 | 2005-02-03 Lute Kamstra <lute@gnu.org> | ||
| 5771 | |||
| 5772 | * frames.texi (Frames, Drag and Drop): Fix typos. | ||
| 5773 | |||
| 5774 | 2005-02-03 Richard M. Stallman <rms@gnu.org> | ||
| 5775 | |||
| 5776 | * windows.texi (Basic Window): Mention color-change in mode line. | ||
| 5777 | (Change Window): Explain dragging vertical boundaries. | ||
| 5778 | |||
| 5779 | * text.texi (Sentences): Clarify. | ||
| 5780 | (Paragraphs): Explain M-a and blank lines. | ||
| 5781 | (Outline Mode): Clarify text and menu. | ||
| 5782 | (Hard and Soft Newlines): Mention use-hard-newlines. | ||
| 5783 | |||
| 5784 | * frames.texi (Frames): Delete unnecessary mention of Windows. | ||
| 5785 | (Mouse Commands): Likewise. Mention xterm mouse support. | ||
| 5786 | (Clipboard): Clarify. | ||
| 5787 | (Mouse References): Mention use of Mouse-1 for following links. | ||
| 5788 | (Menu Mouse Clicks): Clarify. | ||
| 5789 | (Mode Line Mouse): Clarify. | ||
| 5790 | (Drag and Drop): Rewrite. | ||
| 5791 | |||
| 5792 | * fixit.texi (Spelling): Fix typo. | ||
| 5793 | |||
| 5794 | * files.texi (File Names): Clarify. | ||
| 5795 | (Visiting): Update conditions for use of file dialog. Clarify. | ||
| 5796 | (Saving): Doc d as answer in save-some-buffers. | ||
| 5797 | (Remote Files): Clean up the text. | ||
| 5798 | |||
| 5799 | * dired.texi (Misc Dired Commands): Delete dired-marked-files. | ||
| 5800 | |||
| 5801 | * buffers.texi (Select Buffer): Doc next-buffer and prev-buffer. | ||
| 5802 | (List Buffers): Clarify. | ||
| 5803 | (Several Buffers): Doc T command. | ||
| 5804 | (Buffer Convenience): Clarify menu. | ||
| 5805 | |||
| 5806 | * basic.texi (Undo): Clarify last change. | ||
| 5807 | |||
| 5808 | 2005-02-02 Matt Hodges <MPHodges@member.fsf.org> | ||
| 5809 | |||
| 5810 | * fixit.texi (Spelling): Fix typo. | ||
| 5811 | |||
| 5812 | 2005-02-01 Luc Teirlinck <teirllm@auburn.edu> | ||
| 5813 | |||
| 5814 | * basic.texi (Undo): Update description of `undo-outer-limit'. | ||
| 5815 | |||
| 5816 | 2005-02-01 Nick Roberts <nickrob@snap.net.nz> | ||
| 5817 | |||
| 5818 | * building.texi: Update documentation relating to GDB Graphical | ||
| 5819 | Interface. | ||
| 5820 | |||
| 5821 | 2005-01-30 Luc Teirlinck <teirllm@auburn.edu> | ||
| 5822 | |||
| 5823 | * custom.texi (Easy Customization): Adapt menu to node name change. | ||
| 5824 | |||
| 5825 | 2005-01-30 Richard M. Stallman <rms@gnu.org> | ||
| 5826 | |||
| 5827 | * custom.texi (Easy Customization): Defn of "User Option" now | ||
| 5828 | includes faces. Don't say just "option" when talking about variables. | ||
| 5829 | Do say just "options" to mean "anything customizable". | ||
| 5830 | (Specific Customization): Describe `customize-variable', | ||
| 5831 | not `customize-option'. | ||
| 5832 | |||
| 5833 | * glossary.texi (Glossary) <Faces>: Add xref. | ||
| 5834 | <User Option>: Change definition--include faces. Change xref. | ||
| 5835 | |||
| 5836 | * picture.texi (Picture): Mention artist.el. | ||
| 5837 | |||
| 5838 | * sending.texi, screen.texi, programs.texi, misc.texi: | ||
| 5839 | * mini.texi, major.texi, maintaining.texi, macos.texi: | ||
| 5840 | * help.texi, frames.texi, files.texi: | ||
| 5841 | Don't say just "option" when talking about variables. | ||
| 5842 | |||
| 5843 | * display.texi, mule.texi: Don't say just "option" when talking | ||
| 5844 | about variables. Other minor cleanups. | ||
| 5845 | |||
| 5846 | 2005-01-28 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 5847 | |||
| 5848 | * gnus.texi: Some edits based on comments from David Abrahams. | ||
| 5849 | |||
| 5850 | 2005-01-24 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 5851 | |||
| 5852 | * gnus.texi (RSS): Fix the keystroke. | ||
| 5853 | |||
| 5854 | 2005-01-26 Lute Kamstra <lute@gnu.org> | ||
| 5855 | |||
| 5856 | * cmdargs.texi (Initial Options): Add a cross reference to `Init | ||
| 5857 | File'. Mention the `-Q' option at the `--no-site-file' option. | ||
| 5858 | |||
| 5859 | 2005-01-24 David Kastrup <dak@gnu.org> | ||
| 5860 | |||
| 5861 | * faq.texi: Update AUCTeX version info. | ||
| 5862 | |||
| 5863 | 2005-01-16 Xavier Maillard <zedek@gnu-rox.org> (tiny change) | ||
| 5864 | |||
| 5865 | * gnus-faq.texi ([4.1]): Typo. | ||
| 5866 | |||
| 5867 | 2005-01-22 David Kastrup <dak@gnu.org> | ||
| 5868 | |||
| 5869 | * building.texi (Grep Searching): Mention alias `find-grep' for | ||
| 5870 | `grep-find'. | ||
| 5871 | |||
| 5872 | 2005-01-20 Richard M. Stallman <rms@gnu.org> | ||
| 5873 | |||
| 5874 | * calendar.texi (Time Intervals): Delete special stuff for MS-DOS. | ||
| 5875 | |||
| 5876 | 2005-01-19 Jay Belanger <belanger@truman.edu> | ||
| 5877 | |||
| 5878 | * calc.texi (Keep Arguments): Mention that keeping arguments | ||
| 5879 | doesn't work with keyboard macros. | ||
| 5880 | |||
| 5881 | 2005-01-16 Richard M. Stallman <rms@gnu.org> | ||
| 5882 | |||
| 5883 | * autotype.texi (Autoinserting): Fix small error. | ||
| 5884 | |||
| 5885 | 2005-01-16 Michael Albinus <michael.albinus@gmx.de> | ||
| 5886 | |||
| 5887 | Sync with Tramp 2.0.47. | ||
| 5888 | |||
| 5889 | * tramp.texi (Compilation): New section, describing compilation of | ||
| 5890 | remote files. | ||
| 5891 | |||
| 5892 | 2005-01-15 Sergey Poznyakoff <gray@Mirddin.farlep.net> | ||
| 5893 | |||
| 5894 | * rmail.texi (Movemail): Explain differences | ||
| 5895 | between standard and mailutils versions of movemail. | ||
| 5896 | Describe command line and configuration options introduced | ||
| 5897 | with the latter. | ||
| 5898 | Explain the notion of mailbox URL, provide examples and | ||
| 5899 | cross-references to mailutils documentation. | ||
| 5900 | Describe various methods of specifying mailbox names, | ||
| 5901 | user names and user passwords for rmail. | ||
| 5902 | (Remote Mailboxes): New section. Describe | ||
| 5903 | how movemail handles remote mailboxes. Describe configuration | ||
| 5904 | options used to control its behavior. | ||
| 5905 | (Other Mailbox Formats): Explain handling of various mailbox | ||
| 5906 | formats. | ||
| 5907 | |||
| 5908 | 2005-01-13 Richard M. Stallman <rms@gnu.org> | ||
| 5909 | |||
| 5910 | * commands.texi (Commands): Clarification. | ||
| 5911 | |||
| 5912 | 2005-01-11 Richard M. Stallman <rms@gnu.org> | ||
| 5913 | |||
| 5914 | * programs.texi (Multi-line Indent): Fix previous change. | ||
| 5915 | (Fortran Autofill): Simplify description of fortran-auto-fill-mode. | ||
| 5916 | |||
| 5917 | 2005-01-11 Kim F. Storm <storm@cua.dk> | ||
| 5918 | |||
| 5919 | * widget.texi (Basic Types): Add :follow-link keyword. | ||
| 5920 | |||
| 5921 | 2005-01-09 Jay Belanger <belanger@truman.edu> | ||
| 5922 | |||
| 5923 | * calc.texi (Basic Commands): Describe new behavior of calc-reset. | ||
| 5924 | |||
| 5925 | 2005-01-08 Richard M. Stallman <rms@gnu.org> | ||
| 5926 | |||
| 5927 | * display.texi (Faces): isearch-lazy-highlight-face renamed to | ||
| 5928 | lazy-highlight. | ||
| 5929 | |||
| 5930 | * search.texi (Query Replace): Mention faces query-replace | ||
| 5931 | and lazy-highlight. | ||
| 5932 | (Incremental Search): Update isearch highlighting info. | ||
| 5933 | |||
| 5934 | 2005-01-08 Jay Belanger <belanger@truman.edu> | ||
| 5935 | |||
| 5936 | * calc.texi: Change throughout to reflect new default value of | ||
| 5937 | calc-settings-file. | ||
| 5938 | |||
| 5939 | 2005-01-06 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 5940 | |||
| 5941 | * message.texi (Reply): `message-reply-to-function' should return | ||
| 5942 | a list. Suggested by ARISAWA Akihiro <ari@mbf.ocn.co.jp>. | ||
| 5943 | |||
| 5944 | 2005-01-06 Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp> (tiny change) | ||
| 5945 | |||
| 5946 | * faq.texi (Changing load-path): Fix typo. | ||
| 5947 | |||
| 5948 | 2005-01-05 Jay Belanger <belanger@truman.edu> | ||
| 5949 | |||
| 5950 | * calc.texi (Programming Tutorial): Replace kbd command by | ||
| 5951 | appropriate characters for a keyboard macro. | ||
| 5952 | |||
| 5953 | 2005-01-04 Jay Belanger <belanger@truman.edu> | ||
| 5954 | |||
| 5955 | * calc.texi (Basic Tutorial, Programming Tutorial): Remove caveats | ||
| 5956 | for Lucid Emacs. | ||
| 5957 | (Programming Tutorial): Mention that the user needs to be in the | ||
| 5958 | right mode to compute some functions. | ||
| 5959 | |||
| 5960 | 2005-01-04 Richard M. Stallman <rms@gnu.org> | ||
| 5961 | |||
| 5962 | * custom.texi (Saving Customizations): Minor improvement. | ||
| 5963 | |||
| 5964 | 2005-01-04 Jay Belanger <belanger@truman.edu> | ||
| 5965 | |||
| 5966 | * calc.texi (Rewrite rules): Remove an exercise (on 0^0) which is | ||
| 5967 | no longer applicable. | ||
| 5968 | |||
| 5969 | 2005-01-03 Luc Teirlinck <teirllm@auburn.edu> | ||
| 5970 | |||
| 5971 | * custom.texi (Saving Customizations): Emacs no longer loads | ||
| 5972 | `custom-file' after .emacs. No longer mention customizing through | ||
| 5973 | Custom. | ||
| 5974 | |||
| 5975 | 2005-01-01 Jay Belanger <belanger@truman.edu> | ||
| 5976 | |||
| 5977 | * calc.texi (Programming Tutorial): Changed description of how to | ||
| 5978 | edit keyboard macros to match current behavior. | ||
| 5979 | |||
| 5980 | 2005-01-01 Andreas Schwab <schwab@suse.de> | ||
| 5981 | |||
| 5982 | * killing.texi (Graphical Kill): Move up under node Killing, | ||
| 5983 | change @section to @subsection. | ||
| 5984 | |||
| 5985 | 2005-01-01 Richard M. Stallman <rms@gnu.org> | ||
| 5986 | |||
| 5987 | * custom.texi (Face Customization): Mention hex color specs. | ||
| 5988 | |||
| 5989 | * emacs.texi (Top): Update Killing submenu. | ||
| 5990 | |||
| 5991 | * killing.texi (Killing): Reorganize section. | ||
| 5992 | No more TeX-only text; put the node command at start of chapter. | ||
| 5993 | But the first section heading is used only in TeX. | ||
| 5994 | Rewrite the text to read better in this mode. | ||
| 5995 | (Graphical Kill): New subnode gets some of the text that | ||
| 5996 | used to be in the first section. | ||
| 5997 | |||
| 5998 | 2004-12-31 Richard M. Stallman <rms@gnu.org> | ||
| 5999 | |||
| 6000 | * dired.texi (Shell Commands in Dired): Delete the ? example. | ||
| 6001 | |||
| 6002 | * display.texi (Scrolling): Correct scroll-preserve-screen-position. | ||
| 6003 | |||
| 6004 | * files.texi (Saving): Describe new require-final-newline features | ||
| 6005 | and mode-require-final-newline. | ||
| 6006 | |||
| 6007 | 2004-12-31 Jay Belanger <belanger@truman.edu> | ||
| 6008 | |||
| 6009 | * calc.texi: Mention C-cC-c as the way to finish editing throughout. | ||
| 6010 | |||
| 6011 | 2004-12-29 Richard M. Stallman <rms@gnu.org> | ||
| 6012 | |||
| 6013 | * custom.texi (File Variables): Clarify previous change. | ||
| 6014 | |||
| 6015 | 2004-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 6016 | |||
| 6017 | * frames.texi (Dialog Boxes): Mention Gtk+ 2.6 also, as that version is | ||
| 6018 | out now. | ||
| 6019 | |||
| 6020 | 2004-12-27 Richard M. Stallman <rms@gnu.org> | ||
| 6021 | |||
| 6022 | * Makefile.in (MAKEINFO): Specify --force. | ||
| 6023 | |||
| 6024 | * basic.texi (Moving Point): C-e now runs move-end-of-line. | ||
| 6025 | (Undo): Doc undo-outer-limit. | ||
| 6026 | |||
| 6027 | 2004-12-20 Jay Belanger <belanger@truman.edu> | ||
| 6028 | |||
| 6029 | * calc.texi (Types Tutorial): Emphasize that you can't divide by | ||
| 6030 | zero. | ||
| 6031 | |||
| 6032 | 2004-12-17 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6033 | |||
| 6034 | * cc-mode.texi (Text Filling and Line Breaking): Put period after | ||
| 6035 | @xref. | ||
| 6036 | (Font Locking): Avoid @strong{Note:}. | ||
| 6037 | |||
| 6038 | 2004-12-17 Michael Albinus <michael.albinus@gmx.de> | ||
| 6039 | |||
| 6040 | Sync with Tramp 2.0.46. | ||
| 6041 | |||
| 6042 | * tramp.texi (bottom): Add arch-tag. It was lost, somehow. | ||
| 6043 | |||
| 6044 | 2004-12-16 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6045 | |||
| 6046 | * url.texi: Correct typos. | ||
| 6047 | (Retrieving URLs): @var{nil}->@code{nil}. | ||
| 6048 | (HTTP language/coding, mailto): Replace "GNU Emacs Manual" with | ||
| 6049 | the standard "The GNU Emacs Manual" in fifth argument of @xref's. | ||
| 6050 | (Dealing with HTTP documents): @inforef->@xref. | ||
| 6051 | |||
| 6052 | 2004-12-15 Juri Linkov <juri@jurta.org> | ||
| 6053 | |||
| 6054 | * mark.texi (Transient Mark, Mark Ring): M-< and other | ||
| 6055 | movement commands don't set mark in Transient Mark mode | ||
| 6056 | if mark is active. | ||
| 6057 | |||
| 6058 | 2004-12-15 Jay Belanger <belanger@truman.edu> | ||
| 6059 | |||
| 6060 | * calc.texi: Consistently capitalized all mode names. | ||
| 6061 | (Answers to Exercises): Mention that an answer can be a fraction | ||
| 6062 | when in Fraction mode. | ||
| 6063 | |||
| 6064 | 2004-12-13 Jay Belanger <belanger@truman.edu> | ||
| 6065 | |||
| 6066 | * calc.texi: Fix some TeX definitions. | ||
| 6067 | |||
| 6068 | 2004-12-12 Juri Linkov <juri@jurta.org> | ||
| 6069 | |||
| 6070 | * misc.texi (FFAP): Add C-x C-r, C-x C-v, C-x C-d, | ||
| 6071 | C-x 4 r, C-x 4 d, C-x 5 r, C-x 5 d. | ||
| 6072 | |||
| 6073 | * dired.texi (Dired Navigation): Add @r{(Dired)} to M-g. | ||
| 6074 | (Misc Dired Commands): Add @r{(Dired)} to w. | ||
| 6075 | |||
| 6076 | 2004-12-12 Juri Linkov <juri@jurta.org> | ||
| 6077 | |||
| 6078 | * mark.texi (Marking Objects): Marking commands also extend the | ||
| 6079 | region when mark is active in Transient Mark mode. | ||
| 6080 | |||
| 6081 | 2004-12-09 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6082 | |||
| 6083 | * reftex.texi (Imprint): Remove erroneous @value's. | ||
| 6084 | |||
| 6085 | 2004-12-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6086 | |||
| 6087 | * custom.texi (Saving Customizations): Emacs only loads the custom | ||
| 6088 | file automatically after the init file in version 22.1 or later. | ||
| 6089 | Adapt text and examples to this fact. | ||
| 6090 | |||
| 6091 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, $(infodir)/org) | ||
| 6092 | (org.dvi, $(infodir)/url, url.dvi, clean): Add org and url manuals. | ||
| 6093 | |||
| 6094 | 2004-12-08 Jay Belanger <belanger@truman.edu> | ||
| 6095 | |||
| 6096 | * calc.texi (Starting Calc): Remove comment about installation. | ||
| 6097 | (Keypad Mode Overview): Remove comment about Emacs 19 support. | ||
| 6098 | |||
| 6099 | 2004-12-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6100 | |||
| 6101 | * url.texi: Update @setfilename. | ||
| 6102 | (Getting Started): No need to worry about Gnus versions. | ||
| 6103 | (Dealing with HTTP documents): Use @inforef. | ||
| 6104 | |||
| 6105 | * org.texi: Fix @direntry file name. | ||
| 6106 | |||
| 6107 | 2004-12-07 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6108 | |||
| 6109 | * frames.texi (Scroll Bars): The option `scroll-bar-mode' has to | ||
| 6110 | be set through Custom. Otherwise, it has no effect. | ||
| 6111 | |||
| 6112 | 2004-12-07 Stefan <monnier@iro.umontreal.ca> | ||
| 6113 | |||
| 6114 | * url.texi: New file. | ||
| 6115 | |||
| 6116 | * Makefile.in (INFO_TARGETS, DVI_TARGETS, ../info/url, url.dvi): Add it. | ||
| 6117 | |||
| 6118 | 2004-12-06 Jay Belanger <belanger@truman.edu> | ||
| 6119 | |||
| 6120 | * calc.texi (Using Calc): Remove paragraph about installation. | ||
| 6121 | |||
| 6122 | 2004-12-06 Jay Belanger <belanger@truman.edu> | ||
| 6123 | |||
| 6124 | * calc.texi: Use more Texinfo macros and less TeX defs. | ||
| 6125 | Remove @refill's. | ||
| 6126 | |||
| 6127 | 2004-12-06 Richard M. Stallman <rms@gnu.org> | ||
| 6128 | |||
| 6129 | * org.texi: New file. | ||
| 6130 | |||
| 6131 | 2004-12-05 Richard M. Stallman <rms@gnu.org> | ||
| 6132 | |||
| 6133 | * cmdargs.texi, doclicense.texi, xresources.texi, emacs.texi: | ||
| 6134 | * entering.texi: Rename Command Line to Emacs Invocation. | ||
| 6135 | |||
| 6136 | * Makefile.in (org.dvi, ../info/org): New targets. | ||
| 6137 | (INFO_TARGETS): Add ../info/org. | ||
| 6138 | (DVI_TARGETS): Add org.dvi. | ||
| 6139 | (maintainer-clean): Remove the info files in the info dir. | ||
| 6140 | |||
| 6141 | * misc.texi (Term Mode): Correcty describe C-c. | ||
| 6142 | |||
| 6143 | * custom.texi (Easy Customization): Move up to section level, | ||
| 6144 | before Variables. Avoid using the term "variable"; say "option". | ||
| 6145 | New initial explanation. | ||
| 6146 | (Variables): In initial explanation, connect "variable" to the | ||
| 6147 | already-explained "user option". | ||
| 6148 | |||
| 6149 | * emacs.texi (Top): Fix ref to Command Line. | ||
| 6150 | Move reference to Easy Customization. | ||
| 6151 | |||
| 6152 | * xresources.texi (X Resources): Fix From link. | ||
| 6153 | |||
| 6154 | * doclicense.texi (GNU Free Documentation License): Fix To link. | ||
| 6155 | |||
| 6156 | * entering.texi (Entering Emacs): Fix xref, now to Command Line. | ||
| 6157 | |||
| 6158 | * cmdargs.texi (Command Line): Node renamed from Command Arguments. | ||
| 6159 | |||
| 6160 | 2004-12-03 Richard M. Stallman <rms@gnu.org> | ||
| 6161 | |||
| 6162 | * cmdargs.texi (Initial Options): Clarify batch mode i/o. | ||
| 6163 | |||
| 6164 | 2004-12-01 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6165 | |||
| 6166 | * kmacro.texi: Several small changes in addition to the following. | ||
| 6167 | (Keyboard Macro Ring): Describe behavior of `C-x C-k C-k' when | ||
| 6168 | defining a keyboard macro. | ||
| 6169 | Mention `kmacro-ring-max'. | ||
| 6170 | (Keyboard Macro Counter): Clarify description of | ||
| 6171 | `kmacro-insert-counter', `kmacro-set-counter', | ||
| 6172 | `kmacro-add-counter' and `kmacro-set-format'. | ||
| 6173 | |||
| 6174 | 2004-11-29 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6175 | |||
| 6176 | * custom.texi (File Variables): Add `unibyte' and make it more | ||
| 6177 | clear that `unibyte' and `coding' are special. Suggested by Simon | ||
| 6178 | Krahnke <overlord@gmx.li>. | ||
| 6179 | |||
| 6180 | * mule.texi (Enabling Multibyte): Refer to File Variables. | ||
| 6181 | Suggested by Simon Krahnke <overlord@gmx.li>. | ||
| 6182 | |||
| 6183 | 2004-11-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 6184 | |||
| 6185 | * frames.texi (Dialog Boxes): Rename use-old-gtk-file-dialog to | ||
| 6186 | x-use-old-gtk-file-dialog. | ||
| 6187 | |||
| 6188 | 2004-11-26 Eli Zaretskii <eliz@gnu.org> | ||
| 6189 | |||
| 6190 | * idlwave.texi: Fix the setfilename directive to put the produced | ||
| 6191 | file in ../info. | ||
| 6192 | (Continued Statement Indentation): Resurrect Jan D.'s change from | ||
| 6193 | 2004-11-03 that was lost when a newer version of idlwave.texi was | ||
| 6194 | imported. | ||
| 6195 | |||
| 6196 | 2004-11-20 Richard M. Stallman <rms@gnu.org> | ||
| 6197 | |||
| 6198 | * text.texi (Fill Prefix): M-q doesn't apply fill prefix to first line. | ||
| 6199 | |||
| 6200 | 2004-11-09 Lars Brinkhoff <lars@nocrew.org> | ||
| 6201 | |||
| 6202 | * building.texi (Lisp Eval): Delete hyphen in section name. | ||
| 6203 | |||
| 6204 | 2004-11-19 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 6205 | |||
| 6206 | * files.texi (Old Versions): | ||
| 6207 | No longer document annotation as "CVS only". | ||
| 6208 | |||
| 6209 | 2004-11-10 Andre Spiegel <spiegel@gnu.org> | ||
| 6210 | |||
| 6211 | * files.texi (Version Control): Rewrite the introduction about | ||
| 6212 | version systems, mentioning the new ones that we support. Thanks | ||
| 6213 | to Alex Ott, Karl Fogel, Stefan Monnier, and David Kastrup for | ||
| 6214 | suggestions. | ||
| 6215 | |||
| 6216 | 2004-12-08 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6217 | |||
| 6218 | * gnus-faq.texi ([5.1]): Added missing bracket. | ||
| 6219 | |||
| 6220 | * gnus.texi (Filtering Spam Using The Spam ELisp Package): Index | ||
| 6221 | `spam-initialize'. | ||
| 6222 | |||
| 6223 | 2004-11-22 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6224 | |||
| 6225 | * message.texi (Various Message Variables): Mention that all mail | ||
| 6226 | file variables are derived from `message-directory'. | ||
| 6227 | |||
| 6228 | * gnus.texi (Splitting Mail): Clarify bogus group. | ||
| 6229 | |||
| 6230 | 2004-11-02 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 6231 | |||
| 6232 | * emacs-mime.texi (Encoding Customization): Fix | ||
| 6233 | mm-coding-system-priorities entry. | ||
| 6234 | |||
| 6235 | 2004-11-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 6236 | |||
| 6237 | * frames.texi (Dialog Boxes): | ||
| 6238 | * idlwave.texi (Continued Statement Indentation): | ||
| 6239 | * reftex.texi (Options (Index Support)): | ||
| 6240 | (Displaying and Editing the Index, Table of Contents): | ||
| 6241 | * speedbar.texi (Creating a display, Major Display Modes): Replace | ||
| 6242 | non-nil with non-@code{nil}. | ||
| 6243 | |||
| 6244 | 2004-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 6245 | |||
| 6246 | * frames.texi (Dialog Boxes): Document use-old-gtk-file-dialog. | ||
| 6247 | |||
| 6248 | 2004-10-23 Eli Zaretskii <eliz@gnu.org> | ||
| 6249 | |||
| 6250 | * text.texi (Text Based Tables, Table Definition) | ||
| 6251 | (Table Creation, Table Recognition, Cell Commands) | ||
| 6252 | (Cell Justification, Row Commands, Column Commands) | ||
| 6253 | (Fixed Width Mode, Table Conversion, Measuring Tables) | ||
| 6254 | (Table Misc): New nodes, documenting the Table Mode. | ||
| 6255 | |||
| 6256 | 2004-10-21 Jay Belanger <belanger@truman.edu> | ||
| 6257 | |||
| 6258 | * calc.texi (Algebraic-Style Calculations): Removed a comment. | ||
| 6259 | |||
| 6260 | 2004-10-19 Jason Rumney <jasonr@gnu.org> | ||
| 6261 | |||
| 6262 | * makefile.w32-in (info): Change order of arguments to makeinfo. | ||
| 6263 | |||
| 6264 | 2004-10-19 Ulf Jasper <ulf.jasper@web.de> | ||
| 6265 | |||
| 6266 | * calendar.texi (iCalendar): Update for package changes. | ||
| 6267 | |||
| 6268 | 2004-10-18 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6269 | |||
| 6270 | * calc.texi (Reporting Bugs): Double up `@'. | ||
| 6271 | |||
| 6272 | 2004-10-18 Jay Belanger <belanger@truman.edu> | ||
| 6273 | |||
| 6274 | * calc.texi (Reporting Bugs): Changed the address that bugs | ||
| 6275 | should be sent to. | ||
| 6276 | |||
| 6277 | 2004-10-15 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6278 | |||
| 6279 | * gnus.texi (New Features): Add 5.11. | ||
| 6280 | |||
| 6281 | * message.texi (Resending): Remove wrong default value. | ||
| 6282 | |||
| 6283 | * gnus.texi (Mail Source Specifiers): Describe possible problems | ||
| 6284 | of `pop3-leave-mail-on-server'. Add `pop3-movemail' and | ||
| 6285 | `pop3-leave-mail-on-server' to the index. | ||
| 6286 | |||
| 6287 | 2004-10-15 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 6288 | |||
| 6289 | * message.texi (Canceling News): Add how to set a password. | ||
| 6290 | |||
| 6291 | 2004-10-12 Jay Belanger <belanger@truman.edu> | ||
| 6292 | |||
| 6293 | * calc.texi (Help Commands): Changed the descriptions of | ||
| 6294 | calc-describe-function and calc-describe-variable to match their | ||
| 6295 | current behavior. | ||
| 6296 | |||
| 6297 | 2004-10-12 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6298 | |||
| 6299 | * gnus-faq.texi ([5.9]): Improve code for reply-in-news. | ||
| 6300 | |||
| 6301 | 2004-10-12 Michael Albinus <michael.albinus@gmx.de> | ||
| 6302 | |||
| 6303 | Sync with Tramp 2.0.45. | ||
| 6304 | |||
| 6305 | * tramp.texi (Frequently Asked Questions): Comment paragraph about | ||
| 6306 | plink link. The URL is outdated. Originator contacted for | ||
| 6307 | clarification. | ||
| 6308 | |||
| 6309 | 2004-10-10 Juri Linkov <juri@jurta.org> | ||
| 6310 | |||
| 6311 | * gnus.texi (Top, Marking Articles): Join two menus in one node | ||
| 6312 | because a node can have only one menu. | ||
| 6313 | |||
| 6314 | 2004-10-09 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6315 | |||
| 6316 | * files.texi (Misc File Ops): View mode is a minor mode. | ||
| 6317 | |||
| 6318 | 2004-10-09 Juri Linkov <juri@jurta.org> | ||
| 6319 | |||
| 6320 | * gnus.texi (Fancy Mail Splitting): Remove backslash in the | ||
| 6321 | example of nnmail-split-fancy. | ||
| 6322 | |||
| 6323 | 2004-10-08 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 6324 | |||
| 6325 | * calendar.texi (iCalendar): Style changes. | ||
| 6326 | |||
| 6327 | 2004-10-07 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6328 | |||
| 6329 | * search.texi (Regexps): The regexp described in the example is no | ||
| 6330 | longer stored in the variable `sentence-end'. | ||
| 6331 | |||
| 6332 | 2004-10-06 Karl Berry <karl@gnu.org> | ||
| 6333 | |||
| 6334 | * info.texi (@kbd{1}--@kbd{9}): No space around --, for | ||
| 6335 | consistency with other uses of dashes. | ||
| 6336 | |||
| 6337 | 2004-10-06 Nick Roberts <nickrob@snap.net.nz> | ||
| 6338 | |||
| 6339 | * building.texi (Starting GUD): Note that multiple debugging | ||
| 6340 | sessions requires `gdb --fullname'. | ||
| 6341 | |||
| 6342 | 2004-10-05 Ulf Jasper <ulf.jasper@web.de> | ||
| 6343 | |||
| 6344 | * calendar.texi (iCalendar): New section for a new package. | ||
| 6345 | |||
| 6346 | 2004-10-05 Karl Berry <karl@gnu.org> | ||
| 6347 | |||
| 6348 | * info.texi: Consistently use --- throughout, periods at end of | ||
| 6349 | menu descriptions, and a couple typos. | ||
| 6350 | |||
| 6351 | 2004-10-05 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6352 | |||
| 6353 | * text.texi: Various small changes in addition to the following. | ||
| 6354 | (Text): Replace xref for autotype with inforef. | ||
| 6355 | (Sentences): Explain nil value for `sentence-end'. | ||
| 6356 | (Paragraphs): Update default values for `paragraph-start' and | ||
| 6357 | `paragraph-separate'. | ||
| 6358 | (Text Mode): Correct description of Text mode's effect on the | ||
| 6359 | syntax table. | ||
| 6360 | (Outline Visibility): `hide-other' does not hide top level headings. | ||
| 6361 | `selective-display-ellipses' no longer has an effect on Outline mode. | ||
| 6362 | (TeX Misc): Add missing @cindex. | ||
| 6363 | Replace xref for RefTeX with inforef. | ||
| 6364 | (Requesting Formatted Text): The variable | ||
| 6365 | `enriched-fill-after-visiting' no longer exists. | ||
| 6366 | (Editing Format Info): Update names of menu items and commands. | ||
| 6367 | (Format Faces): Mention special effect of specifying the default face. | ||
| 6368 | Describe inheritance of text properties. | ||
| 6369 | Correct description of `fixed' face. | ||
| 6370 | (Format Indentation): Correct description of effect of setting | ||
| 6371 | margins. Mention `set-left-margin' and `set-right-margin'. | ||
| 6372 | (Format Justification): Update names of menu items. | ||
| 6373 | `set-justification-full' is now bound to `M-j b'. | ||
| 6374 | Mention that `default-justification' is a per buffer variable. | ||
| 6375 | (Format Properties): Update name of menu item. | ||
| 6376 | (Forcing Enriched Mode): `format-decode-buffer' automatically | ||
| 6377 | turns on Enriched mode if the buffer is in text/enriched format. | ||
| 6378 | |||
| 6379 | 2004-10-05 Emilio C. Lopes <eclig@gmx.net> | ||
| 6380 | |||
| 6381 | * calendar.texi (From Other Calendar): Add calendar-goto-iso-week. | ||
| 6382 | |||
| 6383 | 2004-09-28 Kim F. Storm <storm@cua.dk> | ||
| 6384 | |||
| 6385 | * display.texi (Display Custom) <indicate-buffer-boundaries>: | ||
| 6386 | Align with new functionality. | ||
| 6387 | |||
| 6388 | 2004-09-26 Jesper Harder <harder@ifa.au.dk> | ||
| 6389 | |||
| 6390 | * sieve.texi (Manage Sieve API): nil -> @code{nil}. | ||
| 6391 | * pgg.texi (User Commands, Backend methods): Do. | ||
| 6392 | * gnus.texi: Markup fixes. | ||
| 6393 | (Setting Process Marks): Fix `M P a' entry. | ||
| 6394 | * emacs-mime.texi: Fixes. | ||
| 6395 | |||
| 6396 | 2004-09-23 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6397 | |||
| 6398 | * gnus-faq.texi ([5.12]): Fix code example for FQDN in Message-Ids | ||
| 6399 | again. | ||
| 6400 | Use 5.10 instead of 5.10.0. | ||
| 6401 | |||
| 6402 | 2004-09-20 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 6403 | |||
| 6404 | * gnus.texi (Summary Mail Commands): S D e. | ||
| 6405 | |||
| 6406 | 2004-09-20 Raymond Scholz <ray-2004@zonix.de> (tiny change) | ||
| 6407 | |||
| 6408 | * gnus.texi (Misc Article): Refer to `Summary Buffer Mode Line' in | ||
| 6409 | the gnus-article-mode-line-format section. | ||
| 6410 | |||
| 6411 | 2004-09-20 Helmut Waitzmann <Helmut.Waitzmann@web.de> (tiny change) | ||
| 6412 | |||
| 6413 | * gnus.texi (Various Summary Stuff): Fix the documentation for | ||
| 6414 | gnus-newsgroup-variables. | ||
| 6415 | |||
| 6416 | 2004-09-20 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6417 | |||
| 6418 | * gnus.texi (MIME Commands): Added | ||
| 6419 | gnus-mime-display-multipart-as-mixed, | ||
| 6420 | gnus-mime-display-multipart-alternative-as-mixed, | ||
| 6421 | gnus-mime-display-multipart-related-as-mixed. | ||
| 6422 | (Mail Source Customization): Clarify `mail-source-directory'. | ||
| 6423 | (Splitting Mail): Mention gnus-group-find-new-groups. | ||
| 6424 | (SpamOracle): Fixed typo. | ||
| 6425 | |||
| 6426 | * gnus-faq.texi: Untabify. | ||
| 6427 | ([6.3]): nnir.el is in contrib directory. | ||
| 6428 | |||
| 6429 | * message.texi (News Headers): Clarify how a unique ID is created. | ||
| 6430 | |||
| 6431 | * gnus.texi (Batching Agents): Fixed typo in example. Reported | ||
| 6432 | by Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp>. | ||
| 6433 | |||
| 6434 | 2004-09-20 Andre Srinivasan <andre@e2open.com> | ||
| 6435 | |||
| 6436 | * gnus.texi (Group Parameters): Added more on hooks. (Small | ||
| 6437 | change.) | ||
| 6438 | |||
| 6439 | 2004-09-20 Florian Weimer <fw@deneb.enyo.de> | ||
| 6440 | |||
| 6441 | * gnus.texi (Charsets): Point to relevant section in emacs-mime. | ||
| 6442 | |||
| 6443 | 2004-09-22 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6444 | |||
| 6445 | * display.texi (Display Custom): Remove stray `@end defvar'. | ||
| 6446 | |||
| 6447 | 2004-09-23 Kim F. Storm <storm@cua.dk> | ||
| 6448 | |||
| 6449 | * display.texi (Display Custom): Add `overflow-newline-into-fringe', | ||
| 6450 | `indicate-buffer-boundaries' and `default-indicate-buffer-boundaries'. | ||
| 6451 | |||
| 6452 | 2004-09-22 Jay Belanger <belanger@truman.edu> | ||
| 6453 | |||
| 6454 | * calc.texi (Vectors as Lists): Added a warning that the tutorial | ||
| 6455 | might be hidden during part of the session. | ||
| 6456 | |||
| 6457 | 2004-09-20 Jay Belanger <belanger@truman.edu> | ||
| 6458 | |||
| 6459 | * calc.texi (Notations Used in This Manual): Put in an earlier | ||
| 6460 | mention that DEL could be called Backspace. | ||
| 6461 | |||
| 6462 | 2004-09-20 Richard M. Stallman <rms@gnu.org> | ||
| 6463 | |||
| 6464 | * custom.texi (Hooks): Explain using setq to clear out a hook. | ||
| 6465 | (File Variables): Explain multiline string constants. | ||
| 6466 | (Non-ASCII Rebinding): Explain when you need to update | ||
| 6467 | non-ASCII char codes in .emacs. | ||
| 6468 | |||
| 6469 | * building.texi (Compilation): Explain how to make a silent | ||
| 6470 | subprocess that won't be terminated. Explain compilation-environment. | ||
| 6471 | |||
| 6472 | 2004-09-13 Kim F. Storm <storm@cua.dk> | ||
| 6473 | |||
| 6474 | * mini.texi (Repetition): Rename isearch-resume-enabled to | ||
| 6475 | isearch-resume-in-command-history and change default to disabled. | ||
| 6476 | |||
| 6477 | 2004-09-10 Simon Josefsson <jas@extundo.com> | ||
| 6478 | |||
| 6479 | * gnus.texi (IMAP): Add example. Suggested and partially written | ||
| 6480 | by Steinar Bang <sb@dod.no>. | ||
| 6481 | |||
| 6482 | 2004-09-10 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 6483 | |||
| 6484 | * gnus.texi (IMAP): Add comments about imaps synonym to imap in | ||
| 6485 | netrc syntax. | ||
| 6486 | |||
| 6487 | 2004-09-10 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 6488 | |||
| 6489 | * gnus.texi (Spam ELisp Package Sequence of Events): Some clarifications. | ||
| 6490 | (Spam ELisp Package Global Variables): More clarifications. | ||
| 6491 | |||
| 6492 | 2004-09-10 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 6493 | |||
| 6494 | * gnus.texi (Spam ELisp Package Filtering of Incoming Mail): | ||
| 6495 | Mention spam-split does not modify incoming mail. | ||
| 6496 | |||
| 6497 | 2004-09-10 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 6498 | |||
| 6499 | * gnus.texi (Spam ELisp Package Sequence of Events): Fix typo. | ||
| 6500 | |||
| 6501 | 2004-09-10 Eli Zaretskii <eliz@gnu.org> | ||
| 6502 | |||
| 6503 | * Makefile.in (../info/gnus, gnus.dvi): Depend on gnus-faq.texi. | ||
| 6504 | |||
| 6505 | 2004-09-09 Kim F. Storm <storm@cua.dk> | ||
| 6506 | |||
| 6507 | * kmacro.texi (Save Keyboard Macro): Replace `name-last-kbd-macro' | ||
| 6508 | with new `kmacro-name-last-macro'. | ||
| 6509 | |||
| 6510 | 2004-09-09 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6511 | |||
| 6512 | * makefile.w32-in (sieve, pgg): Use $(infodir). | ||
| 6513 | |||
| 6514 | 2004-09-08 Juri Linkov <juri@jurta.org> | ||
| 6515 | |||
| 6516 | * mini.texi (Minibuffer History): Add `history-delete-duplicates'. | ||
| 6517 | |||
| 6518 | 2004-09-08 Dhruva Krishnamurthy <dhruva.krishnamurthy@gmail.com> (tiny change) | ||
| 6519 | |||
| 6520 | * makefile.w32-in: Fix PGG and Sieve entries. | ||
| 6521 | |||
| 6522 | 2004-09-03 Juri Linkov <juri@jurta.org> | ||
| 6523 | |||
| 6524 | * search.texi (Incremental Search): Update wording for M-%. | ||
| 6525 | |||
| 6526 | 2004-09-02 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6527 | |||
| 6528 | * killing.texi (Killing): Correct description of kill commands in | ||
| 6529 | read-only buffer. | ||
| 6530 | |||
| 6531 | 2004-09-02 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 6532 | |||
| 6533 | * building.texi (Compilation Mode): Add a paragraph about rules | ||
| 6534 | for finding the compilation buffer for `next-error'. | ||
| 6535 | |||
| 6536 | * search.texi (Other Repeating Search): Mention that Occur mode | ||
| 6537 | supports the next-error functionality. | ||
| 6538 | |||
| 6539 | 2004-09-02 Juri Linkov <juri@jurta.org> | ||
| 6540 | |||
| 6541 | * search.texi (Regexp Replace): Add missing backslash to \footnote. | ||
| 6542 | |||
| 6543 | 2004-08-31 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6544 | |||
| 6545 | * kmacro.texi (Basic Keyboard Macro): | ||
| 6546 | `apply-macro-to-region-lines' now operates on all lines that begin | ||
| 6547 | in the region, rather than on all complete lines in the region. | ||
| 6548 | |||
| 6549 | 2004-08-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 6550 | |||
| 6551 | * frames.texi (Drag and drop): Add documentation about | ||
| 6552 | x-dnd-test-function and x-dnd-known-types. | ||
| 6553 | |||
| 6554 | 2004-08-30 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6555 | |||
| 6556 | * indent.texi: Various minor changes in addition to: | ||
| 6557 | (Indentation Commands): Correct description of `indent-relative'. | ||
| 6558 | (Tab Stops): <TAB> is no longer bound to `tab-to-tab-stop' in Text | ||
| 6559 | mode. The *Tab Stops* buffer uses Overwrite Mode. | ||
| 6560 | (Just Spaces): `tabify' converts sequences of at least two spaces | ||
| 6561 | to tabs. | ||
| 6562 | |||
| 6563 | 2004-08-28 Eli Zaretskii <eliz@gnu.org> | ||
| 6564 | |||
| 6565 | * faq.texi (Emacs for MS-DOS): Update URLs for the MS-DOS port of | ||
| 6566 | Emacs and related programs. | ||
| 6567 | |||
| 6568 | 2004-08-27 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6569 | |||
| 6570 | * frames.texi (Secondary Selection): Setting the secondary | ||
| 6571 | selection with M-Drag-Mouse-1 does not alter the kill ring, | ||
| 6572 | setting it with M-Mouse-1 and M-Mouse-3 does. | ||
| 6573 | (Mode Line Mouse): C-Mouse-2 on scroll bar now also works for | ||
| 6574 | toolkit scroll bars. | ||
| 6575 | (Scroll Bars): Ditto. | ||
| 6576 | |||
| 6577 | * windows.texi (Basic Window): When using a window system, the value | ||
| 6578 | of point in a non-selected window is indicated by a hollow box. | ||
| 6579 | (Split Window): Side by side windows are separated by a scroll bar, | ||
| 6580 | if scroll bars are used. | ||
| 6581 | C-Mouse-2 on scroll bar now also works for toolkit scroll bars. | ||
| 6582 | (Change Window): Correct Mouse-2 vs Mouse-3 mess-up. | ||
| 6583 | (Window Convenience): Update bindings for `winner-undo' and | ||
| 6584 | `winner-redo'. | ||
| 6585 | |||
| 6586 | * ack.texi (Acknowledgments): Use `@unnumbered'. | ||
| 6587 | * misc.texi : Adapt sectioning in Info to the node structure. | ||
| 6588 | (Invoking emacsclient): Make "Invoking emacsclient" a subsection | ||
| 6589 | of "Using Emacs as a Server". | ||
| 6590 | * building.texi (Building): Interchange nodes (for correct numbering). | ||
| 6591 | * programs.texi (Programs): Interchange nodes (for correct numbering). | ||
| 6592 | * killing.texi, entering.texi, commands.texi: Adapt sectioning in | ||
| 6593 | Info to the node structure. | ||
| 6594 | * emacs.texi: Make "GNU GENERAL PUBLIC LICENSE" an appendix. | ||
| 6595 | Rearrange order of nodes and sections such that both "GNU GENERAL | ||
| 6596 | PUBLIC LICENSE" and "GNU Free Documentation License" appear at the | ||
| 6597 | end, as appropriate for appendices. | ||
| 6598 | (Acknowledgments): Put inside @iftex instead of @ifnotinfo. | ||
| 6599 | Use `@unnumberedsec'. | ||
| 6600 | * trouble.texi: Adapt sectioning in Info to the node structure. | ||
| 6601 | Adapt node pointers to change in emacs.texi. | ||
| 6602 | * cmdargs.texi, doclicense.texi: Adapt node pointers. | ||
| 6603 | |||
| 6604 | 2004-08-27 Richard M. Stallman <rms@gnu.org> | ||
| 6605 | |||
| 6606 | * faq.texi: Fix texinfo usage, esp. doublequotes. | ||
| 6607 | (Difference between Emacs and XEmacs): Some clarification. | ||
| 6608 | |||
| 6609 | * faq.texi (Difference between Emacs and XEmacs): | ||
| 6610 | Explain not to contrast XEmacs with GNU Emacs. | ||
| 6611 | |||
| 6612 | 2004-08-26 Richard M. Stallman <rms@gnu.org> | ||
| 6613 | |||
| 6614 | * faq.texi (Difference between Emacs and XEmacs): Rewrite. | ||
| 6615 | |||
| 6616 | 2004-08-25 Kenichi Handa <handa@m17n.org> | ||
| 6617 | |||
| 6618 | * custom.texi (Non-ASCII Rebinding): Fix and simplify the | ||
| 6619 | description for unibyte mode. | ||
| 6620 | |||
| 6621 | 2004-08-23 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6622 | |||
| 6623 | * display.texi (Font Lock): Correct invalid (for hardcopy) @xref. | ||
| 6624 | |||
| 6625 | * search.texi (Regexps): Correct cryptic (in hardcopy) @ref. | ||
| 6626 | (Configuring Scrolling): Correct invalid (for hardcopy) @xref. | ||
| 6627 | (Regexp Replace): Standardize reference to hardcopy Elisp Manual | ||
| 6628 | in @pxref. | ||
| 6629 | |||
| 6630 | 2004-08-22 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6631 | |||
| 6632 | * kmacro.texi (Keyboard Macro Counter, Keyboard Macro Step-Edit): | ||
| 6633 | Change section names. | ||
| 6634 | |||
| 6635 | 2004-08-22 David Kastrup <dak@gnu.org> | ||
| 6636 | |||
| 6637 | * reftex.texi (AUCTeX): Update links, section name. | ||
| 6638 | |||
| 6639 | * faq.texi (Calc): Update availability (included in 22.1). | ||
| 6640 | (AUCTeX): Update availability, information, versions, description. | ||
| 6641 | |||
| 6642 | 2004-08-21 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6643 | |||
| 6644 | * kmacro.texi (Keyboard Macro Ring): Rename section. | ||
| 6645 | Emacs treats the head of the macro ring as the `last keyboard macro'. | ||
| 6646 | (Keyboard Macro Counter): Minor change. | ||
| 6647 | (Save Keyboard Macro): Some clarifications. | ||
| 6648 | (Edit Keyboard Macro): Rename section. | ||
| 6649 | |||
| 6650 | * buffers.texi (Buffers): Maximum buffer size is now 256M on | ||
| 6651 | 32-bit machines. | ||
| 6652 | (Several Buffers): Clarify which buffer is selected if `2' is | ||
| 6653 | pressed in the Buffer Menu. | ||
| 6654 | Auto Revert mode can be used to update the Buffer Menu | ||
| 6655 | automatically. | ||
| 6656 | |||
| 6657 | 2004-08-21 Eli Zaretskii <eliz@gnu.org> | ||
| 6658 | |||
| 6659 | * help.texi (Misc Help): Add an index entry for finding an Info | ||
| 6660 | manual by its file name. | ||
| 6661 | |||
| 6662 | 2004-08-20 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6663 | |||
| 6664 | * files.texi (Backup Deletion): Correct description of | ||
| 6665 | `delete-old-versions'. | ||
| 6666 | (Time Stamps): `time-stamp' needs to be added to `before-save-hook'. | ||
| 6667 | (Auto Save Files): Recommend `auto-save-mode' to reenable | ||
| 6668 | auto-saving, rather than the abbreviation `auto-save'. | ||
| 6669 | |||
| 6670 | 2004-08-17 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6671 | |||
| 6672 | * emacs.texi (Top): Mention "cutting" and "pasting" as synonyms | ||
| 6673 | for "killing" and "yanking" in main menu. | ||
| 6674 | |||
| 6675 | 2004-08-16 Richard M. Stallman <rms@gnu.org> | ||
| 6676 | |||
| 6677 | * killing.texi (Yanking, Killing): Minor cleanups. | ||
| 6678 | |||
| 6679 | * mark.texi (Momentary Mark): Minor cleanups. | ||
| 6680 | |||
| 6681 | 2004-08-15 Kenichi Handa <handa@etl.go.jp> | ||
| 6682 | |||
| 6683 | * custom.texi (Non-ASCII Rebinding): | ||
| 6684 | C-q always inserts the right code to pass to global-set-key. | ||
| 6685 | |||
| 6686 | 2004-08-14 Eli Zaretskii <eliz@gnu.org> | ||
| 6687 | |||
| 6688 | * Makefile.in (../info/tramp, tramp.dvi): Depend on trampver.texi. | ||
| 6689 | |||
| 6690 | 2004-08-13 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6691 | |||
| 6692 | * regs.texi (RegNumbers): Mention `C-x r i' binding for | ||
| 6693 | `insert-register', instead of `C-x r g' binding, for consistency. | ||
| 6694 | |||
| 6695 | 2004-08-12 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6696 | |||
| 6697 | * fixit.texi (Spelling): Fix typo. | ||
| 6698 | |||
| 6699 | 2004-08-11 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6700 | |||
| 6701 | * help.texi (Help): Fix Texinfo usage. | ||
| 6702 | |||
| 6703 | 2004-08-11 Martin Stjernholm <bug-cc-mode@gnu.org> | ||
| 6704 | |||
| 6705 | * cc-mode.texi: Various updates for CC Mode 5.30.9. | ||
| 6706 | |||
| 6707 | 2004-08-10 Michael Albinus <michael.albinus@gmx.de> | ||
| 6708 | |||
| 6709 | Sync with Tramp 2.0.44. | ||
| 6710 | |||
| 6711 | 2004-08-05 Lars Hansen <larsh@math.ku.dk> | ||
| 6712 | |||
| 6713 | * widget.texi (User Interface): Update how to separate the | ||
| 6714 | editable field of an editable-field widget from other widgets. | ||
| 6715 | (Programming Example): Add text after field. | ||
| 6716 | |||
| 6717 | 2004-07-24 Richard M. Stallman <rms@gnu.org> | ||
| 6718 | |||
| 6719 | * text.texi (Paragraphs): Update how paragraphs are separated | ||
| 6720 | and the default for paragraph-separate. | ||
| 6721 | |||
| 6722 | * search.texi (Regexp Replace): Further update text for new | ||
| 6723 | replacement operators. | ||
| 6724 | |||
| 6725 | 2004-08-31 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 6726 | |||
| 6727 | * emacs-mime.texi (Encoding Customization): Add a note to the | ||
| 6728 | mm-content-transfer-encoding-defaults entry. | ||
| 6729 | (rfc2047): Update. | ||
| 6730 | |||
| 6731 | * gnus.texi (Article Highlighting): Add | ||
| 6732 | gnus-cite-ignore-quoted-from. | ||
| 6733 | (POP before SMTP): New node. | ||
| 6734 | (Posting Styles): Addition. | ||
| 6735 | (Splitting Mail): Add nnmail-split-lowercase-expanded. | ||
| 6736 | (Fancy Mail Splitting): Ditto. | ||
| 6737 | (X-Face): Add gnus-x-face. | ||
| 6738 | |||
| 6739 | 2004-08-30 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6740 | |||
| 6741 | * emacs-mime.texi, gnus-faq.texi, gnus.texi, message.texi, | ||
| 6742 | * pgg.texi, sieve.texi: Use @copying and @insertcopying. | ||
| 6743 | |||
| 6744 | 2004-08-22 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6745 | |||
| 6746 | * gnus.texi (Mail Source Specifiers): Describe | ||
| 6747 | `pop3-leave-mail-on-server'. | ||
| 6748 | |||
| 6749 | 2004-08-02 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 6750 | |||
| 6751 | * Makefile.in, makefile.w32-in: Added PGG and Sieve files. | ||
| 6752 | |||
| 6753 | * pgg.texi, sieve.texi: Import from the v5_10 branch of the Gnus | ||
| 6754 | repository. Change setfilename. | ||
| 6755 | |||
| 6756 | * emacs-mime.texi, gnus-faq.texi, gnus.texi, message.texi: Ditto. | ||
| 6757 | |||
| 6758 | 2004-07-18 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6759 | |||
| 6760 | * emacs-xtra.texi (Subdir switches): Dired does not remember the | ||
| 6761 | `R' switch. | ||
| 6762 | |||
| 6763 | * dired.texi (Dired Updating): `k' only deletes inserted | ||
| 6764 | subdirectories from the Dired buffer if a prefix argument was given. | ||
| 6765 | |||
| 6766 | * search.texi (Regexps): Delete redundant definition of `symbol' in | ||
| 6767 | description of `\_>'. It already occurs in the description of `\_<'. | ||
| 6768 | |||
| 6769 | 2004-07-02 Juri Linkov <juri@jurta.org> | ||
| 6770 | |||
| 6771 | * pcl-cvs.texi (Viewing differences): Add `d r'. | ||
| 6772 | |||
| 6773 | 2004-07-01 Juri Linkov <juri@jurta.org> | ||
| 6774 | |||
| 6775 | * search.texi (Incremental Search): Add C-M-w, C-M-y, M-%, C-M-%, M-e. | ||
| 6776 | (Regexp Search): Add M-r. | ||
| 6777 | |||
| 6778 | 2004-06-30 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6779 | |||
| 6780 | * makefile.w32-in (EMACSSOURCES): Remove emacs-xtra. | ||
| 6781 | |||
| 6782 | 2004-06-29 Jesper Harder <harder@ifa.au.dk> | ||
| 6783 | |||
| 6784 | * ses.texi, viper.texi, search.texi, flymake.texi, faq.texi: | ||
| 6785 | * eshell.texi, ediff.texi, calendar.texi: Markup fixes. | ||
| 6786 | |||
| 6787 | 2004-06-25 Richard M. Stallman <rms@gnu.org> | ||
| 6788 | |||
| 6789 | * search.texi (Regexp Replace): Rewrite description of \# \, and \?. | ||
| 6790 | |||
| 6791 | 2004-06-25 David Kastrup <dak@gnu.org> | ||
| 6792 | |||
| 6793 | * search.texi (Regexp Replace): Some typo corrections and | ||
| 6794 | rearrangement. | ||
| 6795 | |||
| 6796 | 2004-06-24 David Kastrup <dak@gnu.org> | ||
| 6797 | |||
| 6798 | * search.texi (Unconditional Replace): Use replace-string instead | ||
| 6799 | of query-replace in example. | ||
| 6800 | (Regexp Replace): Add explanations for `\,', `\#' and `\?' | ||
| 6801 | sequences. | ||
| 6802 | (Query Replace): Correct explanation of `^' which does not use | ||
| 6803 | the mark stack. | ||
| 6804 | |||
| 6805 | 2004-06-21 Nick Roberts <nickrob@gnu.org> | ||
| 6806 | |||
| 6807 | * misc.texi (Shell History Copying): Document comint-insert-input. | ||
| 6808 | (Shell Ring): Describe comint-dynamic-list-input-ring here. | ||
| 6809 | |||
| 6810 | 2004-06-21 Karl Berry <karl@gnu.org> | ||
| 6811 | |||
| 6812 | * info.texi (Top): Mention that only Emacs has mouse support. | ||
| 6813 | (Getting Started): Mention this in a few other places. | ||
| 6814 | |||
| 6815 | 2004-06-20 Jesper Harder <harder@ifa.au.dk> | ||
| 6816 | |||
| 6817 | * msdog.texi (Text and Binary, MS-DOS Printing): Use m-dash. | ||
| 6818 | * custom.texi (Customization): Do. | ||
| 6819 | * anti.texi (Antinews): Do. | ||
| 6820 | * abbrevs.texi (Defining Abbrevs): Do. | ||
| 6821 | |||
| 6822 | * programs.texi (Info Lookup): Fix keybinding for | ||
| 6823 | info-lookup-symbol. | ||
| 6824 | |||
| 6825 | 2004-06-16 Juanma Barranquero <lektu@terra.es> | ||
| 6826 | |||
| 6827 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, EMACSSOURCES): | ||
| 6828 | Add emacs-xtra. | ||
| 6829 | ($(infodir)/emacs-xtra, emacs-xtra.dvi): New dependencies. | ||
| 6830 | (clean): Add emacs-xtra and flymake. Remove redundancies. | ||
| 6831 | |||
| 6832 | 2004-06-15 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6833 | |||
| 6834 | * Makefile.in (INFO_TARGETS, DVI_TARGETS, ../info/emacs-xtra): | ||
| 6835 | Add emacs-xtra. | ||
| 6836 | * emacs-xtra.texi: New file. | ||
| 6837 | |||
| 6838 | 2004-06-14 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6839 | |||
| 6840 | * dired.texi (Dired Enter): Mention conditions on `ls' switches. | ||
| 6841 | (Dired and Find): Mention differences with ordinary Dired buffers. | ||
| 6842 | |||
| 6843 | 2004-06-13 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6844 | |||
| 6845 | * autotype.texi (Copyrights, Timestamps): Recommend | ||
| 6846 | `before-save-hook' instead of `write-file-functions'. | ||
| 6847 | |||
| 6848 | 2004-06-13 Richard M. Stallman <rms@gnu.org> | ||
| 6849 | |||
| 6850 | * custom.texi (Init Syntax): Explain about vars that do special | ||
| 6851 | things when set with setq or with Custom. | ||
| 6852 | (Init Examples): Add line-number-mode example. | ||
| 6853 | |||
| 6854 | 2004-06-13 Lars Hansen <larsh@math.ku.dk> | ||
| 6855 | |||
| 6856 | * dired-x.texi (dired-mark-omitted): Update keybinding. | ||
| 6857 | |||
| 6858 | 2004-06-12 Juri Linkov <juri@jurta.org> | ||
| 6859 | |||
| 6860 | * dired.texi (Operating on Files): Add dired-do-touch. | ||
| 6861 | |||
| 6862 | 2004-06-10 Kim F. Storm <storm@cua.dk> | ||
| 6863 | |||
| 6864 | * pcl-cvs.texi (Viewing differences): Add 'd y'. | ||
| 6865 | |||
| 6866 | 2004-06-10 Juri Linkov <juri@jurta.org> | ||
| 6867 | |||
| 6868 | * building.texi (Lisp Eval): Add C-M-x on defface. | ||
| 6869 | |||
| 6870 | 2004-06-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6871 | |||
| 6872 | * files.texi (Reverting): Auto-Revert mode and | ||
| 6873 | Global Auto-Revert mode no longer revert remote files. | ||
| 6874 | |||
| 6875 | 2004-06-05 Lars Hansen <larsh@math.ku.dk> | ||
| 6876 | |||
| 6877 | * dired-x.texi (variable dired-omit-mode): Rename from | ||
| 6878 | dired-omit-files-p. | ||
| 6879 | (function dired-omit-mode): Rename from dired-omit-toggle. | ||
| 6880 | Call dired-omit-mode rather than set dired-omit-files-p. | ||
| 6881 | (dired-mark-omitted): Describe command. | ||
| 6882 | |||
| 6883 | 2004-05-29 Michael Albinus <michael.albinus@gmx.de> | ||
| 6884 | |||
| 6885 | Version 2.0.41 of Tramp released. | ||
| 6886 | |||
| 6887 | 2004-05-29 Juanma Barranquero <lektu@terra.es> | ||
| 6888 | |||
| 6889 | * makefile.w32-in (../info/flymake, flymake.dvi): New targets. | ||
| 6890 | (INFO_TARGETS, DVI_TARGETS): Add Flymake. | ||
| 6891 | |||
| 6892 | 2004-05-29 Richard M. Stallman <rms@gnu.org> | ||
| 6893 | |||
| 6894 | * custom.texi (Init File): Two dashes start --no-site-file. | ||
| 6895 | |||
| 6896 | * cl.texi (Top): Call this chapter `Introduction'. | ||
| 6897 | (Overview): In TeX, no section heading here. | ||
| 6898 | |||
| 6899 | * cc-mode.texi: Put commas after i.e. and e.g. Minor cleanups. | ||
| 6900 | |||
| 6901 | 2004-05-29 Alan Mackenzie <acm@muc.de> | ||
| 6902 | |||
| 6903 | * programs.texi: Update for CC Mode 5.30 and incidental amendments. | ||
| 6904 | ("AWK"): Is consistently thus spelt throughout. | ||
| 6905 | (AWK, Pike): Document as "C-like modes". | ||
| 6906 | (@kbd{M-j}): Document as alternative to @kbd{C-M-j}. | ||
| 6907 | (M-x man): Supersedes M-x manual-entry. | ||
| 6908 | Add numerous index entries. Correct "ESC a/e" to "M-a/e". | ||
| 6909 | |||
| 6910 | ("Comments in C"): Delete node; the info is in CC Mode manual. | ||
| 6911 | (c-comment-only-line-offset): Remove description. | ||
| 6912 | |||
| 6913 | (C-c ., C-c C-c): Describe new C Mode bindings. | ||
| 6914 | |||
| 6915 | (C-u TAB, indent-code-rigidly, c-indent-exp, c-tab-always-indent) | ||
| 6916 | (@dfn{Style}, c-default-style, comment-column, comment-padding) | ||
| 6917 | (c-up-conditional, c-beginning-of-statement, c-end-of-statement): | ||
| 6918 | Amend definitions. | ||
| 6919 | |||
| 6920 | (c-beginning-of-defun, c-end-of-defun, c-context-line-break): | ||
| 6921 | Describe functions. | ||
| 6922 | |||
| 6923 | (c-comment-start-regexp, c-hanging-comment-ender-p) | ||
| 6924 | (c-hanging-comment-starter-p): Remove obsolete definitions. | ||
| 6925 | |||
| 6926 | * emacs.texi: Remove the menu entry "Comments in C". | ||
| 6927 | |||
| 6928 | 2004-05-29 Eli Zaretskii <eliz@gnu.org> | ||
| 6929 | |||
| 6930 | * Makefile.in (../info/flymake, flymake.dvi): New targets. | ||
| 6931 | (INFO_TARGETS, DVI_TARGETS): Add Flymake. | ||
| 6932 | |||
| 6933 | 2004-05-29 Pavel Kobiakov <pk_at_work@yahoo.com> | ||
| 6934 | |||
| 6935 | * flymake.texi: New file. | ||
| 6936 | |||
| 6937 | 2004-05-28 Simon Josefsson <jas@extundo.com> | ||
| 6938 | |||
| 6939 | * smtpmail.texi (Authentication): Improve STARTTLS discussion. | ||
| 6940 | |||
| 6941 | 2004-05-27 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6942 | |||
| 6943 | * dired.texi (Dired and Find): `find-ls-option' does not apply to | ||
| 6944 | `M-x locate'. | ||
| 6945 | |||
| 6946 | 2004-05-16 Karl Berry <karl@gnu.org> | ||
| 6947 | |||
| 6948 | * emacs.texi (ack.texi) [@ifnottex]: Change condition; with @ifinfo, | ||
| 6949 | makeinfo --html fails. | ||
| 6950 | * help.texi (Help Summary) [@ifnottex]: Likewise. | ||
| 6951 | |||
| 6952 | 2004-05-13 Nick Roberts <nickrob@gnu.org> | ||
| 6953 | |||
| 6954 | * building.texi (GDB Graphical Interface): Update and describe | ||
| 6955 | layout first. | ||
| 6956 | |||
| 6957 | 2004-05-07 Kai Grossjohann <kai@emptydomain.de> | ||
| 6958 | |||
| 6959 | Version 2.0.40 of Tramp released. | ||
| 6960 | |||
| 6961 | 2004-04-25 Michael Albinus <Michael.Albinus@alcatel.de> | ||
| 6962 | |||
| 6963 | Complete rework, based on review by Karl Berry <karl@gnu.org>. | ||
| 6964 | |||
| 6965 | * tramp.texi (Auto-save and Backup): Explain exploitation of new | ||
| 6966 | variables `tramp-backup-directory-alist' and | ||
| 6967 | `tramp-bkup-backup-directory-info'. | ||
| 6968 | (Overview, Connection types) | ||
| 6969 | (External transfer methods, Default Method) | ||
| 6970 | (Windows setup hints): Remove restriction of password entering | ||
| 6971 | with external methods. | ||
| 6972 | (Auto-save and Backup): Make file name example | ||
| 6973 | (X)Emacs neutral. In case of XEmacs, `bkup-backup-directory-info' | ||
| 6974 | and `auto-save-directory' must be used. | ||
| 6975 | (Frequently Asked Questions): Use "MS Windows NT/2000/XP" (not | ||
| 6976 | only "NT"). Remove doubled entry "What kinds of systems does | ||
| 6977 | @tramp{} work on". | ||
| 6978 | (tramp): Macro removed. | ||
| 6979 | (Obtaining Tramp): Flag removed from title. | ||
| 6980 | (all): "tramp-" and "-" removed from flag names. Flags `tramp' | ||
| 6981 | and `trampver' used properly. Flag `tramp-inst' replaced by | ||
| 6982 | `installchapter'. Installation related text adapted. | ||
| 6983 | |||
| 6984 | 2004-05-04 Jason Rumney <jasonr@gnu.org> | ||
| 6985 | |||
| 6986 | * makefile.w32-in: Revert last change. | ||
| 6987 | |||
| 6988 | 2004-05-03 Jason Rumney <jasonr@gnu.org> | ||
| 6989 | |||
| 6990 | * makefile.w32-in (MULTI_INSTALL_INFO, ENVADD): Use forward slashes. | ||
| 6991 | |||
| 6992 | 2004-04-28 Masatake YAMATO <jet@gyve.org> | ||
| 6993 | |||
| 6994 | * widget.texi (Programming Example): Remove overlays. | ||
| 6995 | |||
| 6996 | 2004-04-27 Jesper Harder <harder@ifa.au.dk> | ||
| 6997 | |||
| 6998 | * faq.texi, viper.texi, dired-x.texi, autotype.texi: lisp -> Lisp. | ||
| 6999 | |||
| 7000 | 2004-04-23 Juanma Barranquero <lektu@terra.es> | ||
| 7001 | |||
| 7002 | * makefile.w32-in: Add "-*- makefile -*-" mode tag. | ||
| 7003 | |||
| 7004 | 2004-04-18 Juri Linkov <juri@jurta.org> | ||
| 7005 | |||
| 7006 | * fixit.texi (Spelling): Remove file extension from ispell xref. | ||
| 7007 | |||
| 7008 | 2004-04-15 Kim F. Storm <storm@cua.dk> | ||
| 7009 | |||
| 7010 | * cmdargs.texi (Initial Options): Add -Q. | ||
| 7011 | |||
| 7012 | 2004-04-05 Kim F. Storm <storm@cua.dk> | ||
| 7013 | |||
| 7014 | * custom.texi (File Variables): Add safe-local-eval-forms. | ||
| 7015 | |||
| 7016 | 2004-04-05 Jesper Harder <harder@ifa.au.dk> | ||
| 7017 | |||
| 7018 | * info.texi (Info Search): Add info-apropos. | ||
| 7019 | |||
| 7020 | 2004-04-02 Luc Teirlinck <teirllm@auburn.edu> | ||
| 7021 | |||
| 7022 | * files.texi (Reverting): Correct description of revert-buffer's | ||
| 7023 | handling of point. | ||
| 7024 | |||
| 7025 | 2004-03-22 Juri Linkov <juri@jurta.org> | ||
| 7026 | |||
| 7027 | * emacs.texi (Top): Add `Misc X'. | ||
| 7028 | |||
| 7029 | * faq.texi, trouble.texi: Fix help key bindings. | ||
| 7030 | |||
| 7031 | * glossary.texi: Improve references. | ||
| 7032 | |||
| 7033 | * help.texi: Sync keywords with finder.el. | ||
| 7034 | |||
| 7035 | * mini.texi (Completion): Add description for menu items. | ||
| 7036 | |||
| 7037 | * misc.texi (Browse-URL, FFAP): Add information about keywords. | ||
| 7038 | |||
| 7039 | * sending.texi (Mail Methods): Fix xref to Message manual. | ||
| 7040 | |||
| 7041 | 2004-03-17 Luc Teirlinck <teirllm@auburn.edu> | ||
| 7042 | |||
| 7043 | * info.texi (Advanced): Replace @unnumberedsubsec by @subheading | ||
| 7044 | (as suggested by Karl Berry). Update information about colored | ||
| 7045 | stars in menus. Add new subheading describing M-n. | ||
| 7046 | |||
| 7047 | 2004-03-12 Richard M. Stallman <rms@gnu.org> | ||
| 7048 | |||
| 7049 | * cl.texi (Top): Rename top node's title. | ||
| 7050 | |||
| 7051 | * buffers.texi (Misc Buffer): Add index entry for rename-uniquely. | ||
| 7052 | |||
| 7053 | 2004-03-08 Karl Berry <karl@gnu.org> | ||
| 7054 | |||
| 7055 | * info.texi: \input texinfo.tex instead of just texinfo, to avoid | ||
| 7056 | problems making the texinfo distribution. | ||
| 7057 | |||
| 7058 | 2004-03-04 Richard M. Stallman <rms@gnu.org> | ||
| 7059 | |||
| 7060 | * search.texi (Regexps): Explain that ^ and $ have their | ||
| 7061 | special meanings only in certain contexts. | ||
| 7062 | |||
| 7063 | * programs.texi (Expressions): Doc C-M-SPC as alias for C-M-@. | ||
| 7064 | |||
| 7065 | * mule.texi (Specify Coding): Doc C-x RET F. | ||
| 7066 | |||
| 7067 | * buffers.texi (Misc Buffer): Explain use of M-x rename-uniquely | ||
| 7068 | for multiple compile and grep buffers. | ||
| 7069 | (Indirect Buffers): Don't recommand clone-indirect-buffer | ||
| 7070 | for multiple compile and grep buffers. | ||
| 7071 | |||
| 7072 | 2004-02-29 Simon Josefsson <jas@extundo.com> | ||
| 7073 | |||
| 7074 | * smtpmail.texi (Authentication): Changed the list of supported | ||
| 7075 | authentication mechanisms from CRAM-MD5, PLAIN and LOGIN-MD5 to | ||
| 7076 | CRAM-MD5 and LOGIN, tiny patch from Andreas Voegele | ||
| 7077 | <voegelas@gmx.net>. | ||
| 7078 | |||
| 7079 | 2004-02-29 Juanma Barranquero <lektu@terra.es> | ||
| 7080 | |||
| 7081 | * makefile.w32-in (mostlyclean, clean, maintainer-clean): | ||
| 7082 | Use $(DEL) instead of rm, and ignore exit code. | ||
| 7083 | |||
| 7084 | 2004-02-29 Kai Grossjohann <kgrossjo@eu.uu.net> | ||
| 7085 | |||
| 7086 | Tramp version 2.0.39 released. | ||
| 7087 | |||
| 7088 | 2004-02-29 Michael Albinus <Michael.Albinus@alcatel.de> | ||
| 7089 | |||
| 7090 | * tramp.texi (Customizing Completion): Explain new functions | ||
| 7091 | `tramp-parse-shostkeys' and `tramp-parse-sknownhosts'. | ||
| 7092 | (all): Savannah URLs unified to "http://savannah.nongnu.org". | ||
| 7093 | (Top): Refer to Savannah mailing list as the major one. Mention | ||
| 7094 | older mailing lists in HTML mode only. | ||
| 7095 | (Auto-save and Backup): Add auto-save. Based on wording of Kai. | ||
| 7096 | (Frequently Asked Questions): Remote hosts must not be Unix-like | ||
| 7097 | for "smb" method. | ||
| 7098 | (Password caching): New node. | ||
| 7099 | (External transfer methods): Refer to password caching for "smb" | ||
| 7100 | method. | ||
| 7101 | |||
| 7102 | 2004-02-23 Nick Roberts <nick@nick.uklinux.net> | ||
| 7103 | |||
| 7104 | * building.texi (Watch Expressions): Update. | ||
| 7105 | |||
| 7106 | 2004-02-21 Juri Linkov <juri@jurta.org> | ||
| 7107 | |||
| 7108 | * cmdargs.texi (Action Arguments): Add alias --find-file. Add | ||
| 7109 | --directory, --help, --version. Move text about command-line-args | ||
| 7110 | to Command Arguments. | ||
| 7111 | (Initial Options): Add @cindex for --script. Fix @cindex for -q. | ||
| 7112 | Add --no-desktop. Add alias --no-multibyte, --no-unibyte. | ||
| 7113 | (Window Size X): Join -g and --geometry. Add @cindex. | ||
| 7114 | (Borders X): Fix @cindex for -ib. Add @cindex for -bw. | ||
| 7115 | (Title X): Remove alias -title. | ||
| 7116 | (Misc X): New node. | ||
| 7117 | |||
| 7118 | 2004-02-17 Karl Berry <karl@gnu.org> | ||
| 7119 | |||
| 7120 | * info.texi (Help-Int): Mention the new line number feature. | ||
| 7121 | |||
| 7122 | 2004-02-15 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 7123 | |||
| 7124 | * frames.texi (Drag and drop): Add Motif to list of supported | ||
| 7125 | protocols. | ||
| 7126 | |||
| 7127 | 2004-02-14 Jonathan Yavner <jyavner@member.fsf.org> | ||
| 7128 | |||
| 7129 | * ses.texi (Advanced Features): New functionality for | ||
| 7130 | ses-set-header-row (defaults to current row unless C-u used). | ||
| 7131 | (Acknowledgements): Add Stefan Monnier. | ||
| 7132 | |||
| 7133 | 2004-02-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 7134 | |||
| 7135 | * frames.texi (Drag and drop): New section. | ||
| 7136 | |||
| 7137 | 2004-01-24 Richard M. Stallman <rms@gnu.org> | ||
| 7138 | |||
| 7139 | * emacs.texi (Acknowledgments): Renamed from Acknowledgements. | ||
| 7140 | Include it only @ifnotinfo. Patch the preceding and following | ||
| 7141 | node headers to point to each other. | ||
| 7142 | |||
| 7143 | 2004-01-11 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 7144 | |||
| 7145 | * calendar.texi (Appointments): Update section. | ||
| 7146 | |||
| 7147 | 2003-12-29 Kevin Ryde <user42@zip.com.au> | ||
| 7148 | |||
| 7149 | * viper.texi (Vi Macros): Fix reference to the Emacs manual. | ||
| 7150 | |||
| 7151 | * programs.texi (C Modes): Fix the xref. | ||
| 7152 | |||
| 7153 | 2003-12-23 Nick Roberts <nick@nick.uklinux.net> | ||
| 7154 | |||
| 7155 | * building.texi (Watch Expressions): Update. | ||
| 7156 | (Commands of GUD): Include use of toolbar + breakpoints set from | ||
| 7157 | fringe/margin. | ||
| 7158 | |||
| 7159 | 2003-12-03 Andre Spiegel <spiegel@gnu.org> | ||
| 7160 | |||
| 7161 | * files.texi: Say how to disable VC. Suggested by Alan Mackenzie | ||
| 7162 | <acm@muc.de>. | ||
| 7163 | |||
| 7164 | 2003-11-30 Kai Grossjohann <kai.grossjohann@gmx.net> | ||
| 7165 | |||
| 7166 | Tramp version 2.0.38 released. | ||
| 7167 | |||
| 7168 | * tramp.texi (Remote shell setup): Warn of environment variables | ||
| 7169 | FRUMPLE if user frumple exists. Suggested by Sven Gabriel | ||
| 7170 | <sven.gabriel@imk.fzk.de>. | ||
| 7171 | (Configuration): Tramp now chooses base64/uuencode | ||
| 7172 | automatically. Update wording accordingly. | ||
| 7173 | (Top): More description for the `Default Method' menu entry. | ||
| 7174 | (Default Method): Use @code, not @var, for Lisp variables. | ||
| 7175 | (Default Method): New subsection `Which method is the right one | ||
| 7176 | for me?' Suggested by Christian Kirsch. | ||
| 7177 | (Configuration): Pointer to new subsection added. | ||
| 7178 | (Default Method): Too many "use" in one sentence. | ||
| 7179 | Rephrase. Reported by Christian Kirsch. | ||
| 7180 | (Filename Syntax): Old `su' example is probably a left-over from | ||
| 7181 | the sm/su method naming. Replace with `ssh', instead. | ||
| 7182 | (External transfer methods, Auto-save and Backup): | ||
| 7183 | Typo fixes. | ||
| 7184 | |||
| 7185 | 2003-11-02 Michael Albinus <Michael.Albinus@alcatel.de> | ||
| 7186 | |||
| 7187 | * tramp.texi (all): Harmonize all occurences of @tramp{}. | ||
| 7188 | (Top): Mention japanese manual only if flag `jamanual' is set. | ||
| 7189 | Insert section `Japanese manual' in menu. | ||
| 7190 | |||
| 7191 | 2003-11-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 7192 | |||
| 7193 | * frames.texi (Dialog Boxes): Add use-file-dialog. | ||
| 7194 | |||
| 7195 | 2003-11-26 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 7196 | |||
| 7197 | * eshell.texi (Known Problems): Add doc item. | ||
| 7198 | |||
| 7199 | 2003-11-22 Martin Stjernholm <bug-cc-mode@gnu.org> | ||
| 7200 | |||
| 7201 | * ack.texi: Note that Alan Mackenzie contributed the AWK support | ||
| 7202 | in CC Mode. | ||
| 7203 | |||
| 7204 | 2003-11-22 Martin Stjernholm <bug-cc-mode@gnu.org> | ||
| 7205 | |||
| 7206 | * cc-mode.texi: Update for CC Mode 5.30. | ||
| 7207 | |||
| 7208 | Note: Please refrain from doing purely cosmetic changes like | ||
| 7209 | removing trailing whitespace in this manual; it clobbers cvs | ||
| 7210 | merging for no good reason. | ||
| 7211 | |||
| 7212 | 2003-11-02 Jesper Harder <harder@ifa.au.dk> (tiny change) | ||
| 7213 | |||
| 7214 | * man/ack.texi, man/basic.texi, man/cmdargs.texi: | ||
| 7215 | * man/commands.texi, man/custom.texi, man/display.texi: | ||
| 7216 | * man/ediff.texi, man/emacs.texi, man/faq.texi, man/files.texi: | ||
| 7217 | * man/frames.texi, man/glossary.texi, man/killing.texi: | ||
| 7218 | * man/macos.texi, man/mark.texi, man/misc.texi, man/msdog.texi: | ||
| 7219 | * man/mule.texi, man/rmail.texi, man/search.texi: | ||
| 7220 | * man/sending.texi, man/text.texi, man/tramp.texi: | ||
| 7221 | * man/trouble.texi, man/vip.texi, man/viper.texi, man/widget.texi: | ||
| 7222 | * man/woman.texi: Replace @sc{ascii} and ASCII with @acronym{ASCII}. | ||
| 7223 | |||
| 7224 | 2003-11-01 Alan Mackenzie <acm@muc.de> | ||
| 7225 | |||
| 7226 | * search.texi (Scrolling During Incremental Search): Document a | ||
| 7227 | new scrolling facility in isearch mode. | ||
| 7228 | |||
| 7229 | 2003-10-26 Karl Berry <karl@gnu.org> | ||
| 7230 | |||
| 7231 | * info.texi (Info Search): Echo area, not echo are. From Debian | ||
| 7232 | diff. | ||
| 7233 | |||
| 7234 | 2003-10-26 Per Abrahamsen <abraham@dina.kvl.dk> | ||
| 7235 | |||
| 7236 | * widget.texi (Defining New Widgets): Document new beavior of | ||
| 7237 | :buttons and :children keywords. | ||
| 7238 | |||
| 7239 | 2003-10-22 Miles Bader <miles@gnu.org> | ||
| 7240 | |||
| 7241 | * Makefile.in (info): Move before $(top_srcdir)/info. | ||
| 7242 | |||
| 7243 | 2003-10-22 Nick Roberts <nick@nick.uklinux.net> | ||
| 7244 | |||
| 7245 | * building.texi (Watch Expressions): Update section on data display | ||
| 7246 | to reflect code changes (GDB Graphical Interface). | ||
| 7247 | |||
| 7248 | 2003-10-17 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 7249 | |||
| 7250 | * tramp.texi (Inline methods): Small grammar fix. | ||
| 7251 | (External transfer methods): Likewise. | ||
| 7252 | |||
| 7253 | 2003-10-13 Richard M. Stallman <rms@gnu.org> | ||
| 7254 | |||
| 7255 | * xresources.texi (GTK resources): Clean up previous change. | ||
| 7256 | |||
| 7257 | 2003-10-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 7258 | |||
| 7259 | * xresources.texi (GTK resources): Add a note that some themes | ||
| 7260 | disallow customizations. Add scroll theme example. | ||
| 7261 | |||
| 7262 | 2003-10-08 Nick Roberts <nick@nick.uklinux.net> | ||
| 7263 | |||
| 7264 | * speedbar.texi: Remove paragraph for GUD that is no longer true. | ||
| 7265 | |||
| 7266 | 2003-10-06 Luc Teirlinck <teirllm@auburn.edu> | ||
| 7267 | |||
| 7268 | * texinfo.tex: Replace `%' in arch tagline by @ignore. | ||
| 7269 | |||
| 7270 | 2003-09-30 Richard M. Stallman <rms@gnu.org> | ||
| 7271 | |||
| 7272 | * dired-x.texi (Miscellaneous Commands): Delete M-g, w, T. | ||
| 7273 | |||
| 7274 | * widget.texi (User Interface): Fix typos. | ||
| 7275 | |||
| 7276 | * pcl-cvs.texi, cl.texi, woman.texi, ediff.texi: Fix @strong{Note:}. | ||
| 7277 | |||
| 7278 | * cmdargs.texi (General Variables): Remove MAILRC envvar. | ||
| 7279 | |||
| 7280 | * misc.texi (Saving Emacs Sessions): Shorten the section, | ||
| 7281 | collapsing back into one node. | ||
| 7282 | |||
| 7283 | 2003-09-30 Lars Hansen <larsh@math.ku.dk> | ||
| 7284 | |||
| 7285 | * misc.texi: Section "Saving Emacs Sessions" rewritten. | ||
| 7286 | |||
| 7287 | 2003-09-29 Jan Dj,Ad(Brv. <jan.h.d@swipnet.se> | ||
| 7288 | |||
| 7289 | * xresources.texi (GTK names in Emacs): Correct typo. | ||
| 7290 | |||
| 7291 | 2003-09-29 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 7292 | |||
| 7293 | * pcl-cvs.texi (Selected Files): Fix typo. | ||
| 7294 | |||
| 7295 | 2003-09-24 Luc Teirlinck <teirllm@mail.auburn.edu> | ||
| 7296 | |||
| 7297 | * cmdargs.texi (Font X): Mention new default font. More | ||
| 7298 | fully describe long font names, wildcard patterns and the | ||
| 7299 | problems involved. (Result of discussion on emacs-devel.) | ||
| 7300 | |||
| 7301 | 2003-09-22 Luc Teirlinck <teirllm@mail.auburn.edu> | ||
| 7302 | |||
| 7303 | * emacs.texi (Acknowledgements): Correct typo. | ||
| 7304 | |||
| 7305 | 2003-09-22 Richard M. Stallman <rms@gnu.org> | ||
| 7306 | |||
| 7307 | * dired.texi (Misc Dired Commands): New node. | ||
| 7308 | (Dired Navigation): Add dired-goto-file. | ||
| 7309 | |||
| 7310 | * files.texi (File Aliases, Misc File Ops): Add @cindex entries. | ||
| 7311 | |||
| 7312 | * emacs.texi (Acknowledgements): New node, split from Distribution. | ||
| 7313 | |||
| 7314 | * cmdargs.texi (Action Arguments): -f reads interactive args. | ||
| 7315 | |||
| 7316 | 2003-09-21 Karl Berry <karl@gnu.org> | ||
| 7317 | |||
| 7318 | * info.texi (] and [ commands): No period at end of section title. | ||
| 7319 | |||
| 7320 | 2003-09-08 Lute Kamstra <lute@gnu.org> | ||
| 7321 | |||
| 7322 | * screen.texi (Mode Line): Say that POS comes before LINE. | ||
| 7323 | Mention `size-indication-mode'. | ||
| 7324 | * display.texi (Optional Mode Line): Document | ||
| 7325 | `size-indication-mode'. | ||
| 7326 | * basic.texi (Position Info): Mention `size-indication-mode'. | ||
| 7327 | |||
| 7328 | 2003-09-07 Luc Teirlinck <teirllm@mail.auburn.edu> | ||
| 7329 | |||
| 7330 | * xresources.texi (Resources): Refer to `editres' man page. | ||
| 7331 | (Lucid Resources): Update defaults. Expand description of | ||
| 7332 | `shadowThickness'. | ||
| 7333 | |||
| 7334 | 2003-09-04 Miles Bader <miles@gnu.org> | ||
| 7335 | |||
| 7336 | * Makefile.in (top_srcdir): New variable. | ||
| 7337 | ($(top_srcdir)/info): New rule. | ||
| 7338 | (info): Depend on it. | ||
| 7339 | |||
| 7340 | 2003-09-03 Peter Runestig <peter@runestig.com> | ||
| 7341 | |||
| 7342 | * makefile.w32-in: New file. | ||
| 7343 | |||
| 7344 | 2003-08-29 Richard M. Stallman <rms@gnu.org> | ||
| 7345 | |||
| 7346 | * misc.texi (Saving Emacs Sessions): Correct previous change. | ||
| 7347 | |||
| 7348 | 2003-08-26 Per Abrahamsen <abraham@dina.kvl.dk> | ||
| 7349 | |||
| 7350 | * widget.texi (User Interface): Explain the need of static text | ||
| 7351 | around an editable field. | ||
| 7352 | |||
| 7353 | 2003-08-19 Luc Teirlinck <teirllm@mail.auburn.edu> | ||
| 7354 | |||
| 7355 | * widget.texi (Basic Types): The argument to `:help-echo' can now | ||
| 7356 | be a form that evaluates to a string. | ||
| 7357 | |||
| 7358 | * emacs.texi (Top): Update menu to reflect new Keyboard Macros chapter. | ||
| 7359 | (Intro): Include kmacro.texi after fixit.texi instead of after | ||
| 7360 | custom.texi. (As suggested by Kim Storm.) | ||
| 7361 | |||
| 7362 | 2003-08-18 Luc Teirlinck <teirllm@mail.auburn.edu> | ||
| 7363 | |||
| 7364 | * fixit.texi (Fixit): Update `Next' pointer. | ||
| 7365 | * files.texi (Files): Update `Previous' pointer. | ||
| 7366 | * kmacro.texi (Keyboard Macros): Remove redundant node and section. | ||
| 7367 | * emacs.texi (Intro): Include kmacro.texi after custom.texi. | ||
| 7368 | (Suggested by Kim Storm.) | ||
| 7369 | * Makefile (EMACSSOURCES): Add kmacro.texi. (Suggested by Kim Storm.) | ||
| 7370 | |||
| 7371 | 2003-08-18 Kim F. Storm <storm@cua.dk> | ||
| 7372 | |||
| 7373 | * kmacro.texi: New file describing enhanced keyboard macro | ||
| 7374 | functionality. Replaces old description in custom.texi. | ||
| 7375 | |||
| 7376 | * custom.texi (Customization): Add xref to Keyboard Macros chapter. | ||
| 7377 | (Keyboard Macros): Move to new kmacro.texi file. | ||
| 7378 | |||
| 7379 | * emacs.texi (Keyboard Macros): Reference new keyboard macro topics. | ||
| 7380 | |||
| 7381 | * calc.texi (Queries in Macros): Update xref to keyboard macro query. | ||
| 7382 | |||
| 7383 | 2003-08-17 Edward M. Reingold <reingold@emr.cs.iit.edu> | ||
| 7384 | |||
| 7385 | * calendar.texi (Specified Dates): Add `calendar-goto-day-of-year'. | ||
| 7386 | |||
| 7387 | 2003-08-17 Alex Schroeder <alex@gnu.org> | ||
| 7388 | |||
| 7389 | * misc.texi (Saving Emacs Sessions): Manual M-x desktop-save not | ||
| 7390 | required. | ||
| 7391 | |||
| 7392 | 2003-08-16 Richard M. Stallman <rms@gnu.org> | ||
| 7393 | |||
| 7394 | * dired-x.texi (Shell Command Guessing): Explain *. | ||
| 7395 | |||
| 7396 | 2003-08-16 Chunyu Wang <spr@db.cs.hit.edu.cn> (tiny change) | ||
| 7397 | |||
| 7398 | * pcl-cvs.texi (Log Edit Mode): Fix key binding for | ||
| 7399 | log-edit-insert-changelog. | ||
| 7400 | |||
| 7401 | 2003-08-05 Richard M. Stallman <rms@gnu.org> | ||
| 7402 | |||
| 7403 | * programs.texi (Lisp Indent): Don't describe | ||
| 7404 | lisp-indent-function property here. Use xref to Lisp Manual. | ||
| 7405 | |||
| 7406 | 2003-08-03 Karl Berry <karl@gnu.org> | ||
| 7407 | |||
| 7408 | * info.texi: Need @contents. | ||
| 7409 | |||
| 7410 | 2003-08-03 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 7411 | |||
| 7412 | * calendar.texi (Date Formats): Document changed behaviour of | ||
| 7413 | abbreviations. | ||
| 7414 | |||
| 7415 | 2003-07-24 Markus Rost <rost@math.ohio-state.edu> | ||
| 7416 | |||
| 7417 | * buffers.texi (List Buffers): Fix previous change. | ||
| 7418 | |||
| 7419 | 2003-07-20 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> | ||
| 7420 | |||
| 7421 | Tramp version 2.0.36 released. | ||
| 7422 | |||
| 7423 | * tramp.texi (Remote shell setup): Explain about problems with | ||
| 7424 | non-Bourne commands in ~/.profile and ~/.shrc. | ||
| 7425 | |||
| 7426 | 2003-07-13 Markus Rost <rost@math.ohio-state.edu> | ||
| 7427 | |||
| 7428 | * buffers.texi (List Buffers): Adjust to new format of *Buffer | ||
| 7429 | List*. | ||
| 7430 | |||
| 7431 | 2003-07-07 Luc Teirlinck <teirllm@mail.auburn.edu> | ||
| 7432 | |||
| 7433 | * info.texi (Help-Inv, Help-M, Help-Xref): Update following | ||
| 7434 | renaming of `vis-mode' to `visible-mode'. | ||
| 7435 | |||
| 7436 | * display.texi (Font Lock): Fix typo. | ||
| 7437 | |||
| 7438 | 2003-07-07 Richard M. Stallman <rms@gnu.org> | ||
| 7439 | |||
| 7440 | * display.texi (Font Lock): Add xref for format info on | ||
| 7441 | font-lock-remove-keywords. | ||
| 7442 | |||
| 7443 | * building.texi (Compilation): Document what happens with asynch | ||
| 7444 | children of compiler process. | ||
| 7445 | |||
| 7446 | * help.texi (Library Keywords): Use @multitable. | ||
| 7447 | |||
| 7448 | 2003-07-04 Luc Teirlinck <teirllm@mail.auburn.edu> | ||
| 7449 | |||
| 7450 | * info.texi (Top, Help-Small-Screen): Remove accidentally added | ||
| 7451 | next, prev and up pointers. | ||
| 7452 | |||
| 7453 | 2003-07-02 Luc Teirlinck <teirllm@mail.auburn.edu> | ||
| 7454 | |||
| 7455 | * info.texi (Help): Mention existence of Emacs and stand-alone | ||
| 7456 | Info at the very beginning of the tutorial. | ||
| 7457 | (Help-Inv): New node. | ||
| 7458 | (Help-]): New node. | ||
| 7459 | (Help-M): Systematically point out the differences between default | ||
| 7460 | Emacs and stand-alone versions. Delete second menu. | ||
| 7461 | (Help-Xref): Systematically point out the differences between | ||
| 7462 | default Emacs and stand-alone versions. | ||
| 7463 | (Help-Int): Change `l' example. | ||
| 7464 | (Expert Info): Fix typos. | ||
| 7465 | (Emacs Info Variables): Mention `Info-hide-note-references' and | ||
| 7466 | new default for `Info-scroll-prefer-subnodes'. | ||
| 7467 | |||
| 7468 | 2003-06-17 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> | ||
| 7469 | |||
| 7470 | Version 2.0.35 of Tramp released. | ||
| 7471 | |||
| 7472 | * tramp.texi: From Michael Albinus <Michael.Albinus@alcatel.de>: | ||
| 7473 | (Inline methods): Add methods `remsh' and `plink1'. | ||
| 7474 | (External transfer methods): Add method `remcp'. | ||
| 7475 | (Multi-hop Methods): Add method `remsh'. | ||
| 7476 | Small patch from Adrian Aichner <adrian@xemacs.org>: | ||
| 7477 | Fix minor typos. | ||
| 7478 | (Concept Index): Added to make manual searchable via | ||
| 7479 | `Info-index'. | ||
| 7480 | (Version Control): Add cindex entry. | ||
| 7481 | |||
| 7482 | 2003-06-04 Richard M. Stallman <rms@gnu.org> | ||
| 7483 | |||
| 7484 | * programs.texi (Expressions): Delete C-M-DEL. | ||
| 7485 | |||
| 7486 | * misc.texi (Shell Options): Clarify comint-scroll-show-maximum-output. | ||
| 7487 | comint-move-point-for-output renamed from | ||
| 7488 | comint-scroll-to-bottom-on-output. | ||
| 7489 | |||
| 7490 | * custom.texi (Init Rebinding): Replace previous change with xref. | ||
| 7491 | (Non-ASCII Rebinding): Explain that issue more briefly here. | ||
| 7492 | |||
| 7493 | 2003-05-28 Richard M. Stallman <rms@gnu.org> | ||
| 7494 | |||
| 7495 | * indent.texi (Indentation): Condense, simplify, clarify prev change. | ||
| 7496 | |||
| 7497 | 2003-05-28 Nick Roberts <nick@nick.uklinux.net> | ||
| 7498 | |||
| 7499 | * building.texi (GDB Graphical Interface): New node. | ||
| 7500 | (Rewritten somewhat by RMS.) | ||
| 7501 | |||
| 7502 | 2003-05-28 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> | ||
| 7503 | |||
| 7504 | * custom.texi (Init Rebinding): Xref Non-ASCII Rebinding, for | ||
| 7505 | non-English letters. Explain how to set coding systems correctly | ||
| 7506 | and how to include the right coding cookie in the file. | ||
| 7507 | |||
| 7508 | 2003-05-24 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> | ||
| 7509 | |||
| 7510 | * trampver.texi: Version 2.0.34 released. | ||
| 7511 | |||
| 7512 | 2003-05-22 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> | ||
| 7513 | |||
| 7514 | * indent.texi (Indentation): Explain the concepts. | ||
| 7515 | (Just Spaces): Explain why preventing tabs for indentation might | ||
| 7516 | be useful. | ||
| 7517 | |||
| 7518 | 2003-05-03 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 7519 | |||
| 7520 | * faq.texi: Improve previous changes. | ||
| 7521 | |||
| 7522 | 2003-05-02 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 7523 | |||
| 7524 | * faq.texi: Update copyright and maintenance details. | ||
| 7525 | Update some package URLs, versions, and maintainers. | ||
| 7526 | Remove many references to the Emacs Lisp Archive. | ||
| 7527 | |||
| 7528 | 2003-04-23 Simon Josefsson <jas@extundo.com> | ||
| 7529 | |||
| 7530 | * smtpmail.texi: Fix license (the invariant sections mentioned has | ||
| 7531 | never been part of the smtp manual). Align info dir entry with | ||
| 7532 | other emacs packages. | ||
| 7533 | |||
| 7534 | 2003-04-16 Richard M. Stallman <rms@gnu.org> | ||
| 7535 | |||
| 7536 | * search.texi (Regexps): Ref to Lisp manual for more regexp features. | ||
| 7537 | |||
| 7538 | 2003-04-08 Michael Albinus <Michael.Albinus@alcatel.de> | ||
| 7539 | |||
| 7540 | * tramp.texi: Version 2.0.33 released. | ||
| 7541 | Remove installation chapter. Remove XEmacs specifics. | ||
| 7542 | |||
| 7543 | 2003-03-29 Richard M. Stallman <rms@gnu.org> | ||
| 7544 | |||
| 7545 | * tramp.texi (Top): Undo the previous renaming. | ||
| 7546 | (emacs-other-name, emacs-other-dir, emacs-other-file-name): Delete. | ||
| 7547 | |||
| 7548 | 2003-03-29 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> | ||
| 7549 | |||
| 7550 | * Makefile.in (../info/tramp): Compile Emacs, instead of XEmacs, | ||
| 7551 | version of manual. | ||
| 7552 | |||
| 7553 | * tramp.texi (Auto-save and Backup): New node. | ||
| 7554 | |||
| 7555 | 2003-03-29 Michael Albinus <Michael.Albinus@alcatel.de> | ||
| 7556 | |||
| 7557 | * tramp.texi (Top): Include trampver.texi. Rename "Emacs" to "GNU | ||
| 7558 | Emacs" in order to have better differentiation to "XEmacs". | ||
| 7559 | `emacs-other-name', `emacs-other-dir' and `emacs-other-file-name' | ||
| 7560 | are new macros in order to point to the other Emacs flavor where | ||
| 7561 | appropriate. In info case, point to node `Installation' in order | ||
| 7562 | to explain how to generate the other way. In html case, make a | ||
| 7563 | link to the other html file. | ||
| 7564 | (Obtaining TRAMP): Added a paragraph saying to perform `autoconf' | ||
| 7565 | after CVS checkout/update. | ||
| 7566 | (Installation): Completely rewritten. | ||
| 7567 | (Installation parameters, Load paths): New sections under | ||
| 7568 | `Installation'. | ||
| 7569 | |||
| 7570 | 2003-02-28 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de> | ||
| 7571 | |||
| 7572 | * tramp.texi: Version 2.0.30 released. | ||
| 7573 | Replace word "path" with "localname" where used as a component of | ||
| 7574 | a Tramp file name. | ||
| 7575 | |||
| 7576 | 2003-02-28 Michael Albinus <Michael.Albinus@alcatel.de> | ||
| 7577 | |||
| 7578 | * tramp.texi (Frequently Asked Questions): `tramp-chunksize' | ||
| 7579 | introduced. | ||
| 7580 | (Installation): Explain what to do if files from the tramp/contrib | ||
| 7581 | directory are needed. | ||
| 7582 | |||
| 7583 | 2003-02-23 Alex Schroeder <alex@emacswiki.org> | ||
| 7584 | |||
| 7585 | * smtpmail.texi (How Mail Works): New. | ||
| 7586 | |||
| 7587 | 2003-02-22 Alex Schroeder <alex@emacswiki.org> | ||
| 7588 | |||
| 7589 | * cmdargs.texi (General Variables): Document SMTPSERVER. | ||
| 7590 | |||
| 7591 | * smtpmail.texi: New file. | ||
| 7592 | |||
| 7593 | * sending.texi: Remove SMTP node. | ||
| 7594 | (Mail Sending): Describe `send-mail-function'. Link to SMTP | ||
| 7595 | library. | ||
| 7596 | |||
| 7597 | * Makefile.in: Build SMTP manual. | ||
| 7598 | |||
| 7599 | 2003-02-22 Alex Schroeder <alex@emacswiki.org> | ||
| 7600 | |||
| 7601 | * sending.texi (Sending via SMTP): Explain MTA/MUA. | ||
| 7602 | |||
| 7603 | 2003-02-22 Simon Josefsson <jas@extundo.com> | ||
| 7604 | |||
| 7605 | * sending.texi (Mail Methods): Add node about SMTP. | ||
| 7606 | |||
| 7607 | 2003-02-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 7608 | |||
| 7609 | * xresources.texi (GTK names in Emacs): Add emacs-toolbar - GtkToolbar. | ||
| 7610 | |||
| 7611 | 2003-02-05 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de> | ||
| 7612 | |||
| 7613 | * tramp.texi: Version 2.0.29 released. | ||
| 7614 | (Installation): In Emacs, use M-x texinfo-format-buffer RET, not | ||
| 7615 | M-x makeinfo-buffer RET. Reported by gebser@ameritech.net. | ||
| 7616 | |||
| 7617 | 2003-02-01 Michael Albinus <Michael.Albinus@alcatel.de> | ||
| 7618 | |||
| 7619 | * tramp.texi (Frequently Asked Questions): Explain a workaround if | ||
| 7620 | another package loads accidently Ange-FTP. | ||
| 7621 | |||
| 7622 | 2003-01-24 Michael Albinus <Michael.Albinus@alcatel.de> | ||
| 7623 | |||
| 7624 | * tramp.texi (Customizing Completion): Add function | ||
| 7625 | `tramp-parse-sconfig'. Change example of | ||
| 7626 | `tramp-set-completion-function', because parsing of ssh config | ||
| 7627 | files looks more natural. | ||
| 7628 | |||
| 7629 | 2003-02-01 Kevin Ryde <user42@zip.com.au> | ||
| 7630 | |||
| 7631 | * glossary.texi (Glossary): Correction to cl cross reference. | ||
| 7632 | |||
| 7633 | 2003-01-20 Richard M. Stallman <rms@gnu.org> | ||
| 7634 | |||
| 7635 | * killing.texi (Rectangles): Document C-x c r. | ||
| 7636 | |||
| 7637 | 2003-01-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 7638 | |||
| 7639 | * xresources.texi (GTK resources): New node. | ||
| 7640 | (GTK widget names): New node. | ||
| 7641 | (GTK names in Emacs): New node. | ||
| 7642 | (GTK styles): New node. | ||
| 7643 | |||
| 7644 | 2003-01-15 ShengHuo ZHU <zsh@cs.rochester.edu> | ||
| 7645 | |||
| 7646 | * gnus.texi: Do not use `path' in several locations. | ||
| 7647 | |||
| 7648 | 2003-01-09 Francesco Potort,Al(B <pot@gnu.org> | ||
| 7649 | |||
| 7650 | * maintaining.texi (Create Tags Table): Add reference to the new | ||
| 7651 | `etags --help --lang=LANG' option. | ||
| 7652 | |||
| 7653 | 2002-12-26 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de> | ||
| 7654 | |||
| 7655 | * tramp.texi (External transfer methods): New method `smb'. From | ||
| 7656 | Michael Albinus. | ||
| 7657 | |||
| 7658 | 2002-11-05 Karl Berry <karl@gnu.org> | ||
| 7659 | |||
| 7660 | * info.texi (Info-fontify): Reorder face list to avoid bad line | ||
| 7661 | breaks. | ||
| 7662 | |||
| 7663 | 2002-10-06 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> | ||
| 7664 | |||
| 7665 | * tramp.texi: Move @copying to standard place. Use | ||
| 7666 | @insertcopying. | ||
| 7667 | |||
| 7668 | 2002-10-02 Karl Berry <karl@gnu.org> | ||
| 7669 | |||
| 7670 | * (ada-mode.texi autotype.texi calc.texi cc-mode.texi cl.texi | ||
| 7671 | dired-x.texi ebrowse.texi ediff.texi emacs-mime.texi emacs.texi | ||
| 7672 | eshell.texi eudc.texi faq.texi forms.texi idlwave.texi info.texi | ||
| 7673 | message.texi mh-e.texi pcl-cvs.texi reftex.texi sc.texi ses.texi | ||
| 7674 | speedbar.texi vip.texi viper.texi widget.texi woman.texi): | ||
| 7675 | Per rms, update all manuals to use @copying instead of @ifinfo. | ||
| 7676 | Also use @ifnottex instead of @ifinfo around the top node, where | ||
| 7677 | needed for the sake of the HTML output. | ||
| 7678 | (The Gnus manual is not fixed since it's not clear to me how it | ||
| 7679 | works; and the Tramp manual already uses @copying, although in an | ||
| 7680 | unusual way. All others were changed.) | ||
| 7681 | |||
| 7682 | 2002-09-10 Jonathan Yavner <jyavner@engineer.com> | ||
| 7683 | |||
| 7684 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add SES. | ||
| 7685 | (../info/ses, ses.dvi): New targets. | ||
| 7686 | * ses.texi: New file. | ||
| 7687 | |||
| 7688 | 2002-09-06 Pavel Jan,Am(Bk <Pavel@Janik.cz> | ||
| 7689 | |||
| 7690 | * texinfo.tex: Update to texinfo 4.2. | ||
| 7691 | |||
| 7692 | 2002-08-27 Carsten Dominik <dominik@sand.science.uva.nl> | ||
| 7693 | |||
| 7694 | * reftex.texi: Update to RefTeX 4.19. | ||
| 7695 | |||
| 7696 | 2002-06-17 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> | ||
| 7697 | |||
| 7698 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add Tramp. | ||
| 7699 | (../info/tramp, tramp.dvi): New targets. | ||
| 7700 | |||
| 7701 | 2002-01-04 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 7702 | |||
| 7703 | * Makefile.in (DVI_TARGETS): Add calc.dvi. | ||
| 7704 | (calc.dvi): Uncomment. | ||
| 7705 | |||
| 7706 | 2001-12-20 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 7707 | |||
| 7708 | * Makefile.in (EMACSSOURCES): Update the list of Emacs manual | ||
| 7709 | source files. | ||
| 7710 | |||
| 7711 | 2001-11-16 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 7712 | |||
| 7713 | * Makefile.in (emacsman): New target. | ||
| 7714 | |||
| 7715 | 2001-11-07 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 7716 | |||
| 7717 | * Makefile.in (INFO_TARGETS): Add ../info/calc. | ||
| 7718 | (../info/calc): New target. | ||
| 7719 | |||
| 7720 | 2001-10-20 Gerd Moellmann <gerd@gnu.org> | ||
| 7721 | |||
| 7722 | * (Version 21.1 released.) | ||
| 7723 | |||
| 7724 | 2001-10-05 Gerd Moellmann <gerd@gnu.org> | ||
| 7725 | |||
| 7726 | * Branch for 21.1. | ||
| 7727 | |||
| 7728 | 2001-04-14 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 7729 | |||
| 7730 | * Makefile.in (../info/info): Use an explicit -o switch to | ||
| 7731 | makeinfo. | ||
| 7732 | |||
| 7733 | 2001-03-05 Gerd Moellmann <gerd@gnu.org> | ||
| 7734 | |||
| 7735 | * Makefile.in (mostlyclean, maintainer-clean): Delete more files. | ||
| 7736 | |||
| 7737 | 2000-12-20 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 7738 | |||
| 7739 | * Makefile.in (../info/idlwave): Use --no-split. | ||
| 7740 | |||
| 7741 | 2000-12-14 Dave Love <fx@gnu.org> | ||
| 7742 | |||
| 7743 | * Makefile.in (mostlyclean): Remove gnustmp.* | ||
| 7744 | (gnus.dvi): Change rule to remove @latex stuff. | ||
| 7745 | |||
| 7746 | 2000-10-19 Eric M. Ludlam <zappo@ultranet.com> | ||
| 7747 | |||
| 7748 | * Makefile.in (Speedbar): Add build targets for speedbar.texi. | ||
| 7749 | |||
| 7750 | 2000-10-13 John Wiegley <johnw@gnu.org> | ||
| 7751 | |||
| 7752 | * Makefile.in: Add build targets for eshell.texi. | ||
| 7753 | |||
| 7754 | 2000-09-25 Gerd Moellmann <gerd@gnu.org> | ||
| 7755 | |||
| 7756 | * Makefile.in: Remove/comment speedbar stuff. | ||
| 7757 | |||
| 7758 | 2000-09-22 Dave Love <fx@gnu.org> | ||
| 7759 | |||
| 7760 | * Makefile.in: Add emacs-mime. | ||
| 7761 | |||
| 7762 | 2000-08-08 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 7763 | |||
| 7764 | * Makefile.in (INFO_TARGETS): Add ../info/woman. | ||
| 7765 | (DVI_TARGETS): Add woman.dvi. | ||
| 7766 | (../info/woman, woman.dvi): New targets. | ||
| 7767 | |||
| 7768 | 2000-05-31 Stefan Monnier <monnier@cs.yale.edu> | ||
| 7769 | |||
| 7770 | * .cvsignore (*.tmp): New entry. Seems to be used for @macro. | ||
| 7771 | |||
| 7772 | * pcl-cvs.texi: New file. | ||
| 7773 | * Makefile.in (INFO_TARGETS, DVI_TARGETS: Add pcl-cvs. | ||
| 7774 | (../info/pcl-cvs, pcl-cvs.dvi): New targets. | ||
| 7775 | |||
| 7776 | 2000-05-11 Gerd Moellmann <gerd@gnu.org> | ||
| 7777 | |||
| 7778 | * Makefile.in (INFO_TARGETS): Add info/ebrowse. | ||
| 7779 | (../info/ebrowse, ebrowse.dvi): New targets. | ||
| 7780 | |||
| 7781 | 2000-01-13 Gerd Moellmann <gerd@gnu.org> | ||
| 7782 | |||
| 7783 | * Makefile.in (INFO_TARGETS): Add eudc. | ||
| 7784 | (DVI_TARGETS): Add eudc.dvi. | ||
| 7785 | (../info/eudc, eudc.dvi): New targets. | ||
| 7786 | |||
| 7787 | 2000-01-05 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 7788 | |||
| 7789 | * Makefile.in (INFO_TARGETS): Rename emacs-faq to efaq (for | ||
| 7790 | compatibility with 8+3 filesystems). | ||
| 7791 | (../info/efaq): Rename from emacs-faq. | ||
| 7792 | |||
| 7793 | 2000-01-03 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 7794 | |||
| 7795 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add idlwave. | ||
| 7796 | (../info/idlwave, idlwave.dvi): New targets. | ||
| 7797 | |||
| 7798 | 1999-10-23 Dave Love <fx@gnu.org> | ||
| 7799 | |||
| 7800 | * Makefile.in: Use autotype.texi. | ||
| 7801 | |||
| 7802 | 1999-10-12 Stefan Monnier <monnier@cs.yale.edu> | ||
| 7803 | |||
| 7804 | * Makefile.in (faq): Use ../info/emacs-faq.info (as specified in the | ||
| 7805 | faq.texi file) rather than ../info/faq. | ||
| 7806 | |||
| 7807 | 1999-10-07 Gerd Moellmann <gerd@gnu.org> | ||
| 7808 | |||
| 7809 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add ada-mode. | ||
| 7810 | (../info/ada-mode, ada-mode.dvi): New targets. | ||
| 7811 | |||
| 7812 | 1999-09-01 Dave Love <fx@gnu.org> | ||
| 7813 | |||
| 7814 | * Makefile.in: Add faq. | ||
| 7815 | |||
| 7816 | 1999-07-12 Richard Stallman <rms@gnu.org> | ||
| 7817 | |||
| 7818 | * Version 20.4 released. | ||
| 7819 | |||
| 7820 | 1998-12-04 Markus Rost <rost@delysid.gnu.org> | ||
| 7821 | |||
| 7822 | * Makefile.in (INFO_TARGETS): Delete customize.info. | ||
| 7823 | (DVI_TARGETS): Delete customize.dvi. | ||
| 7824 | (../info/customize, customize.dvi): Targets deleted. | ||
| 7825 | |||
| 7826 | 1998-08-19 Richard Stallman <rms@psilocin.ai.mit.edu> | ||
| 7827 | |||
| 7828 | * Version 20.3 released. | ||
| 7829 | |||
| 7830 | 1998-05-06 Richard Stallman <rms@psilocin.gnu.org> | ||
| 7831 | |||
| 7832 | * Makefile.in (EMACSSOURCES): Add mule.texi. | ||
| 7833 | Add msdog.texi, ack.texi. Remove gnu1.texi. | ||
| 7834 | |||
| 7835 | 1998-04-06 Andreas Schwab <schwab@gnu.org> | ||
| 7836 | |||
| 7837 | * Makefile.in (ENVADD): Enviroment vars to pass to texi2dvi. Use | ||
| 7838 | it in dvi targets. | ||
| 7839 | (../etc/GNU): Change to $(srcdir) first. | ||
| 7840 | |||
| 7841 | 1998-03-11 Carsten Dominik <cd@delysid.gnu.org> | ||
| 7842 | |||
| 7843 | * reftex.texi: Update for RefTeX version 3.22. | ||
| 7844 | |||
| 7845 | 1998-02-08 Richard Stallman <rms@psilocin.gnu.org> | ||
| 7846 | |||
| 7847 | * Makefile.in (reftex.dvi, ../info/reftex): New targets. | ||
| 7848 | (INFO_TARGETS, DVI_TARGETS): Add the new targets. | ||
| 7849 | |||
| 7850 | 1997-09-23 Paul Eggert <eggert@twinsun.com> | ||
| 7851 | |||
| 7852 | * Makefile.in: Merge changes mistakenly made to `Makefile'. | ||
| 7853 | (INFO_TARGETS): Change ../info/custom to ../info/customize. | ||
| 7854 | (../info/customize): Rename from ../info/custom. | ||
| 7855 | (../info/viper, viper.dvi): Remove dependency on viper-cmd.texi. | ||
| 7856 | |||
| 7857 | 1997-09-19 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> | ||
| 7858 | |||
| 7859 | * Version 20.2 released. | ||
| 7860 | |||
| 7861 | 1997-09-15 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> | ||
| 7862 | |||
| 7863 | * Version 20.1 released. | ||
| 7864 | |||
| 7865 | 1997-08-24 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> | ||
| 7866 | |||
| 7867 | * Makefile (../info/customize, customize.dvi): New targets. | ||
| 7868 | (INFO_TARGETS): Add ../info/customize. | ||
| 7869 | (DVI_TARGETS): Add customize.dvi. | ||
| 7870 | |||
| 7871 | 1997-07-10 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> | ||
| 7872 | |||
| 7873 | * Makefile (../info/viper, viper.dvi): Delete viper-cmd.texi dep. | ||
| 7874 | |||
| 7875 | 1996-08-11 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> | ||
| 7876 | |||
| 7877 | * Version 19.33 released. | ||
| 7878 | |||
| 7879 | 1996-07-31 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> | ||
| 7880 | |||
| 7881 | * Version 19.32 released. | ||
| 7882 | |||
| 7883 | 1996-06-27 Lars Magne Ingebrigtsen <larsi@ifi.uio.no> | ||
| 7884 | |||
| 7885 | * Makefile.in: Add rules for the Message manual. | ||
| 7886 | |||
| 7887 | 1996-06-26 Lars Magne Ingebrigtsen <larsi@ifi.uio.no> | ||
| 7888 | |||
| 7889 | * gnus.texi: New version. | ||
| 7890 | |||
| 7891 | * message.texi: New manual. | ||
| 7892 | |||
| 7893 | 1996-06-20 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> | ||
| 7894 | |||
| 7895 | * Makefile.in (All info targets): cd $(srcdir) to do the work. | ||
| 7896 | |||
| 7897 | 1996-06-19 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> | ||
| 7898 | |||
| 7899 | * Makefile.in (All info targets): Specify $(srcdir) in input files. | ||
| 7900 | Specify -I option. | ||
| 7901 | (All dvi targets): Set the TEXINPUTS variable. | ||
| 7902 | |||
| 7903 | 1996-05-25 Karl Heuer <kwzh@gnu.ai.mit.edu> | ||
| 7904 | |||
| 7905 | * Version 19.31 released. | ||
| 7906 | |||
| 7907 | 1996-01-07 Richard Stallman <rms@whiz-bang.gnu.ai.mit.edu> | ||
| 7908 | |||
| 7909 | * Makefile.in (../info/ccmode): Rename from ../info/cc-mode. | ||
| 7910 | (INFO_TARGETS): Use new name. This avoids name conflict on MSDOS. | ||
| 7911 | |||
| 7912 | 1995-11-29 Richard Stallman <rms@mole.gnu.ai.mit.edu> | ||
| 7913 | |||
| 7914 | * Makefile.in (../info/cc-mode, cc-mode.dvi): New targets. | ||
| 7915 | (INFO_TARGETS): Add ../info/cc-mode. | ||
| 7916 | (DVI_TARGETS): Add cc-mode.dvi. | ||
| 7917 | |||
| 7918 | 1995-11-24 Richard Stallman <rms@mole.gnu.ai.mit.edu> | ||
| 7919 | |||
| 7920 | * Version 19.30 released. | ||
| 7921 | |||
| 7922 | 1995-11-04 Lars Magne Ingebrigtsen <larsi@ifi.uio.no> | ||
| 7923 | |||
| 7924 | * gnus.texi: New file. | ||
| 7925 | |||
| 7926 | 1995-11-04 Erik Naggum <erik@naggum.no> | ||
| 7927 | |||
| 7928 | * gnus.texi: File deleted. | ||
| 7929 | |||
| 7930 | 1995-11-02 Stephen Gildea <gildea@stop.mail-abuse.org> | ||
| 7931 | |||
| 7932 | * mh-e.texi: "Function Index" -> "Command Index" to work with | ||
| 7933 | Emacs 19.30 C-h C-k support of separately-documented commands. | ||
| 7934 | |||
| 7935 | 1995-06-26 Richard Stallman <rms@mole.gnu.ai.mit.edu> | ||
| 7936 | |||
| 7937 | * Makefile.in (../info/ediff, ediff.dvi): New targets. | ||
| 7938 | (INFO_TARGETS, DVI_TARGETS): Add those new targets. | ||
| 7939 | |||
| 7940 | 1995-04-24 Richard Stallman <rms@mole.gnu.ai.mit.edu> | ||
| 7941 | |||
| 7942 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add viper targets. | ||
| 7943 | (../info/viper, viper.dvi): New targets. | ||
| 7944 | |||
| 7945 | 1995-04-20 Kevin Rodgers <kevinr@ihs.com> | ||
| 7946 | |||
| 7947 | * dired-x.texi (Installation): Change the example to set | ||
| 7948 | buffer-local variables like dired-omit-files-p in | ||
| 7949 | dired-mode-hook. | ||
| 7950 | |||
| 7951 | 1995-04-17 Richard Stallman <rms@mole.gnu.ai.mit.edu> | ||
| 7952 | |||
| 7953 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add mh-e targets. | ||
| 7954 | (../info/mh-e, mh-e.dvi): New targets. | ||
| 7955 | |||
| 7956 | 1995-02-07 Richard Stallman <rms@pogo.gnu.ai.mit.edu> | ||
| 7957 | |||
| 7958 | * Makefile.in (maintainer-clean): Rename from realclean. | ||
| 7959 | |||
| 7960 | 1994-11-23 Richard Stallman <rms@mole.gnu.ai.mit.edu> | ||
| 7961 | |||
| 7962 | * Makefile.in: New file. | ||
| 7963 | * Makefile: File deleted. | ||
| 7964 | |||
| 7965 | 1994-11-19 Richard Stallman <rms@mole.gnu.ai.mit.edu> | ||
| 7966 | |||
| 7967 | * Makefile (TEXINDEX_OBJS): Variable deleted. | ||
| 7968 | (texindex, texindex.o, getopt.o): Rules deleted. | ||
| 7969 | All deps on texindex deleted. | ||
| 7970 | (distclean): Don't delete texindex. | ||
| 7971 | (mostlyclean): Don't delete *.o. | ||
| 7972 | * texindex.c, getopt.c: Files deleted. | ||
| 7973 | |||
| 7974 | 1994-09-07 Richard Stallman <rms@mole.gnu.ai.mit.edu> | ||
| 7975 | |||
| 7976 | * Version 19.26 released. | ||
| 7977 | |||
| 7978 | 1994-07-02 Richard Stallman (rms@gnu.ai.mit.edu) | ||
| 7979 | |||
| 7980 | * Makefile (EMACSSOURCES): Exclude undo.texi. | ||
| 7981 | |||
| 7982 | 1994-05-30 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 7983 | |||
| 7984 | * Version 19.25 released. | ||
| 7985 | |||
| 7986 | 1994-05-23 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 7987 | |||
| 7988 | * Version 19.24 released. | ||
| 7989 | |||
| 7990 | 1994-05-16 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 7991 | |||
| 7992 | * Version 19.23 released. | ||
| 7993 | |||
| 7994 | 1994-04-17 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 7995 | |||
| 7996 | * Makefile: Delete spurious tab. | ||
| 7997 | |||
| 7998 | 1994-02-16 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 7999 | |||
| 8000 | * Makefile (.SUFFIXES): New rule. | ||
| 8001 | |||
| 8002 | 1994-01-15 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8003 | |||
| 8004 | * Makefile (dired-x.dvi, ../info/dired-x): New targets. | ||
| 8005 | (INFO_TARGETS, DVI_TARGETS): Add the new targets. | ||
| 8006 | |||
| 8007 | 1994-01-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8008 | |||
| 8009 | * Makefile (../info/sc): Rename frin sc.info. | ||
| 8010 | (../info/cl): Likewise. | ||
| 8011 | (INFO_TARGETS): Use new names. | ||
| 8012 | |||
| 8013 | 1993-12-04 Richard Stallman (rms@srarc2) | ||
| 8014 | |||
| 8015 | * getopt.c: New file. | ||
| 8016 | * Makefile (TEXINDEX_OBJS): Use getopt.o in this dir, not ../lib-src. | ||
| 8017 | (getopt.o): New rule. | ||
| 8018 | (dvi): Don't depend on texindex. | ||
| 8019 | (emacs.dvi, cl.dvi, forms.dvi, vip.dvi, gnus.dvi, sc.dvi): | ||
| 8020 | Depend on texindex. | ||
| 8021 | |||
| 8022 | 1993-12-03 Richard Stallman (rms@srarc2) | ||
| 8023 | |||
| 8024 | * Makefile (../info/sc.info): Rename from ../info/sc. | ||
| 8025 | (TEXI2DVI): New variable. | ||
| 8026 | (emacs.dvi, cl.dvi forms.dvi, sc.dvi, vip.dvi, gnus.dvi, info.dvi): | ||
| 8027 | Add explicit commands. | ||
| 8028 | (TEXINDEX_OBJS): Delete duplicate getopt.o. | ||
| 8029 | |||
| 8030 | 1993-11-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8031 | |||
| 8032 | * Version 19.22 released. | ||
| 8033 | |||
| 8034 | 1993-11-18 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8035 | |||
| 8036 | * Makefile (TEXINDEX_OBJS): Delete spurious period. | ||
| 8037 | |||
| 8038 | 1993-11-16 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8039 | |||
| 8040 | * Version 19.21 released. | ||
| 8041 | |||
| 8042 | 1993-11-15 Paul Eggert (eggert@twinsun.com) | ||
| 8043 | |||
| 8044 | * man/Makefile (../info/cl.info): Rename from ../info/cl. | ||
| 8045 | |||
| 8046 | 1993-11-15 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8047 | |||
| 8048 | * Makefile (../etc/GNU): New target. | ||
| 8049 | (EMACSSOURCES): Add gnu1.texi. | ||
| 8050 | |||
| 8051 | 1993-11-14 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8052 | |||
| 8053 | * Makefile (realclean): Don't delete the Info files. | ||
| 8054 | |||
| 8055 | 1993-10-25 Brian Fox (bfox@albert.gnu.ai.mit.edu) | ||
| 8056 | |||
| 8057 | * forms.texi: Fix forms.texi so that it will format correctly. | ||
| 8058 | Add missing `@end iftex', fix bad reference. | ||
| 8059 | |||
| 8060 | * info.texi, info-stn.texi: New files implement texinfo version of | ||
| 8061 | `info' file. | ||
| 8062 | |||
| 8063 | * frames.texi (Creating Frames): Mention `C-x 5' instead of `C-x | ||
| 8064 | 4' where appropriate. | ||
| 8065 | |||
| 8066 | 1993-10-20 Brian Fox (bfox@ai.mit.edu) | ||
| 8067 | |||
| 8068 | * Makefile: Fix targets for texindex, new info.texi files. | ||
| 8069 | * info-stnd.texi: New file implements info for standalone info | ||
| 8070 | reader. | ||
| 8071 | * info.texi: Update to include recent changes to "../info/info". | ||
| 8072 | New source file for ../info/info; includes info-stnd.texi. | ||
| 8073 | |||
| 8074 | * texindex.c: Include "../src/config.h" if building in emacs. | ||
| 8075 | |||
| 8076 | * Makefile: Change all files to FILENAME.texi, force all targets | ||
| 8077 | to be FILENAME, not FILENAME.info. This changes sc.texinfo, | ||
| 8078 | vip.texinfo, forms.texinfo, cl.texinfo. | ||
| 8079 | Add target to build texindex.c, defining `emacs'. | ||
| 8080 | |||
| 8081 | * forms.texi: Install new file to match version 2.3 of forms.el. | ||
| 8082 | |||
| 8083 | 1993-08-14 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8084 | |||
| 8085 | * Version 19.19 released. | ||
| 8086 | |||
| 8087 | 1993-08-10 Simon Leinen (simon@lia.di.epfl.ch) | ||
| 8088 | |||
| 8089 | * sc.texinfo: Fix info file name. | ||
| 8090 | |||
| 8091 | * Makefile (info): Add gnus and sc. | ||
| 8092 | (dvi): Add gnus.dvi and sc.dvi. | ||
| 8093 | (../info/sc, sc.dvi): New targets. | ||
| 8094 | |||
| 8095 | 1993-08-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8096 | |||
| 8097 | * Version 19.18 released. | ||
| 8098 | |||
| 8099 | 1993-07-20 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8100 | |||
| 8101 | * Makefile: Fix source file names of the separate manuals. | ||
| 8102 | (gnus.dvi, ../info/gnus): New targets. | ||
| 8103 | |||
| 8104 | 1993-07-18 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8105 | |||
| 8106 | * Version 19.17 released. | ||
| 8107 | |||
| 8108 | 1993-07-10 Richard Stallman (rms@mole.gnu.ai.mit.edu) | ||
| 8109 | |||
| 8110 | * split-man: Fix typos in last change. | ||
| 8111 | |||
| 8112 | 1993-07-06 Jim Blandy (jimb@geech.gnu.ai.mit.edu) | ||
| 8113 | |||
| 8114 | * Version 19.16 released. | ||
| 8115 | |||
| 8116 | 1993-06-19 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) | ||
| 8117 | |||
| 8118 | * version 19.15 released. | ||
| 8119 | |||
| 8120 | 1993-06-18 Jim Blandy (jimb@geech.gnu.ai.mit.edu) | ||
| 8121 | |||
| 8122 | * Makefile (distclean): It's rm, not rf. | ||
| 8123 | |||
| 8124 | 1993-06-17 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) | ||
| 8125 | |||
| 8126 | * Version 19.14 released. | ||
| 8127 | |||
| 8128 | 1993-06-16 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) | ||
| 8129 | |||
| 8130 | * Makefile: New file. | ||
| 8131 | |||
| 8132 | 1993-06-08 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) | ||
| 8133 | |||
| 8134 | * Version 19.13 released. | ||
| 8135 | |||
| 8136 | 1993-05-27 Jim Blandy (jimb@geech.gnu.ai.mit.edu) | ||
| 8137 | |||
| 8138 | * Version 19.9 released. | ||
| 8139 | |||
| 8140 | 1993-05-25 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) | ||
| 8141 | |||
| 8142 | * Version 19.8 released. | ||
| 8143 | |||
| 8144 | 1993-05-25 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) | ||
| 8145 | |||
| 8146 | * cmdargs.texi: Document the -i, -itype, and -iconic options. | ||
| 8147 | |||
| 8148 | * trouble.texi: It's `enable-flow-control-on', not | ||
| 8149 | `evade-flow-control-on'. | ||
| 8150 | |||
| 8151 | 1993-05-24 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) | ||
| 8152 | |||
| 8153 | * display.texi: Document standard-display-european. | ||
| 8154 | |||
| 8155 | 1993-05-22 Jim Blandy (jimb@geech.gnu.ai.mit.edu) | ||
| 8156 | |||
| 8157 | * Version 19.7 released. | ||
| 8158 | |||
| 8159 | * emacs.texi: Add a sentence to the top menu mentioning the | ||
| 8160 | specific version of Emacs this manual applies to. | ||
| 8161 | |||
| 8162 | 1993-04-25 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) | ||
| 8163 | |||
| 8164 | * basic.texi: Document next-line-add-lines variable used to | ||
| 8165 | implement down-arrow. | ||
| 8166 | |||
| 8167 | * killing.texi: Document kill-whole-line. | ||
| 8168 | |||
| 8169 | 1993-04-18 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) | ||
| 8170 | |||
| 8171 | * text.texi: Update unix TeX ordering information. | ||
| 8172 | |||
| 8173 | 1993-03-26 Eric S. Raymond (eric@geech.gnu.ai.mit.edu) | ||
| 8174 | |||
| 8175 | * news.texi: Mention fill-rectangle in keybinding list. | ||
| 8176 | |||
| 8177 | * killing.texi: Document fill-rectangle. | ||
| 8178 | |||
| 8179 | 1993-03-17 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) | ||
| 8180 | |||
| 8181 | * vc.texi: Bring the docs up to date with VC 5.2. | ||
| 8182 | |||
| 8183 | 1992-01-10 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) | ||
| 8184 | |||
| 8185 | * emacs.tex: Mention blackbox and gomoku under Amusements. | ||
| 8186 | Assembler mode is now mentioned and appropriately indexed | ||
| 8187 | under Programming Modes. | ||
| 8188 | |||
| 8189 | 1991-02-15 Robert J. Chassell (bob@wookumz.ai.mit.edu) | ||
| 8190 | |||
| 8191 | * emacs.tex: Update TeX ordering information. | ||
| 8192 | |||
| 8193 | 1990-08-30 David Lawrence (tale@pogo.ai.mit.edu) | ||
| 8194 | |||
| 8195 | * gnus.texinfo: New file. Removed installation instructions. | ||
| 8196 | |||
| 8197 | 1990-06-26 David Lawrence (tale@geech) | ||
| 8198 | |||
| 8199 | * emacs.tex: Note that completion-ignored-extensions is not used | ||
| 8200 | to filter out names when all completions are displayed in | ||
| 8201 | *Completions*. | ||
| 8202 | |||
| 8203 | 1990-05-25 Richard Stallman (rms@sugar-bombs.ai.mit.edu) | ||
| 8204 | |||
| 8205 | * texindex.tex: If USG, include sys/types.h and sys/fcntl.h. | ||
| 8206 | |||
| 8207 | 1990-03-21 Jim Kingdon (kingdon@pogo.ai.mit.edu) | ||
| 8208 | |||
| 8209 | * emacs.tex: Add @findex grep. | ||
| 8210 | |||
| 8211 | 1989-01-17 Robert J. Chassell (bob@rice-chex.ai.mit.edu) | ||
| 8212 | |||
| 8213 | * texinfo.tex: Change spelling of `\sc' font to `\smallcaps' and | ||
| 8214 | then define `\sc' as the command for smallcaps in Texinfo. This | ||
| 8215 | means that the @sc command will produce small caps. bfox has | ||
| 8216 | made the corresponding change to makeinfo and texinfm.el. | ||
| 8217 | |||
| 8218 | 1988-08-16 Robert J. Chassell (bob@frosted-flakes.ai.mit.edu) | ||
| 8219 | |||
| 8220 | * emacs.tex: Correct two typos. No other changes before | ||
| 8221 | Version 19 will be made. | ||
| 8222 | |||
| 8223 | * vip.texinfo: Remove menu entry Adding Lisp Code in node | ||
| 8224 | Customization since the menu entry did not point to anything. | ||
| 8225 | Also add an @finalout command to remove overfull hboxes from the | ||
| 8226 | printed output. | ||
| 8227 | |||
| 8228 | * cl.texinfo: Add @bye, \input line and @settitle to file. | ||
| 8229 | This file is clearly intended to be a chapter of some other work, | ||
| 8230 | but the other work does not yet exist. | ||
| 8231 | |||
| 8232 | 1988-07-25 Robert J. Chassell (bob@frosted-flakes.ai.mit.edu) | ||
| 8233 | |||
| 8234 | * texinfo.texinfo: Three typos corrected. | ||
| 8235 | |||
| 8236 | 1988-05-23 Robert J. Chassell (bob@frosted-flakes.ai.mit.edu) | ||
| 8237 | |||
| 8238 | * emacs.tex: Update information for obtaining TeX distribution from the | ||
| 8239 | University of Washington. | ||
| 8240 | |||
| 8241 | ;; Local Variables: | ||
| 8242 | ;; coding: iso-2022-7bit | ||
| 8243 | ;; fill-column: 79 | ||
| 8244 | ;; add-log-time-zone-rule: t | ||
| 8245 | ;; End: | ||
| 8246 | |||
| 8247 | Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, | ||
| 8248 | 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 8249 | |||
| 8250 | This file is part of GNU Emacs. | ||
| 8251 | |||
| 8252 | GNU Emacs is free software; you can redistribute it and/or modify | ||
| 8253 | it under the terms of the GNU General Public License as published by | ||
| 8254 | the Free Software Foundation; either version 3, or (at your option) | ||
| 8255 | any later version. | ||
| 8256 | |||
| 8257 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 8258 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 8259 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 8260 | GNU General Public License for more details. | ||
| 8261 | |||
| 8262 | You should have received a copy of the GNU General Public License | ||
| 8263 | along with GNU Emacs; see the file COPYING. If not, write to the | ||
| 8264 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 8265 | Boston, MA 02110-1301, USA. | ||
| 8266 | |||
| 8267 | ;;; arch-tag: f1d62776-3ed5-4811-9d96-267252577dbd | ||
diff --git a/doc/emacs/Makefile.in b/doc/emacs/Makefile.in new file mode 100644 index 00000000000..00088b74b51 --- /dev/null +++ b/doc/emacs/Makefile.in | |||
| @@ -0,0 +1,368 @@ | |||
| 1 | #### Makefile for the Emacs Manual and other documentation. | ||
| 2 | |||
| 3 | # Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, | ||
| 4 | # 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 5 | |||
| 6 | # This file is part of GNU Emacs. | ||
| 7 | |||
| 8 | # GNU Emacs is free software; you can redistribute it and/or modify | ||
| 9 | # it under the terms of the GNU General Public License as published by | ||
| 10 | # the Free Software Foundation; either version 3, or (at your option) | ||
| 11 | # any later version. | ||
| 12 | |||
| 13 | # GNU Emacs is distributed in the hope that it will be useful, | ||
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | # GNU General Public License for more details. | ||
| 17 | |||
| 18 | # You should have received a copy of the GNU General Public License | ||
| 19 | # along with GNU Emacs; see the file COPYING. If not, write to | ||
| 20 | # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 21 | # Boston, MA 02110-1301, USA. | ||
| 22 | |||
| 23 | # Where to find the source code. $(srcdir) will be the man | ||
| 24 | # subdirectory of the source tree. This is | ||
| 25 | # set by the configure script's `--srcdir' option. | ||
| 26 | srcdir=@srcdir@ | ||
| 27 | top_srcdir=@top_srcdir@ | ||
| 28 | |||
| 29 | # Tell make where to find source files; this is needed for the makefiles. | ||
| 30 | VPATH=@srcdir@ | ||
| 31 | |||
| 32 | |||
| 33 | # The makeinfo program is part of the Texinfo distribution. | ||
| 34 | # Use --force so that it generates output even if there are errors. | ||
| 35 | MAKEINFO = makeinfo --force | ||
| 36 | INFO_TARGETS = ../info/emacs ../info/ccmode ../info/cl \ | ||
| 37 | ../info/dired-x ../info/ediff ../info/forms ../info/gnus \ | ||
| 38 | ../info/message ../info/sieve ../info/pgg ../info/emacs-mime \ | ||
| 39 | ../info/info ../info/mh-e ../info/reftex \ | ||
| 40 | ../info/sc ../info/vip ../info/viper ../info/widget \ | ||
| 41 | ../info/efaq ../info/ada-mode ../info/autotype ../info/calc \ | ||
| 42 | ../info/idlwave ../info/eudc ../info/ebrowse ../info/pcl-cvs \ | ||
| 43 | ../info/woman ../info/eshell ../info/org ../info/url \ | ||
| 44 | ../info/speedbar ../info/tramp ../info/ses ../info/smtpmail \ | ||
| 45 | ../info/flymake ../info/newsticker ../info/rcirc ../info/erc | ||
| 46 | DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \ | ||
| 47 | ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \ | ||
| 48 | gnus.dvi message.dvi sieve.dvi pgg.dvi mh-e.dvi \ | ||
| 49 | reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \ | ||
| 50 | ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \ | ||
| 51 | pcl-cvs.dvi woman.dvi eshell.dvi org.dvi url.dvi \ | ||
| 52 | speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \ | ||
| 53 | newsticker.dvi emacs-xtra.dvi rcirc.dvi erc.dvi | ||
| 54 | INFOSOURCES = info.texi | ||
| 55 | |||
| 56 | # The following rule does not work with all versions of `make'. | ||
| 57 | .SUFFIXES: .texi .dvi | ||
| 58 | .texi.dvi: | ||
| 59 | texi2dvi $< | ||
| 60 | |||
| 61 | TEXI2DVI = texi2dvi | ||
| 62 | ENVADD = TEXINPUTS="$(srcdir):$(TEXINPUTS)" MAKEINFO="$(MAKEINFO) -I$(srcdir)" | ||
| 63 | |||
| 64 | EMACS_XTRA=\ | ||
| 65 | $(srcdir)/arevert-xtra.texi \ | ||
| 66 | $(srcdir)/cal-xtra.texi \ | ||
| 67 | $(srcdir)/dired-xtra.texi \ | ||
| 68 | $(srcdir)/picture-xtra.texi \ | ||
| 69 | $(srcdir)/emerge-xtra.texi \ | ||
| 70 | $(srcdir)/vc-xtra.texi \ | ||
| 71 | $(srcdir)/vc1-xtra.texi \ | ||
| 72 | $(srcdir)/vc2-xtra.texi \ | ||
| 73 | $(srcdir)/fortran-xtra.texi \ | ||
| 74 | $(srcdir)/msdog-xtra.texi | ||
| 75 | |||
| 76 | EMACSSOURCES= \ | ||
| 77 | ${srcdir}/emacs.texi \ | ||
| 78 | ${srcdir}/doclicense.texi \ | ||
| 79 | ${srcdir}/gpl.texi \ | ||
| 80 | ${srcdir}/screen.texi \ | ||
| 81 | ${srcdir}/commands.texi \ | ||
| 82 | ${srcdir}/entering.texi \ | ||
| 83 | ${srcdir}/basic.texi \ | ||
| 84 | ${srcdir}/mini.texi \ | ||
| 85 | ${srcdir}/m-x.texi \ | ||
| 86 | ${srcdir}/help.texi \ | ||
| 87 | ${srcdir}/mark.texi \ | ||
| 88 | ${srcdir}/killing.texi \ | ||
| 89 | ${srcdir}/regs.texi \ | ||
| 90 | ${srcdir}/display.texi \ | ||
| 91 | ${srcdir}/search.texi \ | ||
| 92 | ${srcdir}/fixit.texi \ | ||
| 93 | ${srcdir}/files.texi \ | ||
| 94 | ${srcdir}/buffers.texi \ | ||
| 95 | ${srcdir}/windows.texi \ | ||
| 96 | ${srcdir}/frames.texi \ | ||
| 97 | ${srcdir}/mule.texi \ | ||
| 98 | ${srcdir}/major.texi \ | ||
| 99 | ${srcdir}/indent.texi \ | ||
| 100 | ${srcdir}/text.texi \ | ||
| 101 | ${srcdir}/programs.texi \ | ||
| 102 | ${srcdir}/building.texi \ | ||
| 103 | ${srcdir}/maintaining.texi \ | ||
| 104 | ${srcdir}/abbrevs.texi \ | ||
| 105 | ${srcdir}/sending.texi \ | ||
| 106 | ${srcdir}/rmail.texi \ | ||
| 107 | ${srcdir}/dired.texi \ | ||
| 108 | ${srcdir}/calendar.texi \ | ||
| 109 | ${srcdir}/misc.texi \ | ||
| 110 | ${srcdir}/custom.texi \ | ||
| 111 | ${srcdir}/trouble.texi \ | ||
| 112 | ${srcdir}/cmdargs.texi \ | ||
| 113 | ${srcdir}/xresources.texi \ | ||
| 114 | ${srcdir}/anti.texi \ | ||
| 115 | ${srcdir}/macos.texi \ | ||
| 116 | ${srcdir}/msdog.texi \ | ||
| 117 | ${srcdir}/gnu.texi \ | ||
| 118 | ${srcdir}/glossary.texi \ | ||
| 119 | ${srcdir}/ack.texi \ | ||
| 120 | ${srcdir}/kmacro.texi \ | ||
| 121 | $(EMACS_XTRA) | ||
| 122 | |||
| 123 | info: $(top_srcdir)/info $(INFO_TARGETS) | ||
| 124 | |||
| 125 | $(top_srcdir)/info: | ||
| 126 | mkdir $@ | ||
| 127 | |||
| 128 | dvi: $(DVI_TARGETS) | ||
| 129 | |||
| 130 | # Note that all the Info targets build the Info files | ||
| 131 | # in srcdir. There is no provision for Info files | ||
| 132 | # to exist in the build directory. | ||
| 133 | # In a distribution of Emacs, the Info files should be up to date. | ||
| 134 | |||
| 135 | # The following target uses an explicit -o switch to work around | ||
| 136 | # the @setfilename directive in info.texi, which is required for | ||
| 137 | # the Texinfo distribution. | ||
| 138 | |||
| 139 | ../info/info: ${INFOSOURCES} | ||
| 140 | cd $(srcdir); $(MAKEINFO) --no-split info.texi -o $@ | ||
| 141 | |||
| 142 | info.dvi: ${INFOSOURCES} | ||
| 143 | $(ENVADD) $(TEXI2DVI) ${srcdir}/info.texi | ||
| 144 | |||
| 145 | ../info/emacs: ${EMACSSOURCES} | ||
| 146 | cd $(srcdir); $(MAKEINFO) emacs.texi | ||
| 147 | |||
| 148 | emacs.dvi: ${EMACSSOURCES} | ||
| 149 | $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi | ||
| 150 | |||
| 151 | # This target is here so you could easily get the list of the *.texi | ||
| 152 | # files which belong to the Emacs manual (as opposed to the separate | ||
| 153 | # manuals for CL, CC Mode, Ebrowse, etc.). With this target, you can | ||
| 154 | # say things like "grep foo `make emacsman`". | ||
| 155 | emacsman: | ||
| 156 | @echo $(EMACSSOURCES) | ||
| 157 | |||
| 158 | ../info/ccmode: cc-mode.texi | ||
| 159 | cd $(srcdir); $(MAKEINFO) cc-mode.texi | ||
| 160 | cc-mode.dvi: cc-mode.texi | ||
| 161 | $(ENVADD) $(TEXI2DVI) ${srcdir}/cc-mode.texi | ||
| 162 | |||
| 163 | ../info/ada-mode: ada-mode.texi | ||
| 164 | cd $(srcdir); $(MAKEINFO) ada-mode.texi | ||
| 165 | ada-mode.dvi: ada-mode.texi | ||
| 166 | $(ENVADD) $(TEXI2DVI) ${srcdir}/ada-mode.texi | ||
| 167 | |||
| 168 | ../info/pcl-cvs: pcl-cvs.texi | ||
| 169 | cd $(srcdir); $(MAKEINFO) pcl-cvs.texi | ||
| 170 | pcl-cvs.dvi: pcl-cvs.texi | ||
| 171 | $(ENVADD) $(TEXI2DVI) ${srcdir}/pcl-cvs.texi | ||
| 172 | |||
| 173 | ../info/eshell: eshell.texi | ||
| 174 | cd $(srcdir); $(MAKEINFO) eshell.texi | ||
| 175 | eshell.dvi: eshell.texi | ||
| 176 | $(ENVADD) $(TEXI2DVI) ${srcdir}/eshell.texi | ||
| 177 | |||
| 178 | ../info/cl: cl.texi | ||
| 179 | cd $(srcdir); $(MAKEINFO) cl.texi | ||
| 180 | cl.dvi: cl.texi | ||
| 181 | $(ENVADD) $(TEXI2DVI) ${srcdir}/cl.texi | ||
| 182 | |||
| 183 | ../info/dired-x: dired-x.texi | ||
| 184 | cd $(srcdir); $(MAKEINFO) dired-x.texi | ||
| 185 | dired-x.dvi: dired-x.texi | ||
| 186 | $(ENVADD) $(TEXI2DVI) ${srcdir}/dired-x.texi | ||
| 187 | |||
| 188 | ../info/ediff: ediff.texi | ||
| 189 | cd $(srcdir); $(MAKEINFO) ediff.texi | ||
| 190 | ediff.dvi: ediff.texi | ||
| 191 | $(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi | ||
| 192 | |||
| 193 | emacs-xtra.dvi: emacs-xtra.texi $(EMACS_XTRA) | ||
| 194 | $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi | ||
| 195 | |||
| 196 | ../info/forms: forms.texi | ||
| 197 | cd $(srcdir); $(MAKEINFO) forms.texi | ||
| 198 | forms.dvi: forms.texi | ||
| 199 | $(ENVADD) $(TEXI2DVI) ${srcdir}/forms.texi | ||
| 200 | |||
| 201 | # gnus/message/emacs-mime/sieve/pgg are part of Gnus: | ||
| 202 | ../info/gnus: gnus.texi gnus-faq.texi | ||
| 203 | cd $(srcdir); $(MAKEINFO) gnus.texi | ||
| 204 | gnus.dvi: gnus.texi gnus-faq.texi | ||
| 205 | sed -e '/@iflatex/,/@end iflatex/d' ${srcdir}/gnus.texi > gnustmp.texi | ||
| 206 | $(ENVADD) $(TEXI2DVI) gnustmp.texi | ||
| 207 | cp gnustmp.dvi $*.dvi | ||
| 208 | rm gnustmp.* | ||
| 209 | |||
| 210 | ../info/message: message.texi | ||
| 211 | cd $(srcdir); $(MAKEINFO) message.texi | ||
| 212 | message.dvi: message.texi | ||
| 213 | $(ENVADD) $(TEXI2DVI) ${srcdir}/message.texi | ||
| 214 | |||
| 215 | ../info/sieve: sieve.texi | ||
| 216 | cd $(srcdir); $(MAKEINFO) sieve.texi | ||
| 217 | sieve.dvi: sieve.texi | ||
| 218 | $(ENVADD) $(TEXI2DVI) ${srcdir}/sieve.texi | ||
| 219 | |||
| 220 | ../info/emacs-mime: emacs-mime.texi | ||
| 221 | cd $(srcdir); $(MAKEINFO) --enable-encoding emacs-mime.texi | ||
| 222 | emacs-mime.dvi: emacs-mime.texi | ||
| 223 | $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-mime.texi | ||
| 224 | |||
| 225 | ../info/pgg: pgg.texi | ||
| 226 | cd $(srcdir); $(MAKEINFO) pgg.texi | ||
| 227 | pgg.dvi: pgg.texi | ||
| 228 | $(ENVADD) $(TEXI2DVI) ${srcdir}/pgg.texi | ||
| 229 | |||
| 230 | ../info/mh-e: mh-e.texi | ||
| 231 | cd $(srcdir); $(MAKEINFO) mh-e.texi | ||
| 232 | mh-e.dvi: mh-e.texi | ||
| 233 | $(ENVADD) $(TEXI2DVI) ${srcdir}/mh-e.texi | ||
| 234 | |||
| 235 | ../info/reftex: reftex.texi | ||
| 236 | cd $(srcdir); $(MAKEINFO) reftex.texi | ||
| 237 | reftex.dvi: reftex.texi | ||
| 238 | $(ENVADD) $(TEXI2DVI) ${srcdir}/reftex.texi | ||
| 239 | |||
| 240 | ../info/sc: sc.texi | ||
| 241 | cd $(srcdir); $(MAKEINFO) sc.texi | ||
| 242 | sc.dvi: sc.texi | ||
| 243 | $(ENVADD) $(TEXI2DVI) ${srcdir}/sc.texi | ||
| 244 | |||
| 245 | ../info/vip: vip.texi | ||
| 246 | cd $(srcdir); $(MAKEINFO) vip.texi | ||
| 247 | vip.dvi: vip.texi | ||
| 248 | $(ENVADD) $(TEXI2DVI) ${srcdir}/vip.texi | ||
| 249 | |||
| 250 | ../info/viper: viper.texi | ||
| 251 | cd $(srcdir); $(MAKEINFO) viper.texi | ||
| 252 | viper.dvi: viper.texi | ||
| 253 | $(ENVADD) $(TEXI2DVI) ${srcdir}/viper.texi | ||
| 254 | |||
| 255 | ../info/widget: widget.texi | ||
| 256 | cd $(srcdir); $(MAKEINFO) widget.texi | ||
| 257 | widget.dvi: widget.texi | ||
| 258 | $(ENVADD) $(TEXI2DVI) ${srcdir}/widget.texi | ||
| 259 | |||
| 260 | ../info/efaq: faq.texi | ||
| 261 | cd $(srcdir); $(MAKEINFO) faq.texi | ||
| 262 | faq.dvi: faq.texi | ||
| 263 | $(ENVADD) $(TEXI2DVI) ${srcdir}/faq.texi | ||
| 264 | |||
| 265 | ../etc/GNU: gnu1.texi gnu.texi | ||
| 266 | cd $(srcdir) && makeinfo --no-headers -o ../etc/GNU gnu1.texi | ||
| 267 | |||
| 268 | ../info/autotype: autotype.texi | ||
| 269 | cd $(srcdir); $(MAKEINFO) autotype.texi | ||
| 270 | autotype.dvi: autotype.texi | ||
| 271 | $(ENVADD) $(TEXI2DVI) ${srcdir}/autotype.texi | ||
| 272 | |||
| 273 | ../info/calc: calc.texi | ||
| 274 | cd $(srcdir); $(MAKEINFO) calc.texi | ||
| 275 | |||
| 276 | calc.dvi: calc.texi | ||
| 277 | $(ENVADD) $(TEXI2DVI) ${srcdir}/calc.texi | ||
| 278 | |||
| 279 | # This is produced with --no-split to avoid making files whose | ||
| 280 | # names clash on DOS 8+3 filesystems | ||
| 281 | ../info/idlwave: idlwave.texi | ||
| 282 | cd $(srcdir); $(MAKEINFO) --no-split idlwave.texi | ||
| 283 | idlwave.dvi: idlwave.texi | ||
| 284 | $(ENVADD) $(TEXI2DVI) ${srcdir}/idlwave.texi | ||
| 285 | |||
| 286 | ../info/eudc: eudc.texi | ||
| 287 | cd $(srcdir); $(MAKEINFO) eudc.texi | ||
| 288 | eudc.dvi: eudc.texi | ||
| 289 | $(ENVADD) $(TEXI2DVI) ${srcdir}/eudc.texi | ||
| 290 | |||
| 291 | ../info/ebrowse: ebrowse.texi | ||
| 292 | cd $(srcdir); $(MAKEINFO) ebrowse.texi | ||
| 293 | ebrowse.dvi: ebrowse.texi | ||
| 294 | $(ENVADD) $(TEXI2DVI) ${srcdir}/ebrowse.texi | ||
| 295 | |||
| 296 | ../info/woman: woman.texi | ||
| 297 | cd $(srcdir); $(MAKEINFO) woman.texi | ||
| 298 | woman.dvi: woman.texi | ||
| 299 | $(ENVADD) $(TEXI2DVI) ${srcdir}/woman.texi | ||
| 300 | |||
| 301 | ../info/org: org.texi | ||
| 302 | cd $(srcdir); $(MAKEINFO) org.texi | ||
| 303 | org.dvi: org.texi | ||
| 304 | $(ENVADD) $(TEXI2DVI) ${srcdir}/org.texi | ||
| 305 | |||
| 306 | ../info/url: url.texi | ||
| 307 | cd $(srcdir); $(MAKEINFO) url.texi | ||
| 308 | url.dvi: url.texi | ||
| 309 | $(ENVADD) $(TEXI2DVI) ${srcdir}/url.texi | ||
| 310 | |||
| 311 | ../info/speedbar: speedbar.texi | ||
| 312 | cd $(srcdir); $(MAKEINFO) speedbar.texi | ||
| 313 | speedbar.dvi: speedbar.texi | ||
| 314 | $(ENVADD) $(TEXI2DVI) ${srcdir}/speedbar.texi | ||
| 315 | |||
| 316 | ../info/tramp: tramp.texi trampver.texi | ||
| 317 | cd $(srcdir); $(MAKEINFO) -D emacs tramp.texi | ||
| 318 | tramp.dvi: tramp.texi trampver.texi | ||
| 319 | $(ENVADD) $(TEXI2DVI) ${srcdir}/tramp.texi | ||
| 320 | |||
| 321 | ../info/ses: ses.texi | ||
| 322 | cd $(srcdir); $(MAKEINFO) ses.texi | ||
| 323 | ses.dvi: ses.texi | ||
| 324 | $(ENVADD) $(TEXI2DVI) ${srcdir}/ses.texi | ||
| 325 | |||
| 326 | ../info/smtpmail: smtpmail.texi | ||
| 327 | cd $(srcdir); $(MAKEINFO) smtpmail.texi | ||
| 328 | smtpmail.dvi: smtpmail.texi | ||
| 329 | $(ENVADD) $(TEXI2DVI) ${srcdir}/smtpmail.texi | ||
| 330 | |||
| 331 | ../info/flymake: flymake.texi | ||
| 332 | cd $(srcdir); $(MAKEINFO) flymake.texi | ||
| 333 | flymake.dvi: flymake.texi | ||
| 334 | $(ENVADD) $(TEXI2DVI) ${srcdir}/flymake.texi | ||
| 335 | |||
| 336 | ../info/newsticker: newsticker.texi | ||
| 337 | cd $(srcdir); $(MAKEINFO) newsticker.texi | ||
| 338 | newsticker.dvi: newsticker.texi | ||
| 339 | $(ENVADD) $(TEXI2DVI) ${srcdir}/newsticker.texi | ||
| 340 | |||
| 341 | ../info/rcirc: rcirc.texi | ||
| 342 | cd $(srcdir); $(MAKEINFO) rcirc.texi | ||
| 343 | rcirc.dvi: rcirc.texi | ||
| 344 | $(ENVADD) $(TEXI2DVI) ${srcdir}/rcirc.texi | ||
| 345 | |||
| 346 | ../info/erc: erc.texi | ||
| 347 | cd $(srcdir); $(MAKEINFO) erc.texi | ||
| 348 | erc.dvi: erc.texi | ||
| 349 | $(ENVADD) $(TEXI2DVI) ${srcdir}/erc.texi | ||
| 350 | |||
| 351 | mostlyclean: | ||
| 352 | rm -f *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.* | ||
| 353 | |||
| 354 | clean: mostlyclean | ||
| 355 | rm -f *.dvi | ||
| 356 | |||
| 357 | distclean: clean | ||
| 358 | |||
| 359 | maintainer-clean: distclean | ||
| 360 | rm -f *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc | ||
| 361 | for file in $(INFO_TARGETS); do rm -f $${file}*; done | ||
| 362 | |||
| 363 | |||
| 364 | # Formerly this directory had texindex.c and getopt.c in it | ||
| 365 | # and this makefile built them to make texindex. | ||
| 366 | # That caused trouble because this is run entirely in the source directory. | ||
| 367 | # Since we expect to get texi2dvi from elsewhere, | ||
| 368 | # it is ok to expect texindex from elsewhere also. | ||
diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi new file mode 100644 index 00000000000..585e28318e7 --- /dev/null +++ b/doc/emacs/abbrevs.texi | |||
| @@ -0,0 +1,457 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, 2003, | ||
| 3 | @c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Abbrevs | ||
| 6 | @chapter Abbrevs | ||
| 7 | @cindex abbrevs | ||
| 8 | @cindex expansion (of abbrevs) | ||
| 9 | |||
| 10 | A defined @dfn{abbrev} is a word which @dfn{expands}, if you insert | ||
| 11 | it, into some different text. Abbrevs are defined by the user to expand | ||
| 12 | in specific ways. For example, you might define @samp{foo} as an abbrev | ||
| 13 | expanding to @samp{find outer otter}. Then you could insert | ||
| 14 | @samp{find outer otter } into the buffer by typing @kbd{f o o | ||
| 15 | @key{SPC}}. | ||
| 16 | |||
| 17 | A second kind of abbreviation facility is called @dfn{dynamic abbrev | ||
| 18 | expansion}. You use dynamic abbrev expansion with an explicit command | ||
| 19 | to expand the letters in the buffer before point by looking for other | ||
| 20 | words in the buffer that start with those letters. @xref{Dynamic | ||
| 21 | Abbrevs}. | ||
| 22 | |||
| 23 | ``Hippie'' expansion generalizes abbreviation expansion. | ||
| 24 | @xref{Hippie Expand, , Hippie Expansion, autotype, Features for | ||
| 25 | Automatic Typing}. | ||
| 26 | |||
| 27 | @menu | ||
| 28 | * Abbrev Concepts:: Fundamentals of defined abbrevs. | ||
| 29 | * Defining Abbrevs:: Defining an abbrev, so it will expand when typed. | ||
| 30 | * Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion. | ||
| 31 | * Editing Abbrevs:: Viewing or editing the entire list of defined abbrevs. | ||
| 32 | * Saving Abbrevs:: Saving the entire list of abbrevs for another session. | ||
| 33 | * Dynamic Abbrevs:: Abbreviations for words already in the buffer. | ||
| 34 | * Dabbrev Customization:: What is a word, for dynamic abbrevs. Case handling. | ||
| 35 | @end menu | ||
| 36 | |||
| 37 | @node Abbrev Concepts | ||
| 38 | @section Abbrev Concepts | ||
| 39 | |||
| 40 | An @dfn{abbrev} is a word which has been defined to @dfn{expand} into | ||
| 41 | a specified @dfn{expansion}. When you insert a word-separator character | ||
| 42 | following the abbrev, that expands the abbrev---replacing the abbrev | ||
| 43 | with its expansion. For example, if @samp{foo} is defined as an abbrev | ||
| 44 | expanding to @samp{find outer otter}, then you can insert @samp{find | ||
| 45 | outer otter.} into the buffer by typing @kbd{f o o .}. | ||
| 46 | |||
| 47 | @findex abbrev-mode | ||
| 48 | @vindex abbrev-mode | ||
| 49 | @cindex Abbrev mode | ||
| 50 | @cindex mode, Abbrev | ||
| 51 | Abbrevs expand only when Abbrev mode (a minor mode) is enabled. | ||
| 52 | Disabling Abbrev mode does not cause abbrev definitions to be forgotten, | ||
| 53 | but they do not expand until Abbrev mode is enabled again. The command | ||
| 54 | @kbd{M-x abbrev-mode} toggles Abbrev mode; with a numeric argument, it | ||
| 55 | turns Abbrev mode on if the argument is positive, off otherwise. | ||
| 56 | @xref{Minor Modes}. @code{abbrev-mode} is also a variable; Abbrev mode is | ||
| 57 | on when the variable is non-@code{nil}. The variable @code{abbrev-mode} | ||
| 58 | automatically becomes local to the current buffer when it is set. | ||
| 59 | |||
| 60 | Abbrevs can have @dfn{mode-specific} definitions, active only in one major | ||
| 61 | mode. Abbrevs can also have @dfn{global} definitions that are active in | ||
| 62 | all major modes. The same abbrev can have a global definition and various | ||
| 63 | mode-specific definitions for different major modes. A mode-specific | ||
| 64 | definition for the current major mode overrides a global definition. | ||
| 65 | |||
| 66 | You can define abbrevs interactively during the editing session. You | ||
| 67 | can also save lists of abbrev definitions in files for use in later | ||
| 68 | sessions. Some users keep extensive lists of abbrevs that they load | ||
| 69 | in every session. | ||
| 70 | |||
| 71 | @node Defining Abbrevs | ||
| 72 | @section Defining Abbrevs | ||
| 73 | |||
| 74 | @table @kbd | ||
| 75 | @item C-x a g | ||
| 76 | Define an abbrev, using one or more words before point as its expansion | ||
| 77 | (@code{add-global-abbrev}). | ||
| 78 | @item C-x a l | ||
| 79 | Similar, but define an abbrev specific to the current major mode | ||
| 80 | (@code{add-mode-abbrev}). | ||
| 81 | @item C-x a i g | ||
| 82 | Define a word in the buffer as an abbrev (@code{inverse-add-global-abbrev}). | ||
| 83 | @item C-x a i l | ||
| 84 | Define a word in the buffer as a mode-specific abbrev | ||
| 85 | (@code{inverse-add-mode-abbrev}). | ||
| 86 | @item M-x define-global-abbrev @key{RET} @var{abbrev} @key{RET} @var{exp} @key{RET} | ||
| 87 | Define @var{abbrev} as an abbrev expanding into @var{exp}. | ||
| 88 | @item M-x define-mode-abbrev @key{RET} @var{abbrev} @key{RET} @var{exp} @key{RET} | ||
| 89 | Define @var{abbrev} as a mode-specific abbrev expanding into @var{exp}. | ||
| 90 | @item M-x kill-all-abbrevs | ||
| 91 | Discard all abbrev definitions, leaving a blank slate. | ||
| 92 | @end table | ||
| 93 | |||
| 94 | @kindex C-x a g | ||
| 95 | @findex add-global-abbrev | ||
| 96 | The usual way to define an abbrev is to enter the text you want the | ||
| 97 | abbrev to expand to, position point after it, and type @kbd{C-x a g} | ||
| 98 | (@code{add-global-abbrev}). This reads the abbrev itself using the | ||
| 99 | minibuffer, and then defines it as an abbrev for one or more words before | ||
| 100 | point. Use a numeric argument to say how many words before point should be | ||
| 101 | taken as the expansion. For example, to define the abbrev @samp{foo} as | ||
| 102 | mentioned above, insert the text @samp{find outer otter} and then type | ||
| 103 | @kbd{C-u 3 C-x a g f o o @key{RET}}. | ||
| 104 | |||
| 105 | An argument of zero to @kbd{C-x a g} means to use the contents of the | ||
| 106 | region as the expansion of the abbrev being defined. | ||
| 107 | |||
| 108 | @kindex C-x a l | ||
| 109 | @findex add-mode-abbrev | ||
| 110 | The command @kbd{C-x a l} (@code{add-mode-abbrev}) is similar, but | ||
| 111 | defines a mode-specific abbrev. Mode-specific abbrevs are active only in a | ||
| 112 | particular major mode. @kbd{C-x a l} defines an abbrev for the major mode | ||
| 113 | in effect at the time @kbd{C-x a l} is typed. The arguments work the same | ||
| 114 | as for @kbd{C-x a g}. | ||
| 115 | |||
| 116 | @kindex C-x a i g | ||
| 117 | @findex inverse-add-global-abbrev | ||
| 118 | @kindex C-x a i l | ||
| 119 | @findex inverse-add-mode-abbrev | ||
| 120 | If the abbrev text itself is already in the buffer, you can use the | ||
| 121 | commands @kbd{C-x a i g} (@code{inverse-add-global-abbrev}) and | ||
| 122 | @kbd{C-x a i l} (@code{inverse-add-mode-abbrev}) to define it as an | ||
| 123 | abbrev by specify the expansion in the minibuffer. These commands are | ||
| 124 | called ``inverse'' because they invert the meaning of the two text | ||
| 125 | strings they use (one from the buffer and one read with the | ||
| 126 | minibuffer). | ||
| 127 | |||
| 128 | @findex define-mode-abbrev | ||
| 129 | @findex define-global-abbrev | ||
| 130 | You can define an abbrev without inserting either the abbrev or its | ||
| 131 | expansion in the buffer using the command @code{define-global-abbrev}. | ||
| 132 | It reads two arguments---the abbrev, and its expansion. The command | ||
| 133 | @code{define-mode-abbrev} does likewise for a mode-specific abbrev. | ||
| 134 | |||
| 135 | To change the definition of an abbrev, just define a new definition. | ||
| 136 | When the abbrev has a prior definition, the abbrev definition commands | ||
| 137 | ask for confirmation before replacing it. | ||
| 138 | |||
| 139 | @findex kill-all-abbrevs | ||
| 140 | To remove an abbrev definition, give a negative argument to the | ||
| 141 | abbrev definition command: @kbd{C-u - C-x a g} or @kbd{C-u - C-x a l}. | ||
| 142 | The former removes a global definition, while the latter removes a | ||
| 143 | mode-specific definition. @kbd{M-x kill-all-abbrevs} removes all | ||
| 144 | abbrev definitions, both global and local. | ||
| 145 | |||
| 146 | @node Expanding Abbrevs | ||
| 147 | @section Controlling Abbrev Expansion | ||
| 148 | |||
| 149 | When Abbrev mode is enabled, an abbrev expands whenever it is | ||
| 150 | present in the buffer just before point and you type a self-inserting | ||
| 151 | whitespace or punctuation character (@key{SPC}, comma, etc.@:). More | ||
| 152 | precisely, any character that is not a word constituent expands an | ||
| 153 | abbrev, and any word-constituent character can be part of an abbrev. | ||
| 154 | The most common way to use an abbrev is to insert it and then insert a | ||
| 155 | punctuation or whitespace character to expand it. | ||
| 156 | |||
| 157 | @vindex abbrev-all-caps | ||
| 158 | Abbrev expansion preserves case; thus, @samp{foo} expands into @samp{find | ||
| 159 | outer otter}; @samp{Foo} into @samp{Find outer otter}, and @samp{FOO} into | ||
| 160 | @samp{FIND OUTER OTTER} or @samp{Find Outer Otter} according to the | ||
| 161 | variable @code{abbrev-all-caps} (setting it non-@code{nil} specifies | ||
| 162 | @samp{FIND OUTER OTTER}). | ||
| 163 | |||
| 164 | These commands are used to control abbrev expansion: | ||
| 165 | |||
| 166 | @table @kbd | ||
| 167 | @item M-' | ||
| 168 | Separate a prefix from a following abbrev to be expanded | ||
| 169 | (@code{abbrev-prefix-mark}). | ||
| 170 | @item C-x a e | ||
| 171 | @findex expand-abbrev | ||
| 172 | Expand the abbrev before point (@code{expand-abbrev}). | ||
| 173 | This is effective even when Abbrev mode is not enabled. | ||
| 174 | @item M-x expand-region-abbrevs | ||
| 175 | Expand some or all abbrevs found in the region. | ||
| 176 | @end table | ||
| 177 | |||
| 178 | @kindex M-' | ||
| 179 | @findex abbrev-prefix-mark | ||
| 180 | You may wish to expand an abbrev and attach a prefix to the expansion; | ||
| 181 | for example, if @samp{cnst} expands into @samp{construction}, you might want | ||
| 182 | to use it to enter @samp{reconstruction}. It does not work to type | ||
| 183 | @kbd{recnst}, because that is not necessarily a defined abbrev. What | ||
| 184 | you can do is use the command @kbd{M-'} (@code{abbrev-prefix-mark}) in | ||
| 185 | between the prefix @samp{re} and the abbrev @samp{cnst}. First, insert | ||
| 186 | @samp{re}. Then type @kbd{M-'}; this inserts a hyphen in the buffer to | ||
| 187 | indicate that it has done its work. Then insert the abbrev @samp{cnst}; | ||
| 188 | the buffer now contains @samp{re-cnst}. Now insert a non-word character | ||
| 189 | to expand the abbrev @samp{cnst} into @samp{construction}. This | ||
| 190 | expansion step also deletes the hyphen that indicated @kbd{M-'} had been | ||
| 191 | used. The result is the desired @samp{reconstruction}. | ||
| 192 | |||
| 193 | If you actually want the text of the abbrev in the buffer, rather than | ||
| 194 | its expansion, you can accomplish this by inserting the following | ||
| 195 | punctuation with @kbd{C-q}. Thus, @kbd{foo C-q ,} leaves @samp{foo,} in | ||
| 196 | the buffer, not expanding it. | ||
| 197 | |||
| 198 | @findex unexpand-abbrev | ||
| 199 | If you expand an abbrev by mistake, you can undo the expansion and | ||
| 200 | bring back the abbrev itself by typing @kbd{C-_} to undo (@pxref{Undo}). | ||
| 201 | This also undoes the insertion of the non-word character that expanded | ||
| 202 | the abbrev. If the result you want is the terminating non-word | ||
| 203 | character plus the unexpanded abbrev, you must reinsert the terminating | ||
| 204 | character, quoting it with @kbd{C-q}. You can also use the command | ||
| 205 | @kbd{M-x unexpand-abbrev} to cancel the last expansion without | ||
| 206 | deleting the terminating character. | ||
| 207 | |||
| 208 | @findex expand-region-abbrevs | ||
| 209 | @kbd{M-x expand-region-abbrevs} searches through the region for defined | ||
| 210 | abbrevs, and for each one found offers to replace it with its expansion. | ||
| 211 | This command is useful if you have typed in text using abbrevs but forgot | ||
| 212 | to turn on Abbrev mode first. It may also be useful together with a | ||
| 213 | special set of abbrev definitions for making several global replacements at | ||
| 214 | once. This command is effective even if Abbrev mode is not enabled. | ||
| 215 | |||
| 216 | Expanding any abbrev first runs the hook @code{pre-abbrev-expand-hook} | ||
| 217 | (@pxref{Hooks}). | ||
| 218 | |||
| 219 | @need 1500 | ||
| 220 | @node Editing Abbrevs | ||
| 221 | @section Examining and Editing Abbrevs | ||
| 222 | |||
| 223 | @table @kbd | ||
| 224 | @item M-x list-abbrevs | ||
| 225 | Display a list of all abbrev definitions. With a numeric argument, list | ||
| 226 | only local abbrevs. | ||
| 227 | @item M-x edit-abbrevs | ||
| 228 | Edit a list of abbrevs; you can add, alter or remove definitions. | ||
| 229 | @end table | ||
| 230 | |||
| 231 | @findex list-abbrevs | ||
| 232 | The output from @kbd{M-x list-abbrevs} looks like this: | ||
| 233 | |||
| 234 | @example | ||
| 235 | @var{various other tables@dots{}} | ||
| 236 | (lisp-mode-abbrev-table) | ||
| 237 | "dk" 0 "define-key" | ||
| 238 | (global-abbrev-table) | ||
| 239 | "dfn" 0 "definition" | ||
| 240 | @end example | ||
| 241 | |||
| 242 | @noindent | ||
| 243 | (Some blank lines of no semantic significance, and some other abbrev | ||
| 244 | tables, have been omitted.) | ||
| 245 | |||
| 246 | A line containing a name in parentheses is the header for abbrevs in a | ||
| 247 | particular abbrev table; @code{global-abbrev-table} contains all the global | ||
| 248 | abbrevs, and the other abbrev tables that are named after major modes | ||
| 249 | contain the mode-specific abbrevs. | ||
| 250 | |||
| 251 | Within each abbrev table, each nonblank line defines one abbrev. The | ||
| 252 | word at the beginning of the line is the abbrev. The number that | ||
| 253 | follows is the number of times the abbrev has been expanded. Emacs | ||
| 254 | keeps track of this to help you see which abbrevs you actually use, so | ||
| 255 | that you can eliminate those that you don't use often. The string at | ||
| 256 | the end of the line is the expansion. | ||
| 257 | |||
| 258 | Some abbrevs are marked with @samp{(sys)}. These ``system'' abbrevs | ||
| 259 | (@pxref{Abbrevs,,, elisp, The Emacs Lisp Reference Manual}) are | ||
| 260 | pre-defined by various modes, and are not saved to your abbrev file. | ||
| 261 | To disable a ``system'' abbrev, define an abbrev of the same name that | ||
| 262 | expands to itself, and save it to your abbrev file. | ||
| 263 | |||
| 264 | @findex edit-abbrevs | ||
| 265 | @kindex C-c C-c @r{(Edit Abbrevs)} | ||
| 266 | @kbd{M-x edit-abbrevs} allows you to add, change or kill abbrev | ||
| 267 | definitions by editing a list of them in an Emacs buffer. The list has | ||
| 268 | the same format described above. The buffer of abbrevs is called | ||
| 269 | @samp{*Abbrevs*}, and is in Edit-Abbrevs mode. Type @kbd{C-c C-c} in | ||
| 270 | this buffer to install the abbrev definitions as specified in the | ||
| 271 | buffer---and delete any abbrev definitions not listed. | ||
| 272 | |||
| 273 | The command @code{edit-abbrevs} is actually the same as | ||
| 274 | @code{list-abbrevs} except that it selects the buffer @samp{*Abbrevs*} | ||
| 275 | whereas @code{list-abbrevs} merely displays it in another window. | ||
| 276 | |||
| 277 | @node Saving Abbrevs | ||
| 278 | @section Saving Abbrevs | ||
| 279 | |||
| 280 | These commands allow you to keep abbrev definitions between editing | ||
| 281 | sessions. | ||
| 282 | |||
| 283 | @table @kbd | ||
| 284 | @item M-x write-abbrev-file @key{RET} @var{file} @key{RET} | ||
| 285 | Write a file @var{file} describing all defined abbrevs. | ||
| 286 | @item M-x read-abbrev-file @key{RET} @var{file} @key{RET} | ||
| 287 | Read the file @var{file} and define abbrevs as specified therein. | ||
| 288 | @item M-x quietly-read-abbrev-file @key{RET} @var{file} @key{RET} | ||
| 289 | Similar but do not display a message about what is going on. | ||
| 290 | @item M-x define-abbrevs | ||
| 291 | Define abbrevs from definitions in current buffer. | ||
| 292 | @item M-x insert-abbrevs | ||
| 293 | Insert all abbrevs and their expansions into current buffer. | ||
| 294 | @end table | ||
| 295 | |||
| 296 | @findex write-abbrev-file | ||
| 297 | @kbd{M-x write-abbrev-file} reads a file name using the minibuffer and | ||
| 298 | then writes a description of all current abbrev definitions into that | ||
| 299 | file. This is used to save abbrev definitions for use in a later | ||
| 300 | session. The text stored in the file is a series of Lisp expressions | ||
| 301 | that, when executed, define the same abbrevs that you currently have. | ||
| 302 | |||
| 303 | @findex read-abbrev-file | ||
| 304 | @findex quietly-read-abbrev-file | ||
| 305 | @vindex abbrev-file-name | ||
| 306 | @kbd{M-x read-abbrev-file} reads a file name using the minibuffer | ||
| 307 | and then reads the file, defining abbrevs according to the contents of | ||
| 308 | the file. The function @code{quietly-read-abbrev-file} is similar | ||
| 309 | except that it does not display a message in the echo area; you cannot | ||
| 310 | invoke it interactively, and it is used primarily in the @file{.emacs} | ||
| 311 | file. If either of these functions is called with @code{nil} as the | ||
| 312 | argument, it uses the file name specified in the variable | ||
| 313 | @code{abbrev-file-name}, which is by default @code{"~/.abbrev_defs"}. | ||
| 314 | That file is your standard abbrev definition file, and Emacs loads | ||
| 315 | abbrevs from it automatically when it starts up. | ||
| 316 | |||
| 317 | @vindex save-abbrevs | ||
| 318 | Emacs will offer to save abbrevs automatically if you have changed | ||
| 319 | any of them, whenever it offers to save all files (for @kbd{C-x s} or | ||
| 320 | @kbd{C-x C-c}). It saves them in the file specified by | ||
| 321 | @code{abbrev-file-name}. This feature can be inhibited by setting the | ||
| 322 | variable @code{save-abbrevs} to @code{nil}. | ||
| 323 | |||
| 324 | @findex insert-abbrevs | ||
| 325 | @findex define-abbrevs | ||
| 326 | The commands @kbd{M-x insert-abbrevs} and @kbd{M-x define-abbrevs} are | ||
| 327 | similar to the previous commands but work on text in an Emacs buffer. | ||
| 328 | @kbd{M-x insert-abbrevs} inserts text into the current buffer after point, | ||
| 329 | describing all current abbrev definitions; @kbd{M-x define-abbrevs} parses | ||
| 330 | the entire current buffer and defines abbrevs accordingly. | ||
| 331 | |||
| 332 | @node Dynamic Abbrevs | ||
| 333 | @section Dynamic Abbrev Expansion | ||
| 334 | |||
| 335 | The abbrev facility described above operates automatically as you | ||
| 336 | insert text, but all abbrevs must be defined explicitly. By contrast, | ||
| 337 | @dfn{dynamic abbrevs} allow the meanings of abbreviations to be | ||
| 338 | determined automatically from the contents of the buffer, but dynamic | ||
| 339 | abbrev expansion happens only when you request it explicitly. | ||
| 340 | |||
| 341 | @kindex M-/ | ||
| 342 | @kindex C-M-/ | ||
| 343 | @findex dabbrev-expand | ||
| 344 | @findex dabbrev-completion | ||
| 345 | @table @kbd | ||
| 346 | @item M-/ | ||
| 347 | Expand the word in the buffer before point as a @dfn{dynamic abbrev}, | ||
| 348 | by searching in the buffer for words starting with that abbreviation | ||
| 349 | (@code{dabbrev-expand}). | ||
| 350 | |||
| 351 | @item C-M-/ | ||
| 352 | Complete the word before point as a dynamic abbrev | ||
| 353 | (@code{dabbrev-completion}). | ||
| 354 | @end table | ||
| 355 | |||
| 356 | @vindex dabbrev-limit | ||
| 357 | For example, if the buffer contains @samp{does this follow } and you | ||
| 358 | type @kbd{f o M-/}, the effect is to insert @samp{follow} because that | ||
| 359 | is the last word in the buffer that starts with @samp{fo}. A numeric | ||
| 360 | argument to @kbd{M-/} says to take the second, third, etc.@: distinct | ||
| 361 | expansion found looking backward from point. Repeating @kbd{M-/} | ||
| 362 | searches for an alternative expansion by looking farther back. After | ||
| 363 | scanning all the text before point, it searches the text after point. | ||
| 364 | The variable @code{dabbrev-limit}, if non-@code{nil}, specifies how far | ||
| 365 | away in the buffer to search for an expansion. | ||
| 366 | |||
| 367 | @vindex dabbrev-check-all-buffers | ||
| 368 | After scanning the current buffer, @kbd{M-/} normally searches other | ||
| 369 | buffers, unless you have set @code{dabbrev-check-all-buffers} to | ||
| 370 | @code{nil}. | ||
| 371 | |||
| 372 | @vindex dabbrev-ignored-buffer-regexps | ||
| 373 | For finer control over which buffers to scan, customize the variable | ||
| 374 | @code{dabbrev-ignored-buffer-regexps}. Its value is a list of regular | ||
| 375 | expressions. If a buffer's name matches any of these regular | ||
| 376 | expressions, dynamic abbrev expansion skips that buffer. | ||
| 377 | |||
| 378 | A negative argument to @kbd{M-/}, as in @kbd{C-u - M-/}, says to | ||
| 379 | search first for expansions after point, then other buffers, and | ||
| 380 | consider expansions before point only as a last resort. If you repeat | ||
| 381 | the @kbd{M-/} to look for another expansion, do not specify an | ||
| 382 | argument. Repeating @kbd{M-/} cycles through all the expansions after | ||
| 383 | point and then the expansions before point. | ||
| 384 | |||
| 385 | After you have expanded a dynamic abbrev, you can copy additional | ||
| 386 | words that follow the expansion in its original context. Simply type | ||
| 387 | @kbd{@key{SPC} M-/} for each additional word you want to copy. The | ||
| 388 | spacing and punctuation between words is copied along with the words. | ||
| 389 | |||
| 390 | The command @kbd{C-M-/} (@code{dabbrev-completion}) performs | ||
| 391 | completion of a dynamic abbrev. Instead of trying the possible | ||
| 392 | expansions one by one, it finds all of them, then inserts the text | ||
| 393 | that they have in common. If they have nothing in common, @kbd{C-M-/} | ||
| 394 | displays a list of completions, from which you can select a choice in | ||
| 395 | the usual manner. @xref{Completion}. | ||
| 396 | |||
| 397 | Dynamic abbrev expansion is completely independent of Abbrev mode; the | ||
| 398 | expansion of a word with @kbd{M-/} is completely independent of whether | ||
| 399 | it has a definition as an ordinary abbrev. | ||
| 400 | |||
| 401 | @node Dabbrev Customization | ||
| 402 | @section Customizing Dynamic Abbreviation | ||
| 403 | |||
| 404 | Normally, dynamic abbrev expansion ignores case when searching for | ||
| 405 | expansions. That is, the expansion need not agree in case with the word | ||
| 406 | you are expanding. | ||
| 407 | |||
| 408 | @vindex dabbrev-case-fold-search | ||
| 409 | This feature is controlled by the variable | ||
| 410 | @code{dabbrev-case-fold-search}. If it is @code{t}, case is ignored in | ||
| 411 | this search; if it is @code{nil}, the word and the expansion must match | ||
| 412 | in case. If the value of @code{dabbrev-case-fold-search} is | ||
| 413 | @code{case-fold-search}, which is true by default, then the variable | ||
| 414 | @code{case-fold-search} controls whether to ignore case while searching | ||
| 415 | for expansions. | ||
| 416 | |||
| 417 | @vindex dabbrev-case-replace | ||
| 418 | Normally, dynamic abbrev expansion preserves the case pattern | ||
| 419 | @emph{of the dynamic abbrev you are expanding}, by converting the | ||
| 420 | expansion to that case pattern. | ||
| 421 | |||
| 422 | @vindex dabbrev-case-fold-search | ||
| 423 | The variable @code{dabbrev-case-replace} controls whether to | ||
| 424 | preserve the case pattern of the dynamic abbrev. If it is @code{t}, | ||
| 425 | the dynamic abbrev's case pattern is preserved in most cases; if it is | ||
| 426 | @code{nil}, the expansion is always copied verbatim. If the value of | ||
| 427 | @code{dabbrev-case-replace} is @code{case-replace}, which is true by | ||
| 428 | default, then the variable @code{case-replace} controls whether to | ||
| 429 | copy the expansion verbatim. | ||
| 430 | |||
| 431 | However, if the expansion contains a complex mixed case pattern, and | ||
| 432 | the dynamic abbrev matches this pattern as far as it goes, then the | ||
| 433 | expansion is always copied verbatim, regardless of those variables. | ||
| 434 | Thus, for example, if the buffer contains | ||
| 435 | @code{variableWithSillyCasePattern}, and you type @kbd{v a M-/}, it | ||
| 436 | copies the expansion verbatim including its case pattern. | ||
| 437 | |||
| 438 | @vindex dabbrev-abbrev-char-regexp | ||
| 439 | The variable @code{dabbrev-abbrev-char-regexp}, if non-@code{nil}, | ||
| 440 | controls which characters are considered part of a word, for dynamic expansion | ||
| 441 | purposes. The regular expression must match just one character, never | ||
| 442 | two or more. The same regular expression also determines which | ||
| 443 | characters are part of an expansion. The value @code{nil} has a special | ||
| 444 | meaning: dynamic abbrevs are made of word characters, but expansions are | ||
| 445 | made of word and symbol characters. | ||
| 446 | |||
| 447 | @vindex dabbrev-abbrev-skip-leading-regexp | ||
| 448 | In shell scripts and makefiles, a variable name is sometimes prefixed | ||
| 449 | with @samp{$} and sometimes not. Major modes for this kind of text can | ||
| 450 | customize dynamic abbrev expansion to handle optional prefixes by setting | ||
| 451 | the variable @code{dabbrev-abbrev-skip-leading-regexp}. Its value | ||
| 452 | should be a regular expression that matches the optional prefix that | ||
| 453 | dynamic abbrev expression should ignore. | ||
| 454 | |||
| 455 | @ignore | ||
| 456 | arch-tag: 638e0079-9540-48ec-9166-414083e16445 | ||
| 457 | @end ignore | ||
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi new file mode 100644 index 00000000000..d5dbf1ae8ca --- /dev/null +++ b/doc/emacs/ack.texi | |||
| @@ -0,0 +1,1574 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, | ||
| 3 | @c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @c | ||
| 6 | @node Acknowledgments, Screen, Concept Index, Top | ||
| 7 | @unnumbered Acknowledgments | ||
| 8 | |||
| 9 | Many people have contributed code included in the Free Software | ||
| 10 | Foundation's distribution of GNU Emacs. To show our appreciation for | ||
| 11 | their public spirit, we list here in alphabetical order those who have | ||
| 12 | written substantial portions. | ||
| 13 | |||
| 14 | @c We should list here anyone who has contributed a new package, | ||
| 15 | @c and anyone who has made major enhancements in Emacs | ||
| 16 | @c that many users would notice and consider important. | ||
| 17 | |||
| 18 | @itemize @bullet | ||
| 19 | @item | ||
| 20 | Per Abrahamsen wrote the customization buffer facilities, as well as | ||
| 21 | @file{double.el} for typing accented characters not normally available | ||
| 22 | from the keyboard, @file{xt-mouse.el} which handles mouse commands | ||
| 23 | through Xterm, @file{gnus-cus.el} which implements customization | ||
| 24 | commands for Gnus, @file{gnus-cite.el}, a citation-parsing facility | ||
| 25 | for news articles and @file{cpp.el} which hides or highlights parts of | ||
| 26 | C programs according to preprocessor conditionals. | ||
| 27 | |||
| 28 | @item | ||
| 29 | Tomas Abrahamsson wrote @file{artist.el}, a package for producing @acronym{ASCII} | ||
| 30 | art with a mouse or with keyboard keys. | ||
| 31 | |||
| 32 | @item | ||
| 33 | Jay K.@: Adams wrote @file{jka-compr.el}, providing automatic | ||
| 34 | decompression and recompression for compressed files. | ||
| 35 | |||
| 36 | @item | ||
| 37 | Ralf Angeli wrote @file{scroll-lock.el}, a minor mode which keeps the | ||
| 38 | point vertically fixed by scrolling the window when moving up and down | ||
| 39 | in the buffer. | ||
| 40 | |||
| 41 | @item | ||
| 42 | Joe Arceneaux wrote the original text property implementation, and | ||
| 43 | implemented support for X11. | ||
| 44 | |||
| 45 | @item | ||
| 46 | Miles Bader wrote @file{image-file.el}, support code for visiting | ||
| 47 | image files, @file{minibuf-eldef.el}, a minor mode whereby the default | ||
| 48 | value is shown in the minibuffer prompt only when appropriate, and | ||
| 49 | @file{button.el}, the library that implements clickable buttons. | ||
| 50 | |||
| 51 | @item | ||
| 52 | David Bakhash wrote @file{strokes.el}, a mode for controlling Emacs by | ||
| 53 | moving the mouse in particular patterns. | ||
| 54 | |||
| 55 | @item | ||
| 56 | Eli Barzilay wrote @file{calculator.el}, a desktop calculator for | ||
| 57 | Emacs. | ||
| 58 | |||
| 59 | @item | ||
| 60 | Steven L.@: Baur wrote | ||
| 61 | @c If earcon.el actually works with Emacs 21, it isn't useful for lack | ||
| 62 | @c of sound files. -- fx | ||
| 63 | @c @file{earcon.el}, a facility for sound effects | ||
| 64 | @c for email and news messages, | ||
| 65 | @file{footnote.el} which lets you include | ||
| 66 | footnotes in email messages, and @file{gnus-audio.el} which provides | ||
| 67 | sound effects for Gnus. | ||
| 68 | |||
| 69 | @item | ||
| 70 | Alexander L. Belikoff, Sergey Berezin, David Edmondson, Andreas | ||
| 71 | Fuchs, Mario Lang, Gergely Nagy, Michael Olson, and Alex Schroeder | ||
| 72 | contributed ERC, an advanced Internet Relay Chat client. | ||
| 73 | |||
| 74 | @item | ||
| 75 | Boaz Ben-Zvi wrote @file{profile.el}, to time Emacs Lisp functions. | ||
| 76 | |||
| 77 | @item | ||
| 78 | Anna M. Bigatti wrote @file{cal-html.el}, which produces HTML calendars. | ||
| 79 | |||
| 80 | @item | ||
| 81 | Ray Blaak wrote @file{delphi.el}, a major mode for editing Delphi | ||
| 82 | (Object Pascal) source code. | ||
| 83 | |||
| 84 | @item | ||
| 85 | Jim Blandy wrote Emacs 19's input system, brought its configuration and | ||
| 86 | build process up to the GNU coding standards, and contributed to the | ||
| 87 | frame support and multi-face support. Jim also wrote @file{tvi970.el}, | ||
| 88 | terminal support for the TeleVideo 970 terminals. | ||
| 89 | |||
| 90 | @item | ||
| 91 | Per Bothner wrote @file{term.el}, a terminal emulator in an Emacs | ||
| 92 | buffer. | ||
| 93 | |||
| 94 | @item | ||
| 95 | Terrence M.@: Brannon wrote @file{landmark.el}, a neural-network robot | ||
| 96 | that learns landmarks. | ||
| 97 | |||
| 98 | @item | ||
| 99 | Frank Bresz wrote @file{diff.el}, a program to display @code{diff} | ||
| 100 | output. | ||
| 101 | |||
| 102 | @item | ||
| 103 | Peter Breton implemented: | ||
| 104 | |||
| 105 | @itemize @minus | ||
| 106 | @item | ||
| 107 | @file{dirtrack} which does better tracking of directory changes in shell | ||
| 108 | buffers, | ||
| 109 | @item | ||
| 110 | @file{filecache.el} which records which directories your files are in, | ||
| 111 | @item | ||
| 112 | @file{locate.el} which interfaces to the @code{locate} command, | ||
| 113 | @item | ||
| 114 | @file{find-lisp.el}, an Emacs Lisp emulation of the @code{find} program, | ||
| 115 | @item | ||
| 116 | @file{net-utils.el}, and | ||
| 117 | @item | ||
| 118 | the ``generic mode'' feature. | ||
| 119 | @end itemize | ||
| 120 | |||
| 121 | @item | ||
| 122 | Emmanuel Briot wrote @file{xml.el}, an XML parser for Emacs. | ||
| 123 | |||
| 124 | @item | ||
| 125 | Kevin Broadey wrote @file{foldout.el}, providing folding extensions to | ||
| 126 | Emacs's outline modes. | ||
| 127 | |||
| 128 | @c @item | ||
| 129 | @c Vincent Broman wrote @file{ada.el}, a mode for editing Ada code | ||
| 130 | @c (since replaced by @file{ada-mode.el}). | ||
| 131 | |||
| 132 | @item | ||
| 133 | David M.@: Brown wrote @file{array.el}, for editing arrays and other | ||
| 134 | tabular data. | ||
| 135 | |||
| 136 | @item | ||
| 137 | W@l{}odek Bzyl and Ryszard Kubiak wrote @file{ogonek.el}, a package for | ||
| 138 | changing the encoding of Polish characters. | ||
| 139 | |||
| 140 | @item | ||
| 141 | Bill Carpenter provided @file{feedmail.el}, a package for massaging | ||
| 142 | outgoing mail messages and sending them through various popular mailers. | ||
| 143 | |||
| 144 | @item | ||
| 145 | Per Cederqvist and Inge Wallin wrote @file{ewoc.el}, an Emacs widget for | ||
| 146 | manipulating object collections. | ||
| 147 | |||
| 148 | @item | ||
| 149 | Hans Chalupsky wrote @file{advice.el}, an overloading mechanism for | ||
| 150 | Emacs Lisp functions, and @file{trace.el}, a tracing facility for Emacs | ||
| 151 | Lisp. | ||
| 152 | |||
| 153 | @item | ||
| 154 | Chris Chase and Carsten Dominik wrote @file{idlwave.el}, an editing mode | ||
| 155 | for IDL and WAVE CL. | ||
| 156 | |||
| 157 | @item | ||
| 158 | Bob Chassell wrote @file{texnfo-upd.el} and @file{makeinfo.el}, modes | ||
| 159 | and utilities for working with Texinfo files; and @file{page-ext.el}, | ||
| 160 | commands for extended page handling. | ||
| 161 | |||
| 162 | @item | ||
| 163 | Andrew Choi wrote the Macintosh support code, and contributed | ||
| 164 | @file{mac-win.el}, support for the Mac window system. | ||
| 165 | |||
| 166 | @item | ||
| 167 | James Clark wrote @file{sgml-mode.el}, a mode for editing SGML | ||
| 168 | documents, and contributed to Emacs's dumping procedures. | ||
| 169 | |||
| 170 | @item | ||
| 171 | Mike Clarkson wrote @file{edt.el}, an emulation of DEC's EDT editor. | ||
| 172 | |||
| 173 | @item | ||
| 174 | Glynn Clements provided @file{gamegrid.el} and a couple of games that | ||
| 175 | use it, Snake and Tetris. | ||
| 176 | |||
| 177 | @item | ||
| 178 | Georges Brun-Cottan and Stefan Monnier wrote @file{easy-mmode.el}, a | ||
| 179 | package for easy definition of major and minor modes. | ||
| 180 | |||
| 181 | @item | ||
| 182 | Andrew Csillag wrote M4 mode (@file{m4-mode.el}). | ||
| 183 | |||
| 184 | @item | ||
| 185 | Doug Cutting and Jamie Zawinski wrote @file{disass.el}, a disassembler | ||
| 186 | for compiled Emacs Lisp code. | ||
| 187 | |||
| 188 | @item | ||
| 189 | Mathias Dahl wrote @file{image-dired.el}, a package for viewing image | ||
| 190 | files as ``thumbnails.'' | ||
| 191 | |||
| 192 | @item | ||
| 193 | Michael DeCorte wrote @file{emacs.csh}, a C-shell script that starts a | ||
| 194 | new Emacs job, or restarts a paused Emacs if one exists. | ||
| 195 | |||
| 196 | @item | ||
| 197 | Gary Delp wrote @file{mailpost.el}, an interface between RMAIL and the | ||
| 198 | @file{/usr/uci/post} mailer. | ||
| 199 | |||
| 200 | @item | ||
| 201 | Matthieu Devin wrote @file{delsel.el}, a package to make newly-typed | ||
| 202 | text replace the current selection. | ||
| 203 | |||
| 204 | @item | ||
| 205 | Eric Ding contributed @file{goto-addr.el}, | ||
| 206 | |||
| 207 | @item | ||
| 208 | Jan Dj@"{a}rv added support for the GTK+ toolkit and X drag-and-drop. | ||
| 209 | |||
| 210 | @item | ||
| 211 | Carsten Dominik wrote @file{reftex.el}, a package for setting up | ||
| 212 | labels and cross-references in La@TeX{} documents, and @file{org.el}, | ||
| 213 | a mode for maintaining notes, todo lists, and project planning. | ||
| 214 | |||
| 215 | @item | ||
| 216 | Scott Draves wrote @file{tq.el}, help functions for maintaining | ||
| 217 | transaction queues between Emacs and its subprocesses. | ||
| 218 | |||
| 219 | @item | ||
| 220 | Benjamin Drieu wrote @file{pong.el}, an implementation of the classical | ||
| 221 | pong game. | ||
| 222 | |||
| 223 | @item | ||
| 224 | Viktor Dukhovni wrote support for dumping under SunOS version 4. | ||
| 225 | |||
| 226 | @item | ||
| 227 | John Eaton co-wrote Octave mode. | ||
| 228 | |||
| 229 | @item | ||
| 230 | Rolf Ebert co-wrote Ada mode (@file{ada-mode.el}). | ||
| 231 | |||
| 232 | @item | ||
| 233 | Stephen Eglen implemented @file{mspools.el}, for use with Procmail, | ||
| 234 | which tells you which mail folders have mail waiting in them, and | ||
| 235 | @file{iswitchb.el}, a feature for incremental reading and completion of | ||
| 236 | buffer names. | ||
| 237 | |||
| 238 | @item | ||
| 239 | Torbj@"orn | ||
| 240 | Einarsson contributed the Fortran 90 mode (@file{f90.el}). | ||
| 241 | |||
| 242 | @item | ||
| 243 | Tsugutomo Enami co-wrote the support for international character sets. | ||
| 244 | |||
| 245 | @item | ||
| 246 | Hans Henrik Eriksen wrote @file{simula.el}, a mode for editing SIMULA 87 | ||
| 247 | code. | ||
| 248 | |||
| 249 | @item | ||
| 250 | Michael Ernst wrote @file{reposition.el}, a command for recentering a | ||
| 251 | function's source code and preceding comment on the screen. | ||
| 252 | |||
| 253 | @item | ||
| 254 | Ata Etemadi wrote @file{cdl.el}, functions for working with Common Data | ||
| 255 | Language source code. | ||
| 256 | |||
| 257 | @item | ||
| 258 | Frederick Farnbach implemented @file{morse.el}, which converts text to | ||
| 259 | Morse code. | ||
| 260 | |||
| 261 | @item | ||
| 262 | Oscar Figueiredo wrote EUDC, the Emacs Unified Directory Client, which | ||
| 263 | is an interface to directory servers via LDAP, CCSO PH/QI, or BBDB; and | ||
| 264 | @file{ldap.el}, the LDAP client interface. | ||
| 265 | |||
| 266 | @item | ||
| 267 | Fred Fish wrote the support for dumping COFF executable files. | ||
| 268 | |||
| 269 | @item | ||
| 270 | Karl Fogel wrote: | ||
| 271 | |||
| 272 | @itemize @minus | ||
| 273 | @item | ||
| 274 | @file{bookmark.el}, for creating named placeholders, saving them and | ||
| 275 | jumping to them later, | ||
| 276 | @item | ||
| 277 | @file{mail-hist.el}, a history mechanism for outgoing mail messages, and | ||
| 278 | @item | ||
| 279 | @file{saveplace.el}, for preserving point's location in files between | ||
| 280 | editing sessions. | ||
| 281 | @end itemize | ||
| 282 | |||
| 283 | @item | ||
| 284 | Gary Foster wrote @file{crisp.el}, the emulation for CRiSP and Brief | ||
| 285 | editors, and @file{scroll-lock.el} (now @file{scroll-all.el}) a mode | ||
| 286 | for scrolling several buffers together. | ||
| 287 | |||
| 288 | @item | ||
| 289 | Noah Friedman wrote @file{rlogin.el}, an interface to Rlogin, | ||
| 290 | @file{type-break.el}, which reminds you to take periodic breaks from | ||
| 291 | typing, and @code{eldoc-mode}, a mode to show the defined parameters or | ||
| 292 | the doc string for the Lisp function near point. With Roland McGrath, | ||
| 293 | he wrote @file{rsz-mini.el}, a minor mode to automatically resize the | ||
| 294 | minibuffer to fit the text it contains. | ||
| 295 | |||
| 296 | @item | ||
| 297 | Keith Gabryelski wrote @file{hexl.el}, a mode for editing binary files. | ||
| 298 | |||
| 299 | @item | ||
| 300 | Kevin Gallagher rewrote and enhanced the EDT emulation, and wrote | ||
| 301 | @file{flow-ctrl.el}, a package for coping with unsuppressible XON/XOFF | ||
| 302 | flow control. | ||
| 303 | |||
| 304 | @item | ||
| 305 | Kevin Gallo added multiple-frame support for Windows NT and wrote | ||
| 306 | @file{w32-win.el}, support functions for the MS-Windows window system. | ||
| 307 | |||
| 308 | @item | ||
| 309 | Juan Le@'{o}n Lahoz Garc@'{i}a wrote @file{wdired.el}, a package for | ||
| 310 | performing file operations by directly editing Dired buffers. | ||
| 311 | |||
| 312 | @item | ||
| 313 | Howard Gayle wrote: | ||
| 314 | |||
| 315 | @itemize @minus | ||
| 316 | @item | ||
| 317 | the C and lisp code for display tables and case tables, | ||
| 318 | @item | ||
| 319 | @file{rot13.el}, a command to display the plain-text form of a buffer | ||
| 320 | encoded with the Caesar cipher, | ||
| 321 | @item | ||
| 322 | @file{case-table.el}, code to extend the character set and support case | ||
| 323 | tables, | ||
| 324 | @item | ||
| 325 | much of the support for the ISO-8859 European character sets (which | ||
| 326 | includes @file{iso-ascii.el}, @file{iso-insert.el}, @file{iso-swed.el}, | ||
| 327 | @file{latin-1.el}, @file{iso-syntax.el}, @file{iso-transl.el}, | ||
| 328 | @file{swedish.el}), and | ||
| 329 | @item | ||
| 330 | @file{vt100-led.el}, a package for controlling the LED's on | ||
| 331 | VT100-compatible terminals. | ||
| 332 | @end itemize | ||
| 333 | |||
| 334 | @item | ||
| 335 | Stephen Gildea made the Emacs quick reference card, and made many | ||
| 336 | contributions for @file{time-stamp.el}, a package for maintaining | ||
| 337 | last-change time stamps in files. | ||
| 338 | |||
| 339 | @item | ||
| 340 | Julien Gilles wrote @file{gnus-ml.el}, a mailing list minor mode for | ||
| 341 | Gnus. | ||
| 342 | |||
| 343 | @item | ||
| 344 | David Gillespie wrote: | ||
| 345 | |||
| 346 | @itemize @minus | ||
| 347 | @item | ||
| 348 | The Common Lisp compatibility packages, | ||
| 349 | @item | ||
| 350 | @code{Calc}, an advanced calculator and mathematical tool, | ||
| 351 | @item | ||
| 352 | @file{complete.el}, a partial completion mechanism, and | ||
| 353 | @item | ||
| 354 | @file{edmacro.el}, a package for editing keyboard macros. | ||
| 355 | @end itemize | ||
| 356 | |||
| 357 | @item | ||
| 358 | Bob Glickstein contributed the @file{sregex.el} feature, a facility for | ||
| 359 | writing regexps using a Lisp-like syntax. | ||
| 360 | |||
| 361 | @item | ||
| 362 | Boris Goldowsky wrote: | ||
| 363 | |||
| 364 | @itemize @minus | ||
| 365 | @item | ||
| 366 | @file{avoid.el}, a package to keep the mouse cursor out of the way of | ||
| 367 | the text cursor, | ||
| 368 | @item | ||
| 369 | @file{shadowfile.el}, a package for keeping identical copies of files in | ||
| 370 | more than one place, | ||
| 371 | @item | ||
| 372 | @file{format.el}, a package for reading and writing files in various | ||
| 373 | formats, | ||
| 374 | @item | ||
| 375 | @file{enriched.el}, a package for saving text properties in files, and | ||
| 376 | @item | ||
| 377 | @file{facemenu.el}, a package for specifying faces. | ||
| 378 | @end itemize | ||
| 379 | |||
| 380 | @item | ||
| 381 | Michelangelo Grigni wrote @file{ffap.el} which visits a file, | ||
| 382 | taking the file name from the buffer. | ||
| 383 | |||
| 384 | @item | ||
| 385 | Odd Gripenstam wrote @file{dcl-mode.el} for editing DCL command files. | ||
| 386 | |||
| 387 | @item | ||
| 388 | Kai Gro@ss{}johann and Michael Albinus wrote the Tramp package, which | ||
| 389 | provides transparent remote file editing using rcp, ssh, ftp, and other | ||
| 390 | network protocols. | ||
| 391 | |||
| 392 | @item | ||
| 393 | Michael Gschwind wrote @file{iso-cvt.el}, a package to convert between | ||
| 394 | the ISO 8859-1 character set and the notations for non-@acronym{ASCII} | ||
| 395 | characters used by @TeX{} and net tradition, and @file{latin-2.el}, code | ||
| 396 | which sets up case-conversion and syntax tables for the ISO Latin-2 | ||
| 397 | character set. | ||
| 398 | |||
| 399 | @item | ||
| 400 | Henry Guillaume wrote @file{find-file.el}, a package to visit files | ||
| 401 | related to the currently visited file. | ||
| 402 | |||
| 403 | @item | ||
| 404 | Doug Gwyn wrote the portable @code{alloca} implementation. | ||
| 405 | |||
| 406 | @item | ||
| 407 | Ken'ichi Handa implemented most of the support for international | ||
| 408 | character sets, and wrote @file{isearch-x.el}, a facility for searching | ||
| 409 | non-@acronym{ASCII} text. Together with Naoto Takahashi, he wrote | ||
| 410 | @file{quail.el}, a simple input facility for typing non-@acronym{ASCII} text from | ||
| 411 | an @acronym{ASCII} keyboard. Ken'ichi also wrote @file{ps-bdf.el}, a BDF font | ||
| 412 | support for printing non-@acronym{ASCII} text on a PostScript printer. | ||
| 413 | |||
| 414 | @item | ||
| 415 | Chris Hanson wrote @file{netuname.el}, a package to use HP-UX's Remote | ||
| 416 | File Access facility from Emacs. | ||
| 417 | |||
| 418 | @item | ||
| 419 | Jesper Harder wrote @file{yenc.el}, for decoding yenc encoded messages. | ||
| 420 | |||
| 421 | @item | ||
| 422 | K. Shane Hartman wrote: | ||
| 423 | |||
| 424 | @itemize @minus | ||
| 425 | @item | ||
| 426 | @file{chistory.el} and @file{echistory.el}, packages for browsing | ||
| 427 | command history lists, | ||
| 428 | @item | ||
| 429 | @file{electric.el} and @file{helper.el}, providing an alternative | ||
| 430 | command loop and appropriate help facilities, | ||
| 431 | @item | ||
| 432 | @file{emacsbug.el}, a package for reporting Emacs bugs, | ||
| 433 | @item | ||
| 434 | @file{picture.el}, a mode for editing @acronym{ASCII} pictures, and | ||
| 435 | @item | ||
| 436 | @file{view.el}, a package for perusing files and buffers without editing | ||
| 437 | them. | ||
| 438 | @end itemize | ||
| 439 | |||
| 440 | @item | ||
| 441 | John Heidemann wrote @file{mouse-copy.el} and @file{mouse-drag.el}, | ||
| 442 | which provide alternative mouse-based editing and scrolling features. | ||
| 443 | |||
| 444 | @item | ||
| 445 | Jon K Hellan wrote @file{utf7.el}, support for mail-safe transformation | ||
| 446 | format of Unicode. | ||
| 447 | |||
| 448 | @item | ||
| 449 | Markus Heritsch co-wrote Ada mode (@file{ada-mode.el}). | ||
| 450 | |||
| 451 | @item | ||
| 452 | Karl Heuer wrote the original blessmail script, implemented the | ||
| 453 | @code{intangible} text property, and rearranged the structure of the | ||
| 454 | @code{Lisp_Object} type to allow for more data bits. | ||
| 455 | |||
| 456 | @item | ||
| 457 | Manabu Higashida ported Emacs to MS-DOS. | ||
| 458 | |||
| 459 | @item | ||
| 460 | Anders Holst wrote @file{hippie-exp.el}, a versatile completion and | ||
| 461 | expansion package. | ||
| 462 | |||
| 463 | @item | ||
| 464 | Kurt Hornik co-wrote Octave mode. | ||
| 465 | |||
| 466 | @item | ||
| 467 | Tom Houlder wrote @file{mantemp.el}, which generates manual C@t{++} | ||
| 468 | template instantiations. | ||
| 469 | |||
| 470 | @item | ||
| 471 | Joakim Hove wrote @file{html2text.el}, a html to plain text converter. | ||
| 472 | @item | ||
| 473 | Denis Howe wrote @file{browse-url.el}, a package for invoking a WWW | ||
| 474 | browser to display a URL. | ||
| 475 | |||
| 476 | @item | ||
| 477 | Lars Magne Ingebrigtsen did a major redesign of the Gnus news-reader and | ||
| 478 | wrote many of its parts. | ||
| 479 | |||
| 480 | @item | ||
| 481 | Andrew Innes contributed extensively to the MS-Windows support. | ||
| 482 | |||
| 483 | @item | ||
| 484 | Seiichiro Inoue improved Emacs's XIM support. | ||
| 485 | |||
| 486 | @item | ||
| 487 | Ulf Jasper wrote @file{icalendar.el}, a package for converting Emacs | ||
| 488 | diary entries to and from the iCalendar format, and | ||
| 489 | @file{newsticker.el}, an RSS and Atom based Newsticker. | ||
| 490 | |||
| 491 | @item | ||
| 492 | Kyle Jones wrote @file{life.el}, a package to play Conway's ``life'' game, | ||
| 493 | and @file{mldrag.el}, a package which allows the user to resize windows | ||
| 494 | by dragging mode lines and vertical window separators with the mouse. | ||
| 495 | |||
| 496 | @item | ||
| 497 | Terry Jones wrote @file{shadow.el}, a package for finding potential | ||
| 498 | load-path problems when some Lisp file ``shadows'' another. | ||
| 499 | |||
| 500 | @item | ||
| 501 | Simon Josefsson wrote: | ||
| 502 | |||
| 503 | @itemize @minus | ||
| 504 | @item | ||
| 505 | @file{dns-mode.el}, an editing mode for Domain Name System master files, | ||
| 506 | @item | ||
| 507 | @file{flow-fill.el}, a package for interpreting RFC2646 formatted text | ||
| 508 | in messages, | ||
| 509 | @item | ||
| 510 | @file{fringe.el}, a package for customizing the fringe, | ||
| 511 | @item | ||
| 512 | @file{imap.el}, an Emacs Lisp library for talking to IMAP servers, | ||
| 513 | @item | ||
| 514 | @file{nnimap}, the IMAP back-end for Gnus, and | ||
| 515 | @item | ||
| 516 | @file{rfc2104.el}, a hashed message authentication facility. | ||
| 517 | @end itemize | ||
| 518 | |||
| 519 | @item | ||
| 520 | Arne J@o{}rgensen wrote @file{latexenc.el}, a package to | ||
| 521 | automatically guess the correct coding system in LaTeX files. | ||
| 522 | |||
| 523 | @item | ||
| 524 | Tomoji Kagatani implemented @file{smtpmail.el}, used for sending out | ||
| 525 | mail with SMTP. | ||
| 526 | |||
| 527 | @item | ||
| 528 | David Kaufman wrote @file{yow.c}, an essential utility program for the | ||
| 529 | hopelessly pinheaded. | ||
| 530 | |||
| 531 | @item | ||
| 532 | Henry Kautz wrote @file{bib-mode.el}, a mode for maintaining | ||
| 533 | bibliography databases compatible with @code{refer} (the @code{troff} | ||
| 534 | version) and @code{lookbib}, and @file{refbib.el}, a package to convert | ||
| 535 | those databases to the format used by the LaTeX text formatting package. | ||
| 536 | |||
| 537 | @item | ||
| 538 | Taichi Kawabata added support for Devanagari script and the Indian | ||
| 539 | languages. | ||
| 540 | |||
| 541 | @item | ||
| 542 | Howard Kaye wrote @file{sort.el}, commands to sort text in Emacs | ||
| 543 | buffers. | ||
| 544 | |||
| 545 | @item | ||
| 546 | Michael Kifer wrote @file{ediff.el}, an interactive interface to the | ||
| 547 | @command{diff}, @command{patch}, and @command{merge} programs, and | ||
| 548 | Viper, the newest emulation for VI. | ||
| 549 | |||
| 550 | @item | ||
| 551 | Richard King wrote the first version of @file{userlock.el} and | ||
| 552 | @file{filelock.c}, which provide simple support for multiple users | ||
| 553 | editing the same file. He also wrote the initial version of | ||
| 554 | @file{uniquify.el}, a facility to make buffer names unique by adding | ||
| 555 | parts of the file's name to the buffer name. | ||
| 556 | @c We're not using his backquote.el any more. | ||
| 557 | |||
| 558 | @item | ||
| 559 | Peter Kleiweg wrote @file{ps-mode.el}, a major mode for editing | ||
| 560 | PostScript files and running a PostScript interpreter interactively from | ||
| 561 | within Emacs. | ||
| 562 | |||
| 563 | @item | ||
| 564 | Pavel Kobiakov wrote @file{flymake.el}, a minor mode for performing | ||
| 565 | on-the-fly syntax checking. | ||
| 566 | |||
| 567 | @item | ||
| 568 | Larry K.@: Kolodney wrote @file{cvtmail.c}, a program to convert the mail | ||
| 569 | directories used by Gosling Emacs into RMAIL format. | ||
| 570 | |||
| 571 | @item | ||
| 572 | David M.@: Koppelman wrote @file{hi-lock.el}, a minor mode for | ||
| 573 | interactive automatic highlighting of parts of the buffer text. | ||
| 574 | |||
| 575 | @item | ||
| 576 | Koseki Yoshinori wrote @file{iimage.el}, a minor mode for displaying | ||
| 577 | inline images. | ||
| 578 | |||
| 579 | @item | ||
| 580 | Robert Krawitz wrote the original @file{xmenu.c}, part of Emacs's pop-up | ||
| 581 | menu support. | ||
| 582 | |||
| 583 | @item | ||
| 584 | Sebastian Kremer wrote Emacs 19's @code{dired-mode}, with contributions | ||
| 585 | by Lawrence R.@: Dodd. He also wrote @file{ls-lisp.el}, a Lisp emulation | ||
| 586 | of the @code{ls} command for platforms which don't have @code{ls} as a | ||
| 587 | standard program. | ||
| 588 | |||
| 589 | @item | ||
| 590 | Geoff Kuenning wrote Emacs 19's @file{ispell.el}, based on work by Ken | ||
| 591 | Stevens and others. | ||
| 592 | |||
| 593 | @item | ||
| 594 | David K@ringaccent{a}gedal wrote @file{tempo.el}, providing support for | ||
| 595 | easy insertion of boilerplate text and other common constructions. | ||
| 596 | |||
| 597 | @item | ||
| 598 | Daniel LaLiberte wrote: | ||
| 599 | |||
| 600 | @itemize @minus | ||
| 601 | @item | ||
| 602 | @file{edebug.el}, a source-level debugger for Emacs Lisp, | ||
| 603 | @item | ||
| 604 | @file{cl-specs.el}, specifications to help @code{edebug} debug code | ||
| 605 | written using David Gillespie's Common Lisp support, | ||
| 606 | @item | ||
| 607 | @file{cust-print.el}, a customizable package for printing lisp objects, | ||
| 608 | @item | ||
| 609 | @file{eval-reg.el}, a re-implementation of @code{eval-region} in Emacs | ||
| 610 | Lisp, and | ||
| 611 | @item | ||
| 612 | @file{isearch.el}, Emacs's incremental search minor mode. | ||
| 613 | @end itemize | ||
| 614 | |||
| 615 | @item | ||
| 616 | James R.@: Larus wrote @file{mh-e.el}, an interface to the MH mail system. | ||
| 617 | |||
| 618 | @item | ||
| 619 | Vinicius Jose Latorre wrote the Emacs printing facilities, as well as: | ||
| 620 | |||
| 621 | @itemize @minus | ||
| 622 | @item | ||
| 623 | @code{ps-print}, a package for pretty-printing Emacs buffers to | ||
| 624 | PostScript printers, | ||
| 625 | @item | ||
| 626 | @file{delim-col.el}, a package to arrange text into columns, | ||
| 627 | @item | ||
| 628 | @file{ebnf2ps.el}, a package that translates EBNF grammar to a syntactic | ||
| 629 | chart that can be printed to a PostScript printer. | ||
| 630 | @end itemize | ||
| 631 | |||
| 632 | @item | ||
| 633 | Frederic Lepied contributed @file{expand.el}, which uses the abbrev | ||
| 634 | mechanism for inserting programming constructs. | ||
| 635 | |||
| 636 | @item | ||
| 637 | Peter Liljenberg wrote @file{elint.el}, a Lint-style code checker for | ||
| 638 | Emacs Lisp programs. | ||
| 639 | |||
| 640 | @item | ||
| 641 | Lars Lindberg wrote @file{msb.el}, which provides more flexible menus | ||
| 642 | for buffer selection, and rewrote @file{dabbrev.el}. | ||
| 643 | |||
| 644 | @item | ||
| 645 | Anders Lindgren wrote @file{autorevert.el}, a package for automatically | ||
| 646 | reverting files visited by Emacs that were changed on disk; | ||
| 647 | @file{cwarn.el}, a package to highlight suspicious C and C@t{++} | ||
| 648 | constructs; and @file{follow.el}, a minor mode to synchronize windows | ||
| 649 | that show the same buffer. | ||
| 650 | |||
| 651 | @item | ||
| 652 | Thomas Link wrote @file{filesets.el}, a package for handling sets of | ||
| 653 | files. | ||
| 654 | |||
| 655 | @item | ||
| 656 | Dave Love wrote much of the code dealing with Unicode support and | ||
| 657 | Latin-N unification. He added support for many coding systems, | ||
| 658 | including those in @file{code-pages.el} and the various UTF-7 and | ||
| 659 | UTF-16 coding systems. He also wrote: | ||
| 660 | |||
| 661 | @itemize @minus | ||
| 662 | @item | ||
| 663 | @code{autoarg-mode}, a global minor mode whereby digit keys supply | ||
| 664 | prefix arguments, and @code{autoarg-kp-mode} which redefines the keypad | ||
| 665 | numeric keys to digit arguments, | ||
| 666 | @item | ||
| 667 | @file{autoconf.el}, a mode for editing Autoconf @file{configure.in} | ||
| 668 | files, | ||
| 669 | @item | ||
| 670 | @file{cfengine.el}, a mode for editing Cfengine files, | ||
| 671 | @item | ||
| 672 | @file{elide-head.el}, a package for eliding boilerplate text, such as | ||
| 673 | copyright notices, from file headers, | ||
| 674 | @item | ||
| 675 | @file{hl-line.el}, a package that provides a minor mode for highlighting | ||
| 676 | the line in the current window on which point is, | ||
| 677 | @item | ||
| 678 | @file{latin-8.el} and @file{latin-9.el}, code which sets up | ||
| 679 | case-conversion and syntax tables for the ISO Latin-8 and Latin-9 | ||
| 680 | character sets, | ||
| 681 | @item | ||
| 682 | @file{latin1-disp.el}, a package that lets you display ISO 8859 | ||
| 683 | characters on Latin-1 terminals by setting up appropriate display | ||
| 684 | tables, | ||
| 685 | @item | ||
| 686 | @file{python.el}, a major mode for the Python programming language. | ||
| 687 | @item | ||
| 688 | @file{refill.el}, a mode for automatic paragraph refilling, akin to | ||
| 689 | typical word processors, | ||
| 690 | @item | ||
| 691 | @file{smiley-ems.el}, a facility for displaying smiley faces, and | ||
| 692 | @item | ||
| 693 | @file{tool-bar.el}, a mode to control the display of the Emacs tool bar. | ||
| 694 | @end itemize | ||
| 695 | |||
| 696 | @item | ||
| 697 | Eric Ludlam wrote the Speedbar package and the following packages: | ||
| 698 | |||
| 699 | @itemize @minus | ||
| 700 | @item | ||
| 701 | @file{checkdoc.el}, for checking doc strings in Emacs Lisp programs, | ||
| 702 | @item | ||
| 703 | @file{dframe.el}, providing dedicatd frame support modes, and | ||
| 704 | @item | ||
| 705 | @file{ezimage.el}, a generalized way to place images over text. | ||
| 706 | @end itemize | ||
| 707 | |||
| 708 | @item | ||
| 709 | Alan Mackenzie wrote the integrated AWK support in CC Mode. | ||
| 710 | |||
| 711 | @item | ||
| 712 | Christopher J.@: Madsen wrote @file{decipher.el}, a package for cracking | ||
| 713 | simple substitution ciphers. | ||
| 714 | |||
| 715 | @item | ||
| 716 | Neil M.@: Mager wrote @file{appt.el}, functions to notify users of their | ||
| 717 | appointments. It finds appointments recorded in the diary files | ||
| 718 | generated by Edward M.@: Reingold's @code{calendar} package. | ||
| 719 | |||
| 720 | @item | ||
| 721 | Ken Manheimer wrote @file{allout.el}, a mode for manipulating and | ||
| 722 | formatting outlines, and @file{icomplete.el}, which provides incremental | ||
| 723 | completion feedback in the minibuffer. | ||
| 724 | |||
| 725 | @item | ||
| 726 | Bill Mann wrote @file{perl-mode.el}, a mode for editing Perl code. | ||
| 727 | |||
| 728 | @item | ||
| 729 | Brian Marick and Daniel LaLiberte wrote @file{hideif.el}, support for | ||
| 730 | hiding selected code within C @code{#ifdef} clauses. | ||
| 731 | |||
| 732 | @item | ||
| 733 | Simon Marshall wrote @file{regexp-opt.el}, which generates a regular | ||
| 734 | expression from a list of strings. He also extended @file{comint.el}, | ||
| 735 | originally written by Olin Shivers. | ||
| 736 | |||
| 737 | @item | ||
| 738 | Bengt Martensson, Marc Shapiro, Mike Newton, Aaron Larson, and Stefan | ||
| 739 | Schoef, wrote @file{bibtex.el}, a mode for editing Bib@TeX{} | ||
| 740 | bibliography files. | ||
| 741 | |||
| 742 | @item | ||
| 743 | Charlie Martin wrote @file{autoinsert.el}, which provides automatic | ||
| 744 | mode-sensitive insertion of text into new files. | ||
| 745 | |||
| 746 | @item | ||
| 747 | Thomas May wrote @file{blackbox.el}, a version of the traditional | ||
| 748 | blackbox game. | ||
| 749 | |||
| 750 | @item | ||
| 751 | Roland McGrath wrote: | ||
| 752 | |||
| 753 | @itemize @minus | ||
| 754 | @item | ||
| 755 | @file{compile.el}, a package for running compilations in a buffer, and | ||
| 756 | then visiting the locations reported in error messages, | ||
| 757 | @item | ||
| 758 | @file{etags.el}, a package for jumping to function definitions and | ||
| 759 | searching or replacing in all the files mentioned in a @file{TAGS} file, | ||
| 760 | @item | ||
| 761 | @file{find-dired.el}, for using @code{dired} commands on output from the | ||
| 762 | @code{find} program, with Sebastian Kremer, | ||
| 763 | @item | ||
| 764 | @file{map-ynp.el}, a general purpose boolean question-asker, | ||
| 765 | @item | ||
| 766 | @file{autoload.el}, providing semi-automatic maintenance of autoload | ||
| 767 | files, and | ||
| 768 | @item | ||
| 769 | @file{upd-copyr.el}, providing semi-automatic maintenance of copyright | ||
| 770 | notices in source code. | ||
| 771 | @end itemize | ||
| 772 | |||
| 773 | @item | ||
| 774 | David Megginson wrote @file{derived.el}, which allows one to define new | ||
| 775 | major modes by inheriting key bindings and commands from existing major | ||
| 776 | modes. | ||
| 777 | |||
| 778 | @item | ||
| 779 | Will Mengarini wrote @file{repeat.el}, a command to repeat the preceding | ||
| 780 | command with its arguments. | ||
| 781 | |||
| 782 | @item | ||
| 783 | Wayne Mesard wrote @file{hscroll.el} which does horizontal scrolling | ||
| 784 | automatically. | ||
| 785 | |||
| 786 | @item | ||
| 787 | Brad Miller wrote @file{gnus-gl.el}, a Gnus interface for GroupLens. | ||
| 788 | |||
| 789 | @item | ||
| 790 | Richard Mlynarik wrote: | ||
| 791 | |||
| 792 | @itemize @minus | ||
| 793 | @item | ||
| 794 | @file{cl-indent.el}, a package for indenting Common Lisp code, | ||
| 795 | @item | ||
| 796 | @file{ebuff-menu.el}, an ``electric'' browser for buffer listings, | ||
| 797 | @item | ||
| 798 | @file{ehelp.el}, bindings for browsing help screens, | ||
| 799 | @item | ||
| 800 | @file{rfc822.el}, a parser for E-mail addresses in the RFC-822 format, | ||
| 801 | used in mail messages and news articles, | ||
| 802 | @item | ||
| 803 | @file{terminal.el}, a terminal emulator for Emacs subprocesses, and | ||
| 804 | @item | ||
| 805 | @file{yow.el}, an essential utility (try @kbd{M-x yow}). | ||
| 806 | @end itemize | ||
| 807 | |||
| 808 | @item | ||
| 809 | Gerd Moellmann was the Emacs maintainer from the beginning of Emacs 21 | ||
| 810 | development until the release of 21.1. He wrote: | ||
| 811 | |||
| 812 | @itemize @minus | ||
| 813 | @item | ||
| 814 | the new display engine for Emacs 21, | ||
| 815 | @item | ||
| 816 | the asynchronous timers facility (@file{atimer.c}), | ||
| 817 | @item | ||
| 818 | the @code{ebrowse} C@t{++} browser, | ||
| 819 | @item | ||
| 820 | @file{jit-lock.el}, the Just-In-Time font-lock support mode, | ||
| 821 | @item | ||
| 822 | @file{tooltip.el}, a package for displaying tooltips, and | ||
| 823 | @item | ||
| 824 | @file{authors.el} package for maintaining the @file{AUTHORS} files. | ||
| 825 | @end itemize | ||
| 826 | |||
| 827 | @item | ||
| 828 | Stefan Monnier added support for Arch, Subversion, and Meta-CVS to VC, | ||
| 829 | and re-wrote much of the Emacs server to use the built-in networking | ||
| 830 | primitives. He also wrote: | ||
| 831 | |||
| 832 | @itemize @minus | ||
| 833 | @item | ||
| 834 | @code{PCL-CVS}, a directory-level front end to the CVS version control | ||
| 835 | system, | ||
| 836 | @item | ||
| 837 | @file{reveal.el}, a minor mode for automatically revealing invisible | ||
| 838 | text, | ||
| 839 | @item | ||
| 840 | @file{smerge-mode.el}, a minor mode for resolving @code{diff3} | ||
| 841 | conflicts, and | ||
| 842 | @item | ||
| 843 | @file{diff-mode.el}, a mode for viewing and editing context diffs. | ||
| 844 | @end itemize | ||
| 845 | |||
| 846 | @item | ||
| 847 | Morioka Tomohiko wrote several packages for MIME support in Gnus and | ||
| 848 | elsewhere. | ||
| 849 | |||
| 850 | @item | ||
| 851 | Sen Nagata wrote @file{crm.el}, a package for reading multiple strings | ||
| 852 | with completion, and @file{rfc2368.el}, support for @code{mailto:} | ||
| 853 | URLs. | ||
| 854 | |||
| 855 | @item | ||
| 856 | Erik Naggum wrote the time-conversion functions. He also wrote | ||
| 857 | @file{disp-table.el}, a package for dealing with display tables, | ||
| 858 | @file{latin-4.el} and @file{latin-5.el}, code which sets up | ||
| 859 | case-conversion and syntax tables for the ISO Latin-4 and Latin-5 | ||
| 860 | character sets, @file{mailheader.el}, a package for parsing email | ||
| 861 | headers, and @file{parse-time.el}, a package for parsing time strings. | ||
| 862 | |||
| 863 | @item | ||
| 864 | Thomas Neumann and Eric Raymond wrote @file{makefile.el} (now | ||
| 865 | @file{make-mode.el}), a mode for editing makefiles. | ||
| 866 | |||
| 867 | @item | ||
| 868 | Thien-Thi Nguyen and Dan Nicolaescu wrote @file{hideshow.el}, a minor | ||
| 869 | mode for selectively displaying blocks of text. | ||
| 870 | |||
| 871 | @item | ||
| 872 | Dan Nicolaescu wrote @file{romanian.el}, support for editing Romanian | ||
| 873 | text, and @file{iris-ansi.el}, support for running Emacs on SGI's | ||
| 874 | @code{xwsh} and @code{winterm} terminal emulators. | ||
| 875 | |||
| 876 | @item | ||
| 877 | Jurgen Nickelsen wrote @file{ws-mode.el}, providing WordStar emulation. | ||
| 878 | |||
| 879 | @item | ||
| 880 | Hrvoje Niksic wrote @file{savehist.el}, for saving the minibuffer | ||
| 881 | history between Emacs sessions. | ||
| 882 | |||
| 883 | @item | ||
| 884 | Jeff Norden wrote @file{kermit.el}, a package to help the Kermit | ||
| 885 | dialup communications program run comfortably in an Emacs shell buffer. | ||
| 886 | |||
| 887 | @item | ||
| 888 | Andrew Norman wrote @file{ange-ftp.el}, providing transparent FTP | ||
| 889 | support. | ||
| 890 | |||
| 891 | @item | ||
| 892 | Alexandre Oliva wrote @file{gnus-mlspl.el}, a group params-based mail | ||
| 893 | splitting mechanism. | ||
| 894 | |||
| 895 | @item | ||
| 896 | Takaaki Ota wrote @file{table.el}, a package for creating and editing | ||
| 897 | embedded text-based tables. | ||
| 898 | |||
| 899 | @item | ||
| 900 | Pieter E.@: J.@: Pareit wrote @file{mixal-mode.el}, an editing mode for | ||
| 901 | the MIX assembly language. | ||
| 902 | |||
| 903 | @item | ||
| 904 | David Pearson contributed @file{quickurl.el}, a simple method of | ||
| 905 | inserting a URL into the current buffer based on text at point; | ||
| 906 | @file{5x5.el}, a game to fill all squares on the field. | ||
| 907 | |||
| 908 | @item | ||
| 909 | Jeff Peck wrote: | ||
| 910 | |||
| 911 | @itemize @minus | ||
| 912 | @item | ||
| 913 | @file{emacstool.c}, support for running Emacs under SunView/Sun Windows, | ||
| 914 | @item | ||
| 915 | @file{sun.el}, key bindings for sunterm keys, | ||
| 916 | @item | ||
| 917 | @file{sun-curs.el}, cursor definitions for Sun Windows, and | ||
| 918 | @item | ||
| 919 | @file{sun-fns.el} and @file{sun-mouse.el}, providing mouse support for | ||
| 920 | Sun Windows. | ||
| 921 | @end itemize | ||
| 922 | |||
| 923 | @item | ||
| 924 | Damon Anton Permezel wrote @file{hanoi.el}, an animated demonstration of | ||
| 925 | the ``Towers of Hanoi'' puzzle. | ||
| 926 | |||
| 927 | @item | ||
| 928 | William M.@: Perry wrote @file{mailcap.el}, a MIME media types | ||
| 929 | configuration facility, @file{mwheel.el}, a package for supporting | ||
| 930 | mouse wheels, and the URL package. | ||
| 931 | |||
| 932 | @item | ||
| 933 | Per Persson wrote @file{gnus-vm.el}, the VM interface for Gnus. | ||
| 934 | |||
| 935 | @item | ||
| 936 | Jens Petersen wrote @file{find-func.el}, which makes it easy to find | ||
| 937 | the source code for an Emacs Lisp function or variable. | ||
| 938 | |||
| 939 | @item | ||
| 940 | Daniel Pfeiffer wrote: | ||
| 941 | |||
| 942 | @itemize @minus | ||
| 943 | @item | ||
| 944 | @file{conf-mode.el}, a major mode for editing configuration files, | ||
| 945 | @item | ||
| 946 | @file{copyright.el}, a package for updating copyright notices in files, | ||
| 947 | @item | ||
| 948 | @file{executable.el}, a package for executing interpreter scripts, | ||
| 949 | @item | ||
| 950 | @file{sh-script.el}, a mode for editing shell scripts, | ||
| 951 | @item | ||
| 952 | @file{skeleton.el}, implementing a concise language for writing | ||
| 953 | statement skeletons, and | ||
| 954 | @item | ||
| 955 | @file{two-column.el}, a minor mode for simultaneous two-column editing. | ||
| 956 | @end itemize | ||
| 957 | |||
| 958 | Daniel also rewrote @file{apropos.el}, originally written by Joe Wells, | ||
| 959 | and, together with Jim Blandy, co-authored @file{wyse50.el}, support for | ||
| 960 | Wyse 50 terminals. | ||
| 961 | |||
| 962 | @item | ||
| 963 | Richard L.@: Pieri wrote @file{pop3.el}, a Post Office Protocol (RFC | ||
| 964 | 1460) interface for Emacs. | ||
| 965 | |||
| 966 | @item | ||
| 967 | Fred Pierresteguy and Paul Reilly made Emacs work with X Toolkit | ||
| 968 | widgets. | ||
| 969 | |||
| 970 | @item | ||
| 971 | Christian Plaunt wrote @file{soundex.el}, an implementation of the | ||
| 972 | Soundex algorithm for comparing English words by their pronunciation. | ||
| 973 | |||
| 974 | @item | ||
| 975 | David Ponce wrote: | ||
| 976 | |||
| 977 | @itemize @minus | ||
| 978 | @item | ||
| 979 | @file{recentf.el}, a package that puts a menu of recently visited | ||
| 980 | files in the Emacs menu bar, | ||
| 981 | @item | ||
| 982 | @file{ruler-mode.el}, a minor mode for displaying a ruler in the | ||
| 983 | header line, and | ||
| 984 | @item | ||
| 985 | @file{tree-widget.el}, a package to display hierarchical data structures. | ||
| 986 | @end itemize | ||
| 987 | |||
| 988 | @item | ||
| 989 | Francesco A.@: Potorti wrote @file{cmacexp.el}, providing a command which | ||
| 990 | runs the C preprocessor on a region of a file and displays the results. | ||
| 991 | He also expanded and redesigned the @code{etags} program. | ||
| 992 | |||
| 993 | @item | ||
| 994 | Michael D.@: Prange and Steven A.@: Wood wrote @file{fortran.el}, a mode for | ||
| 995 | editing FORTRAN code. | ||
| 996 | @c We're not distributing his tex-mode.el anymore; we're using Ed Reingold's. | ||
| 997 | |||
| 998 | @item | ||
| 999 | Mukesh Prasad contributed @file{vmsproc.el}, a facility for running | ||
| 1000 | asynchronous subprocesses on VMS. | ||
| 1001 | |||
| 1002 | @item | ||
| 1003 | Marko Rahamaa wrote @file{latin-3.el}, code which sets up | ||
| 1004 | case-conversion and syntax tables for the ISO Latin-3 character set. | ||
| 1005 | |||
| 1006 | @item | ||
| 1007 | Ashwin Ram wrote @file{refer.el}, commands to look up references in | ||
| 1008 | bibliography files by keyword. | ||
| 1009 | |||
| 1010 | @item | ||
| 1011 | Eric S.@: Raymond wrote: | ||
| 1012 | |||
| 1013 | @itemize @minus | ||
| 1014 | @item | ||
| 1015 | @file{vc.el}, an interface to the RCS and SCCS source code version | ||
| 1016 | control systems, with Paul Eggert, | ||
| 1017 | @item | ||
| 1018 | @file{gud.el}, a package for running source-level debuggers like GDB | ||
| 1019 | and SDB in Emacs, | ||
| 1020 | @item | ||
| 1021 | @file{asm-mode.el}, a mode for editing assembly language code, | ||
| 1022 | @item | ||
| 1023 | @file{AT386.el}, terminal support package for IBM's AT keyboards, | ||
| 1024 | @item | ||
| 1025 | @file{cookie1.el}, support for ``fortune-cookie'' programs like | ||
| 1026 | @file{yow.el} and @file{spook.el}, | ||
| 1027 | @item | ||
| 1028 | @file{finder.el}, a package for finding Emacs Lisp packages by keyword | ||
| 1029 | and topic, | ||
| 1030 | @item | ||
| 1031 | @file{keyswap.el}, code to swap the @key{BS} and @key{DEL} keys, | ||
| 1032 | @item | ||
| 1033 | @file{loadhist.el}, functions for loading and unloading Emacs features, | ||
| 1034 | @item | ||
| 1035 | @file{lisp-mnt.el}, functions for working with the special headers used | ||
| 1036 | in Emacs Lisp library files, and | ||
| 1037 | @item | ||
| 1038 | code to set and make use of the @code{load-history} lisp variable, which | ||
| 1039 | records the source file from which each lisp function loaded into Emacs | ||
| 1040 | came. | ||
| 1041 | @end itemize | ||
| 1042 | |||
| 1043 | @item | ||
| 1044 | Edward M.@: Reingold wrote the extensive calendar and diary support (try | ||
| 1045 | @kbd{M-x calendar}), with contributions from Stewart Clamen, Nachum | ||
| 1046 | Dershowitz, Paul Eggert, Steve Fisk, Michael Kifer, and Lara Rios. Andy | ||
| 1047 | Oram contributed to its documentation. Reingold has also contributed to | ||
| 1048 | @file{tex-mode.el}, a mode for editing @TeX{} files, as have William | ||
| 1049 | F.@: Schelter, Dick King, Stephen Gildea, Michael Prange, and Jacob Gore. | ||
| 1050 | |||
| 1051 | @item | ||
| 1052 | David Reitter wrote @file{mailclient.el} which can send mail via the | ||
| 1053 | system's designated mail client. | ||
| 1054 | |||
| 1055 | @item | ||
| 1056 | Alex Rezinsky contributed @file{which-func.el}, a mode that shows the | ||
| 1057 | name of the current function in the mode line. | ||
| 1058 | |||
| 1059 | @item | ||
| 1060 | Rob Riepel contributed @file{tpu-edt.el} and its associated files, | ||
| 1061 | providing an emulation of the VMS TPU text editor emulating the VMS EDT | ||
| 1062 | editor, and @file{vt-control.el}, providing some control functions for | ||
| 1063 | the DEC VT line of terminals. | ||
| 1064 | |||
| 1065 | @item | ||
| 1066 | Nick Roberts wrote @file{gdb-ui.el}, the graphical user interface to | ||
| 1067 | GDB. | ||
| 1068 | |||
| 1069 | @item | ||
| 1070 | Roland B.@: Roberts contributed much of the VMS support distributed with | ||
| 1071 | Emacs 19, along with Joseph M.@: Kelsey, and @file{vms-pmail.el}, support | ||
| 1072 | for using Emacs within VMS MAIL. | ||
| 1073 | |||
| 1074 | @item | ||
| 1075 | John Robinson wrote @file{bg-mouse.el}, support for the mouse on the BBN | ||
| 1076 | Bitgraph terminal. | ||
| 1077 | |||
| 1078 | @item | ||
| 1079 | Danny Roozendaal implemented @file{handwrite.el}, which converts text | ||
| 1080 | into ``handwriting.'' | ||
| 1081 | |||
| 1082 | @item | ||
| 1083 | William Rosenblatt wrote @file{float.el}, implementing a floating-point | ||
| 1084 | numeric type using Lisp cons cells and integers. | ||
| 1085 | |||
| 1086 | @item | ||
| 1087 | Guillermo J.@: Rozas wrote @file{scheme.el}, a mode for editing Scheme and | ||
| 1088 | DSSSL code, and @file{fakemail.c}, an interface to the System V mailer. | ||
| 1089 | |||
| 1090 | @item | ||
| 1091 | Ivar Rummelhoff provided @file{winner.el}, which records | ||
| 1092 | recent window configurations so you can move back to them. | ||
| 1093 | |||
| 1094 | @item | ||
| 1095 | Jason Rumney has ported the Emacs 21 display engine to MS-Windows, and | ||
| 1096 | contributed extensively to the MS-Windows port of Emacs. | ||
| 1097 | |||
| 1098 | @item | ||
| 1099 | Wolfgang Rupprecht contributed Emacs 19's floating-point support | ||
| 1100 | (including @file{float-sup.el} and @file{floatfns.c}), and | ||
| 1101 | @file{sup-mouse.el}, support for the Supdup mouse on lisp machines. | ||
| 1102 | |||
| 1103 | @item | ||
| 1104 | Kevin Ryde wrote @file{info-xref.el}, a library for checking | ||
| 1105 | references in Info files. | ||
| 1106 | |||
| 1107 | @item | ||
| 1108 | James B.@: Salem and Brewster Kahle wrote @file{completion.el}, providing | ||
| 1109 | dynamic word completion. | ||
| 1110 | |||
| 1111 | @item | ||
| 1112 | Masahiko Sato wrote @file{vip.el}, an emulation of the VI editor. | ||
| 1113 | |||
| 1114 | @item | ||
| 1115 | Holger Schauer wrote @file{fortune.el}, a package for using fortune in | ||
| 1116 | message signatures. | ||
| 1117 | |||
| 1118 | @item | ||
| 1119 | William Schelter wrote @file{telnet.el}, support for @code{telnet} | ||
| 1120 | sessions within Emacs. | ||
| 1121 | |||
| 1122 | @item | ||
| 1123 | Ralph Schleicher contributed @file{battery.el}, a package for displaying | ||
| 1124 | laptop computer battery status, and @file{info-look.el}, a package for | ||
| 1125 | looking up Info documentation for symbols in the buffer. | ||
| 1126 | |||
| 1127 | @item | ||
| 1128 | Michael Schmidt and Tom Perrine wrote @file{modula2.el}, a mode for | ||
| 1129 | editing Modula-2 code, based on work by Mick Jordan and Peter Robinson. | ||
| 1130 | |||
| 1131 | @item | ||
| 1132 | Ronald S.@: Schnell wrote @file{dunnet.el}, a text adventure game. | ||
| 1133 | |||
| 1134 | @item | ||
| 1135 | Philippe Schnoebelen wrote @file{gomoku.el}, a Go Moku game played | ||
| 1136 | against Emacs, and @file{mpuz.el}, a multiplication puzzle. | ||
| 1137 | |||
| 1138 | @item | ||
| 1139 | Jan Schormann wrote @file{solitaire.el}, an Emacs Lisp implementation of | ||
| 1140 | the Solitaire game. | ||
| 1141 | |||
| 1142 | @item | ||
| 1143 | Alex Schroeder wrote @file{ansi-color.el}, a package for translating | ||
| 1144 | ANSI color escape sequences to Emacs faces, and @file{sql.el}, a package | ||
| 1145 | for interactively running an SQL interpreter in an Emacs buffer. | ||
| 1146 | |||
| 1147 | @item | ||
| 1148 | Randal Schwartz wrote @file{pp.el}, a pretty-printer for lisp objects. | ||
| 1149 | |||
| 1150 | @item | ||
| 1151 | Oliver Seidel wrote @file{todo-mode.el}, a package for maintaining | ||
| 1152 | @file{TODO} list files. | ||
| 1153 | |||
| 1154 | @item | ||
| 1155 | Manuel Serrano contributed the Flyspell package that does spell checking | ||
| 1156 | as you type. | ||
| 1157 | |||
| 1158 | @item | ||
| 1159 | Hovav Shacham wrote @file{windmove.el}, a set of commands for selecting | ||
| 1160 | windows based on their geometrical position on the frame. | ||
| 1161 | |||
| 1162 | @item | ||
| 1163 | Stanislav Shalunov wrote @file{uce.el}, for responding to unsolicited | ||
| 1164 | commercial email. | ||
| 1165 | |||
| 1166 | @item | ||
| 1167 | Richard Sharman contributed @file{hilit-chg.el}, which uses colors | ||
| 1168 | to show recent editing changes. | ||
| 1169 | |||
| 1170 | @item | ||
| 1171 | Olin Shivers wrote: | ||
| 1172 | |||
| 1173 | @itemize @minus | ||
| 1174 | @item | ||
| 1175 | @file{comint.el}, a library for modes running interactive command-line- | ||
| 1176 | oriented subprocesses, | ||
| 1177 | @item | ||
| 1178 | @file{cmuscheme.el}, for running inferior Scheme processes, | ||
| 1179 | @item | ||
| 1180 | @file{inf-lisp.el}, for running inferior Lisp process, and | ||
| 1181 | @item | ||
| 1182 | @file{shell.el}, for running inferior shells. | ||
| 1183 | @end itemize | ||
| 1184 | |||
| 1185 | @item | ||
| 1186 | Espen Skoglund wrote @file{pascal.el}, a mode for editing Pascal code. | ||
| 1187 | |||
| 1188 | @item | ||
| 1189 | Rick Sladkey wrote @file{backquote.el}, a lisp macro for creating | ||
| 1190 | mostly-constant data. | ||
| 1191 | |||
| 1192 | @item | ||
| 1193 | Lynn Slater wrote @file{help-macro.el}, a macro for writing interactive | ||
| 1194 | help for key bindings. | ||
| 1195 | |||
| 1196 | @item | ||
| 1197 | Chris Smith wrote @file{icon.el}, a mode for editing Icon code. | ||
| 1198 | |||
| 1199 | @item | ||
| 1200 | David Smith wrote @file{ielm.el}, a mode for interacting with the Emacs | ||
| 1201 | Lisp interpreter as a subprocess. | ||
| 1202 | |||
| 1203 | @item | ||
| 1204 | Paul D.@: Smith wrote @file{snmp-mode.el}. | ||
| 1205 | |||
| 1206 | @item | ||
| 1207 | William Sommerfeld wrote @file{scribe.el}, a mode for editing Scribe | ||
| 1208 | files, and @file{server.el}, a package allowing programs to send files | ||
| 1209 | to an extant Emacs job to be edited. | ||
| 1210 | |||
| 1211 | @item | ||
| 1212 | Andre Spiegel made many contributions to the Emacs Version Control | ||
| 1213 | package, and in particular made it support multiple back ends. | ||
| 1214 | |||
| 1215 | @item | ||
| 1216 | Michael Staats wrote @file{pc-select.el}, which rebinds keys for | ||
| 1217 | selecting regions to follow many other systems. | ||
| 1218 | |||
| 1219 | @item | ||
| 1220 | Richard Stallman invented Emacs, and then wrote: | ||
| 1221 | |||
| 1222 | @itemize @minus | ||
| 1223 | @item | ||
| 1224 | @file{easymenu.el}, a facility for defining Emacs menus, | ||
| 1225 | @item | ||
| 1226 | @file{menu-bar.el}, the Emacs menu bar support code, | ||
| 1227 | @item | ||
| 1228 | @file{paren.el}, a package to make matching parentheses stand out in | ||
| 1229 | color, and | ||
| 1230 | @item | ||
| 1231 | most of the rest of Emacs code. | ||
| 1232 | @end itemize | ||
| 1233 | |||
| 1234 | @item | ||
| 1235 | Sam Steingold wrote @file{gulp.el}, a facility for asking package | ||
| 1236 | maintainers for updated versions of their packages via e-mail, and | ||
| 1237 | @file{midnight.el}, a package for running a command every midnight. | ||
| 1238 | |||
| 1239 | @item | ||
| 1240 | Ake Stenhoff and Lars Lindberg wrote @file{imenu.el}, a framework for | ||
| 1241 | browsing indices made from buffer contents. | ||
| 1242 | |||
| 1243 | @item | ||
| 1244 | Peter Stephenson contributed @file{vcursor.el}, which implements a | ||
| 1245 | ``virtual cursor'' that you can move with the keyboard and use for | ||
| 1246 | copying text. | ||
| 1247 | |||
| 1248 | @item | ||
| 1249 | Ken Stevens wrote the initial version of @file{ispell.el} and maintains | ||
| 1250 | that package since Ispell 3.1 release. | ||
| 1251 | |||
| 1252 | @item | ||
| 1253 | Jonathan Stigelman wrote @file{hilit19.el}, a package providing | ||
| 1254 | automatic highlighting in source code buffers, mail readers, and other | ||
| 1255 | contexts. | ||
| 1256 | |||
| 1257 | @item | ||
| 1258 | Kim F.@: Storm made many improvements to the Emacs display engine, | ||
| 1259 | process support, and networking support. He also wrote: | ||
| 1260 | |||
| 1261 | @itemize @minus | ||
| 1262 | @item | ||
| 1263 | @file{bindat.el}, a package for encoding and decoding binary data. | ||
| 1264 | @item | ||
| 1265 | @file{cua.el}, which allows Emacs to emulate the standard CUA key | ||
| 1266 | bindings. | ||
| 1267 | @item | ||
| 1268 | @file{ido.el}, a package for selecting buffers and files quickly. | ||
| 1269 | @item | ||
| 1270 | @file{kmacro.el}, the keyboard macro facility. | ||
| 1271 | @end itemize | ||
| 1272 | |||
| 1273 | @item | ||
| 1274 | Martin Stjernholm co-authored CC Mode, a major editing mode for C, | ||
| 1275 | C@t{++}, Objective-C, Java, Pike, CORBA IDL, and AWK code. | ||
| 1276 | |||
| 1277 | @item | ||
| 1278 | Steve Strassman did not write @file{spook.el}, and even if he did, he | ||
| 1279 | really didn't mean for you to use it in an anarchistic way. | ||
| 1280 | |||
| 1281 | @item | ||
| 1282 | Olaf Sylvester wrote @file{bs.el}, a package for manipulating Emacs | ||
| 1283 | buffers. | ||
| 1284 | |||
| 1285 | @item | ||
| 1286 | Tibor @v{S}imko and Milan Zamazal wrote @file{slovak.el}, support for | ||
| 1287 | editing text in Slovak language. | ||
| 1288 | |||
| 1289 | @item | ||
| 1290 | Naoto Takahashi wrote @file{utf-8.el}, support for encoding and | ||
| 1291 | decoding UTF-8 data. | ||
| 1292 | |||
| 1293 | @item | ||
| 1294 | Luc Teirlinck wrote @file{help-at-pt.el}, providing local help through | ||
| 1295 | the keyboard. | ||
| 1296 | |||
| 1297 | @item | ||
| 1298 | Jean-Philippe Theberge wrote @file{thumbs.el}, a package for viewing | ||
| 1299 | image files as ``thumbnails.'' | ||
| 1300 | |||
| 1301 | @item | ||
| 1302 | Jens T.@: Berger Thielemann wrote @file{word-help.el}, which is | ||
| 1303 | part of the basis for @file{info-look.el}. | ||
| 1304 | |||
| 1305 | @item | ||
| 1306 | Spencer Thomas wrote the original @file{dabbrev.el}, providing a command | ||
| 1307 | which completes the partial word before point, based on other nearby | ||
| 1308 | words for which it is a prefix. He also wrote the original dumping | ||
| 1309 | support. | ||
| 1310 | |||
| 1311 | @item | ||
| 1312 | Jim Thompson wrote @file{ps-print.el}, which converts | ||
| 1313 | Emacs text to PostScript. | ||
| 1314 | |||
| 1315 | @item | ||
| 1316 | Tom Tromey and Chris Lindblad wrote @file{tcl.el}, a major mode for | ||
| 1317 | editing Tcl/Tk source files and running a Tcl interpreter as an Emacs | ||
| 1318 | subprocess. | ||
| 1319 | |||
| 1320 | @item | ||
| 1321 | Eli Tziperman wrote @file{rmail-spam-filter.el}, a spam filter for RMAIL. | ||
| 1322 | @item | ||
| 1323 | Daiki Ueno wrote @file{starttls.el}, support for Transport Layer | ||
| 1324 | Security protocol, and the PGG package adding GnuPG and PGP support. | ||
| 1325 | |||
| 1326 | @item | ||
| 1327 | Masanobu Umeda wrote: | ||
| 1328 | |||
| 1329 | @itemize @minus | ||
| 1330 | @item | ||
| 1331 | GNUS, a feature-full reader for Usenet news, | ||
| 1332 | @item | ||
| 1333 | @file{prolog.el}, a mode for editing Prolog code, | ||
| 1334 | @item | ||
| 1335 | @file{rmailsort.el}, a package for sorting messages in RMAIL folders, | ||
| 1336 | @item | ||
| 1337 | @file{metamail.el}, an interface to the Metamail program, | ||
| 1338 | @item | ||
| 1339 | @file{gnus-kill.el}, the Kill File mode for Gnus, | ||
| 1340 | @item | ||
| 1341 | @file{gnus-mh.el}, an mh-e interface for Gnus, | ||
| 1342 | @item | ||
| 1343 | @file{gnus-msg.el}, a mail and post interface for Gnus, | ||
| 1344 | @item | ||
| 1345 | @file{tcp.el}, emulation of the @code{open-network-stream} function for | ||
| 1346 | some Emacs configurations which lack it, and | ||
| 1347 | @item | ||
| 1348 | @file{timezone.el}, providing functions for dealing with time zones. | ||
| 1349 | @end itemize | ||
| 1350 | |||
| 1351 | @item | ||
| 1352 | Rajesh Vaidheeswarran wrote @file{whitespace.el}, a package that | ||
| 1353 | detects and cleans up excess whitespace in a file. | ||
| 1354 | |||
| 1355 | @item | ||
| 1356 | Neil W.@: Van Dyke wrote @file{webjump.el}, a ``hot links'' package. | ||
| 1357 | |||
| 1358 | @item | ||
| 1359 | Didier Verna contributed @file{rect.el}, a package of functions for | ||
| 1360 | operations on rectangle regions of text. | ||
| 1361 | |||
| 1362 | @item | ||
| 1363 | Ulrik Vieth implemented @file{meta-mode.el}, for editing MetaFont code. | ||
| 1364 | |||
| 1365 | @item | ||
| 1366 | Geoffrey Voelker wrote the Windows NT support. He also wrote | ||
| 1367 | @file{dos-w32.el}, functions shared by the MS-DOS and MS-Windows ports | ||
| 1368 | of Emacs, and @file{w32-fns.el}, MS-Windows specific support functions. | ||
| 1369 | |||
| 1370 | @item | ||
| 1371 | Johan Vromans wrote @file{forms.el} and its associated files, a | ||
| 1372 | mode for filling in forms. | ||
| 1373 | |||
| 1374 | @item | ||
| 1375 | Colin Walters wrote @file{ibuffer.el}, a Dired-like major mode for | ||
| 1376 | operating on buffers. | ||
| 1377 | |||
| 1378 | @item | ||
| 1379 | Barry Warsaw wrote: | ||
| 1380 | |||
| 1381 | @itemize @minus | ||
| 1382 | @item | ||
| 1383 | @file{assoc.el}, a set of utility functions for working with association | ||
| 1384 | lists, | ||
| 1385 | @item | ||
| 1386 | @file{cc-mode.el}, a major mode for editing C, C@t{++}, and Java code, | ||
| 1387 | based on earlier work by Dave Detlefs, Stewart Clamen, and Richard | ||
| 1388 | Stallman, | ||
| 1389 | @item | ||
| 1390 | @file{elp.el}, a new profiler for Emacs Lisp programs. | ||
| 1391 | @item | ||
| 1392 | @file{man.el}, a mode for reading UNIX manual pages, | ||
| 1393 | @item | ||
| 1394 | @file{regi.el}, providing an AWK-like functionality for use in lisp | ||
| 1395 | programs, | ||
| 1396 | @item | ||
| 1397 | @file{reporter.el}, providing customizable bug reporting for lisp | ||
| 1398 | packages, and | ||
| 1399 | @item | ||
| 1400 | @file{supercite.el}, a minor mode for quoting sections of mail messages | ||
| 1401 | and news articles. | ||
| 1402 | @end itemize | ||
| 1403 | |||
| 1404 | @item | ||
| 1405 | Morten Welinder introduced face support into the MS-DOS port of Emacs, | ||
| 1406 | and also wrote: | ||
| 1407 | |||
| 1408 | @itemize @minus | ||
| 1409 | @item | ||
| 1410 | @file{desktop.el}, facilities for saving some of Emacs's state between | ||
| 1411 | sessions, | ||
| 1412 | @item | ||
| 1413 | @file{timer.el}, the Emacs facility to run commands at a given time or | ||
| 1414 | frequency, or when Emacs is idle, and its C-level support code, | ||
| 1415 | @item | ||
| 1416 | @file{pc-win.el}, the MS-DOS ``window-system'' support, | ||
| 1417 | @item | ||
| 1418 | @file{internal.el}, an ``internal terminal'' emulator for the MS-DOS | ||
| 1419 | port of Emacs, | ||
| 1420 | @item | ||
| 1421 | @file{arc-mode.el}, the mode for editing compressed archives, | ||
| 1422 | @item | ||
| 1423 | @file{s-region.el}, commands for setting the region using the shift key | ||
| 1424 | and motion commands, and | ||
| 1425 | @item | ||
| 1426 | @file{dos-fns.el}, functions for use under MS-DOS. | ||
| 1427 | @end itemize | ||
| 1428 | |||
| 1429 | He also helped port Emacs to MS-DOS. | ||
| 1430 | |||
| 1431 | @item | ||
| 1432 | Joseph Brian Wells wrote: | ||
| 1433 | |||
| 1434 | @itemize @minus | ||
| 1435 | @item | ||
| 1436 | @file{apropos.el}, a command to find commands, functions, and variables | ||
| 1437 | whose names contain matches for a regular expression, | ||
| 1438 | @item | ||
| 1439 | @file{resume.el}, support for processing command-line arguments after | ||
| 1440 | resuming a suspended Emacs job, and | ||
| 1441 | @item | ||
| 1442 | @file{mail-extr.el}, a package for extracting names and addresses from | ||
| 1443 | mail headers, with contributions from Jamie Zawinski. | ||
| 1444 | @end itemize | ||
| 1445 | |||
| 1446 | @item | ||
| 1447 | Rodney Whitby and Reto Zimmermann wrote @file{vhdl-mode.el}, a major | ||
| 1448 | mode for editing VHDL source code. | ||
| 1449 | |||
| 1450 | @item | ||
| 1451 | John Wiegley wrote @file{align.el}, a set of commands for aligning text | ||
| 1452 | according to regular-expression based rules; @file{timeclock.el}, a | ||
| 1453 | package for keeping track of time spent on projects; | ||
| 1454 | @file{pcomplete.el}, a programmable completion facility; and | ||
| 1455 | @code{eshell}, a command shell implemented entirely in Emacs Lisp. | ||
| 1456 | |||
| 1457 | @item | ||
| 1458 | Ed Wilkinson wrote @file{b2m.c}, a program to convert mail files from | ||
| 1459 | RMAIL format to Unix @code{mbox} format. | ||
| 1460 | |||
| 1461 | @item | ||
| 1462 | Mike Williams wrote @file{mouse-sel.el}, providing enhanced mouse | ||
| 1463 | selection, and @file{thingatpt.el}, a library of functions for finding | ||
| 1464 | the ``thing'' (word, line, s-expression) containing point. | ||
| 1465 | |||
| 1466 | @item | ||
| 1467 | Bill Wohler wrote the Emacs interface to the MH mail system. | ||
| 1468 | |||
| 1469 | @item | ||
| 1470 | Dale R.@: Worley wrote @file{emerge.el}, a package for interactively | ||
| 1471 | merging two versions of a file. | ||
| 1472 | |||
| 1473 | @item | ||
| 1474 | Francis J.@: Wright wrote @code{WoMan}, a package for browsing | ||
| 1475 | manual pages without the @code{man} command. | ||
| 1476 | |||
| 1477 | @item | ||
| 1478 | Tom Wurgler wrote @file{emacs-lock.el}, which makes it harder | ||
| 1479 | to exit with valuable buffers unsaved. | ||
| 1480 | |||
| 1481 | @item | ||
| 1482 | Masatake Yamato wrote @file{ld-script.el}, an editing mode for GNU | ||
| 1483 | linker scripts, and contributed subword handling in CC mode. | ||
| 1484 | |||
| 1485 | @item | ||
| 1486 | Jonathan Yavner wrote @file{testcover.el}, a package for keeping track | ||
| 1487 | of the testing status of Emacs Lisp code, and the SES spreadsheet | ||
| 1488 | package. | ||
| 1489 | |||
| 1490 | @item | ||
| 1491 | Ryan Yeske wrote @file{rcirc.el} a simple Internet Relay Chat client. | ||
| 1492 | @item | ||
| 1493 | Ilya Zakharevich and Bob Olson contributed @file{cperl-mode.el}, a major | ||
| 1494 | mode for editing Perl code. Ilya Zakharevich also wrote @file{tmm.el}, | ||
| 1495 | a mode for accessing the Emacs menu bar on a text-mode terminal. | ||
| 1496 | |||
| 1497 | @item | ||
| 1498 | Milan Zamazal wrote @file{czech.el}, support for editing Czech text, | ||
| 1499 | @file{glasses.el}, a package for easier reading of source code which | ||
| 1500 | uses illegible identifier names such as @code{cantReadThisVariable}, and | ||
| 1501 | @file{tildify.el}, commands for adding hard spaces to text, @TeX{}, and | ||
| 1502 | SGML/HTML files. | ||
| 1503 | |||
| 1504 | @item | ||
| 1505 | Victor Zandy contributed @file{zone.el}, a package for people who like | ||
| 1506 | to zone out in front of Emacs. | ||
| 1507 | |||
| 1508 | @item | ||
| 1509 | Eli Zaretskii made many standard Emacs features work on MS-DOS. He also | ||
| 1510 | wrote @file{tty-colors.el}, which implements transparent mapping of X | ||
| 1511 | colors to tty colors, and (together with Kenichi Handa) | ||
| 1512 | @file{codepage.el}, a package for editing text encoded in DOS/Windows | ||
| 1513 | code pages. | ||
| 1514 | |||
| 1515 | @item | ||
| 1516 | Jamie Zawinski wrote: | ||
| 1517 | |||
| 1518 | @itemize @minus | ||
| 1519 | @item | ||
| 1520 | Emacs 19's optimizing byte compiler, with Hallvard Furuseth, | ||
| 1521 | @item | ||
| 1522 | much of the support for faces and X selections, | ||
| 1523 | @item | ||
| 1524 | @file{mailabbrev.el}, a package providing automatic expansion of mail | ||
| 1525 | aliases, and | ||
| 1526 | @item | ||
| 1527 | @file{tar-mode.el}, providing simple viewing and editing commands for | ||
| 1528 | tar files. | ||
| 1529 | @end itemize | ||
| 1530 | |||
| 1531 | @item | ||
| 1532 | Andrew Zhilin created the Emacs icons used beginning with Emacs 22. | ||
| 1533 | |||
| 1534 | @item | ||
| 1535 | Shenghuo Zhu wrote: | ||
| 1536 | |||
| 1537 | @itemize @minus | ||
| 1538 | @item | ||
| 1539 | @file{binhex.el}, a package for reading and writing binhex files, | ||
| 1540 | @item | ||
| 1541 | @file{mm-partial.el}, message/partial support for MIME messages, | ||
| 1542 | @item | ||
| 1543 | @file{rfc1843.el}, an HZ decoding package, | ||
| 1544 | @item | ||
| 1545 | @file{uudecode.el}, an Emacs Lisp decoder for uuencoded data, | ||
| 1546 | @item | ||
| 1547 | @file{webmail.el}, an interface to Web mail. | ||
| 1548 | @end itemize | ||
| 1549 | |||
| 1550 | @item | ||
| 1551 | Ian T.@: Zimmerman wrote @file{gametree.el}. | ||
| 1552 | |||
| 1553 | @item | ||
| 1554 | Neal Ziring and Felix S.@: T.@: Wu wrote @file{vi.el}, an emulation of the | ||
| 1555 | VI text editor. | ||
| 1556 | |||
| 1557 | @item | ||
| 1558 | Detlev Zundel wrote @file{re-builder.el}, a package for building regexps | ||
| 1559 | with visual feedback. | ||
| 1560 | |||
| 1561 | @end itemize | ||
| 1562 | |||
| 1563 | Others too numerous to mention have reported and fixed bugs, and added | ||
| 1564 | features to many parts of Emacs. (Many are mentioned in the | ||
| 1565 | @file{ChangeLog} files which are summarized in the file @file{AUTHORS} | ||
| 1566 | in the distribution.) We thank them for their generosity as well. | ||
| 1567 | |||
| 1568 | This list intended to mention every contributor of a major package or | ||
| 1569 | feature we currently distribute; if you know of someone we have omitted, | ||
| 1570 | please report that as a manual bug. | ||
| 1571 | |||
| 1572 | @ignore | ||
| 1573 | arch-tag: bb1d0fa4-0240-4992-b5d4-8602d1e3d4ba | ||
| 1574 | @end ignore | ||
diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi new file mode 100644 index 00000000000..ebff1c7677f --- /dev/null +++ b/doc/emacs/anti.texi | |||
| @@ -0,0 +1,306 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | |||
| 5 | @node Antinews, Mac OS, X Resources, Top | ||
| 6 | @appendix Emacs 21 Antinews | ||
| 7 | |||
| 8 | For those users who live backwards in time, here is information about | ||
| 9 | downgrading to Emacs version 21.4. We hope you will enjoy the greater | ||
| 10 | simplicity that results from the absence of many Emacs @value{EMACSVER} | ||
| 11 | features. | ||
| 12 | |||
| 13 | @itemize @bullet | ||
| 14 | |||
| 15 | @item | ||
| 16 | The buffer position and line number are now displayed at the end of | ||
| 17 | the mode line, where they can be more easily seen. | ||
| 18 | |||
| 19 | @item | ||
| 20 | The mode line of the selected window is no longer displayed with a | ||
| 21 | special face. All mode lines are created equal. Meanwhile, you can | ||
| 22 | use the variable @code{mode-line-inverse-video} to control whether | ||
| 23 | mode lines are highlighted at all---@code{nil} means don't highlight | ||
| 24 | them. | ||
| 25 | |||
| 26 | @item | ||
| 27 | Clicking on a link with the left mouse button (@kbd{mouse-1}) will | ||
| 28 | always set point at the position clicked, instead of following the | ||
| 29 | link. If you want to follow the link, use the middle mouse button | ||
| 30 | (@kbd{mouse-2}). | ||
| 31 | |||
| 32 | @item | ||
| 33 | Emacs is tired of X droppings. If you drop a file or a piece of text | ||
| 34 | onto an Emacs window, nothing will happen. | ||
| 35 | |||
| 36 | @item | ||
| 37 | On an xterm, even if you enable Xterm Mouse mode, Emacs provides a | ||
| 38 | more convincing simulation of a text terminal by not responding to | ||
| 39 | mouse clicks on the mode line, header line, or display margin. | ||
| 40 | |||
| 41 | @item | ||
| 42 | For simplicity, windows always have fringes. We wouldn't want to | ||
| 43 | in-fringe anyone's windows. Likewise, horizontal scrolling always | ||
| 44 | works in the same automatic way. | ||
| 45 | |||
| 46 | @item | ||
| 47 | The horizontal-bar cursor shape has been removed. | ||
| 48 | |||
| 49 | @item | ||
| 50 | If command line arguments are given, Emacs will not display a splash | ||
| 51 | screen, so that you can immediately get on with your editing. The | ||
| 52 | command-line option @samp{--no-splash} is therefore obsolete, and has | ||
| 53 | been removed. | ||
| 54 | |||
| 55 | @item | ||
| 56 | These command line options have also been removed: @samp{--color}, | ||
| 57 | @samp{--fullwidth}, @samp{--fullheight}, @samp{--fullscreen}, | ||
| 58 | @samp{--no-blinking-cursor}, @samp{--no-desktop}, and @samp{-Q}. | ||
| 59 | |||
| 60 | @item | ||
| 61 | The @samp{--geometry} option applies only to the initial frame, and | ||
| 62 | the @samp{-f} option will not read arguments for interactive | ||
| 63 | functions. | ||
| 64 | |||
| 65 | @item | ||
| 66 | We have standardized on one location for the user init file: the file | ||
| 67 | named @file{.emacs} in your home directory. Emacs will not look for | ||
| 68 | the init file in @file{~/.emacs.d/init.el}. Similarly, don't try | ||
| 69 | putting @file{.emacs_SHELL} as @file{init_SHELL.sh} in | ||
| 70 | @file{~/.emacs.d}; Emacs won't find it. | ||
| 71 | |||
| 72 | @item | ||
| 73 | Emacs will not read @file{~/.abbrev_defs} automatically. If you want | ||
| 74 | to load abbrev definitions from a file, you must always do so | ||
| 75 | explicitly. | ||
| 76 | |||
| 77 | @item | ||
| 78 | When you are logged in as root, all files now give you writable | ||
| 79 | buffers, reflecting the fact that you can write any files. | ||
| 80 | |||
| 81 | @item | ||
| 82 | The maximum size of buffers and integer variables has been halved. On | ||
| 83 | 32-bit machines, the maximum buffer size is now 128 megabytes. | ||
| 84 | |||
| 85 | @item | ||
| 86 | An unquoted @samp{$} in a file name is now an error, if the following | ||
| 87 | name is not recognized as an environment variable. Thus, | ||
| 88 | the file name @file{foo$bar} would probably be an error. Meanwhile, | ||
| 89 | the @code{setenv} command does not expand @samp{$} at all. | ||
| 90 | |||
| 91 | @item | ||
| 92 | If a single command accumulates too much undo information, Emacs never | ||
| 93 | discards it. If Emacs runs out of memory as a result, it will handle | ||
| 94 | this by crashing. | ||
| 95 | |||
| 96 | @item | ||
| 97 | Many commands have been removed from the menus or rearranged. | ||
| 98 | |||
| 99 | @item | ||
| 100 | The @kbd{C-h} (help) subcommands have been rearranged---especially | ||
| 101 | those that display specific files. Type @kbd{C-h C-h} to see a list | ||
| 102 | of these commands; that will show you what is different. | ||
| 103 | |||
| 104 | @item | ||
| 105 | The @kbd{C-h v} and @kbd{C-h f} commands no longer show a hyperlink to | ||
| 106 | the C source code, even if it is available. If you want to find the | ||
| 107 | source code, grep for it. | ||
| 108 | |||
| 109 | @item | ||
| 110 | The apropos commands will not accept a list of words to match, in | ||
| 111 | order to encourage you to be more specific. Also, the user option | ||
| 112 | @code{apropos-sort-by-scores} has been removed. | ||
| 113 | |||
| 114 | @item | ||
| 115 | The minibuffer prompt is now displayed using the default face. | ||
| 116 | The colon is enough to show you what part is the prompt. | ||
| 117 | |||
| 118 | @item | ||
| 119 | Minibuffer completion commands always complete the entire minibuffer | ||
| 120 | contents, just as if you had typed them at the end of the minibuffer, | ||
| 121 | no matter where point is actually located. | ||
| 122 | |||
| 123 | @item | ||
| 124 | The command @code{backward-kill-sexp} is now bound to @kbd{C-M-delete} | ||
| 125 | and @kbd{C-M-backspace}. Be careful when using these key sequences! | ||
| 126 | It may shut down your X server, or reboot your operating system. | ||
| 127 | |||
| 128 | @item | ||
| 129 | Commands to set the mark at a place away from point, including | ||
| 130 | @kbd{M-@@}, @kbd{M-h}, etc., don't do anything special when you repeat | ||
| 131 | them. In most cases, typing these commands multiple times is | ||
| 132 | equivalent to typing them once. @kbd{M-h} ignores numeric arguments. | ||
| 133 | |||
| 134 | @item | ||
| 135 | The user option @code{set-mark-command-repeat-pop} has been removed. | ||
| 136 | |||
| 137 | @item | ||
| 138 | @kbd{C-@key{SPC} C-@key{SPC}} has no special meaning--it just sets the | ||
| 139 | mark twice. Neither does @kbd{C-u C-x C-x}, which simply exchanges | ||
| 140 | point and mark like @kbd{C-x C-x}. | ||
| 141 | |||
| 142 | @item | ||
| 143 | The function @code{sentence-end} has been eliminated in favor of a | ||
| 144 | more straightforward approach: directly setting the variable | ||
| 145 | @code{sentence-end}. For example, to end each sentence with a single | ||
| 146 | space, use | ||
| 147 | |||
| 148 | @lisp | ||
| 149 | (setq sentence-end "[.?!][]\"')@}]*\\($\\|[ \t]\\)[ \t\n]*") | ||
| 150 | @end lisp | ||
| 151 | |||
| 152 | @item | ||
| 153 | The variable @code{fill-nobreak-predicate} is no longer customizable, | ||
| 154 | and it can only hold a single function. | ||
| 155 | |||
| 156 | @item | ||
| 157 | Nobreak spaces and hyphens are displayed just like normal characters, | ||
| 158 | and the user option @code{nobreak-char-display} has been removed. | ||
| 159 | |||
| 160 | @item | ||
| 161 | @kbd{C-w} in an incremental search always grabs an entire word | ||
| 162 | into the search string. More precisely, it grabs text through | ||
| 163 | the next end of a word. | ||
| 164 | |||
| 165 | @item | ||
| 166 | Yanking now preserves all text properties that were in the killed | ||
| 167 | text. The variable @code{yank-excluded-properties} has been removed. | ||
| 168 | |||
| 169 | @item | ||
| 170 | Occur mode, Info mode, and Comint-derived modes now control | ||
| 171 | fontification in their own way, and @kbd{M-x font-lock-mode} has | ||
| 172 | nothing to do with it. To control fontification in Info mode, use the | ||
| 173 | variable @code{Info-fontify}. | ||
| 174 | |||
| 175 | @item | ||
| 176 | @samp{M-x shell} is now completely standard in regard to scrolling | ||
| 177 | behavior. It no longer has the option of scrolling the input line to | ||
| 178 | the bottom of the window the way a text terminal running a shell does. | ||
| 179 | |||
| 180 | @item | ||
| 181 | The Grep package has been merged with Compilation mode. Many | ||
| 182 | grep-specific commands and user options have thus been eliminated. | ||
| 183 | Also, @kbd{M-x grep} never tries the GNU grep @samp{-H} option, | ||
| 184 | and instead silently appends @file{/dev/null} to the command line. | ||
| 185 | |||
| 186 | @item | ||
| 187 | In Dired's @kbd{!} command, @samp{*} and @samp{?} now | ||
| 188 | cause substitution of the file names wherever they appear---not | ||
| 189 | only when they are surrounded by whitespace. | ||
| 190 | |||
| 191 | @item | ||
| 192 | When a file is managed with version control, the command @kbd{C-x C-q} | ||
| 193 | (whose general meaning is to make a buffer read-only or writable) now | ||
| 194 | does so by checking the file in or out. Checking the file out makes | ||
| 195 | the buffer writable; checking it in makes the buffer read-only. | ||
| 196 | |||
| 197 | You can still use @kbd{C-x v v} to do these operations if you wish; | ||
| 198 | its meaning is unchanged. If you want to control the buffer's | ||
| 199 | read-only flag without performing any version control operation, | ||
| 200 | use @kbd{M-x toggle-read-only}. | ||
| 201 | |||
| 202 | @item | ||
| 203 | SGML mode does not handle XML syntax, and does not have indentation | ||
| 204 | support. | ||
| 205 | |||
| 206 | @item | ||
| 207 | Many Info mode commands have been removed. Incremental search in Info | ||
| 208 | searches only the current node. | ||
| 209 | |||
| 210 | @item | ||
| 211 | Many @code{etags} features for customizing parsing using regexps | ||
| 212 | have been removed. | ||
| 213 | |||
| 214 | @item | ||
| 215 | The Emacs server now runs a small C program called @file{emacsserver}, | ||
| 216 | rather than trying to handle everything in Emacs Lisp. Now there can | ||
| 217 | only be one Emacs server running at a time. The @code{server-mode} | ||
| 218 | command and @code{server-name} user option have been eliminated. | ||
| 219 | |||
| 220 | @item | ||
| 221 | The @file{emacsclient} program no longer accepts the @samp{--eval}, | ||
| 222 | @samp{--display} and @samp{--server-file} command line options, and | ||
| 223 | can only establish local connections using Unix domain sockets. | ||
| 224 | |||
| 225 | @item | ||
| 226 | The command @code{quail-show-key}, for showing how to input a | ||
| 227 | character, has been removed. | ||
| 228 | |||
| 229 | @item | ||
| 230 | The default value of @code{keyboard-coding-system} is always | ||
| 231 | @code{nil}, regardless of your locale settings. If you want some | ||
| 232 | other value, set it yourself. | ||
| 233 | |||
| 234 | @item | ||
| 235 | Unicode support and unification between Latin-@var{n} character sets | ||
| 236 | have been removed. Cutting and pasting X selections does not support | ||
| 237 | ``extended segments'', so there are certain coding systems it cannot | ||
| 238 | handle. | ||
| 239 | |||
| 240 | @item | ||
| 241 | The input methods for Emacs are included in a separate distribution | ||
| 242 | called ``Leim.'' To use this, you must extract the Leim tar file on | ||
| 243 | top of the Emacs distribution, into the same directory, before you | ||
| 244 | build Emacs. | ||
| 245 | |||
| 246 | @item | ||
| 247 | The following input methods have been eliminated: belarusian, | ||
| 248 | bulgarian-bds, bulgarian-phonetic, chinese-sisheng, croatian, dutch, | ||
| 249 | georgian, latin-alt-postfix, latin-postfix, latin-prefix, | ||
| 250 | latvian-keyboard, lithuanian-numeric, lithuanian-keyboard, | ||
| 251 | malayalam-inscript, rfc1345, russian-computer, sgml, slovenian, | ||
| 252 | tamil-inscript ucs, ukrainian-computer, vietnamese-telex, and welsh. | ||
| 253 | |||
| 254 | @item | ||
| 255 | The following language environments have been eliminated: Belarusian, | ||
| 256 | Bulgarian, Chinese-EUC-TW, Croatian, French, Georgian, Italian, | ||
| 257 | Latin-6, Latin-7, Latvian, Lithuanian, Malayalam, Russian, Russian, | ||
| 258 | Slovenian, Swedish, Tajik, Tamil, UTF-8, Ukrainian, Ukrainian, Welsh, | ||
| 259 | and Windows-1255. | ||
| 260 | |||
| 261 | @item | ||
| 262 | The @code{code-pages} library, which contained various 8-bit coding | ||
| 263 | systems, has been removed. | ||
| 264 | |||
| 265 | @item | ||
| 266 | The Kmacro package has been replaced with a simple and elegant | ||
| 267 | keyboard macro system. Use @kbd{C-x (} to start a new keyboard macro, | ||
| 268 | @kbd{C-x )} to end the macro, and @kbd{C-x e} to execute the last | ||
| 269 | macro. Use @kbd{M-x name-last-kbd-macro} to name the most recently | ||
| 270 | defined macro. | ||
| 271 | |||
| 272 | @item | ||
| 273 | Emacs no longer displays your breakpoints in the source buffer, so you | ||
| 274 | have to remember where you left them. It can be difficult to inspect | ||
| 275 | the state of your debugged program from the command line, so Emacs | ||
| 276 | tries to demonstrate this in the GUD buffer. | ||
| 277 | |||
| 278 | @item | ||
| 279 | The Calc, CUA, Ibuffer, Ido, Password, Printing, Reveal, | ||
| 280 | Ruler-mode, SES, Table, Tramp, and URL packages have been removed. | ||
| 281 | The Benchmark, Cfengine, Conf, Dns, Flymake, Python, Thumbs, and | ||
| 282 | Wdired modes have also been removed. | ||
| 283 | |||
| 284 | @item | ||
| 285 | The Emacs Lisp Reference Manual and the Introduction to Programming in | ||
| 286 | Emacs Lisp are now distributed separately, not in the Emacs | ||
| 287 | distribution. | ||
| 288 | |||
| 289 | @item | ||
| 290 | On MS Windows, there is no longer any support for tooltips, images, | ||
| 291 | sound, different mouse pointer shapes, or pointing devices with more | ||
| 292 | than 3 buttons. If you want these features, consider switching to | ||
| 293 | another operating system. But even if you don't want these features, | ||
| 294 | you should still switch---for freedom's sake. | ||
| 295 | |||
| 296 | @item | ||
| 297 | Emacs will not use Unicode for clipboard operations on MS Windows. | ||
| 298 | |||
| 299 | @item | ||
| 300 | To keep up with decreasing computer memory capacity and disk space, many | ||
| 301 | other functions and files have been eliminated in Emacs 21.4. | ||
| 302 | @end itemize | ||
| 303 | |||
| 304 | @ignore | ||
| 305 | arch-tag: 32932bd9-46f5-41b2-8a0e-fb0cc4caeb29 | ||
| 306 | @end ignore | ||
diff --git a/doc/emacs/arevert-xtra.texi b/doc/emacs/arevert-xtra.texi new file mode 100644 index 00000000000..c2b1ddc2ffe --- /dev/null +++ b/doc/emacs/arevert-xtra.texi | |||
| @@ -0,0 +1,191 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | @c | ||
| 5 | @c This file is included either in emacs-xtra.texi (when producing the | ||
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | ||
| 7 | @node Autorevert | ||
| 8 | @section Auto Reverting non-file Buffers | ||
| 9 | |||
| 10 | Normally Global Auto Revert Mode only reverts file buffers. There are | ||
| 11 | two ways to auto-revert certain non-file buffers: enabling Auto Revert | ||
| 12 | Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting | ||
| 13 | @code{global-auto-revert-non-file-buffers} to @code{t}. The latter | ||
| 14 | enables Auto Reverting for all types of buffers for which it is | ||
| 15 | implemented, that is, for the types of buffers listed in the menu | ||
| 16 | below. | ||
| 17 | |||
| 18 | Like file buffers, non-file buffers should normally not revert while | ||
| 19 | you are working on them, or while they contain information that might | ||
| 20 | get lost after reverting. Therefore, they do not revert if they are | ||
| 21 | ``modified''. This can get tricky, because deciding when a non-file | ||
| 22 | buffer should be marked modified is usually more difficult than for | ||
| 23 | file buffers. | ||
| 24 | |||
| 25 | Another tricky detail is that, for efficiency reasons, Auto Revert | ||
| 26 | often does not try to detect all possible changes in the buffer, only | ||
| 27 | changes that are ``major'' or easy to detect. Hence, enabling | ||
| 28 | auto-reverting for a non-file buffer does not always guarantee that | ||
| 29 | all information in the buffer is up to date and does not necessarily | ||
| 30 | make manual reverts useless. | ||
| 31 | |||
| 32 | At the other extreme, certain buffers automatically auto-revert every | ||
| 33 | @code{auto-revert-interval} seconds. (This currently only applies to | ||
| 34 | the Buffer Menu.) In this case, Auto Revert does not print any | ||
| 35 | messages while reverting, even when @code{auto-revert-verbose} is | ||
| 36 | non-@code{nil}. | ||
| 37 | |||
| 38 | The details depend on the particular types of buffers and are | ||
| 39 | explained in the corresponding sections. | ||
| 40 | |||
| 41 | @menu | ||
| 42 | * Auto Reverting the Buffer Menu:: | ||
| 43 | * Auto Reverting Dired:: | ||
| 44 | * Supporting additional buffers:: | ||
| 45 | @end menu | ||
| 46 | |||
| 47 | @node Auto Reverting the Buffer Menu | ||
| 48 | @subsection Auto Reverting the Buffer Menu | ||
| 49 | |||
| 50 | If auto-reverting of non-file buffers is enabled, the Buffer Menu | ||
| 51 | automatically reverts every @code{auto-revert-interval} seconds, | ||
| 52 | whether there is a need for it or not. (It would probably take longer | ||
| 53 | to check whether there is a need than to actually revert.) | ||
| 54 | |||
| 55 | If the Buffer Menu inappropriately gets marked modified, just revert | ||
| 56 | it manually using @kbd{g} and auto-reverting will resume. However, if | ||
| 57 | you marked certain buffers to get deleted or to be displayed, you have | ||
| 58 | to be careful, because reverting erases all marks. The fact that | ||
| 59 | adding marks sets the buffer's modified flag prevents Auto Revert from | ||
| 60 | automatically erasing the marks. | ||
| 61 | |||
| 62 | @node Auto Reverting Dired | ||
| 63 | @subsection Auto Reverting Dired buffers | ||
| 64 | |||
| 65 | Auto-reverting Dired buffers currently works on GNU or Unix style | ||
| 66 | operating systems. It may not work satisfactorily on some other | ||
| 67 | systems. | ||
| 68 | |||
| 69 | Dired buffers only auto-revert when the file list of the buffer's main | ||
| 70 | directory changes. They do not auto-revert when information about a | ||
| 71 | particular file changes or when inserted subdirectories change. To be | ||
| 72 | sure that @emph{all} listed information is up to date, you have to | ||
| 73 | manually revert using @kbd{g}, @emph{even} if auto-reverting is | ||
| 74 | enabled in the Dired buffer. Sometimes, you might get the impression | ||
| 75 | that modifying or saving files listed in the main directory actually | ||
| 76 | does cause auto-reverting. This is because making changes to a file, | ||
| 77 | or saving it, very often causes changes in the directory itself, for | ||
| 78 | instance, through backup files or auto-save files. However, this is | ||
| 79 | not guaranteed. | ||
| 80 | |||
| 81 | If the Dired buffer is marked modified and there are no changes you | ||
| 82 | want to protect, then most of the time you can make auto-reverting | ||
| 83 | resume by manually reverting the buffer using @kbd{g}. There is one | ||
| 84 | exception. If you flag or mark files, you can safely revert the | ||
| 85 | buffer. This will not erase the flags or marks (unless the marked | ||
| 86 | file has been deleted, of course). However, the buffer will stay | ||
| 87 | modified, even after reverting, and auto-reverting will not resume. | ||
| 88 | This is because, if you flag or mark files, you may be working on the | ||
| 89 | buffer and you might not want the buffer to change without warning. | ||
| 90 | If you want auto-reverting to resume in the presence of marks and | ||
| 91 | flags, mark the buffer non-modified using @kbd{M-~}. However, adding, | ||
| 92 | deleting or changing marks or flags will mark it modified again. | ||
| 93 | |||
| 94 | Remote Dired buffers are not auto-reverted. Neither are Dired buffers | ||
| 95 | for which you used shell wildcards or file arguments to list only some | ||
| 96 | of the files. @samp{*Find*} and @samp{*Locate*} buffers do not | ||
| 97 | auto-revert either. | ||
| 98 | |||
| 99 | @node Supporting additional buffers | ||
| 100 | @subsection Adding Support for Auto-Reverting additional Buffers. | ||
| 101 | |||
| 102 | This section is intended for Elisp programmers who would like to add | ||
| 103 | support for auto-reverting new types of buffers. | ||
| 104 | |||
| 105 | To support auto-reverting the buffer must first of all have a | ||
| 106 | @code{revert-buffer-function}. @xref{Definition of | ||
| 107 | revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}. | ||
| 108 | |||
| 109 | In addition, it @emph{must} have a @code{buffer-stale-function}. | ||
| 110 | |||
| 111 | @defvar buffer-stale-function | ||
| 112 | The value of this variable is a function to check whether a non-file | ||
| 113 | buffer needs reverting. This should be a function with one optional | ||
| 114 | argument @var{noconfirm}. The function should return non-@code{nil} | ||
| 115 | if the buffer should be reverted. The buffer is current when this | ||
| 116 | function is called. | ||
| 117 | |||
| 118 | While this function is mainly intended for use in auto-reverting, it | ||
| 119 | could be used for other purposes as well. For instance, if | ||
| 120 | auto-reverting is not enabled, it could be used to warn the user that | ||
| 121 | the buffer needs reverting. The idea behind the @var{noconfirm} | ||
| 122 | argument is that it should be @code{t} if the buffer is going to be | ||
| 123 | reverted without asking the user and @code{nil} if the function is | ||
| 124 | just going to be used to warn the user that the buffer is out of date. | ||
| 125 | In particular, for use in auto-reverting, @var{noconfirm} is @code{t}. | ||
| 126 | If the function is only going to be used for auto-reverting, you can | ||
| 127 | ignore the @var{noconfirm} argument. | ||
| 128 | |||
| 129 | If you just want to automatically auto-revert every | ||
| 130 | @code{auto-revert-interval} seconds, use: | ||
| 131 | |||
| 132 | @example | ||
| 133 | (set (make-local-variable 'buffer-stale-function) | ||
| 134 | #'(lambda (&optional noconfirm) 'fast)) | ||
| 135 | @end example | ||
| 136 | |||
| 137 | @noindent | ||
| 138 | in the buffer's mode function. | ||
| 139 | |||
| 140 | The special return value @samp{fast} tells the caller that the need | ||
| 141 | for reverting was not checked, but that reverting the buffer is fast. | ||
| 142 | It also tells Auto Revert not to print any revert messages, even if | ||
| 143 | @code{auto-revert-verbose} is non-@code{nil}. This is important, as | ||
| 144 | getting revert messages every @code{auto-revert-interval} seconds can | ||
| 145 | be very annoying. The information provided by this return value could | ||
| 146 | also be useful if the function is consulted for purposes other than | ||
| 147 | auto-reverting. | ||
| 148 | @end defvar | ||
| 149 | |||
| 150 | Once the buffer has a @code{revert-buffer-function} and a | ||
| 151 | @code{buffer-stale-function}, several problems usually remain. | ||
| 152 | |||
| 153 | The buffer will only auto-revert if it is marked unmodified. Hence, | ||
| 154 | you will have to make sure that various functions mark the buffer | ||
| 155 | modified if and only if either the buffer contains information that | ||
| 156 | might be lost by reverting or there is reason to believe that the user | ||
| 157 | might be inconvenienced by auto-reverting, because he is actively | ||
| 158 | working on the buffer. The user can always override this by manually | ||
| 159 | adjusting the modified status of the buffer. To support this, calling | ||
| 160 | the @code{revert-buffer-function} on a buffer that is marked | ||
| 161 | unmodified should always keep the buffer marked unmodified. | ||
| 162 | |||
| 163 | It is important to assure that point does not continuously jump around | ||
| 164 | as a consequence of auto-reverting. Of course, moving point might be | ||
| 165 | inevitable if the buffer radically changes. | ||
| 166 | |||
| 167 | You should make sure that the @code{revert-buffer-function} does not | ||
| 168 | print messages that unnecessarily duplicate Auto Revert's own messages | ||
| 169 | if @code{auto-revert-verbose} is @code{t} and effectively override a | ||
| 170 | @code{nil} value for @code{auto-revert-verbose}. Hence, adapting a | ||
| 171 | mode for auto-reverting often involves getting rid of such messages. | ||
| 172 | This is especially important for buffers that automatically | ||
| 173 | auto-revert every @code{auto-revert-interval} seconds. | ||
| 174 | |||
| 175 | Also, you may want to update the documentation string of | ||
| 176 | @code{global-auto-revert-non-file-buffers}. | ||
| 177 | |||
| 178 | @ifinfo | ||
| 179 | Finally, you should add a node to this chapter's menu. This node | ||
| 180 | @end ifinfo | ||
| 181 | @ifnotinfo | ||
| 182 | Finally, you should add a section to this chapter. This section | ||
| 183 | @end ifnotinfo | ||
| 184 | should at the very least make clear whether enabling auto-reverting | ||
| 185 | for the buffer reliably assures that all information in the buffer is | ||
| 186 | completely up to date (or will be after @code{auto-revert-interval} | ||
| 187 | seconds). | ||
| 188 | |||
| 189 | @ignore | ||
| 190 | arch-tag: 2983e613-a272-45f6-9593-3010ad7f865e | ||
| 191 | @end ignore | ||
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi new file mode 100644 index 00000000000..333985e4a4a --- /dev/null +++ b/doc/emacs/basic.texi | |||
| @@ -0,0 +1,776 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Basic, Minibuffer, Exiting, Top | ||
| 6 | @chapter Basic Editing Commands | ||
| 7 | |||
| 8 | @kindex C-h t | ||
| 9 | @findex help-with-tutorial | ||
| 10 | Here we explain the basics of how to enter text, make corrections, | ||
| 11 | and save the text in a file. If this material is new to you, we | ||
| 12 | suggest you first run the Emacs learn-by-doing tutorial, by typing | ||
| 13 | @kbd{Control-h t} inside Emacs. (@code{help-with-tutorial}). | ||
| 14 | |||
| 15 | To clear and redisplay the screen, type @kbd{C-l} (@code{recenter}). | ||
| 16 | |||
| 17 | @menu | ||
| 18 | |||
| 19 | * Inserting Text:: Inserting text by simply typing it. | ||
| 20 | * Moving Point:: Moving the cursor to the place where you want to | ||
| 21 | change something. | ||
| 22 | * Erasing:: Deleting and killing text. | ||
| 23 | * Basic Undo:: Undoing recent changes in the text. | ||
| 24 | * Files: Basic Files. Visiting, creating, and saving files. | ||
| 25 | * Help: Basic Help. Asking what a character does. | ||
| 26 | * Blank Lines:: Making and deleting blank lines. | ||
| 27 | * Continuation Lines:: How Emacs displays lines too wide for the screen. | ||
| 28 | * Position Info:: What page, line, row, or column is point on? | ||
| 29 | * Arguments:: Numeric arguments for repeating a command N times. | ||
| 30 | * Repeating:: Repeating the previous command quickly. | ||
| 31 | @end menu | ||
| 32 | |||
| 33 | @node Inserting Text | ||
| 34 | @section Inserting Text | ||
| 35 | |||
| 36 | @cindex insertion | ||
| 37 | @cindex graphic characters | ||
| 38 | Typing printing characters inserts them into the text you are | ||
| 39 | editing. It inserts them into the buffer at the cursor; more | ||
| 40 | precisely, it inserts them at @dfn{point}, but the cursor normally | ||
| 41 | shows where point is. @xref{Point}. | ||
| 42 | |||
| 43 | Insertion moves the cursor forward, and the following text moves | ||
| 44 | forward with the cursor. If the text in the buffer is @samp{FOOBAR}, | ||
| 45 | with the cursor before the @samp{B}, and you type @kbd{XX}, you get | ||
| 46 | @samp{FOOXXBAR}, with the cursor still before the @samp{B}. | ||
| 47 | |||
| 48 | To @dfn{delete} text you have just inserted, use the large key | ||
| 49 | labeled @key{DEL}, @key{BACKSPACE} or @key{DELETE} which is a short | ||
| 50 | distance above the @key{RET} or @key{ENTER} key. Regardless of the | ||
| 51 | label on that key, Emacs thinks of it as @key{DEL}, and that's what we | ||
| 52 | call it in this manual. @key{DEL} is the key you normally use outside | ||
| 53 | Emacs to erase the last character that you typed. | ||
| 54 | |||
| 55 | The @key{DEL} key deletes the character @emph{before} the cursor. | ||
| 56 | As a consequence, the cursor and all the characters after it move | ||
| 57 | backwards. If you type a printing character and then type @key{DEL}, | ||
| 58 | they cancel out. | ||
| 59 | |||
| 60 | On most computers, Emacs sets up @key{DEL} automatically. In some | ||
| 61 | cases, especially with text-only terminals, Emacs may guess wrong. If | ||
| 62 | the key that ought to erase the last character doesn't do it in Emacs, | ||
| 63 | see @ref{DEL Does Not Delete}. | ||
| 64 | |||
| 65 | Most PC keyboards have both a @key{BACKSPACE} key a little ways | ||
| 66 | above @key{RET} or @key{ENTER}, and a @key{DELETE} key elsewhere. On | ||
| 67 | these keyboards, Emacs tries to set up @key{BACKSPACE} as @key{DEL}. | ||
| 68 | The @key{DELETE} key deletes ``forwards'' like @kbd{C-d} (see below), | ||
| 69 | which means it deletes the character underneath the cursor (after | ||
| 70 | point). | ||
| 71 | |||
| 72 | @kindex RET | ||
| 73 | @cindex newline | ||
| 74 | To end a line and start typing a new one, type @key{RET}. (This | ||
| 75 | key may be labeled @key{RETURN} or @key{ENTER}, but in Emacs we call | ||
| 76 | it @key{RET}.) This inserts a newline character in the buffer. If | ||
| 77 | point is at the end of the line, this creates a new blank line after | ||
| 78 | it. If point is in the middle of a line, the effect is to split that | ||
| 79 | line. Typing @key{DEL} when the cursor is at the beginning of a line | ||
| 80 | deletes the preceding newline character, thus joining the line with | ||
| 81 | the one before it. | ||
| 82 | |||
| 83 | Emacs can split lines automatically when they become too long, if | ||
| 84 | you turn on a special minor mode called @dfn{Auto Fill} mode. | ||
| 85 | @xref{Filling}, for Auto Fill mode and other methods of @dfn{filling} | ||
| 86 | text. | ||
| 87 | |||
| 88 | If you prefer printing characters to replace (overwrite) existing | ||
| 89 | text, rather than shove it to the right, you should enable Overwrite | ||
| 90 | mode, a minor mode. @xref{Minor Modes}. | ||
| 91 | |||
| 92 | @cindex quoting | ||
| 93 | @kindex C-q | ||
| 94 | @findex quoted-insert | ||
| 95 | Only printing characters and @key{SPC} insert themselves in Emacs. | ||
| 96 | Other characters act as editing commands and do not insert themselves. | ||
| 97 | These include control characters, and characters with codes above 200 | ||
| 98 | octal. If you need to insert one of these characters in the buffer, | ||
| 99 | you must @dfn{quote} it by typing the character @kbd{Control-q} | ||
| 100 | (@code{quoted-insert}) first. (This character's name is normally | ||
| 101 | written @kbd{C-q} for short.) There are two ways to use | ||
| 102 | @kbd{C-q}: | ||
| 103 | |||
| 104 | @itemize @bullet | ||
| 105 | @item | ||
| 106 | @kbd{C-q} followed by any non-graphic character (even @kbd{C-g}) | ||
| 107 | inserts that character. | ||
| 108 | |||
| 109 | @item | ||
| 110 | @kbd{C-q} followed by a sequence of octal digits inserts the character | ||
| 111 | with the specified octal character code. You can use any number of | ||
| 112 | octal digits; any non-digit terminates the sequence. If the | ||
| 113 | terminating character is @key{RET}, it serves only to terminate the | ||
| 114 | sequence. Any other non-digit terminates the sequence and then acts | ||
| 115 | as normal input---thus, @kbd{C-q 1 0 1 B} inserts @samp{AB}. | ||
| 116 | |||
| 117 | The use of octal sequences is disabled in ordinary non-binary | ||
| 118 | Overwrite mode, to give you a convenient way to insert a digit instead | ||
| 119 | of overwriting with it. | ||
| 120 | @end itemize | ||
| 121 | |||
| 122 | @cindex 8-bit character codes | ||
| 123 | @noindent | ||
| 124 | When multibyte characters are enabled, if you specify a code in the | ||
| 125 | range 0200 through 0377 octal, @kbd{C-q} assumes that you intend to | ||
| 126 | use some ISO 8859-@var{n} character set, and converts the specified | ||
| 127 | code to the corresponding Emacs character code. @xref{Enabling | ||
| 128 | Multibyte}. You select @emph{which} of the ISO 8859 character sets to | ||
| 129 | use through your choice of language environment (@pxref{Language | ||
| 130 | Environments}). | ||
| 131 | |||
| 132 | @vindex read-quoted-char-radix | ||
| 133 | To use decimal or hexadecimal instead of octal, set the variable | ||
| 134 | @code{read-quoted-char-radix} to 10 or 16. If the radix is greater than | ||
| 135 | 10, some letters starting with @kbd{a} serve as part of a character | ||
| 136 | code, just like digits. | ||
| 137 | |||
| 138 | A numeric argument tells @kbd{C-q} how many copies of the quoted | ||
| 139 | character to insert (@pxref{Arguments}). | ||
| 140 | |||
| 141 | @findex newline | ||
| 142 | @findex self-insert | ||
| 143 | Customization information: @key{DEL} in most modes runs the command | ||
| 144 | @code{delete-backward-char}; @key{RET} runs the command | ||
| 145 | @code{newline}, and self-inserting printing characters run the command | ||
| 146 | @code{self-insert}, which inserts whatever character you typed. Some | ||
| 147 | major modes rebind @key{DEL} to other commands. | ||
| 148 | |||
| 149 | @node Moving Point | ||
| 150 | @section Changing the Location of Point | ||
| 151 | |||
| 152 | @cindex arrow keys | ||
| 153 | @cindex moving point | ||
| 154 | @cindex movement | ||
| 155 | @cindex cursor motion | ||
| 156 | @cindex moving the cursor | ||
| 157 | To do more than insert characters, you have to know how to move point | ||
| 158 | (@pxref{Point}). The simplest way to do this is with arrow keys, or by | ||
| 159 | clicking the left mouse button where you want to move to. | ||
| 160 | |||
| 161 | There are also control and meta characters for cursor motion. Some | ||
| 162 | are equivalent to the arrow keys (it is faster to use these control | ||
| 163 | keys than move your hand over to the arrow keys). Others do more | ||
| 164 | sophisticated things. | ||
| 165 | |||
| 166 | @kindex C-a | ||
| 167 | @kindex C-e | ||
| 168 | @kindex C-f | ||
| 169 | @kindex C-b | ||
| 170 | @kindex C-n | ||
| 171 | @kindex C-p | ||
| 172 | @kindex M-> | ||
| 173 | @kindex M-< | ||
| 174 | @kindex M-r | ||
| 175 | @kindex LEFT | ||
| 176 | @kindex RIGHT | ||
| 177 | @kindex UP | ||
| 178 | @kindex DOWN | ||
| 179 | @findex move-beginning-of-line | ||
| 180 | @findex move-end-of-line | ||
| 181 | @findex forward-char | ||
| 182 | @findex backward-char | ||
| 183 | @findex next-line | ||
| 184 | @findex previous-line | ||
| 185 | @findex beginning-of-buffer | ||
| 186 | @findex end-of-buffer | ||
| 187 | @findex goto-char | ||
| 188 | @findex goto-line | ||
| 189 | @findex move-to-window-line | ||
| 190 | @table @kbd | ||
| 191 | @item C-a | ||
| 192 | Move to the beginning of the line (@code{move-beginning-of-line}). | ||
| 193 | @item C-e | ||
| 194 | Move to the end of the line (@code{move-end-of-line}). | ||
| 195 | @item C-f | ||
| 196 | Move forward one character (@code{forward-char}). The right-arrow key | ||
| 197 | does the same thing. | ||
| 198 | @item C-b | ||
| 199 | Move backward one character (@code{backward-char}). The left-arrow | ||
| 200 | key has the same effect. | ||
| 201 | @item M-f | ||
| 202 | Move forward one word (@code{forward-word}). | ||
| 203 | @item M-b | ||
| 204 | Move backward one word (@code{backward-word}). | ||
| 205 | @item C-n | ||
| 206 | Move down one line vertically (@code{next-line}). This command | ||
| 207 | attempts to keep the horizontal position unchanged, so if you start in | ||
| 208 | the middle of one line, you move to the middle of the next. The | ||
| 209 | down-arrow key does the same thing. | ||
| 210 | @item C-p | ||
| 211 | Move up one line, vertically (@code{previous-line}). The up-arrow key | ||
| 212 | has the same effect. This command preserves position within the line, | ||
| 213 | like @kbd{C-n}. | ||
| 214 | @item M-r | ||
| 215 | Move point to left margin, vertically centered in the window | ||
| 216 | (@code{move-to-window-line}). Text does not move on the screen. | ||
| 217 | A numeric argument says which screen line to place point on, counting | ||
| 218 | downward from the top of the window (zero means the top line). A | ||
| 219 | negative argument counts lines up from the bottom (@minus{}1 means the | ||
| 220 | bottom line). | ||
| 221 | @item M-< | ||
| 222 | Move to the top of the buffer (@code{beginning-of-buffer}). With | ||
| 223 | numeric argument @var{n}, move to @var{n}/10 of the way from the top. | ||
| 224 | @xref{Arguments}, for more information on numeric arguments.@refill | ||
| 225 | @item M-> | ||
| 226 | Move to the end of the buffer (@code{end-of-buffer}). | ||
| 227 | @item C-v | ||
| 228 | @itemx @key{PAGEDOWN} | ||
| 229 | @itemx @key{PRIOR} | ||
| 230 | Scroll the display one screen forward, and move point if necessary to | ||
| 231 | put it on the screen (@code{scroll-up}). This doesn't always move | ||
| 232 | point, but it is commonly used to do so. If your keyboard has a | ||
| 233 | @key{PAGEDOWN} or @key{PRIOR} key, it does the same thing. | ||
| 234 | |||
| 235 | Scrolling commands are described further in @ref{Scrolling}. | ||
| 236 | @item M-v | ||
| 237 | @itemx @key{PAGEUP} | ||
| 238 | @itemx @key{NEXT} | ||
| 239 | Scroll one screen backward, and move point if necessary to put it on | ||
| 240 | the screen (@code{scroll-down}). This doesn't always move point, but | ||
| 241 | it is commonly used to do so. If your keyboard has a @key{PAGEUP} or | ||
| 242 | @key{NEXT} key, it does the same thing. | ||
| 243 | @item M-x goto-char | ||
| 244 | Read a number @var{n} and move point to buffer position @var{n}. | ||
| 245 | Position 1 is the beginning of the buffer. | ||
| 246 | @item M-g M-g | ||
| 247 | @itemx M-g g | ||
| 248 | @itemx M-x goto-line | ||
| 249 | Read a number @var{n} and move point to the beginning of line number | ||
| 250 | @var{n}. Line 1 is the beginning of the buffer. If point is on or | ||
| 251 | just after a number in the buffer, and you type @key{RET} with the | ||
| 252 | minibuffer empty, that number is used for @var{n}. | ||
| 253 | @item C-x C-n | ||
| 254 | @findex set-goal-column | ||
| 255 | @kindex C-x C-n | ||
| 256 | Use the current column of point as the @dfn{semipermanent goal column} | ||
| 257 | for @kbd{C-n} and @kbd{C-p} (@code{set-goal-column}). When a | ||
| 258 | semipermanent goal column is in effect, those commands always try to | ||
| 259 | move to this column, or as close as possible to it, after moving | ||
| 260 | vertically. The goal column remains in effect until canceled. | ||
| 261 | @item C-u C-x C-n | ||
| 262 | Cancel the goal column. Henceforth, @kbd{C-n} and @kbd{C-p} try to | ||
| 263 | preserve the horizontal position, as usual. | ||
| 264 | @end table | ||
| 265 | |||
| 266 | @vindex track-eol | ||
| 267 | If you set the variable @code{track-eol} to a non-@code{nil} value, | ||
| 268 | then @kbd{C-n} and @kbd{C-p}, when starting at the end of the line, move | ||
| 269 | to the end of another line. Normally, @code{track-eol} is @code{nil}. | ||
| 270 | @xref{Variables}, for how to set variables such as @code{track-eol}. | ||
| 271 | |||
| 272 | @vindex next-line-add-newlines | ||
| 273 | @kbd{C-n} normally stops at the end of the buffer when you use it on | ||
| 274 | the last line of the buffer. However, if you set the variable | ||
| 275 | @code{next-line-add-newlines} to a non-@code{nil} value, @kbd{C-n} on | ||
| 276 | the last line of a buffer creates an additional line at the end and | ||
| 277 | moves down into it. | ||
| 278 | |||
| 279 | @node Erasing | ||
| 280 | @section Erasing Text | ||
| 281 | |||
| 282 | @table @kbd | ||
| 283 | @item @key{DEL} | ||
| 284 | Delete the character before point (@code{delete-backward-char}). | ||
| 285 | @item C-d | ||
| 286 | Delete the character after point (@code{delete-char}). | ||
| 287 | @item @key{DELETE} | ||
| 288 | @itemx @key{BACKSPACE} | ||
| 289 | One of these keys, whichever is the large key above the @key{RET} or | ||
| 290 | @key{ENTER} key, deletes the character before point---it is @key{DEL}. | ||
| 291 | If @key{BACKSPACE} is @key{DEL}, and your keyboard also has @key{DELETE}, | ||
| 292 | then @key{DELETE} deletes forwards, like @kbd{C-d}. | ||
| 293 | @item C-k | ||
| 294 | Kill to the end of the line (@code{kill-line}). | ||
| 295 | @item M-d | ||
| 296 | Kill forward to the end of the next word (@code{kill-word}). | ||
| 297 | @item M-@key{DEL} | ||
| 298 | Kill back to the beginning of the previous word | ||
| 299 | (@code{backward-kill-word}). | ||
| 300 | @end table | ||
| 301 | |||
| 302 | @cindex killing characters and lines | ||
| 303 | @cindex deleting characters and lines | ||
| 304 | @cindex erasing characters and lines | ||
| 305 | You already know about the @key{DEL} key which deletes the character | ||
| 306 | before point (that is, before the cursor). Another key, @kbd{Control-d} | ||
| 307 | (@kbd{C-d} for short), deletes the character after point (that is, the | ||
| 308 | character that the cursor is on). This shifts the rest of the text on | ||
| 309 | the line to the left. If you type @kbd{C-d} at the end of a line, it | ||
| 310 | joins that line with the following line. | ||
| 311 | |||
| 312 | To erase a larger amount of text, use the @kbd{C-k} key, which | ||
| 313 | erases (kills) a line at a time. If you type @kbd{C-k} at the | ||
| 314 | beginning or middle of a line, it kills all the text up to the end of | ||
| 315 | the line. If you type @kbd{C-k} at the end of a line, it joins that | ||
| 316 | line with the following line. | ||
| 317 | |||
| 318 | @xref{Killing}, for more flexible ways of killing text. | ||
| 319 | |||
| 320 | @node Basic Undo | ||
| 321 | @section Undoing Changes | ||
| 322 | |||
| 323 | Emacs records a list of changes made in the buffer text, so you can | ||
| 324 | you can undo recent changes, as far as the records go. | ||
| 325 | Usually each editing command makes a separate entry in the undo | ||
| 326 | records, but sometimes an entry covers just part of a command, and | ||
| 327 | very simple commands may be grouped. | ||
| 328 | |||
| 329 | @table @kbd | ||
| 330 | @item C-x u | ||
| 331 | Undo one entry of the undo records---usually, one command worth | ||
| 332 | (@code{undo}). | ||
| 333 | @item C-_ | ||
| 334 | @itemx C-/ | ||
| 335 | The same. | ||
| 336 | @end table | ||
| 337 | |||
| 338 | The command @kbd{C-x u} (or @kbd{C-_} or @kbd{C-/}) is how you undo. | ||
| 339 | Normally this command undoes the last change, and moves point back to | ||
| 340 | where it was before the change. | ||
| 341 | |||
| 342 | If you repeat @kbd{C-x u} (or its aliases), each repetition undoes | ||
| 343 | another, earlier change, back to the limit of the undo information | ||
| 344 | available. If all recorded changes have already been undone, the undo | ||
| 345 | command displays an error message and does nothing. | ||
| 346 | |||
| 347 | The undo command applies only to changes in the buffer; you can't | ||
| 348 | use it to undo mere cursor motion. However, some cursor motion | ||
| 349 | commands set the mark, so if you use these commands from time to time, | ||
| 350 | you can move back to the neighborhoods you have moved through by | ||
| 351 | popping the mark ring (@pxref{Mark Ring}). | ||
| 352 | |||
| 353 | @node Basic Files | ||
| 354 | @section Files | ||
| 355 | |||
| 356 | Text that you insert in an Emacs buffer lasts only as long as the | ||
| 357 | Emacs session. To keep any text permanently you must put it in a | ||
| 358 | @dfn{file}. Files are named units of text which are stored by the | ||
| 359 | operating system for you to retrieve later by name. To use the | ||
| 360 | contents of a file in any way, you must specify the file name. That | ||
| 361 | includes editing the file with Emacs. | ||
| 362 | |||
| 363 | Suppose there is a file named @file{test.emacs} in your home | ||
| 364 | directory. To begin editing this file in Emacs, type | ||
| 365 | |||
| 366 | @example | ||
| 367 | C-x C-f test.emacs @key{RET} | ||
| 368 | @end example | ||
| 369 | |||
| 370 | @noindent | ||
| 371 | Here the file name is given as an @dfn{argument} to the command @kbd{C-x | ||
| 372 | C-f} (@code{find-file}). That command uses the @dfn{minibuffer} to | ||
| 373 | read the argument, and you type @key{RET} to terminate the argument | ||
| 374 | (@pxref{Minibuffer}). | ||
| 375 | |||
| 376 | Emacs obeys this command by @dfn{visiting} the file: it creates a | ||
| 377 | buffer, it copies the contents of the file into the buffer, and then | ||
| 378 | displays the buffer for editing. If you alter the text, you can | ||
| 379 | @dfn{save} the new text in the file by typing @kbd{C-x C-s} | ||
| 380 | (@code{save-buffer}). This copies the altered buffer contents back | ||
| 381 | into the file @file{test.emacs}, making them permanent. Until you | ||
| 382 | save, the changed text exists only inside Emacs, and the file | ||
| 383 | @file{test.emacs} is unaltered. | ||
| 384 | |||
| 385 | To create a file, just visit it with @kbd{C-x C-f} as if it already | ||
| 386 | existed. This creates an empty buffer, in which you can insert the | ||
| 387 | text you want to put in the file. Emacs actually creates the file the | ||
| 388 | first time you save this buffer with @kbd{C-x C-s}. | ||
| 389 | |||
| 390 | To learn more about using files in Emacs, see @ref{Files}. | ||
| 391 | |||
| 392 | @node Basic Help | ||
| 393 | @section Help | ||
| 394 | |||
| 395 | @cindex getting help with keys | ||
| 396 | If you forget what a key does, you can find out with the Help | ||
| 397 | character, which is @kbd{C-h} (or @key{F1}, which is an alias for | ||
| 398 | @kbd{C-h}). Type @kbd{C-h k} followed by the key of interest; for | ||
| 399 | example, @kbd{C-h k C-n} tells you what @kbd{C-n} does. @kbd{C-h} is | ||
| 400 | a prefix key; @kbd{C-h k} is just one of its subcommands (the command | ||
| 401 | @code{describe-key}). The other subcommands of @kbd{C-h} provide | ||
| 402 | different kinds of help. Type @kbd{C-h} twice to get a description of | ||
| 403 | all the help facilities. @xref{Help}. | ||
| 404 | |||
| 405 | @node Blank Lines | ||
| 406 | @section Blank Lines | ||
| 407 | |||
| 408 | @cindex inserting blank lines | ||
| 409 | @cindex deleting blank lines | ||
| 410 | Here are special commands and techniques for inserting and deleting | ||
| 411 | blank lines. | ||
| 412 | |||
| 413 | @table @kbd | ||
| 414 | @item C-o | ||
| 415 | Insert one or more blank lines after the cursor (@code{open-line}). | ||
| 416 | @item C-x C-o | ||
| 417 | Delete all but one of many consecutive blank lines | ||
| 418 | (@code{delete-blank-lines}). | ||
| 419 | @end table | ||
| 420 | |||
| 421 | @kindex C-o | ||
| 422 | @kindex C-x C-o | ||
| 423 | @cindex blank lines | ||
| 424 | @findex open-line | ||
| 425 | @findex delete-blank-lines | ||
| 426 | To insert a new line of text before an existing line, | ||
| 427 | type the new line of text, followed by @key{RET}. | ||
| 428 | However, it may be easier to see what you are doing if you first make a | ||
| 429 | blank line and then insert the desired text into it. This is easy to do | ||
| 430 | using the key @kbd{C-o} (@code{open-line}), which inserts a newline | ||
| 431 | after point but leaves point in front of the newline. After @kbd{C-o}, | ||
| 432 | type the text for the new line. @kbd{C-o F O O} has the same effect as | ||
| 433 | @w{@kbd{F O O @key{RET}}}, except for the final location of point. | ||
| 434 | |||
| 435 | You can make several blank lines by typing @kbd{C-o} several times, or | ||
| 436 | by giving it a numeric argument specifying how many blank lines to make. | ||
| 437 | @xref{Arguments}, for how. If you have a fill prefix, the @kbd{C-o} | ||
| 438 | command inserts the fill prefix on the new line, if typed at the | ||
| 439 | beginning of a line. @xref{Fill Prefix}. | ||
| 440 | |||
| 441 | The easy way to get rid of extra blank lines is with the command | ||
| 442 | @kbd{C-x C-o} (@code{delete-blank-lines}). @kbd{C-x C-o} in a run of | ||
| 443 | several blank lines deletes all but one of them. @kbd{C-x C-o} on a | ||
| 444 | lone blank line deletes that one. When point is on a nonblank line, | ||
| 445 | @kbd{C-x C-o} deletes all following blank lines (if any). | ||
| 446 | |||
| 447 | @node Continuation Lines | ||
| 448 | @section Continuation Lines | ||
| 449 | |||
| 450 | @cindex continuation line | ||
| 451 | @cindex wrapping | ||
| 452 | @cindex line wrapping | ||
| 453 | @cindex fringes, and continuation lines | ||
| 454 | When a text line is too long to fit in one screen line, Emacs | ||
| 455 | displays it on two or more screen lines. This is called | ||
| 456 | @dfn{continuation} or @dfn{line wrapping}. On graphical displays, | ||
| 457 | Emacs indicates line wrapping with small bent arrows in the left and | ||
| 458 | right window fringes. On text-only terminals, Emacs displays a | ||
| 459 | @samp{\} character at the right margin of a screen line if it is not | ||
| 460 | the last in its text line. This @samp{\} character says that the | ||
| 461 | following screen line is not really a new text line. | ||
| 462 | |||
| 463 | When line wrapping occurs just before a character that is wider than one | ||
| 464 | column, some columns at the end of the previous screen line may be | ||
| 465 | ``empty.'' In this case, Emacs displays additional @samp{\} | ||
| 466 | characters in the ``empty'' columns before the @samp{\} | ||
| 467 | character that indicates continuation. | ||
| 468 | |||
| 469 | Continued lines can be difficult to read, since lines can break in | ||
| 470 | the middle of a word. If you prefer, you can make Emacs insert a | ||
| 471 | newline automatically when a line gets too long, by using Auto Fill | ||
| 472 | mode. Or enable Long Lines mode, which ensures that wrapping only | ||
| 473 | occurs between words. @xref{Filling}. | ||
| 474 | |||
| 475 | @cindex truncation | ||
| 476 | @cindex line truncation, and fringes | ||
| 477 | Emacs can optionally @dfn{truncate} long lines---this means | ||
| 478 | displaying just one screen line worth, and the rest of the long line | ||
| 479 | does not appear at all. @samp{$} in the last column or a small | ||
| 480 | straight arrow in the window's right fringe indicates a truncated | ||
| 481 | line. | ||
| 482 | |||
| 483 | @xref{Line Truncation}, for more about line truncation, | ||
| 484 | and other variables that control how text is displayed. | ||
| 485 | |||
| 486 | @node Position Info | ||
| 487 | @section Cursor Position Information | ||
| 488 | |||
| 489 | Here are commands to get information about the size and position of | ||
| 490 | parts of the buffer, and to count lines. | ||
| 491 | |||
| 492 | @table @kbd | ||
| 493 | @item M-x what-page | ||
| 494 | Display the page number of point, and the line number within that page. | ||
| 495 | @item M-x what-line | ||
| 496 | Display the line number of point in the whole buffer. | ||
| 497 | @item M-x line-number-mode | ||
| 498 | @itemx M-x column-number-mode | ||
| 499 | Toggle automatic display of the current line number or column number. | ||
| 500 | @xref{Optional Mode Line}. | ||
| 501 | @item M-= | ||
| 502 | Display the number of lines in the current region (@code{count-lines-region}). | ||
| 503 | @xref{Mark}, for information about the region. | ||
| 504 | @item C-x = | ||
| 505 | Display the character code of character after point, character position of | ||
| 506 | point, and column of point (@code{what-cursor-position}). | ||
| 507 | @item M-x hl-line-mode | ||
| 508 | Enable or disable highlighting of the current line. @xref{Cursor | ||
| 509 | Display}. | ||
| 510 | @item M-x size-indication-mode | ||
| 511 | Toggle automatic display of the size of the buffer. | ||
| 512 | @xref{Optional Mode Line}. | ||
| 513 | @end table | ||
| 514 | |||
| 515 | @findex what-page | ||
| 516 | @findex what-line | ||
| 517 | @cindex line number commands | ||
| 518 | @cindex location of point | ||
| 519 | @cindex cursor location | ||
| 520 | @cindex point location | ||
| 521 | @kbd{M-x what-line} displays the current line number | ||
| 522 | in the echo area. You can also see the current line number in the | ||
| 523 | mode line; see @ref{Mode Line}; but if you narrow the buffer, the | ||
| 524 | line number in the mode line is relative to the accessible portion | ||
| 525 | (@pxref{Narrowing}). By contrast, @code{what-line} shows both the | ||
| 526 | line number relative to the narrowed region and the line number | ||
| 527 | relative to the whole buffer. | ||
| 528 | |||
| 529 | @kbd{M-x what-page} counts pages from the beginning of the file, and | ||
| 530 | counts lines within the page, showing both numbers in the echo area. | ||
| 531 | @xref{Pages}. | ||
| 532 | |||
| 533 | @kindex M-= | ||
| 534 | @findex count-lines-region | ||
| 535 | Use @kbd{M-=} (@code{count-lines-region}) to displays the number of | ||
| 536 | lines in the region (@pxref{Mark}). @xref{Pages}, for the command | ||
| 537 | @kbd{C-x l} which counts the lines in the current page. | ||
| 538 | |||
| 539 | @kindex C-x = | ||
| 540 | @findex what-cursor-position | ||
| 541 | The command @kbd{C-x =} (@code{what-cursor-position}) shows what | ||
| 542 | cursor's column position, and other information about point and the | ||
| 543 | character after it. It displays a line in the echo area that looks | ||
| 544 | like this: | ||
| 545 | |||
| 546 | @smallexample | ||
| 547 | Char: c (99, #o143, #x63) point=28062 of 36168 (78%) column=53 | ||
| 548 | @end smallexample | ||
| 549 | |||
| 550 | The four values after @samp{Char:} describe the character that follows | ||
| 551 | point, first by showing it and then by giving its character code in | ||
| 552 | decimal, octal and hex. For a non-@acronym{ASCII} multibyte character, these are | ||
| 553 | followed by @samp{file} and the character's representation, in hex, in | ||
| 554 | the buffer's coding system, if that coding system encodes the character | ||
| 555 | safely and with a single byte (@pxref{Coding Systems}). If the | ||
| 556 | character's encoding is longer than one byte, Emacs shows @samp{file ...}. | ||
| 557 | |||
| 558 | However, if the character displayed is in the range 0200 through | ||
| 559 | 0377 octal, it may actually stand for an invalid UTF-8 byte read from | ||
| 560 | a file. In Emacs, that byte is represented as a sequence of 8-bit | ||
| 561 | characters, but all of them together display as the original invalid | ||
| 562 | byte, in octal code. In this case, @kbd{C-x =} shows @samp{part of | ||
| 563 | display ...} instead of @samp{file}. | ||
| 564 | |||
| 565 | @samp{point=} is followed by the position of point expressed as a | ||
| 566 | character count. The start of the buffer is position 1, one character | ||
| 567 | later is position 2, and so on. The next, larger, number is the total | ||
| 568 | number of characters in the buffer. Afterward in parentheses comes | ||
| 569 | the position expressed as a percentage of the total size. | ||
| 570 | |||
| 571 | @samp{column=} is followed by the horizontal position of point, in | ||
| 572 | columns from the left edge of the window. | ||
| 573 | |||
| 574 | If the buffer has been narrowed, making some of the text at the | ||
| 575 | beginning and the end temporarily inaccessible, @kbd{C-x =} displays | ||
| 576 | additional text describing the currently accessible range. For example, it | ||
| 577 | might display this: | ||
| 578 | |||
| 579 | @smallexample | ||
| 580 | Char: C (67, #o103, #x43) point=252 of 889 (28%) <231-599> column=0 | ||
| 581 | @end smallexample | ||
| 582 | |||
| 583 | @noindent | ||
| 584 | where the two extra numbers give the smallest and largest character | ||
| 585 | position that point is allowed to assume. The characters between those | ||
| 586 | two positions are the accessible ones. @xref{Narrowing}. | ||
| 587 | |||
| 588 | If point is at the end of the buffer (or the end of the accessible | ||
| 589 | part), the @w{@kbd{C-x =}} output does not describe a character after | ||
| 590 | point. The output might look like this: | ||
| 591 | |||
| 592 | @smallexample | ||
| 593 | point=36169 of 36168 (EOB) column=0 | ||
| 594 | @end smallexample | ||
| 595 | |||
| 596 | @cindex character set of character at point | ||
| 597 | @cindex font of character at point | ||
| 598 | @cindex text properties at point | ||
| 599 | @cindex face at point | ||
| 600 | @w{@kbd{C-u C-x =}} displays the following additional information about a | ||
| 601 | character. | ||
| 602 | |||
| 603 | @itemize @bullet | ||
| 604 | @item | ||
| 605 | The character set name, and the codes that identify the character | ||
| 606 | within that character set; @acronym{ASCII} characters are identified | ||
| 607 | as belonging to the @code{ascii} character set. | ||
| 608 | |||
| 609 | @item | ||
| 610 | The character's syntax and categories. | ||
| 611 | |||
| 612 | @item | ||
| 613 | The character's encodings, both internally in the buffer, and externally | ||
| 614 | if you were to save the file. | ||
| 615 | |||
| 616 | @item | ||
| 617 | What keys to type to input the character in the current input method | ||
| 618 | (if it supports the character). | ||
| 619 | |||
| 620 | @item | ||
| 621 | If you are running Emacs on a graphical display, the font name and | ||
| 622 | glyph code for the character. If you are running Emacs on a text-only | ||
| 623 | terminal, the code(s) sent to the terminal. | ||
| 624 | |||
| 625 | @item | ||
| 626 | The character's text properties (@pxref{Text Properties,,, | ||
| 627 | elisp, the Emacs Lisp Reference Manual}), including any non-default | ||
| 628 | faces used to display the character, and any overlays containing it | ||
| 629 | (@pxref{Overlays,,, elisp, the same manual}). | ||
| 630 | @end itemize | ||
| 631 | |||
| 632 | Here's an example showing the Latin-1 character A with grave accent, | ||
| 633 | in a buffer whose coding system is @code{iso-latin-1}, whose | ||
| 634 | terminal coding system is @code{iso-latin-1} (so the terminal actually | ||
| 635 | displays the character as @samp{@`A}), and which has font-lock-mode | ||
| 636 | (@pxref{Font Lock}) enabled: | ||
| 637 | |||
| 638 | @smallexample | ||
| 639 | character: @`A (2240, #o4300, #x8c0, U+00C0) | ||
| 640 | charset: latin-iso8859-1 | ||
| 641 | (Right-Hand Part of Latin Alphabet 1@dots{} | ||
| 642 | code point: #x40 | ||
| 643 | syntax: w which means: word | ||
| 644 | category: l:Latin | ||
| 645 | to input: type "`A" with latin-1-prefix | ||
| 646 | buffer code: #x81 #xC0 | ||
| 647 | file code: #xC0 (encoded by coding system iso-latin-1) | ||
| 648 | display: terminal code #xC0 | ||
| 649 | |||
| 650 | There are text properties here: | ||
| 651 | fontified t | ||
| 652 | @end smallexample | ||
| 653 | |||
| 654 | @node Arguments | ||
| 655 | @section Numeric Arguments | ||
| 656 | @cindex numeric arguments | ||
| 657 | @cindex prefix arguments | ||
| 658 | @cindex arguments to commands | ||
| 659 | |||
| 660 | In mathematics and computer usage, @dfn{argument} means | ||
| 661 | ``data provided to a function or operation.'' You can give any Emacs | ||
| 662 | command a @dfn{numeric argument} (also called a @dfn{prefix argument}). | ||
| 663 | Some commands interpret the argument as a repetition count. For | ||
| 664 | example, @kbd{C-f} with an argument of ten moves forward ten characters | ||
| 665 | instead of one. With these commands, no argument is equivalent to an | ||
| 666 | argument of one. Negative arguments tell most such commands to move or | ||
| 667 | act in the opposite direction. | ||
| 668 | |||
| 669 | @kindex M-1 | ||
| 670 | @kindex M-@t{-} | ||
| 671 | @findex digit-argument | ||
| 672 | @findex negative-argument | ||
| 673 | If your terminal keyboard has a @key{META} key (labeled @key{ALT} on | ||
| 674 | PC keyboards), the easiest way to specify a numeric argument is to | ||
| 675 | type digits and/or a minus sign while holding down the @key{META} key. | ||
| 676 | For example, | ||
| 677 | |||
| 678 | @example | ||
| 679 | M-5 C-n | ||
| 680 | @end example | ||
| 681 | |||
| 682 | @noindent | ||
| 683 | moves down five lines. The characters @kbd{Meta-1}, @kbd{Meta-2}, | ||
| 684 | and so on, as well as @kbd{Meta--}, do this because they are keys bound | ||
| 685 | to commands (@code{digit-argument} and @code{negative-argument}) that | ||
| 686 | are defined to set up an argument for the next command. | ||
| 687 | @kbd{Meta--} without digits normally means @minus{}1. Digits and | ||
| 688 | @kbd{-} modified with Control, or Control and Meta, also specify numeric | ||
| 689 | arguments. | ||
| 690 | |||
| 691 | @kindex C-u | ||
| 692 | @findex universal-argument | ||
| 693 | You can also specify a numeric argument by typing @kbd{C-u} | ||
| 694 | (@code{universal-argument}) followed by the digits. The advantage of | ||
| 695 | @kbd{C-u} is that you can type the digits without modifier keys; thus, | ||
| 696 | @kbd{C-u} works on all terminals. For a negative argument, type a | ||
| 697 | minus sign after @kbd{C-u}. A minus sign without digits normally | ||
| 698 | means @minus{}1. | ||
| 699 | |||
| 700 | @kbd{C-u} alone has the special meaning of | ||
| 701 | ``four times'': it multiplies the argument for the next command by | ||
| 702 | four. @kbd{C-u C-u} multiplies it by sixteen. Thus, @kbd{C-u C-u | ||
| 703 | C-f} moves forward sixteen characters. This is a good way to move | ||
| 704 | forward ``fast,'' since it moves about 1/5 of a line in the usual size | ||
| 705 | screen. Other useful combinations are @kbd{C-u C-n}, @kbd{C-u C-u | ||
| 706 | C-n} (move down a good fraction of a screen), @kbd{C-u C-u C-o} (make | ||
| 707 | ``a lot'' of blank lines), and @kbd{C-u C-k} (kill four lines). | ||
| 708 | |||
| 709 | Some commands care whether there is an argument, but ignore its | ||
| 710 | value. For example, the command @kbd{M-q} (@code{fill-paragraph}) | ||
| 711 | fills text; with an argument, it justifies the text as well. | ||
| 712 | (@xref{Filling}, for more information on @kbd{M-q}.) Plain @kbd{C-u} | ||
| 713 | is a handy way of providing an argument for such commands. | ||
| 714 | |||
| 715 | Some commands use the value of the argument as a repeat count, but do | ||
| 716 | something peculiar when there is no argument. For example, the command | ||
| 717 | @kbd{C-k} (@code{kill-line}) with argument @var{n} kills @var{n} lines, | ||
| 718 | including their terminating newlines. But @kbd{C-k} with no argument is | ||
| 719 | special: it kills the text up to the next newline, or, if point is right at | ||
| 720 | the end of the line, it kills the newline itself. Thus, two @kbd{C-k} | ||
| 721 | commands with no arguments can kill a nonblank line, just like @kbd{C-k} | ||
| 722 | with an argument of one. (@xref{Killing}, for more information on | ||
| 723 | @kbd{C-k}.) | ||
| 724 | |||
| 725 | A few commands treat a plain @kbd{C-u} differently from an ordinary | ||
| 726 | argument. A few others may treat an argument of just a minus sign | ||
| 727 | differently from an argument of @minus{}1. These unusual cases are | ||
| 728 | described when they come up; they exist to make an individual command | ||
| 729 | more convenient, and they are documented in that command's | ||
| 730 | documentation string. | ||
| 731 | |||
| 732 | You can use a numeric argument before a self-inserting character to | ||
| 733 | insert multiple copies of it. This is straightforward when the | ||
| 734 | character is not a digit; for example, @kbd{C-u 6 4 a} inserts 64 | ||
| 735 | copies of the character @samp{a}. But this does not work for | ||
| 736 | inserting digits; @kbd{C-u 6 4 1} specifies an argument of 641. You | ||
| 737 | can separate the argument from the digit to insert with another | ||
| 738 | @kbd{C-u}; for example, @kbd{C-u 6 4 C-u 1} does insert 64 copies of | ||
| 739 | the character @samp{1}. | ||
| 740 | |||
| 741 | We use the term ``prefix argument'' as well as ``numeric argument,'' | ||
| 742 | to emphasize that you type these argument before the command, and to | ||
| 743 | distinguish them from minibuffer arguments that come after the | ||
| 744 | command. | ||
| 745 | |||
| 746 | @node Repeating | ||
| 747 | @section Repeating a Command | ||
| 748 | @cindex repeating a command | ||
| 749 | |||
| 750 | Many simple commands, such as those invoked with a single key or | ||
| 751 | with @kbd{M-x @var{command-name} @key{RET}}, can be repeated by | ||
| 752 | invoking them with a numeric argument that serves as a repeat count | ||
| 753 | (@pxref{Arguments}). However, if the command you want to repeat | ||
| 754 | prompts for input, or uses a numeric argument in another way, that | ||
| 755 | method won't work. | ||
| 756 | |||
| 757 | @kindex C-x z | ||
| 758 | @findex repeat | ||
| 759 | The command @kbd{C-x z} (@code{repeat}) provides another way to repeat | ||
| 760 | an Emacs command many times. This command repeats the previous Emacs | ||
| 761 | command, whatever that was. Repeating a command uses the same arguments | ||
| 762 | that were used before; it does not read new arguments each time. | ||
| 763 | |||
| 764 | To repeat the command more than once, type additional @kbd{z}'s: each | ||
| 765 | @kbd{z} repeats the command one more time. Repetition ends when you | ||
| 766 | type a character other than @kbd{z}, or press a mouse button. | ||
| 767 | |||
| 768 | For example, suppose you type @kbd{C-u 2 0 C-d} to delete 20 | ||
| 769 | characters. You can repeat that command (including its argument) three | ||
| 770 | additional times, to delete a total of 80 characters, by typing @kbd{C-x | ||
| 771 | z z z}. The first @kbd{C-x z} repeats the command once, and each | ||
| 772 | subsequent @kbd{z} repeats it once again. | ||
| 773 | |||
| 774 | @ignore | ||
| 775 | arch-tag: cda8952a-c439-41c1-aecf-4bc0d6482956 | ||
| 776 | @end ignore | ||
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi new file mode 100644 index 00000000000..b43d72b1067 --- /dev/null +++ b/doc/emacs/buffers.texi | |||
| @@ -0,0 +1,665 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Buffers, Windows, Files, Top | ||
| 6 | @chapter Using Multiple Buffers | ||
| 7 | |||
| 8 | @cindex buffers | ||
| 9 | The text you are editing in Emacs resides in an object called a | ||
| 10 | @dfn{buffer}. Each time you visit a file, a buffer is created to hold the | ||
| 11 | file's text. Each time you invoke Dired, a buffer is created to hold the | ||
| 12 | directory listing. If you send a message with @kbd{C-x m}, a buffer named | ||
| 13 | @samp{*mail*} is used to hold the text of the message. When you ask for a | ||
| 14 | command's documentation, that appears in a buffer called @samp{*Help*}. | ||
| 15 | |||
| 16 | @cindex selected buffer | ||
| 17 | @cindex current buffer | ||
| 18 | At any time, one and only one buffer is @dfn{current}. It is also | ||
| 19 | called the @dfn{selected buffer}. Often we say that a command operates on | ||
| 20 | ``the buffer'' as if there were only one; but really this means that the | ||
| 21 | command operates on the current buffer (most commands do). | ||
| 22 | |||
| 23 | When Emacs has multiple windows, each window has its own chosen | ||
| 24 | buffer and displays it; at any time, only one of the windows is | ||
| 25 | selected, and its chosen buffer is the current buffer. Each window's | ||
| 26 | mode line normally displays the name of the window's chosen buffer | ||
| 27 | (@pxref{Windows}). | ||
| 28 | |||
| 29 | Each buffer has a name, which can be of any length, and you can select | ||
| 30 | any buffer by giving its name. Most buffers are made by visiting files, | ||
| 31 | and their names are derived from the files' names. But you can also create | ||
| 32 | an empty buffer with any name you want. A newly started Emacs has a buffer | ||
| 33 | named @samp{*scratch*} which can be used for evaluating Lisp expressions in | ||
| 34 | Emacs. The distinction between upper and lower case matters in buffer | ||
| 35 | names. | ||
| 36 | |||
| 37 | Each buffer records individually what file it is visiting, whether it is | ||
| 38 | modified, and what major mode and minor modes are in effect in it | ||
| 39 | (@pxref{Major Modes}). Any Emacs variable can be made @dfn{local to} a | ||
| 40 | particular buffer, meaning its value in that buffer can be different from | ||
| 41 | the value in other buffers. @xref{Locals}. | ||
| 42 | |||
| 43 | @cindex buffer size, maximum | ||
| 44 | A buffer's size cannot be larger than some maximum, which is defined | ||
| 45 | by the largest buffer position representable by the @dfn{Emacs integer} | ||
| 46 | data type. This is because Emacs tracks buffer positions using that | ||
| 47 | data type. For 32-bit machines, the largest buffer size is 256 | ||
| 48 | megabytes. | ||
| 49 | |||
| 50 | @menu | ||
| 51 | * Select Buffer:: Creating a new buffer or reselecting an old one. | ||
| 52 | * List Buffers:: Getting a list of buffers that exist. | ||
| 53 | * Misc Buffer:: Renaming; changing read-onlyness; copying text. | ||
| 54 | * Kill Buffer:: Killing buffers you no longer need. | ||
| 55 | * Several Buffers:: How to go through the list of all buffers | ||
| 56 | and operate variously on several of them. | ||
| 57 | * Indirect Buffers:: An indirect buffer shares the text of another buffer. | ||
| 58 | * Buffer Convenience:: Convenience and customization features for | ||
| 59 | buffer handling. | ||
| 60 | @end menu | ||
| 61 | |||
| 62 | @node Select Buffer | ||
| 63 | @section Creating and Selecting Buffers | ||
| 64 | @cindex change buffers | ||
| 65 | @cindex switch buffers | ||
| 66 | |||
| 67 | @table @kbd | ||
| 68 | @item C-x b @var{buffer} @key{RET} | ||
| 69 | Select or create a buffer named @var{buffer} (@code{switch-to-buffer}). | ||
| 70 | @item C-x 4 b @var{buffer} @key{RET} | ||
| 71 | Similar, but select @var{buffer} in another window | ||
| 72 | (@code{switch-to-buffer-other-window}). | ||
| 73 | @item C-x 5 b @var{buffer} @key{RET} | ||
| 74 | Similar, but select @var{buffer} in a separate frame | ||
| 75 | (@code{switch-to-buffer-other-frame}). | ||
| 76 | @item C-x @key{LEFT} | ||
| 77 | Select the previous buffer in the list of existing buffers. | ||
| 78 | @item C-x @key{RIGHT} | ||
| 79 | Select the next buffer in the list of existing buffers. | ||
| 80 | @item C-u M-g M-g | ||
| 81 | @itemx C-u M-g g | ||
| 82 | Read a number @var{n} and move to line @var{n} in the most recently | ||
| 83 | selected buffer other than the current buffer. | ||
| 84 | @end table | ||
| 85 | |||
| 86 | @kindex C-x b | ||
| 87 | @findex switch-to-buffer | ||
| 88 | To select the buffer named @var{bufname}, type @kbd{C-x b @var{bufname} | ||
| 89 | @key{RET}}. This runs the command @code{switch-to-buffer} with argument | ||
| 90 | @var{bufname}. You can use completion to enter the buffer | ||
| 91 | name (@pxref{Completion}). An empty argument to @kbd{C-x b} | ||
| 92 | specifies the buffer that was current most recently among those not | ||
| 93 | now displayed in any window. | ||
| 94 | |||
| 95 | @kindex C-x @key{LEFT} | ||
| 96 | @kindex C-x @key{RIGHT} | ||
| 97 | @findex next-buffer | ||
| 98 | @findex previous-buffer | ||
| 99 | For conveniently switching between a few buffers, use the commands | ||
| 100 | @kbd{C-x @key{LEFT}} and @kbd{C-x @key{RIGHT}}. @kbd{C-x @key{RIGHT}} | ||
| 101 | (@code{previous-buffer}) selects the previous buffer (following the order | ||
| 102 | of most recent selection in the current frame), while @kbd{C-x @key{LEFT}} | ||
| 103 | (@code{next-buffer}) moves through buffers in the reverse direction. | ||
| 104 | |||
| 105 | @kindex C-x 4 b | ||
| 106 | @findex switch-to-buffer-other-window | ||
| 107 | @vindex even-window-heights | ||
| 108 | To select a buffer in a window other than the current one, type | ||
| 109 | @kbd{C-x 4 b @var{bufname} @key{RET}}. This runs the command | ||
| 110 | @code{switch-to-buffer-other-window} which displays the buffer | ||
| 111 | @var{bufname} in another window. By default, if displaying the buffer | ||
| 112 | causes two vertically adjacent windows to be displayed, the heights of | ||
| 113 | those windows are evened out; to countermand that and preserve the | ||
| 114 | window configuration, set the variable @code{even-window-heights} to | ||
| 115 | @code{nil}. | ||
| 116 | |||
| 117 | @kindex C-x 5 b | ||
| 118 | @findex switch-to-buffer-other-frame | ||
| 119 | Similarly, @kbd{C-x 5 b @var{buffer} @key{RET}} runs the command | ||
| 120 | @code{switch-to-buffer-other-frame} which selects a buffer in another | ||
| 121 | frame. | ||
| 122 | |||
| 123 | @vindex display-buffer-reuse-frames | ||
| 124 | You can control how certain buffers are handled by these commands by | ||
| 125 | customizing the variables @code{special-display-buffer-names}, | ||
| 126 | @code{special-display-regexps}, @code{same-window-buffer-names}, and | ||
| 127 | @code{same-window-regexps}. See @ref{Force Same Window}, and | ||
| 128 | @ref{Special Buffer Frames}, for more about these variables. In | ||
| 129 | addition, if the value of @code{display-buffer-reuse-frames} is | ||
| 130 | non-@code{nil}, and the buffer you want to switch to is already | ||
| 131 | displayed in some frame, Emacs will just raise that frame. | ||
| 132 | |||
| 133 | Most buffers are created by visiting files, or by Emacs commands that | ||
| 134 | want to display some text, but you can also create a buffer explicitly | ||
| 135 | by typing @kbd{C-x b @var{bufname} @key{RET}}. This makes a new, empty | ||
| 136 | buffer that is not visiting any file, and selects it for editing. Such | ||
| 137 | buffers are used for making notes to yourself. If you try to save one, | ||
| 138 | you are asked for the file name to use. The new buffer's major mode is | ||
| 139 | determined by the value of @code{default-major-mode} (@pxref{Major | ||
| 140 | Modes}). | ||
| 141 | |||
| 142 | Note that @kbd{C-x C-f}, and any other command for visiting a file, | ||
| 143 | can also be used to switch to an existing file-visiting buffer. | ||
| 144 | @xref{Visiting}. | ||
| 145 | |||
| 146 | @kbd{C-u M-g M-g}, that is @code{goto-line} with a prefix argument | ||
| 147 | of just @kbd{C-u}, reads a number @var{n} using the minibuffer, | ||
| 148 | selects the most recently selected buffer other than the current | ||
| 149 | buffer in another window, and then moves point to the beginning of | ||
| 150 | line number @var{n} in that buffer. This is mainly useful in a buffer | ||
| 151 | that refers to line numbers in another buffer: if point is on or just | ||
| 152 | after a number, @code{goto-line} uses that number as the default for | ||
| 153 | @var{n}. Note that prefix arguments other than just @kbd{C-u} behave | ||
| 154 | differently. @kbd{C-u 4 M-g M-g} goes to line 4 in the @emph{current} | ||
| 155 | buffer, without reading a number from the minibuffer. (Remember that | ||
| 156 | @kbd{M-g M-g} without prefix argument reads a number @var{n} and then | ||
| 157 | moves to line number @var{n} in the current buffer.) | ||
| 158 | |||
| 159 | Emacs uses buffer names that start with a space for internal purposes. | ||
| 160 | It treats these buffers specially in minor ways---for example, by | ||
| 161 | default they do not record undo information. It is best to avoid using | ||
| 162 | such buffer names yourself. | ||
| 163 | |||
| 164 | @node List Buffers | ||
| 165 | @section Listing Existing Buffers | ||
| 166 | |||
| 167 | @table @kbd | ||
| 168 | @item C-x C-b | ||
| 169 | List the existing buffers (@code{list-buffers}). | ||
| 170 | @end table | ||
| 171 | |||
| 172 | @cindex listing current buffers | ||
| 173 | @kindex C-x C-b | ||
| 174 | @findex list-buffers | ||
| 175 | To display a list of existing buffers, type @kbd{C-x C-b}. Each | ||
| 176 | line in the list shows one buffer's name, major mode and visited file. | ||
| 177 | The buffers are listed in the order that they were current; the | ||
| 178 | buffers that were current most recently come first. | ||
| 179 | |||
| 180 | @samp{*} in the first field of a line indicates the buffer is | ||
| 181 | ``modified.'' If several buffers are modified, it may be time to save | ||
| 182 | some with @kbd{C-x s} (@pxref{Save Commands}). @samp{%} indicates a | ||
| 183 | read-only buffer. @samp{.} marks the current buffer. Here is an | ||
| 184 | example of a buffer list:@refill | ||
| 185 | |||
| 186 | @smallexample | ||
| 187 | CRM Buffer Size Mode File | ||
| 188 | . * .emacs 3294 Emacs-Lisp ~/.emacs | ||
| 189 | % *Help* 101 Help | ||
| 190 | search.c 86055 C ~/cvs/emacs/src/search.c | ||
| 191 | % src 20959 Dired by name ~/cvs/emacs/src/ | ||
| 192 | * *mail* 42 Mail | ||
| 193 | % HELLO 1607 Fundamental ~/cvs/emacs/etc/HELLO | ||
| 194 | % NEWS 481184 Outline ~/cvs/emacs/etc/NEWS | ||
| 195 | *scratch* 191 Lisp Interaction | ||
| 196 | * *Messages* 1554 Fundamental | ||
| 197 | @end smallexample | ||
| 198 | |||
| 199 | @noindent | ||
| 200 | Note that the buffer @samp{*Help*} was made by a help request; it is | ||
| 201 | not visiting any file. The buffer @code{src} was made by Dired on the | ||
| 202 | directory @file{~/cvs/emacs/src/}. You can list only buffers that are | ||
| 203 | visiting files by giving the command a prefix argument, as in | ||
| 204 | @kbd{C-u C-x C-b}. | ||
| 205 | |||
| 206 | @code{list-buffers} omits buffers whose names begin with a space, | ||
| 207 | unless they visit files: such buffers are used internally by Emacs. | ||
| 208 | |||
| 209 | @need 2000 | ||
| 210 | @node Misc Buffer | ||
| 211 | @section Miscellaneous Buffer Operations | ||
| 212 | |||
| 213 | @table @kbd | ||
| 214 | @item C-x C-q | ||
| 215 | Toggle read-only status of buffer (@code{toggle-read-only}). | ||
| 216 | @item M-x rename-buffer @key{RET} @var{name} @key{RET} | ||
| 217 | Change the name of the current buffer. | ||
| 218 | @item M-x rename-uniquely | ||
| 219 | Rename the current buffer by adding @samp{<@var{number}>} to the end. | ||
| 220 | @item M-x view-buffer @key{RET} @var{buffer} @key{RET} | ||
| 221 | Scroll through buffer @var{buffer}. | ||
| 222 | @end table | ||
| 223 | |||
| 224 | @kindex C-x C-q | ||
| 225 | @vindex buffer-read-only | ||
| 226 | @cindex read-only buffer | ||
| 227 | A buffer can be @dfn{read-only}, which means that commands to change | ||
| 228 | its contents are not allowed. The mode line indicates read-only | ||
| 229 | buffers with @samp{%%} or @samp{%*} near the left margin. Read-only | ||
| 230 | buffers are usually made by subsystems such as Dired and Rmail that | ||
| 231 | have special commands to operate on the text; also by visiting a file | ||
| 232 | whose access control says you cannot write it. | ||
| 233 | |||
| 234 | @findex toggle-read-only | ||
| 235 | If you wish to make changes in a read-only buffer, use the command | ||
| 236 | @kbd{C-x C-q} (@code{toggle-read-only}). It makes a read-only buffer | ||
| 237 | writable, and makes a writable buffer read-only. This | ||
| 238 | works by setting the variable @code{buffer-read-only}, which has a local | ||
| 239 | value in each buffer and makes the buffer read-only if its value is | ||
| 240 | non-@code{nil}. If you have files under version control, you may find | ||
| 241 | it convenient to bind @kbd{C-x C-q} to @code{vc-toggle-read-only} | ||
| 242 | instead. Then, typing @kbd{C-x C-q} not only changes the read-only | ||
| 243 | flag, but it also checks the file in or out. @xref{Version | ||
| 244 | Control}. | ||
| 245 | |||
| 246 | @findex rename-buffer | ||
| 247 | @kbd{M-x rename-buffer} changes the name of the current buffer. You | ||
| 248 | specify the new name as a minibuffer argument; there is no default. | ||
| 249 | If you specify a name that is in use for some other buffer, an error | ||
| 250 | happens and no renaming is done. | ||
| 251 | |||
| 252 | @findex rename-uniquely | ||
| 253 | @kbd{M-x rename-uniquely} renames the current buffer to a similar | ||
| 254 | name with a numeric suffix added to make it both different and unique. | ||
| 255 | This command does not need an argument. It is useful for creating | ||
| 256 | multiple shell buffers: if you rename the @samp{*shell*} buffer, then | ||
| 257 | do @kbd{M-x shell} again, it makes a new shell buffer named | ||
| 258 | @samp{*shell*}; meanwhile, the old shell buffer continues to exist | ||
| 259 | under its new name. This method is also good for mail buffers, | ||
| 260 | compilation buffers, and most Emacs features that create special | ||
| 261 | buffers with particular names. (With some of these features, such as | ||
| 262 | @kbd{M-x compile}, @kbd{M-x grep} an @kbd{M-x info}, you need to | ||
| 263 | switch to some other buffer before using the command, in order for it | ||
| 264 | to make a different buffer.) | ||
| 265 | |||
| 266 | @findex view-buffer | ||
| 267 | @kbd{M-x view-buffer} is much like @kbd{M-x view-file} (@pxref{Misc | ||
| 268 | File Ops}) except that it examines an already existing Emacs buffer. | ||
| 269 | View mode provides commands for scrolling through the buffer | ||
| 270 | conveniently but not for changing it. When you exit View mode with | ||
| 271 | @kbd{q}, that switches back to the buffer (and the position) which was | ||
| 272 | previously displayed in the window. Alternatively, if you exit View | ||
| 273 | mode with @kbd{e}, the buffer and the value of point that resulted from | ||
| 274 | your perusal remain in effect. | ||
| 275 | |||
| 276 | The commands @kbd{M-x append-to-buffer} and @kbd{M-x insert-buffer} | ||
| 277 | can be used to copy text from one buffer to another. @xref{Accumulating | ||
| 278 | Text}. | ||
| 279 | |||
| 280 | @node Kill Buffer | ||
| 281 | @section Killing Buffers | ||
| 282 | |||
| 283 | @cindex killing buffers | ||
| 284 | If you continue an Emacs session for a while, you may accumulate a | ||
| 285 | large number of buffers. You may then find it convenient to @dfn{kill} | ||
| 286 | the buffers you no longer need. On most operating systems, killing a | ||
| 287 | buffer releases its space back to the operating system so that other | ||
| 288 | programs can use it. Here are some commands for killing buffers: | ||
| 289 | |||
| 290 | @table @kbd | ||
| 291 | @item C-x k @var{bufname} @key{RET} | ||
| 292 | Kill buffer @var{bufname} (@code{kill-buffer}). | ||
| 293 | @item M-x kill-some-buffers | ||
| 294 | Offer to kill each buffer, one by one. | ||
| 295 | @end table | ||
| 296 | |||
| 297 | @findex kill-buffer | ||
| 298 | @findex kill-some-buffers | ||
| 299 | @kindex C-x k | ||
| 300 | |||
| 301 | @kbd{C-x k} (@code{kill-buffer}) kills one buffer, whose name you | ||
| 302 | specify in the minibuffer. The default, used if you type just | ||
| 303 | @key{RET} in the minibuffer, is to kill the current buffer. If you | ||
| 304 | kill the current buffer, another buffer becomes current: one that was | ||
| 305 | current in the recent past but is not displayed in any window now. If | ||
| 306 | you ask to kill a file-visiting buffer that is modified (has unsaved | ||
| 307 | editing), then you must confirm with @kbd{yes} before the buffer is | ||
| 308 | killed. | ||
| 309 | |||
| 310 | The command @kbd{M-x kill-some-buffers} asks about each buffer, one by | ||
| 311 | one. An answer of @kbd{y} means to kill the buffer. Killing the current | ||
| 312 | buffer or a buffer containing unsaved changes selects a new buffer or asks | ||
| 313 | for confirmation just like @code{kill-buffer}. | ||
| 314 | |||
| 315 | The buffer menu feature (@pxref{Several Buffers}) is also convenient | ||
| 316 | for killing various buffers. | ||
| 317 | |||
| 318 | @vindex kill-buffer-hook | ||
| 319 | If you want to do something special every time a buffer is killed, you | ||
| 320 | can add hook functions to the hook @code{kill-buffer-hook} (@pxref{Hooks}). | ||
| 321 | |||
| 322 | @findex clean-buffer-list | ||
| 323 | If you run one Emacs session for a period of days, as many people do, | ||
| 324 | it can fill up with buffers that you used several days ago. The command | ||
| 325 | @kbd{M-x clean-buffer-list} is a convenient way to purge them; it kills | ||
| 326 | all the unmodified buffers that you have not used for a long time. An | ||
| 327 | ordinary buffer is killed if it has not been displayed for three days; | ||
| 328 | however, you can specify certain buffers that should never be killed | ||
| 329 | automatically, and others that should be killed if they have been unused | ||
| 330 | for a mere hour. | ||
| 331 | |||
| 332 | @cindex Midnight mode | ||
| 333 | @vindex midnight-mode | ||
| 334 | @vindex midnight-hook | ||
| 335 | You can also have this buffer purging done for you, every day at | ||
| 336 | midnight, by enabling Midnight mode. Midnight mode operates each day at | ||
| 337 | midnight; at that time, it runs @code{clean-buffer-list}, or whichever | ||
| 338 | functions you have placed in the normal hook @code{midnight-hook} | ||
| 339 | (@pxref{Hooks}). | ||
| 340 | |||
| 341 | To enable Midnight mode, use the Customization buffer to set the | ||
| 342 | variable @code{midnight-mode} to @code{t}. @xref{Easy Customization}. | ||
| 343 | |||
| 344 | @node Several Buffers | ||
| 345 | @section Operating on Several Buffers | ||
| 346 | @cindex buffer menu | ||
| 347 | |||
| 348 | The @dfn{buffer-menu} facility is like a ``Dired for buffers''; it allows | ||
| 349 | you to request operations on various Emacs buffers by editing an Emacs | ||
| 350 | buffer containing a list of them. You can save buffers, kill them | ||
| 351 | (here called @dfn{deleting} them, for consistency with Dired), or display | ||
| 352 | them. | ||
| 353 | |||
| 354 | @table @kbd | ||
| 355 | @item M-x buffer-menu | ||
| 356 | Begin editing a buffer listing all Emacs buffers. | ||
| 357 | @item M-x buffer-menu-other-window. | ||
| 358 | Similar, but do it in another window. | ||
| 359 | @end table | ||
| 360 | |||
| 361 | @findex buffer-menu | ||
| 362 | @findex buffer-menu-other-window | ||
| 363 | The command @code{buffer-menu} writes a list of all Emacs | ||
| 364 | buffers@footnote{Buffers which don't visit files and whose names begin | ||
| 365 | with a space are omitted: these are used internally by Emacs.} into the | ||
| 366 | buffer @samp{*Buffer List*}, and selects that buffer in Buffer Menu | ||
| 367 | mode. | ||
| 368 | |||
| 369 | The buffer is read-only, and can be | ||
| 370 | changed only through the special commands described in this section. | ||
| 371 | The usual Emacs cursor motion commands can be used in the @samp{*Buffer | ||
| 372 | List*} buffer. The following commands apply to the buffer described on | ||
| 373 | the current line. | ||
| 374 | |||
| 375 | @table @kbd | ||
| 376 | @item d | ||
| 377 | Request to delete (kill) the buffer, then move down. The request | ||
| 378 | shows as a @samp{D} on the line, before the buffer name. Requested | ||
| 379 | deletions take place when you type the @kbd{x} command. | ||
| 380 | @item C-d | ||
| 381 | Like @kbd{d} but move up afterwards instead of down. | ||
| 382 | @item s | ||
| 383 | Request to save the buffer. The request shows as an @samp{S} on the | ||
| 384 | line. Requested saves take place when you type the @kbd{x} command. | ||
| 385 | You may request both saving and deletion for the same buffer. | ||
| 386 | @item x | ||
| 387 | Perform previously requested deletions and saves. | ||
| 388 | @item u | ||
| 389 | Remove any request made for the current line, and move down. | ||
| 390 | @item @key{DEL} | ||
| 391 | Move to previous line and remove any request made for that line. | ||
| 392 | @end table | ||
| 393 | |||
| 394 | The @kbd{d}, @kbd{C-d}, @kbd{s} and @kbd{u} commands to add or remove | ||
| 395 | flags also move down (or up) one line. They accept a numeric argument | ||
| 396 | as a repeat count. | ||
| 397 | |||
| 398 | These commands operate immediately on the buffer listed on the current | ||
| 399 | line: | ||
| 400 | |||
| 401 | @table @kbd | ||
| 402 | @item ~ | ||
| 403 | Mark the buffer ``unmodified.'' The command @kbd{~} does this | ||
| 404 | immediately when you type it. | ||
| 405 | @item % | ||
| 406 | Toggle the buffer's read-only flag. The command @kbd{%} does | ||
| 407 | this immediately when you type it. | ||
| 408 | @item t | ||
| 409 | Visit the buffer as a tags table. @xref{Select Tags Table}. | ||
| 410 | @end table | ||
| 411 | |||
| 412 | There are also commands to select another buffer or buffers: | ||
| 413 | |||
| 414 | @table @kbd | ||
| 415 | @item q | ||
| 416 | Quit the buffer menu---immediately display the most recent formerly | ||
| 417 | visible buffer in its place. | ||
| 418 | @item @key{RET} | ||
| 419 | @itemx f | ||
| 420 | Immediately select this line's buffer in place of the @samp{*Buffer | ||
| 421 | List*} buffer. | ||
| 422 | @item o | ||
| 423 | Immediately select this line's buffer in another window as if by | ||
| 424 | @kbd{C-x 4 b}, leaving @samp{*Buffer List*} visible. | ||
| 425 | @item C-o | ||
| 426 | Immediately display this line's buffer in another window, but don't | ||
| 427 | select the window. | ||
| 428 | @item 1 | ||
| 429 | Immediately select this line's buffer in a full-screen window. | ||
| 430 | @item 2 | ||
| 431 | Immediately set up two windows, with this line's buffer selected in | ||
| 432 | one, and the previously current buffer (aside from the buffer | ||
| 433 | @samp{*Buffer List*}) displayed in the other. | ||
| 434 | @item b | ||
| 435 | Bury the buffer listed on this line. | ||
| 436 | @item m | ||
| 437 | Mark this line's buffer to be displayed in another window if you exit | ||
| 438 | with the @kbd{v} command. The request shows as a @samp{>} at the | ||
| 439 | beginning of the line. (A single buffer may not have both a delete | ||
| 440 | request and a display request.) | ||
| 441 | @item v | ||
| 442 | Immediately select this line's buffer, and also display in other windows | ||
| 443 | any buffers previously marked with the @kbd{m} command. If you have not | ||
| 444 | marked any buffers, this command is equivalent to @kbd{1}. | ||
| 445 | @end table | ||
| 446 | |||
| 447 | There is also a command that affects the entire buffer list: | ||
| 448 | |||
| 449 | @table @kbd | ||
| 450 | @item T | ||
| 451 | Delete, or reinsert, lines for non-file buffers. This command toggles | ||
| 452 | the inclusion of such buffers in the buffer list. | ||
| 453 | @end table | ||
| 454 | |||
| 455 | What @code{buffer-menu} actually does is create and switch to a | ||
| 456 | suitable buffer, and turn on Buffer Menu mode in it. Everything else | ||
| 457 | described above is implemented by the special commands provided in | ||
| 458 | Buffer Menu mode. One consequence of this is that you can switch from | ||
| 459 | the @samp{*Buffer List*} buffer to another Emacs buffer, and edit | ||
| 460 | there. You can reselect the @samp{*Buffer List*} buffer later, to | ||
| 461 | perform the operations already requested, or you can kill it, or pay | ||
| 462 | no further attention to it. | ||
| 463 | |||
| 464 | The list in the @samp{*Buffer List*} buffer looks exactly like the | ||
| 465 | buffer list described in @ref{List Buffers}, because they really are | ||
| 466 | the same. The only difference between @code{buffer-menu} and | ||
| 467 | @code{list-buffers} is that @code{buffer-menu} switches to the | ||
| 468 | @samp{*Buffer List*} buffer in the selected window; | ||
| 469 | @code{list-buffers} displays the same buffer in another window. If | ||
| 470 | you run @code{list-buffers} (that is, type @kbd{C-x C-b}) and select | ||
| 471 | the buffer list manually, you can use all of the commands described | ||
| 472 | here. | ||
| 473 | |||
| 474 | Normally, the buffer @samp{*Buffer List*} is not updated | ||
| 475 | automatically when buffers are created and killed; its contents are | ||
| 476 | just text. If you have created, deleted or renamed buffers, the way | ||
| 477 | to update @samp{*Buffer List*} to show what you have done is to type | ||
| 478 | @kbd{g} (@code{revert-buffer}). You can make this happen regularly | ||
| 479 | every @code{auto-revert-interval} seconds if you enable Auto Revert | ||
| 480 | mode in this buffer, as long as it is not marked modified. Global | ||
| 481 | Auto Revert mode applies to the @samp{*Buffer List*} buffer only if | ||
| 482 | @code{global-auto-revert-non-file-buffers} is non-@code{nil}. | ||
| 483 | @iftex | ||
| 484 | @inforef{Autorevert,, emacs-xtra}, for details. | ||
| 485 | @end iftex | ||
| 486 | @ifnottex | ||
| 487 | @xref{Autorevert, global-auto-revert-non-file-buffers}, for details. | ||
| 488 | @end ifnottex | ||
| 489 | |||
| 490 | |||
| 491 | The command @code{buffer-menu-other-window} works the same as | ||
| 492 | @code{buffer-menu}, except that it displays the buffers list in | ||
| 493 | another window. | ||
| 494 | |||
| 495 | @node Indirect Buffers | ||
| 496 | @section Indirect Buffers | ||
| 497 | @cindex indirect buffer | ||
| 498 | @cindex base buffer | ||
| 499 | |||
| 500 | An @dfn{indirect buffer} shares the text of some other buffer, which | ||
| 501 | is called the @dfn{base buffer} of the indirect buffer. In some ways it | ||
| 502 | is the analogue, for buffers, of a symbolic link between files. | ||
| 503 | |||
| 504 | @table @kbd | ||
| 505 | @findex make-indirect-buffer | ||
| 506 | @item M-x make-indirect-buffer @key{RET} @var{base-buffer} @key{RET} @var{indirect-name} @key{RET} | ||
| 507 | Create an indirect buffer named @var{indirect-name} whose base buffer | ||
| 508 | is @var{base-buffer}. | ||
| 509 | @findex clone-indirect-buffer | ||
| 510 | @item M-x clone-indirect-buffer @key{RET} | ||
| 511 | Create an indirect buffer that is a twin copy of the current buffer. | ||
| 512 | @item C-x 4 c | ||
| 513 | @kindex C-x 4 c | ||
| 514 | @findex clone-indirect-buffer-other-window | ||
| 515 | Create an indirect buffer that is a twin copy of the current buffer, and | ||
| 516 | select it in another window (@code{clone-indirect-buffer-other-window}). | ||
| 517 | @end table | ||
| 518 | |||
| 519 | The text of the indirect buffer is always identical to the text of its | ||
| 520 | base buffer; changes made by editing either one are visible immediately | ||
| 521 | in the other. But in all other respects, the indirect buffer and its | ||
| 522 | base buffer are completely separate. They have different names, | ||
| 523 | different values of point, different narrowing, different markers, | ||
| 524 | different major modes, and different local variables. | ||
| 525 | |||
| 526 | An indirect buffer cannot visit a file, but its base buffer can. If | ||
| 527 | you try to save the indirect buffer, that actually works by saving the | ||
| 528 | base buffer. Killing the base buffer effectively kills the indirect | ||
| 529 | buffer, but killing an indirect buffer has no effect on its base buffer. | ||
| 530 | |||
| 531 | One way to use indirect buffers is to display multiple views of an | ||
| 532 | outline. @xref{Outline Views}. | ||
| 533 | |||
| 534 | A quick and handy way to make an indirect buffer is with the command | ||
| 535 | @kbd{M-x clone-indirect-buffer}. It creates and selects an indirect | ||
| 536 | buffer whose base buffer is the current buffer. With a numeric | ||
| 537 | argument, it prompts for the name of the indirect buffer; otherwise it | ||
| 538 | uses the name of the current buffer, with a @samp{<@var{n}>} suffix | ||
| 539 | added. @kbd{C-x 4 c} (@code{clone-indirect-buffer-other-window}) | ||
| 540 | works like @kbd{M-x clone-indirect-buffer}, but it selects the new | ||
| 541 | buffer in another window. | ||
| 542 | |||
| 543 | The more general way to make an indirect buffer is with the command | ||
| 544 | @kbd{M-x make-indirect-buffer}. It creates an indirect buffer from | ||
| 545 | buffer @var{base-buffer}, under the name @var{indirect-name}. It | ||
| 546 | prompts for both @var{base-buffer} and @var{indirect-name} using the | ||
| 547 | minibuffer. | ||
| 548 | |||
| 549 | @node Buffer Convenience | ||
| 550 | @section Convenience Features and Customization of Buffer Handling | ||
| 551 | |||
| 552 | This section describes several modes and features that make it more | ||
| 553 | convenient to switch between buffers. | ||
| 554 | |||
| 555 | @menu | ||
| 556 | * Uniquify:: Making buffer names unique with directory parts. | ||
| 557 | * Iswitchb:: Switching between buffers with substrings. | ||
| 558 | * Buffer Menus:: Configurable buffer menu. | ||
| 559 | @end menu | ||
| 560 | |||
| 561 | @node Uniquify | ||
| 562 | @subsection Making Buffer Names Unique | ||
| 563 | |||
| 564 | @cindex unique buffer names | ||
| 565 | @cindex directories in buffer names | ||
| 566 | When several buffers visit identically-named files, Emacs must give | ||
| 567 | the buffers distinct names. The usual method for making buffer names | ||
| 568 | unique adds @samp{<2>}, @samp{<3>}, etc. to the end of the buffer | ||
| 569 | names (all but one of them). | ||
| 570 | |||
| 571 | @vindex uniquify-buffer-name-style | ||
| 572 | Other methods work by adding parts of each file's directory to the | ||
| 573 | buffer name. To select one, customize the variable | ||
| 574 | @code{uniquify-buffer-name-style} (@pxref{Easy Customization}). | ||
| 575 | |||
| 576 | To begin with, the @code{forward} naming method includes part of the | ||
| 577 | file's directory name at the beginning of the buffer name; using this | ||
| 578 | method, buffers visiting the files @file{/u/rms/tmp/Makefile} and | ||
| 579 | @file{/usr/projects/zaphod/Makefile} would be named | ||
| 580 | @samp{tmp/Makefile} and @samp{zaphod/Makefile}, respectively (instead | ||
| 581 | of @samp{Makefile} and @samp{Makefile<2>}). | ||
| 582 | |||
| 583 | In contrast, the @code{post-forward} naming method would call the | ||
| 584 | buffers @samp{Makefile|tmp} and @samp{Makefile|zaphod}, and the | ||
| 585 | @code{reverse} naming method would call them @samp{Makefile\tmp} and | ||
| 586 | @samp{Makefile\zaphod}. The nontrivial difference between | ||
| 587 | @code{post-forward} and @code{reverse} occurs when just one directory | ||
| 588 | name is not enough to distinguish two files; then @code{reverse} puts | ||
| 589 | the directory names in reverse order, so that @file{/top/middle/file} | ||
| 590 | becomes @samp{file\middle\top}, while @code{post-forward} puts them in | ||
| 591 | forward order after the file name, as in @samp{file|top/middle}. | ||
| 592 | |||
| 593 | Which rule to follow for putting the directory names in the buffer | ||
| 594 | name is not very important if you are going to @emph{look} at the | ||
| 595 | buffer names before you type one. But as an experienced user, if you | ||
| 596 | know the rule, you won't have to look. And then you may find that one | ||
| 597 | rule or another is easier for you to remember and apply quickly. | ||
| 598 | |||
| 599 | @node Iswitchb | ||
| 600 | @subsection Switching Between Buffers using Substrings | ||
| 601 | |||
| 602 | @findex iswitchb-mode | ||
| 603 | @cindex Iswitchb mode | ||
| 604 | @cindex mode, Iswitchb | ||
| 605 | @kindex C-x b @r{(Iswitchb mode)} | ||
| 606 | @kindex C-x 4 b @r{(Iswitchb mode)} | ||
| 607 | @kindex C-x 5 b @r{(Iswitchb mode)} | ||
| 608 | @kindex C-x 4 C-o @r{(Iswitchb mode)} | ||
| 609 | |||
| 610 | Iswitchb global minor mode provides convenient switching between | ||
| 611 | buffers using substrings of their names. It replaces the normal | ||
| 612 | definitions of @kbd{C-x b}, @kbd{C-x 4 b}, @kbd{C-x 5 b}, and @kbd{C-x | ||
| 613 | 4 C-o} with alternative commands that are somewhat ``smarter.'' | ||
| 614 | |||
| 615 | When one of these commands prompts you for a buffer name, you can | ||
| 616 | type in just a substring of the name you want to choose. As you enter | ||
| 617 | the substring, Iswitchb mode continuously displays a list of buffers | ||
| 618 | that match the substring you have typed. | ||
| 619 | |||
| 620 | At any time, you can type @key{RET} to select the first buffer in | ||
| 621 | the list. So the way to select a particular buffer is to make it the | ||
| 622 | first in the list. There are two ways to do this. You can type more | ||
| 623 | of the buffer name and thus narrow down the list, excluding unwanted | ||
| 624 | buffers above the desired one. Alternatively, you can use @kbd{C-s} | ||
| 625 | and @kbd{C-r} to rotate the list until the desired buffer is first. | ||
| 626 | |||
| 627 | @key{TAB} while entering the buffer name performs completion on the | ||
| 628 | string you have entered, based on the displayed list of buffers. | ||
| 629 | |||
| 630 | To enable Iswitchb mode, type @kbd{M-x iswitchb-mode}, or customize | ||
| 631 | the variable @code{iswitchb-mode} to @code{t} (@pxref{Easy | ||
| 632 | Customization}). | ||
| 633 | |||
| 634 | @node Buffer Menus | ||
| 635 | @subsection Customizing Buffer Menus | ||
| 636 | |||
| 637 | @findex bs-show | ||
| 638 | @cindex buffer list, customizable | ||
| 639 | @table @kbd | ||
| 640 | @item M-x bs-show | ||
| 641 | Make a list of buffers similarly to @kbd{M-x list-buffers} but | ||
| 642 | customizable. | ||
| 643 | @end table | ||
| 644 | |||
| 645 | @kbd{M-x bs-show} pops up a buffer list similar to the one normally | ||
| 646 | displayed by @kbd{C-x C-b} but which you can customize. If you prefer | ||
| 647 | this to the usual buffer list, you can bind this command to @kbd{C-x | ||
| 648 | C-b}. To customize this buffer list, use the @code{bs} Custom group | ||
| 649 | (@pxref{Easy Customization}). | ||
| 650 | |||
| 651 | @findex msb-mode | ||
| 652 | @cindex mode, MSB | ||
| 653 | @cindex MSB mode | ||
| 654 | @cindex buffer menu | ||
| 655 | @findex mouse-buffer-menu | ||
| 656 | @kindex C-Down-Mouse-1 | ||
| 657 | MSB global minor mode (``MSB'' stands for ``mouse select buffer'') | ||
| 658 | provides a different and customizable mouse buffer menu which you may | ||
| 659 | prefer. It replaces the bindings of @code{mouse-buffer-menu}, | ||
| 660 | normally on @kbd{C-Down-Mouse-1}, and the menu bar buffer menu. You | ||
| 661 | can customize the menu in the @code{msb} Custom group. | ||
| 662 | |||
| 663 | @ignore | ||
| 664 | arch-tag: 08c43460-f4f4-4b43-9cb5-1ea9ad991695 | ||
| 665 | @end ignore | ||
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi new file mode 100644 index 00000000000..62e5f7b4316 --- /dev/null +++ b/doc/emacs/building.texi | |||
| @@ -0,0 +1,1440 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Building, Maintaining, Programs, Top | ||
| 6 | @chapter Compiling and Testing Programs | ||
| 7 | @cindex building programs | ||
| 8 | @cindex program building | ||
| 9 | @cindex running Lisp functions | ||
| 10 | |||
| 11 | The previous chapter discusses the Emacs commands that are useful for | ||
| 12 | making changes in programs. This chapter deals with commands that assist | ||
| 13 | in the larger process of compiling and testing programs. | ||
| 14 | |||
| 15 | @menu | ||
| 16 | * Compilation:: Compiling programs in languages other | ||
| 17 | than Lisp (C, Pascal, etc.). | ||
| 18 | * Compilation Mode:: The mode for visiting compiler errors. | ||
| 19 | * Compilation Shell:: Customizing your shell properly | ||
| 20 | for use in the compilation buffer. | ||
| 21 | * Grep Searching:: Searching with grep. | ||
| 22 | * Flymake:: Finding syntax errors on the fly. | ||
| 23 | * Debuggers:: Running symbolic debuggers for non-Lisp programs. | ||
| 24 | * Executing Lisp:: Various modes for editing Lisp programs, | ||
| 25 | with different facilities for running | ||
| 26 | the Lisp programs. | ||
| 27 | * Libraries: Lisp Libraries. Creating Lisp programs to run in Emacs. | ||
| 28 | * Eval: Lisp Eval. Executing a single Lisp expression in Emacs. | ||
| 29 | * Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer. | ||
| 30 | * External Lisp:: Communicating through Emacs with a separate Lisp. | ||
| 31 | @end menu | ||
| 32 | |||
| 33 | @node Compilation | ||
| 34 | @section Running Compilations under Emacs | ||
| 35 | @cindex inferior process | ||
| 36 | @cindex make | ||
| 37 | @cindex compilation errors | ||
| 38 | @cindex error log | ||
| 39 | |||
| 40 | Emacs can run compilers for noninteractive languages such as C and | ||
| 41 | Fortran as inferior processes, feeding the error log into an Emacs buffer. | ||
| 42 | It can also parse the error messages and show you the source lines where | ||
| 43 | compilation errors occurred. | ||
| 44 | |||
| 45 | @table @kbd | ||
| 46 | @item M-x compile | ||
| 47 | Run a compiler asynchronously under Emacs, with error messages going to | ||
| 48 | the @samp{*compilation*} buffer. | ||
| 49 | @item M-x recompile | ||
| 50 | Invoke a compiler with the same command as in the last invocation of | ||
| 51 | @kbd{M-x compile}. | ||
| 52 | @item M-x kill-compilation | ||
| 53 | Kill the running compilation subprocess. | ||
| 54 | @end table | ||
| 55 | |||
| 56 | @findex compile | ||
| 57 | To run @code{make} or another compilation command, do @kbd{M-x | ||
| 58 | compile}. This command reads a shell command line using the minibuffer, | ||
| 59 | and then executes the command in an inferior shell, putting output in | ||
| 60 | the buffer named @samp{*compilation*}. The current buffer's default | ||
| 61 | directory is used as the working directory for the execution of the | ||
| 62 | command; normally, therefore, the compilation happens in this | ||
| 63 | directory. | ||
| 64 | |||
| 65 | @vindex compile-command | ||
| 66 | The default for the compilation command is normally @samp{make -k}, | ||
| 67 | which is correct most of the time for nontrivial programs. | ||
| 68 | (@xref{Top,, Make, make, GNU Make Manual}.) If you have done @kbd{M-x | ||
| 69 | compile} before, the default each time is the command you used the | ||
| 70 | previous time. @code{compile} stores this command in the variable | ||
| 71 | @code{compile-command}, so setting that variable specifies the default | ||
| 72 | for the next use of @kbd{M-x compile}. If a file specifies a file | ||
| 73 | local value for @code{compile-command}, that provides the default when | ||
| 74 | you type @kbd{M-x compile} in that file's buffer. @xref{File | ||
| 75 | Variables}. | ||
| 76 | |||
| 77 | Starting a compilation displays the buffer @samp{*compilation*} in | ||
| 78 | another window but does not select it. The buffer's mode line tells | ||
| 79 | you whether compilation is finished, with the word @samp{run}, | ||
| 80 | @samp{signal} or @samp{exit} inside the parentheses. You do not have | ||
| 81 | to keep this buffer visible; compilation continues in any case. While | ||
| 82 | a compilation is going on, the string @samp{Compiling} appears in the | ||
| 83 | mode lines of all windows. When this string disappears, the | ||
| 84 | compilation is finished. | ||
| 85 | |||
| 86 | If you want to watch the compilation transcript as it appears, switch | ||
| 87 | to the @samp{*compilation*} buffer and move point to the end of the | ||
| 88 | buffer. When point is at the end, new compilation output is inserted | ||
| 89 | above point, which remains at the end. If point is not at the end of | ||
| 90 | the buffer, it remains fixed while more compilation output is added at | ||
| 91 | the end of the buffer. | ||
| 92 | |||
| 93 | @cindex compilation buffer, keeping point at end | ||
| 94 | @vindex compilation-scroll-output | ||
| 95 | If you set the variable @code{compilation-scroll-output} to a | ||
| 96 | non-@code{nil} value, then the compilation buffer always scrolls to | ||
| 97 | follow output as it comes in. | ||
| 98 | |||
| 99 | @findex recompile | ||
| 100 | To rerun the last compilation with the same command, type @kbd{M-x | ||
| 101 | recompile}. This automatically reuses the compilation command from | ||
| 102 | the last invocation of @kbd{M-x compile}. It also reuses the | ||
| 103 | @samp{*compilation*} buffer and starts the compilation in its default | ||
| 104 | directory, which is the directory in which the previous compilation | ||
| 105 | was started. | ||
| 106 | |||
| 107 | When the compiler process terminates, for whatever reason, the mode | ||
| 108 | line of the @samp{*compilation*} buffer changes to say @samp{exit} | ||
| 109 | (followed by the exit code, @samp{[0]} for a normal exit), or | ||
| 110 | @samp{signal} (if a signal terminated the process), instead of | ||
| 111 | @samp{run}. | ||
| 112 | |||
| 113 | @findex kill-compilation | ||
| 114 | Starting a new compilation also kills any compilation already | ||
| 115 | running in @samp{*compilation*}, as the buffer can only handle one | ||
| 116 | compilation at any time. However, @kbd{M-x compile} asks for | ||
| 117 | confirmation before actually killing a compilation that is running. | ||
| 118 | You can also kill the compilation process with @kbd{M-x | ||
| 119 | kill-compilation}. | ||
| 120 | |||
| 121 | If you want to run two compilations at once, you should start the | ||
| 122 | first one, then rename the @samp{*compilation*} buffer (perhaps using | ||
| 123 | @code{rename-uniquely}; @pxref{Misc Buffer}), and start the other | ||
| 124 | compilation. That will create a new @samp{*compilation*} buffer. | ||
| 125 | |||
| 126 | Emacs does not expect a compiler process to launch asynchronous | ||
| 127 | subprocesses; if it does, and they keep running after the main | ||
| 128 | compiler process has terminated, Emacs may kill them or their output | ||
| 129 | may not arrive in Emacs. To avoid this problem, make the main process | ||
| 130 | wait for its subprocesses to finish. In a shell script, you can do this | ||
| 131 | using @samp{$!} and @samp{wait}, like this: | ||
| 132 | |||
| 133 | @example | ||
| 134 | (sleep 10; echo 2nd)& pid=$! # @r{Record pid of subprocess} | ||
| 135 | echo first message | ||
| 136 | wait $pid # @r{Wait for subprocess} | ||
| 137 | @end example | ||
| 138 | |||
| 139 | If the background process does not output to the compilation buffer, | ||
| 140 | so you only need to prevent it from being killed when the main | ||
| 141 | compilation process terminates, this is sufficient: | ||
| 142 | |||
| 143 | @example | ||
| 144 | nohup @var{command}; sleep 1 | ||
| 145 | @end example | ||
| 146 | |||
| 147 | @vindex compilation-environment | ||
| 148 | You can control the environment passed to the compilation command | ||
| 149 | with the variable @code{compilation-environment}. Its value is a list | ||
| 150 | of environment variable settings; each element should be a string of | ||
| 151 | the form @code{"@var{envvarname}=@var{value}"}. These environment | ||
| 152 | variable settings override the usual ones. | ||
| 153 | |||
| 154 | @node Compilation Mode | ||
| 155 | @section Compilation Mode | ||
| 156 | |||
| 157 | @cindex Compilation mode | ||
| 158 | @cindex mode, Compilation | ||
| 159 | The @samp{*compilation*} buffer uses a special major mode, | ||
| 160 | Compilation mode, whose main feature is to provide a convenient way to | ||
| 161 | visit the source line corresponding to an error message. These | ||
| 162 | commands are also available in other special buffers that list | ||
| 163 | locations in files, including those made by @kbd{M-x grep} and | ||
| 164 | @kbd{M-x occur}. | ||
| 165 | |||
| 166 | @table @kbd | ||
| 167 | @item M-g M-n | ||
| 168 | @itemx M-g n | ||
| 169 | @itemx C-x ` | ||
| 170 | Visit the locus of the next error message or match. | ||
| 171 | @item M-g M-p | ||
| 172 | @itemx M-g p | ||
| 173 | Visit the locus of the previous error message or match. | ||
| 174 | @item @key{RET} | ||
| 175 | Visit the locus of the error message that point is on. | ||
| 176 | This command is used in the compilation buffer. | ||
| 177 | @item Mouse-2 | ||
| 178 | Visit the locus of the error message that you click on. | ||
| 179 | @item M-n | ||
| 180 | Find and highlight the locus of the next error message, without | ||
| 181 | selecting the source buffer. | ||
| 182 | @item M-p | ||
| 183 | Find and highlight the locus of the previous error message, without | ||
| 184 | selecting the source buffer. | ||
| 185 | @item M-@} | ||
| 186 | Move point to the next error for a different file than the current | ||
| 187 | one. | ||
| 188 | @item M-@{ | ||
| 189 | Move point to the previous error for a different file than the current | ||
| 190 | one. | ||
| 191 | @item C-c C-f | ||
| 192 | Toggle Next Error Follow minor mode, which makes cursor motion in the | ||
| 193 | compilation buffer produce automatic source display. | ||
| 194 | @end table | ||
| 195 | |||
| 196 | @findex compile-goto-error | ||
| 197 | You can visit the source for any particular error message by moving | ||
| 198 | point in the @samp{*compilation*} buffer to that error message and | ||
| 199 | typing @key{RET} (@code{compile-goto-error}). Alternatively, you can | ||
| 200 | click @kbd{Mouse-2} on the error message; you need not switch to the | ||
| 201 | @samp{*compilation*} buffer first. | ||
| 202 | |||
| 203 | @kindex M-g M-n | ||
| 204 | @kindex M-g n | ||
| 205 | @kindex C-x ` | ||
| 206 | @findex next-error | ||
| 207 | @vindex next-error-highlight | ||
| 208 | To parse the compiler error messages sequentially, type @kbd{C-x `} | ||
| 209 | (@code{next-error}). The character following the @kbd{C-x} is the | ||
| 210 | backquote or ``grave accent,'' not the single-quote. This command is | ||
| 211 | available in all buffers, not just in @samp{*compilation*}; it | ||
| 212 | displays the next error message at the top of one window and source | ||
| 213 | location of the error in another window. It also temporarily | ||
| 214 | highlights the relevant source line, for a period controlled by the | ||
| 215 | variable @code{next-error-highlight}. | ||
| 216 | |||
| 217 | The first time @w{@kbd{C-x `}} is used after the start of a compilation, | ||
| 218 | it moves to the first error's location. Subsequent uses of @kbd{C-x | ||
| 219 | `} advance down to subsequent errors. If you visit a specific error | ||
| 220 | message with @key{RET} or @kbd{Mouse-2}, subsequent @w{@kbd{C-x `}} | ||
| 221 | commands advance from there. When @w{@kbd{C-x `}} gets to the end of the | ||
| 222 | buffer and finds no more error messages to visit, it fails and signals | ||
| 223 | an Emacs error. @w{@kbd{C-u C-x `}} starts scanning from the beginning of | ||
| 224 | the compilation buffer, and goes to the first error's location. | ||
| 225 | |||
| 226 | @vindex compilation-skip-threshold | ||
| 227 | By default, @w{@kbd{C-x `}} skips less important messages. The variable | ||
| 228 | @code{compilation-skip-threshold} controls this. If its value is 2, | ||
| 229 | @w{@kbd{C-x `}} skips anything less than error, 1 skips anything less | ||
| 230 | than warning, and 0 doesn't skip any messages. The default is 1. | ||
| 231 | |||
| 232 | When the window has a left fringe, an arrow in the fringe points to | ||
| 233 | the current message in the compilation buffer. The variable | ||
| 234 | @code{compilation-context-lines} controls the number of lines of | ||
| 235 | leading context to display before the current message. Going to an | ||
| 236 | error message location scrolls the @samp{*compilation*} buffer to put | ||
| 237 | the message that far down from the top. The value @code{nil} is | ||
| 238 | special: if there's a left fringe, the window doesn't scroll at all | ||
| 239 | if the message is already visible. If there is no left fringe, | ||
| 240 | @code{nil} means display the message at the top of the window. | ||
| 241 | |||
| 242 | If you're not in the compilation buffer when you run | ||
| 243 | @code{next-error}, Emacs will look for a buffer that contains error | ||
| 244 | messages. First, it looks for one displayed in the selected frame, | ||
| 245 | then for one that previously had @code{next-error} called on it, and | ||
| 246 | then at the current buffer. Finally, Emacs looks at all the remaining | ||
| 247 | buffers. @code{next-error} signals an error if it can't find any such | ||
| 248 | buffer. | ||
| 249 | |||
| 250 | @vindex compilation-error-regexp-alist | ||
| 251 | @vindex grep-regexp-alist | ||
| 252 | To parse messages from the compiler, Compilation mode uses the | ||
| 253 | variable @code{compilation-error-regexp-alist} which lists various | ||
| 254 | formats of error messages and tells Emacs how to extract the source file | ||
| 255 | and the line number from the text of a message. If your compiler isn't | ||
| 256 | supported, you can tailor Compilation mode to it by adding elements to | ||
| 257 | that list. A similar variable @code{grep-regexp-alist} tells Emacs how | ||
| 258 | to parse output of a @code{grep} command. | ||
| 259 | |||
| 260 | @findex compilation-next-error | ||
| 261 | @findex compilation-previous-error | ||
| 262 | @findex compilation-next-file | ||
| 263 | @findex compilation-previous-file | ||
| 264 | Compilation mode also redefines the keys @key{SPC} and @key{DEL} to | ||
| 265 | scroll by screenfuls, and @kbd{M-n} (@code{compilation-next-error}) | ||
| 266 | and @kbd{M-p} (@code{compilation-previous-error}) to move to the next | ||
| 267 | or previous error message. You can also use @kbd{M-@{} | ||
| 268 | (@code{compilation-next-file} and @kbd{M-@}} | ||
| 269 | (@code{compilation-previous-file}) to move up or down to an error | ||
| 270 | message for a different source file. | ||
| 271 | |||
| 272 | @cindex Next Error Follow mode | ||
| 273 | @findex next-error-follow-minor-mode | ||
| 274 | You can type @kbd{C-c C-f} to toggle Next Error Follow mode. In | ||
| 275 | this minor mode, ordinary cursor motion in the compilation buffer | ||
| 276 | automatically updates the source buffer. For instance, moving the | ||
| 277 | cursor to the next error message causes the location of that error to | ||
| 278 | be displayed immediately. | ||
| 279 | |||
| 280 | The features of Compilation mode are also available in a minor mode | ||
| 281 | called Compilation Minor mode. This lets you parse error messages in | ||
| 282 | any buffer, not just a normal compilation output buffer. Type @kbd{M-x | ||
| 283 | compilation-minor-mode} to enable the minor mode. This defines the keys | ||
| 284 | @key{RET} and @kbd{Mouse-2}, as in the Compilation major mode. | ||
| 285 | |||
| 286 | Compilation minor mode works in any buffer, as long as the contents | ||
| 287 | are in a format that it understands. In an Rlogin buffer (@pxref{Remote | ||
| 288 | Host}), Compilation minor mode automatically accesses remote source | ||
| 289 | files by FTP (@pxref{File Names}). | ||
| 290 | |||
| 291 | @node Compilation Shell | ||
| 292 | @section Subshells for Compilation | ||
| 293 | |||
| 294 | Emacs uses a shell to run the compilation command, but specifies the | ||
| 295 | option for a noninteractive shell. This means, in particular, that | ||
| 296 | the shell should start with no prompt. If you find your usual shell | ||
| 297 | prompt making an unsightly appearance in the @samp{*compilation*} | ||
| 298 | buffer, it means you have made a mistake in your shell's init file by | ||
| 299 | setting the prompt unconditionally. (This init file's name may be | ||
| 300 | @file{.bashrc}, @file{.profile}, @file{.cshrc}, @file{.shrc}, or | ||
| 301 | various other things, depending on the shell you use.) The shell init | ||
| 302 | file should set the prompt only if there already is a prompt. Here's | ||
| 303 | how to do it in bash: | ||
| 304 | |||
| 305 | @example | ||
| 306 | if [ "$@{PS1+set@}" = set ] | ||
| 307 | then PS1=@dots{} | ||
| 308 | fi | ||
| 309 | @end example | ||
| 310 | |||
| 311 | @noindent | ||
| 312 | And here's how to do it in csh: | ||
| 313 | |||
| 314 | @example | ||
| 315 | if ($?prompt) set prompt = @dots{} | ||
| 316 | @end example | ||
| 317 | |||
| 318 | There may well be other things that your shell's init file | ||
| 319 | ought to do only for an interactive shell. You can use the same | ||
| 320 | method to conditionalize them. | ||
| 321 | |||
| 322 | The MS-DOS ``operating system'' does not support asynchronous | ||
| 323 | subprocesses; to work around this lack, @kbd{M-x compile} runs the | ||
| 324 | compilation command synchronously on MS-DOS. As a consequence, you must | ||
| 325 | wait until the command finishes before you can do anything else in | ||
| 326 | Emacs. | ||
| 327 | @iftex | ||
| 328 | @inforef{MS-DOS,,emacs-xtra}. | ||
| 329 | @end iftex | ||
| 330 | @ifnottex | ||
| 331 | @xref{MS-DOS}. | ||
| 332 | @end ifnottex | ||
| 333 | |||
| 334 | @node Grep Searching | ||
| 335 | @section Searching with Grep under Emacs | ||
| 336 | |||
| 337 | Just as you can run a compiler from Emacs and then visit the lines | ||
| 338 | with compilation errors, you can also run @code{grep} and then visit | ||
| 339 | the lines on which matches were found. This works by treating the | ||
| 340 | matches reported by @code{grep} as if they were ``errors.'' The | ||
| 341 | buffer of matches uses Grep mode, which is a variant of Compilation | ||
| 342 | mode (@pxref{Compilation Mode}). | ||
| 343 | |||
| 344 | @table @kbd | ||
| 345 | @item M-x grep | ||
| 346 | @item M-x lgrep | ||
| 347 | Run @code{grep} asynchronously under Emacs, with matching lines | ||
| 348 | listed in the buffer named @samp{*grep*}. | ||
| 349 | @item M-x grep-find | ||
| 350 | @itemx M-x find-grep | ||
| 351 | @itemx M-x rgrep | ||
| 352 | Run @code{grep} via @code{find}, with user-specified arguments, and | ||
| 353 | collect output in the buffer named @samp{*grep*}. | ||
| 354 | @item M-x kill-grep | ||
| 355 | Kill the running @code{grep} subprocess. | ||
| 356 | @end table | ||
| 357 | |||
| 358 | @findex grep | ||
| 359 | To run @code{grep}, type @kbd{M-x grep}, then enter a command line | ||
| 360 | that specifies how to run @code{grep}. Use the same arguments you | ||
| 361 | would give @code{grep} when running it normally: a @code{grep}-style | ||
| 362 | regexp (usually in single-quotes to quote the shell's special | ||
| 363 | characters) followed by file names, which may use wildcards. If you | ||
| 364 | specify a prefix argument for @kbd{M-x grep}, it finds the tag | ||
| 365 | (@pxref{Tags}) in the buffer around point, and puts that into the | ||
| 366 | default @code{grep} command. | ||
| 367 | |||
| 368 | Your command need not simply run @code{grep}; you can use any shell | ||
| 369 | command that produces output in the same format. For instance, you | ||
| 370 | can chain @code{grep} commands, like this: | ||
| 371 | |||
| 372 | @example | ||
| 373 | grep -nH -e foo *.el | grep bar | grep toto | ||
| 374 | @end example | ||
| 375 | |||
| 376 | The output from @code{grep} goes in the @samp{*grep*} buffer. You | ||
| 377 | can find the corresponding lines in the original files using @w{@kbd{C-x | ||
| 378 | `}}, @key{RET}, and so forth, just like compilation errors. | ||
| 379 | |||
| 380 | Some grep programs accept a @samp{--color} option to output special | ||
| 381 | markers around matches for the purpose of highlighting. You can make | ||
| 382 | use of this feature by setting @code{grep-highlight-matches} to | ||
| 383 | @code{t}. When displaying a match in the source buffer, the exact | ||
| 384 | match will be highlighted, instead of the entire source line. | ||
| 385 | |||
| 386 | @findex grep-find | ||
| 387 | @findex find-grep | ||
| 388 | The command @kbd{M-x grep-find} (also available as @kbd{M-x | ||
| 389 | find-grep}) is similar to @kbd{M-x grep}, but it supplies a different | ||
| 390 | initial default for the command---one that runs both @code{find} and | ||
| 391 | @code{grep}, so as to search every file in a directory tree. See also | ||
| 392 | the @code{find-grep-dired} command, in @ref{Dired and Find}. | ||
| 393 | |||
| 394 | @findex lgrep | ||
| 395 | @findex rgrep | ||
| 396 | The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep} | ||
| 397 | (recursive grep) are more user-friendly versions of @code{grep} and | ||
| 398 | @code{grep-find}, which prompt separately for the regular expression | ||
| 399 | to match, the files to search, and the base directory for the search. | ||
| 400 | Case sensitivity of the search is controlled by the | ||
| 401 | current value of @code{case-fold-search}. | ||
| 402 | |||
| 403 | These commands build the shell commands based on the variables | ||
| 404 | @code{grep-template} (for @code{lgrep}) and @code{grep-find-template} | ||
| 405 | (for @code{rgrep}). | ||
| 406 | |||
| 407 | The files to search can use aliases defined in the variable | ||
| 408 | @code{grep-files-aliases}. | ||
| 409 | |||
| 410 | Subdirectories listed in the variable | ||
| 411 | @code{grep-find-ignored-directories} such as those typically used by | ||
| 412 | various version control systems, like CVS and arch, are automatically | ||
| 413 | skipped by @code{rgrep}. | ||
| 414 | |||
| 415 | @node Flymake | ||
| 416 | @section Finding Syntax Errors On The Fly | ||
| 417 | @cindex checking syntax | ||
| 418 | |||
| 419 | Flymake mode is a minor mode that performs on-the-fly syntax | ||
| 420 | checking for many programming and markup languages, including C, C++, | ||
| 421 | Perl, HTML, and @TeX{}/La@TeX{}. It is somewhat analogous to Flyspell | ||
| 422 | mode, which performs spell checking for ordinary human languages in a | ||
| 423 | similar fashion (@pxref{Spelling}). As you edit a file, Flymake mode | ||
| 424 | runs an appropriate syntax checking tool in the background, using a | ||
| 425 | temporary copy of the buffer. It then parses the error and warning | ||
| 426 | messages, and highlights the erroneous lines in the buffer. The | ||
| 427 | syntax checking tool used depends on the language; for example, for | ||
| 428 | C/C++ files this is usually the C compiler. Flymake can also use | ||
| 429 | build tools such as @code{make} for checking complicated projects. | ||
| 430 | |||
| 431 | To activate Flymake mode, type @kbd{M-x flymake-mode}. You can move | ||
| 432 | to the errors spotted by Flymake mode with @kbd{M-x | ||
| 433 | flymake-goto-next-error} and @kbd{M-x flymake-goto-prev-error}. To | ||
| 434 | display any error messages associated with the current line, use | ||
| 435 | @kbd{M-x flymake-display-err-menu-for-current-line}. | ||
| 436 | |||
| 437 | For more details about using Flymake, see @ref{Top, Flymake, | ||
| 438 | Flymake, flymake, The Flymake Manual}. | ||
| 439 | |||
| 440 | @node Debuggers | ||
| 441 | @section Running Debuggers Under Emacs | ||
| 442 | @cindex debuggers | ||
| 443 | @cindex GUD library | ||
| 444 | @cindex GDB | ||
| 445 | @cindex DBX | ||
| 446 | @cindex SDB | ||
| 447 | @cindex XDB | ||
| 448 | @cindex Perldb | ||
| 449 | @cindex JDB | ||
| 450 | @cindex PDB | ||
| 451 | |||
| 452 | @c Do you believe in GUD? | ||
| 453 | The GUD (Grand Unified Debugger) library provides an interface to | ||
| 454 | various symbolic debuggers from within Emacs. We recommend the | ||
| 455 | debugger GDB, which is free software, but GUD can also run DBX, SDB or | ||
| 456 | XDB. GUD can also serve as an interface to Perl's debugging mode, the | ||
| 457 | Python debugger PDB, and to JDB, the Java Debugger. | ||
| 458 | @xref{Debugging,, The Lisp Debugger, elisp, the Emacs Lisp Reference | ||
| 459 | Manual}, for information on debugging Emacs Lisp programs. | ||
| 460 | |||
| 461 | @menu | ||
| 462 | * Starting GUD:: How to start a debugger subprocess. | ||
| 463 | * Debugger Operation:: Connection between the debugger and source buffers. | ||
| 464 | * Commands of GUD:: Key bindings for common commands. | ||
| 465 | * GUD Customization:: Defining your own commands for GUD. | ||
| 466 | * GDB Graphical Interface:: An enhanced mode that uses GDB features to | ||
| 467 | implement a graphical debugging environment through | ||
| 468 | Emacs. | ||
| 469 | @end menu | ||
| 470 | |||
| 471 | @node Starting GUD | ||
| 472 | @subsection Starting GUD | ||
| 473 | |||
| 474 | There are several commands for starting a debugger, each corresponding | ||
| 475 | to a particular debugger program. | ||
| 476 | |||
| 477 | @table @kbd | ||
| 478 | @item M-x gdb @key{RET} @var{file} @key{RET} | ||
| 479 | @findex gdb | ||
| 480 | Run GDB as a subprocess of Emacs. By default, this uses an IDE-like | ||
| 481 | graphical interface; see @ref{GDB Graphical Interface}. Only GDB | ||
| 482 | works with the graphical interface. | ||
| 483 | |||
| 484 | @item M-x dbx @key{RET} @var{file} @key{RET} | ||
| 485 | @findex dbx | ||
| 486 | Run DBX as a subprocess of Emacs. Since Emacs does not implement a | ||
| 487 | graphical interface for DBX, communication with DBX works by typing | ||
| 488 | commands in the GUD interaction buffer. The same is true for all | ||
| 489 | the other supported debuggers. | ||
| 490 | |||
| 491 | @item M-x xdb @key{RET} @var{file} @key{RET} | ||
| 492 | @findex xdb | ||
| 493 | @vindex gud-xdb-directories | ||
| 494 | Similar, but run XDB. Use the variable | ||
| 495 | @code{gud-xdb-directories} to specify directories to search for source | ||
| 496 | files. | ||
| 497 | |||
| 498 | @item M-x sdb @key{RET} @var{file} @key{RET} | ||
| 499 | @findex sdb | ||
| 500 | Similar, but run SDB. | ||
| 501 | |||
| 502 | Some versions of SDB do not mention source file names in their | ||
| 503 | messages. When you use them, you need to have a valid tags table | ||
| 504 | (@pxref{Tags}) in order for GUD to find functions in the source code. | ||
| 505 | If you have not visited a tags table or the tags table doesn't list one | ||
| 506 | of the functions, you get a message saying @samp{The sdb support | ||
| 507 | requires a valid tags table to work}. If this happens, generate a valid | ||
| 508 | tags table in the working directory and try again. | ||
| 509 | |||
| 510 | @item M-x perldb @key{RET} @var{file} @key{RET} | ||
| 511 | @findex perldb | ||
| 512 | Run the Perl interpreter in debug mode to debug @var{file}, a Perl program. | ||
| 513 | |||
| 514 | @item M-x jdb @key{RET} @var{file} @key{RET} | ||
| 515 | @findex jdb | ||
| 516 | Run the Java debugger to debug @var{file}. | ||
| 517 | |||
| 518 | @item M-x pdb @key{RET} @var{file} @key{RET} | ||
| 519 | @findex pdb | ||
| 520 | Run the Python debugger to debug @var{file}. | ||
| 521 | @end table | ||
| 522 | |||
| 523 | Each of these commands takes one argument: a command line to invoke | ||
| 524 | the debugger. In the simplest case, specify just the name of the | ||
| 525 | executable file you want to debug. You may also use options that the | ||
| 526 | debugger supports. However, shell wildcards and variables are not | ||
| 527 | allowed. GUD assumes that the first argument not starting with a | ||
| 528 | @samp{-} is the executable file name. | ||
| 529 | |||
| 530 | Tramp provides a facility to debug programs on remote hosts. | ||
| 531 | @xref{Running a debugger on a remote host, Running a debugger on a remote host,, tramp, The Tramp Manual}. | ||
| 532 | @c Running a debugger on a remote host | ||
| 533 | |||
| 534 | @node Debugger Operation | ||
| 535 | @subsection Debugger Operation | ||
| 536 | |||
| 537 | @cindex fringes, and current execution line in GUD | ||
| 538 | Generally when you run a debugger with GUD, the debugger uses an Emacs | ||
| 539 | buffer for its ordinary input and output. This is called the GUD | ||
| 540 | buffer. Input and output from the program you are debugging also use | ||
| 541 | this buffer. We call this @dfn{text command mode}. The GDB Graphical | ||
| 542 | Interface can use further buffers (@pxref{GDB Graphical Interface}). | ||
| 543 | |||
| 544 | The debugger displays the source files of the program by visiting | ||
| 545 | them in Emacs buffers. An arrow in the left fringe indicates the | ||
| 546 | current execution line.@footnote{On a text-only terminal, the arrow | ||
| 547 | appears as @samp{=>} and overlays the first two text columns.} Moving | ||
| 548 | point in this buffer does not move the arrow. The arrow is not part | ||
| 549 | of the file's text; it appears only on the screen. | ||
| 550 | |||
| 551 | You can start editing these source files at any time in the buffers | ||
| 552 | that display them. If you do modify a source file, keep in mind that | ||
| 553 | inserting or deleting lines will throw off the arrow's positioning; | ||
| 554 | GUD has no way of figuring out which line corresponded before your | ||
| 555 | changes to the line number in a debugger message. Also, you'll | ||
| 556 | typically have to recompile and restart the program for your changes | ||
| 557 | to be reflected in the debugger's tables. | ||
| 558 | |||
| 559 | @cindex tooltips with GUD | ||
| 560 | @vindex tooltip-gud-modes | ||
| 561 | @vindex gud-tooltip-mode | ||
| 562 | @vindex gud-tooltip-echo-area | ||
| 563 | The Tooltip facility (@pxref{Tooltips}) provides support for GUD@. | ||
| 564 | You activate this feature by turning on the minor mode | ||
| 565 | @code{gud-tooltip-mode}. Then you can display a variable's value in a | ||
| 566 | tooltip simply by pointing at it with the mouse. This operates in the | ||
| 567 | GUD buffer and in source buffers with major modes in the list | ||
| 568 | @code{gud-tooltip-modes}. If the variable @code{gud-tooltip-echo-area} | ||
| 569 | is non-@code{nil} then the variable's value is displayed in the echo | ||
| 570 | area. When debugging a C program using the GDB Graphical Interface, you | ||
| 571 | can also display macro definitions associated with an identifier when | ||
| 572 | the program is not executing. | ||
| 573 | |||
| 574 | GUD tooltips are disabled when you use GDB in text command mode | ||
| 575 | (@pxref{GDB Graphical Interface}), because displaying an expression's | ||
| 576 | value in GDB can sometimes expand a macro and result in a side effect | ||
| 577 | that interferes with the program's operation. The GDB graphical | ||
| 578 | interface supports GUD tooltips and assures they will not cause side | ||
| 579 | effects. | ||
| 580 | |||
| 581 | @node Commands of GUD | ||
| 582 | @subsection Commands of GUD | ||
| 583 | |||
| 584 | The GUD interaction buffer uses a variant of Shell mode, so the | ||
| 585 | Emacs commands of Shell mode are available (@pxref{Shell Mode}). All | ||
| 586 | the usual commands for your debugger are available, and you can use | ||
| 587 | the Shell mode history commands to repeat them. If you wish, you can | ||
| 588 | control your debugger process entirely through this buffer. | ||
| 589 | |||
| 590 | GUD mode also provides commands for setting and clearing | ||
| 591 | breakpoints, for selecting stack frames, and for stepping through the | ||
| 592 | program. These commands are available both in the GUD buffer and | ||
| 593 | globally, but with different key bindings. It also has its own tool | ||
| 594 | bar from which you can invoke the more common commands by clicking on | ||
| 595 | the appropriate icon. This is particularly useful for repetitive | ||
| 596 | commands like @code{gud-next} and @code{gud-step}, and allows you to | ||
| 597 | keep the GUD buffer hidden. | ||
| 598 | |||
| 599 | The breakpoint commands are normally used in source file buffers, | ||
| 600 | because that is the easiest way to specify where to set or clear the | ||
| 601 | breakpoint. Here's the global command to set a breakpoint: | ||
| 602 | |||
| 603 | @table @kbd | ||
| 604 | @item C-x @key{SPC} | ||
| 605 | @kindex C-x SPC | ||
| 606 | Set a breakpoint on the source line that point is on. | ||
| 607 | @end table | ||
| 608 | |||
| 609 | @kindex C-x C-a @r{(GUD)} | ||
| 610 | Here are the other special commands provided by GUD@. The keys | ||
| 611 | starting with @kbd{C-c} are available only in the GUD interaction | ||
| 612 | buffer. The key bindings that start with @kbd{C-x C-a} are available | ||
| 613 | in the GUD interaction buffer and also in source files. Some of these | ||
| 614 | commands are not available to all the supported debuggers. | ||
| 615 | |||
| 616 | @table @kbd | ||
| 617 | @item C-c C-l | ||
| 618 | @kindex C-c C-l @r{(GUD)} | ||
| 619 | @itemx C-x C-a C-l | ||
| 620 | @findex gud-refresh | ||
| 621 | Display in another window the last line referred to in the GUD | ||
| 622 | buffer (that is, the line indicated in the last location message). | ||
| 623 | This runs the command @code{gud-refresh}. | ||
| 624 | |||
| 625 | @item C-c C-s | ||
| 626 | @kindex C-c C-s @r{(GUD)} | ||
| 627 | @itemx C-x C-a C-s | ||
| 628 | @findex gud-step | ||
| 629 | Execute a single line of code (@code{gud-step}). If the line contains | ||
| 630 | a function call, execution stops after entering the called function. | ||
| 631 | |||
| 632 | @item C-c C-n | ||
| 633 | @kindex C-c C-n @r{(GUD)} | ||
| 634 | @itemx C-x C-a C-n | ||
| 635 | @findex gud-next | ||
| 636 | Execute a single line of code, stepping across entire function calls | ||
| 637 | at full speed (@code{gud-next}). | ||
| 638 | |||
| 639 | @item C-c C-i | ||
| 640 | @kindex C-c C-i @r{(GUD)} | ||
| 641 | @itemx C-x C-a C-i | ||
| 642 | @findex gud-stepi | ||
| 643 | Execute a single machine instruction (@code{gud-stepi}). | ||
| 644 | |||
| 645 | @item C-c C-p | ||
| 646 | @kindex C-c C-p @r{(GUD)} | ||
| 647 | @itemx C-x C-a C-p | ||
| 648 | @findex gud-print | ||
| 649 | Evaluate the expression at point (@code{gud-print}). If Emacs | ||
| 650 | does not print the exact expression that you want, mark it as a region | ||
| 651 | first. | ||
| 652 | |||
| 653 | @need 3000 | ||
| 654 | @item C-c C-r | ||
| 655 | @kindex C-c C-r @r{(GUD)} | ||
| 656 | @itemx C-x C-a C-r | ||
| 657 | @findex gud-cont | ||
| 658 | Continue execution without specifying any stopping point. The program | ||
| 659 | will run until it hits a breakpoint, terminates, or gets a signal that | ||
| 660 | the debugger is checking for (@code{gud-cont}). | ||
| 661 | |||
| 662 | @need 1000 | ||
| 663 | @item C-c C-d | ||
| 664 | @kindex C-c C-d @r{(GUD)} | ||
| 665 | @itemx C-x C-a C-d | ||
| 666 | @findex gud-remove | ||
| 667 | Delete the breakpoint(s) on the current source line, if any | ||
| 668 | (@code{gud-remove}). If you use this command in the GUD interaction | ||
| 669 | buffer, it applies to the line where the program last stopped. | ||
| 670 | |||
| 671 | @item C-c C-t | ||
| 672 | @kindex C-c C-t @r{(GUD)} | ||
| 673 | @itemx C-x C-a C-t | ||
| 674 | @findex gud-tbreak | ||
| 675 | Set a temporary breakpoint on the current source line, if any | ||
| 676 | (@code{gud-tbreak}). If you use this command in the GUD interaction | ||
| 677 | buffer, it applies to the line where the program last stopped. | ||
| 678 | |||
| 679 | @item C-c < | ||
| 680 | @kindex C-c < @r{(GUD)} | ||
| 681 | @itemx C-x C-a < | ||
| 682 | @findex gud-up | ||
| 683 | Select the next enclosing stack frame (@code{gud-up}). This is | ||
| 684 | equivalent to the GDB command @samp{up}. | ||
| 685 | |||
| 686 | @item C-c > | ||
| 687 | @kindex C-c > @r{(GUD)} | ||
| 688 | @itemx C-x C-a > | ||
| 689 | @findex gud-down | ||
| 690 | Select the next inner stack frame (@code{gud-down}). This is | ||
| 691 | equivalent to the GDB command @samp{down}. | ||
| 692 | |||
| 693 | @item C-c C-u | ||
| 694 | @kindex C-c C-u @r{(GUD)} | ||
| 695 | @itemx C-x C-a C-u | ||
| 696 | @findex gud-until | ||
| 697 | Continue execution to the current line (@code{gud-until}). The | ||
| 698 | program will run until it hits a breakpoint, terminates, gets a signal | ||
| 699 | that the debugger is checking for, or reaches the line on which the | ||
| 700 | cursor currently sits. | ||
| 701 | |||
| 702 | @item C-c C-f | ||
| 703 | @kindex C-c C-f @r{(GUD)} | ||
| 704 | @itemx C-x C-a C-f | ||
| 705 | @findex gud-finish | ||
| 706 | Run the program until the selected stack frame returns or | ||
| 707 | stops for some other reason (@code{gud-finish}). | ||
| 708 | @end table | ||
| 709 | |||
| 710 | If you are using GDB, these additional key bindings are available: | ||
| 711 | |||
| 712 | @table @kbd | ||
| 713 | @item C-x C-a C-j | ||
| 714 | @kindex C-x C-a C-j @r{(GUD)} | ||
| 715 | @findex gud-jump | ||
| 716 | Only useful in a source buffer, @code{gud-jump} transfers the | ||
| 717 | program's execution point to the current line. In other words, the | ||
| 718 | next line that the program executes will be the one where you gave the | ||
| 719 | command. If the new execution line is in a different function from | ||
| 720 | the previously one, GDB prompts for confirmation since the results may | ||
| 721 | be bizarre. See the GDB manual entry regarding @code{jump} for | ||
| 722 | details. | ||
| 723 | |||
| 724 | @item @key{TAB} | ||
| 725 | @kindex TAB @r{(GUD)} | ||
| 726 | @findex gud-gdb-complete-command | ||
| 727 | With GDB, complete a symbol name (@code{gud-gdb-complete-command}). | ||
| 728 | This key is available only in the GUD interaction buffer. | ||
| 729 | @end table | ||
| 730 | |||
| 731 | These commands interpret a numeric argument as a repeat count, when | ||
| 732 | that makes sense. | ||
| 733 | |||
| 734 | Because @key{TAB} serves as a completion command, you can't use it to | ||
| 735 | enter a tab as input to the program you are debugging with GDB. | ||
| 736 | Instead, type @kbd{C-q @key{TAB}} to enter a tab. | ||
| 737 | |||
| 738 | @node GUD Customization | ||
| 739 | @subsection GUD Customization | ||
| 740 | |||
| 741 | @vindex gdb-mode-hook | ||
| 742 | @vindex dbx-mode-hook | ||
| 743 | @vindex sdb-mode-hook | ||
| 744 | @vindex xdb-mode-hook | ||
| 745 | @vindex perldb-mode-hook | ||
| 746 | @vindex pdb-mode-hook | ||
| 747 | @vindex jdb-mode-hook | ||
| 748 | On startup, GUD runs one of the following hooks: @code{gdb-mode-hook}, | ||
| 749 | if you are using GDB; @code{dbx-mode-hook}, if you are using DBX; | ||
| 750 | @code{sdb-mode-hook}, if you are using SDB; @code{xdb-mode-hook}, if you | ||
| 751 | are using XDB; @code{perldb-mode-hook}, for Perl debugging mode; | ||
| 752 | @code{pdb-mode-hook}, for PDB; @code{jdb-mode-hook}, for JDB. You can | ||
| 753 | use these hooks to define custom key bindings for the debugger | ||
| 754 | interaction buffer. @xref{Hooks}. | ||
| 755 | |||
| 756 | Here is a convenient way to define a command that sends a particular | ||
| 757 | command string to the debugger, and set up a key binding for it in the | ||
| 758 | debugger interaction buffer: | ||
| 759 | |||
| 760 | @findex gud-def | ||
| 761 | @example | ||
| 762 | (gud-def @var{function} @var{cmdstring} @var{binding} @var{docstring}) | ||
| 763 | @end example | ||
| 764 | |||
| 765 | This defines a command named @var{function} which sends | ||
| 766 | @var{cmdstring} to the debugger process, and gives it the documentation | ||
| 767 | string @var{docstring}. You can then use the command @var{function} in any | ||
| 768 | buffer. If @var{binding} is non-@code{nil}, @code{gud-def} also binds | ||
| 769 | the command to @kbd{C-c @var{binding}} in the GUD buffer's mode and to | ||
| 770 | @kbd{C-x C-a @var{binding}} generally. | ||
| 771 | |||
| 772 | The command string @var{cmdstring} may contain certain | ||
| 773 | @samp{%}-sequences that stand for data to be filled in at the time | ||
| 774 | @var{function} is called: | ||
| 775 | |||
| 776 | @table @samp | ||
| 777 | @item %f | ||
| 778 | The name of the current source file. If the current buffer is the GUD | ||
| 779 | buffer, then the ``current source file'' is the file that the program | ||
| 780 | stopped in. | ||
| 781 | |||
| 782 | @item %l | ||
| 783 | The number of the current source line. If the current buffer is the GUD | ||
| 784 | buffer, then the ``current source line'' is the line that the program | ||
| 785 | stopped in. | ||
| 786 | |||
| 787 | @item %e | ||
| 788 | In transient-mark-mode the text in the region, if it is active. | ||
| 789 | Otherwise the text of the C lvalue or function-call expression at or | ||
| 790 | adjacent to point. | ||
| 791 | |||
| 792 | @item %a | ||
| 793 | The text of the hexadecimal address at or adjacent to point. | ||
| 794 | |||
| 795 | @item %p | ||
| 796 | The numeric argument of the called function, as a decimal number. If | ||
| 797 | the command is used without a numeric argument, @samp{%p} stands for the | ||
| 798 | empty string. | ||
| 799 | |||
| 800 | If you don't use @samp{%p} in the command string, the command you define | ||
| 801 | ignores any numeric argument. | ||
| 802 | |||
| 803 | @item %d | ||
| 804 | The name of the directory of the current source file. | ||
| 805 | |||
| 806 | @item %c | ||
| 807 | Fully qualified class name derived from the expression surrounding point | ||
| 808 | (jdb only). | ||
| 809 | @end table | ||
| 810 | |||
| 811 | @node GDB Graphical Interface | ||
| 812 | @subsection GDB Graphical Interface | ||
| 813 | |||
| 814 | By default, the command @code{gdb} starts GDB using a graphical | ||
| 815 | interface, using Emacs windows for display program state information. | ||
| 816 | In effect, this makes Emacs into an IDE (interactive development | ||
| 817 | environment). With it, you do not need to use textual GDB commands; | ||
| 818 | you can control the debugging session with the mouse. For example, | ||
| 819 | you can click in the fringe of a source buffer to set a breakpoint | ||
| 820 | there, or on a stack frame in the stack buffer to select that frame. | ||
| 821 | |||
| 822 | This mode requires telling GDB that its ``screen size'' is | ||
| 823 | unlimited, so it sets the height and width accordingly. For correct | ||
| 824 | operation you must not change these values during the GDB session. | ||
| 825 | |||
| 826 | @vindex gud-gdb-command-name | ||
| 827 | @findex gdba | ||
| 828 | You can also run GDB in text command mode, like other debuggers. To | ||
| 829 | do this, replace the GDB @code{"--annotate=3"} option with | ||
| 830 | @code{"--fullname"} either in the minibuffer for the current Emacs | ||
| 831 | session, or the custom variable @code{gud-gdb-command-name} for all | ||
| 832 | future sessions. You need to use text command mode to debug multiple | ||
| 833 | programs within one Emacs session. If you have customized | ||
| 834 | @code{gud-gdb-command-name} in this way, you can use @kbd{M-x gdba} to | ||
| 835 | invoke GDB in graphical mode. Moreover, this command succeeds where | ||
| 836 | @kbd{M-x gdb} fails, such as when your @file{.gdbinit} file contains | ||
| 837 | executable GDB commands. | ||
| 838 | |||
| 839 | @menu | ||
| 840 | * GDB-UI Layout:: Control the number of displayed buffers. | ||
| 841 | * Source Buffers:: Use the mouse in the fringe/margin to | ||
| 842 | control your program. | ||
| 843 | * Breakpoints Buffer:: A breakpoint control panel. | ||
| 844 | * Stack Buffer:: Select a frame from the call stack. | ||
| 845 | * Other GDB-UI Buffers:: Input/output, locals, registers, | ||
| 846 | assembler, threads and memory buffers. | ||
| 847 | * Watch Expressions:: Monitor variable values in the speedbar. | ||
| 848 | @end menu | ||
| 849 | |||
| 850 | @node GDB-UI Layout | ||
| 851 | @subsubsection GDB User Interface Layout | ||
| 852 | @cindex GDB User Interface layout | ||
| 853 | |||
| 854 | @vindex gdb-many-windows | ||
| 855 | If the variable @code{gdb-many-windows} is @code{nil} (the default | ||
| 856 | value) then @kbd{M-x gdb} normally displays only the GUD buffer. | ||
| 857 | However, if the variable @code{gdb-show-main} is also non-@code{nil}, | ||
| 858 | it starts with two windows: one displaying the GUD buffer, and the | ||
| 859 | other showing the source for the @code{main} function of the program | ||
| 860 | you are debugging. | ||
| 861 | |||
| 862 | If @code{gdb-many-windows} is non-@code{nil}, then @kbd{M-x gdb} | ||
| 863 | displays the following frame layout: | ||
| 864 | |||
| 865 | @smallexample | ||
| 866 | @group | ||
| 867 | +--------------------------------+--------------------------------+ | ||
| 868 | | GUD buffer (I/O of GDB) | Locals buffer | | ||
| 869 | |--------------------------------+--------------------------------+ | ||
| 870 | | Primary Source buffer | I/O buffer for debugged pgm | | ||
| 871 | |--------------------------------+--------------------------------+ | ||
| 872 | | Stack buffer | Breakpoints buffer | | ||
| 873 | +--------------------------------+--------------------------------+ | ||
| 874 | @end group | ||
| 875 | @end smallexample | ||
| 876 | |||
| 877 | However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O | ||
| 878 | buffer does not appear and the primary source buffer occupies the full | ||
| 879 | width of the frame. | ||
| 880 | |||
| 881 | @findex gdb-restore-windows | ||
| 882 | If you change the window layout, for example, while editing and | ||
| 883 | re-compiling your program, then you can restore this standard window | ||
| 884 | layout with the command @code{gdb-restore-windows}. | ||
| 885 | |||
| 886 | @findex gdb-many-windows | ||
| 887 | To switch between this standard layout and a simple layout | ||
| 888 | containing just the GUD buffer and a source file, type @kbd{M-x | ||
| 889 | gdb-many-windows}. | ||
| 890 | |||
| 891 | You may also specify additional GDB-related buffers to display, | ||
| 892 | either in the same frame or a different one. Select the buffers you | ||
| 893 | want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames} | ||
| 894 | sub-menus. If the menu-bar is unavailable, type @code{M-x | ||
| 895 | gdb-display-@var{buffertype}-buffer} or @code{M-x | ||
| 896 | gdb-frame-@var{buffertype}-buffer} respectively, where | ||
| 897 | @var{buffertype} is the relevant buffer type, such as | ||
| 898 | @samp{breakpoints}. Most of these buffers are read-only, and typing | ||
| 899 | @kbd{q} in them kills them. | ||
| 900 | |||
| 901 | When you finish debugging, kill the GUD buffer with @kbd{C-x k}, | ||
| 902 | which will also kill all the buffers associated with the session. | ||
| 903 | However you need not do this if, after editing and re-compiling your | ||
| 904 | source code within Emacs, you wish continue debugging. When you | ||
| 905 | restart execution, GDB will automatically find your new executable. | ||
| 906 | Keeping the GUD buffer has the advantage of keeping the shell history | ||
| 907 | as well as GDB's breakpoints. You do need to check that the | ||
| 908 | breakpoints in recently edited source files are still in the right | ||
| 909 | places. | ||
| 910 | |||
| 911 | @node Source Buffers | ||
| 912 | @subsubsection Source Buffers | ||
| 913 | @cindex GDB commands in Fringe | ||
| 914 | |||
| 915 | @c @findex gdb-mouse-set-clear-breakpoint | ||
| 916 | @c @findex gdb-mouse-toggle-breakpoint | ||
| 917 | Many GDB commands can be entered using keybindings or the tool bar but | ||
| 918 | sometimes it is quicker to use the fringe. These commands either | ||
| 919 | manipulate breakpoints or control program execution. When there is no | ||
| 920 | fringe, you can use the margin but this is only present when the | ||
| 921 | source file already has a breakpoint. | ||
| 922 | |||
| 923 | You can click @kbd{Mouse-1} in the fringe or display margin of a | ||
| 924 | source buffer to set a breakpoint there and, on a graphical display, a | ||
| 925 | red bullet will appear on that line. If a breakpoint already exists | ||
| 926 | on that line, the same click will remove it. You can also enable or | ||
| 927 | disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet. | ||
| 928 | |||
| 929 | A solid arrow in the left fringe of a source buffer indicates the line | ||
| 930 | of the innermost frame where the debugged program has stopped. A | ||
| 931 | hollow arrow indicates the current execution line of higher level | ||
| 932 | frames. | ||
| 933 | |||
| 934 | If you drag the arrow in the fringe with @kbd{Mouse-1} | ||
| 935 | (@code{gdb-mouse-until}), execution will continue to the line where | ||
| 936 | you release the button, provided it is still in the same frame. | ||
| 937 | Alternatively, you can click @kbd{Mouse-3} at some point in the fringe | ||
| 938 | of this buffer and execution will advance to there. A similar command | ||
| 939 | (@code{gdb-mouse-jump}) allows you to jump to a source line without | ||
| 940 | executing the intermediate lines by clicking @kbd{C-Mouse-3}. This | ||
| 941 | command allows you to go backwards which can be useful for running | ||
| 942 | through code that has already executed, in order to examine its | ||
| 943 | execution in more detail. | ||
| 944 | |||
| 945 | @table @kbd | ||
| 946 | @item Mouse-1 | ||
| 947 | Set or clear a breakpoint. | ||
| 948 | |||
| 949 | @item C-Mouse-1 | ||
| 950 | Enable or disable a breakpoint. | ||
| 951 | |||
| 952 | @item Mouse-3 | ||
| 953 | Continue execution to here. | ||
| 954 | |||
| 955 | @item C-Mouse-3 | ||
| 956 | Jump to here. | ||
| 957 | @end table | ||
| 958 | |||
| 959 | If the variable @code{gdb-find-source-frame} is non-@code{nil} and | ||
| 960 | execution stops in a frame for which there is no source code e.g after | ||
| 961 | an interrupt, then Emacs finds and displays the first frame further up | ||
| 962 | stack for which there is source. If it is @code{nil} then the source | ||
| 963 | buffer continues to display the last frame which maybe more useful, | ||
| 964 | for example, when re-setting a breakpoint. | ||
| 965 | |||
| 966 | @node Breakpoints Buffer | ||
| 967 | @subsubsection Breakpoints Buffer | ||
| 968 | |||
| 969 | The breakpoints buffer shows the existing breakpoints, watchpoints and | ||
| 970 | catchpoints (@pxref{Breakpoints,,, gdb, The GNU debugger}). It has | ||
| 971 | these special commands, which mostly apply to the @dfn{current | ||
| 972 | breakpoint}, the breakpoint which point is on. | ||
| 973 | |||
| 974 | @table @kbd | ||
| 975 | @item @key{SPC} | ||
| 976 | @kindex SPC @r{(GDB breakpoints buffer)} | ||
| 977 | @findex gdb-toggle-breakpoint | ||
| 978 | Enable/disable the current breakpoint (@code{gdb-toggle-breakpoint}). | ||
| 979 | On a graphical display, this changes the color of a bullet in the | ||
| 980 | margin of a source buffer at the relevant line. This is red when | ||
| 981 | the breakpoint is enabled and grey when it is disabled. Text-only | ||
| 982 | terminals correspondingly display a @samp{B} or @samp{b}. | ||
| 983 | |||
| 984 | @item D | ||
| 985 | @kindex D @r{(GDB breakpoints buffer)} | ||
| 986 | @findex gdb-delete-breakpoint | ||
| 987 | Delete the current breakpoint (@code{gdb-delete-breakpoint}). | ||
| 988 | |||
| 989 | @item @key{RET} | ||
| 990 | @kindex RET @r{(GDB breakpoints buffer)} | ||
| 991 | @findex gdb-goto-breakpoint | ||
| 992 | Visit the source line for the current breakpoint | ||
| 993 | (@code{gdb-goto-breakpoint}). | ||
| 994 | |||
| 995 | @item Mouse-2 | ||
| 996 | @kindex Mouse-2 @r{(GDB breakpoints buffer)} | ||
| 997 | Visit the source line for the breakpoint you click on. | ||
| 998 | @end table | ||
| 999 | |||
| 1000 | @node Stack Buffer | ||
| 1001 | @subsubsection Stack Buffer | ||
| 1002 | |||
| 1003 | The stack buffer displays a @dfn{call stack}, with one line for each | ||
| 1004 | of the nested subroutine calls (@dfn{stack frames}) now active in the | ||
| 1005 | program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}. | ||
| 1006 | |||
| 1007 | @findex gdb-frames-select | ||
| 1008 | An arrow in the fringe points to the selected frame or, if the fringe is | ||
| 1009 | not present, the number of the selected frame is displayed in reverse | ||
| 1010 | contrast. To select a frame in GDB, move point in the stack buffer to | ||
| 1011 | that stack frame and type @key{RET} (@code{gdb-frames-select}), or click | ||
| 1012 | @kbd{Mouse-2} on a stack frame. If the locals buffer is visible, | ||
| 1013 | selecting a stack frame updates it to display the local variables of the | ||
| 1014 | new frame. | ||
| 1015 | |||
| 1016 | @node Other GDB-UI Buffers | ||
| 1017 | @subsubsection Other Buffers | ||
| 1018 | |||
| 1019 | @table @asis | ||
| 1020 | @item Input/Output Buffer | ||
| 1021 | @vindex gdb-use-separate-io-buffer | ||
| 1022 | If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil}, | ||
| 1023 | the program being debugged takes its input and displays its output | ||
| 1024 | here. Otherwise it uses the GUD buffer for that. To toggle whether | ||
| 1025 | GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}. | ||
| 1026 | This takes effect when you next restart the program you are debugging. | ||
| 1027 | |||
| 1028 | The history and replay commands from Shell mode are available here, | ||
| 1029 | as are the commands to send signals to the debugged program. | ||
| 1030 | @xref{Shell Mode}. | ||
| 1031 | |||
| 1032 | @item Locals Buffer | ||
| 1033 | The locals buffer displays the values of local variables of the | ||
| 1034 | current frame for simple data types (@pxref{Frame Info, Frame Info, | ||
| 1035 | Information on a frame, gdb, The GNU debugger}). Press @key{RET} or | ||
| 1036 | click @kbd{Mouse-2} on the value if you want to edit it. | ||
| 1037 | |||
| 1038 | Arrays and structures display their type only. With GDB 6.4 or later, | ||
| 1039 | move point to their name and press @key{RET}, or alternatively click | ||
| 1040 | @kbd{Mouse-2} there, to examine their values. With earlier versions | ||
| 1041 | of GDB, use @kbd{Mouse-2} or @key{RET} on the type description | ||
| 1042 | (@samp{[struct/union]} or @samp{[array]}). @xref{Watch Expressions}. | ||
| 1043 | |||
| 1044 | @item Registers Buffer | ||
| 1045 | @findex toggle-gdb-all-registers | ||
| 1046 | The registers buffer displays the values held by the registers | ||
| 1047 | (@pxref{Registers,,, gdb, The GNU debugger}). Press @key{RET} or | ||
| 1048 | click @kbd{Mouse-2} on a register if you want to edit its value. | ||
| 1049 | With GDB 6.4 or later, recently changed register values display with | ||
| 1050 | @code{font-lock-warning-face}. With earlier versions of GDB, you can | ||
| 1051 | press @key{SPC} to toggle the display of floating point registers | ||
| 1052 | (@code{toggle-gdb-all-registers}). | ||
| 1053 | |||
| 1054 | @item Assembler Buffer | ||
| 1055 | The assembler buffer displays the current frame as machine code. An | ||
| 1056 | arrow points to the current instruction, and you can set and remove | ||
| 1057 | breakpoints as in a source buffer. Breakpoint icons also appear in | ||
| 1058 | the fringe or margin. | ||
| 1059 | |||
| 1060 | @item Threads Buffer | ||
| 1061 | @findex gdb-threads-select | ||
| 1062 | The threads buffer displays a summary of all threads currently in your | ||
| 1063 | program (@pxref{Threads, Threads, Debugging programs with multiple | ||
| 1064 | threads, gdb, The GNU debugger}). Move point to any thread in the | ||
| 1065 | list and press @key{RET} to select it (@code{gdb-threads-select}) and | ||
| 1066 | display the associated source in the primary source buffer. | ||
| 1067 | Alternatively, click @kbd{Mouse-2} on a thread to select it. If the | ||
| 1068 | locals buffer is visible, its contents update to display the variables | ||
| 1069 | that are local in the new thread. | ||
| 1070 | |||
| 1071 | @item Memory Buffer | ||
| 1072 | The memory buffer lets you examine sections of program memory | ||
| 1073 | (@pxref{Memory, Memory, Examining memory, gdb, The GNU debugger}). | ||
| 1074 | Click @kbd{Mouse-1} on the appropriate part of the header line to | ||
| 1075 | change the starting address or number of data items that the buffer | ||
| 1076 | displays. Click @kbd{Mouse-3} on the header line to select the | ||
| 1077 | display format or unit size for these data items. | ||
| 1078 | @end table | ||
| 1079 | |||
| 1080 | @node Watch Expressions | ||
| 1081 | @subsubsection Watch Expressions | ||
| 1082 | @cindex Watching expressions in GDB | ||
| 1083 | |||
| 1084 | @findex gud-watch | ||
| 1085 | @kindex C-x C-a C-w @r{(GUD)} | ||
| 1086 | If you want to see how a variable changes each time your program | ||
| 1087 | stops, move point into the variable name and click on the watch icon | ||
| 1088 | in the tool bar (@code{gud-watch}) or type @kbd{C-x C-a C-w}. If you | ||
| 1089 | specify a prefix argument, you can enter the variable name in the | ||
| 1090 | minibuffer. | ||
| 1091 | |||
| 1092 | Each watch expression is displayed in the speedbar. Complex data | ||
| 1093 | types, such as arrays, structures and unions are represented in a tree | ||
| 1094 | format. Leaves and simple data types show the name of the expression | ||
| 1095 | and its value and, when the speedbar frame is selected, display the | ||
| 1096 | type as a tooltip. Higher levels show the name, type and address | ||
| 1097 | value for pointers and just the name and type otherwise. Root expressions | ||
| 1098 | also display the frame address as a tooltip to help identify the frame | ||
| 1099 | in which they were defined. | ||
| 1100 | |||
| 1101 | To expand or contract a complex data type, click @kbd{Mouse-2} or | ||
| 1102 | press @key{SPC} on the tag to the left of the expression. Emacs asks | ||
| 1103 | for confirmation before expanding the expression if its number of | ||
| 1104 | immediate children exceeds the value of the variable | ||
| 1105 | @code{gdb-max-children}. | ||
| 1106 | |||
| 1107 | @kindex D @r{(GDB speedbar)} | ||
| 1108 | @findex gdb-var-delete | ||
| 1109 | To delete a complex watch expression, move point to the root | ||
| 1110 | expression in the speedbar and type @kbd{D} (@code{gdb-var-delete}). | ||
| 1111 | |||
| 1112 | @kindex RET @r{(GDB speedbar)} | ||
| 1113 | @findex gdb-edit-value | ||
| 1114 | To edit a variable with a simple data type, or a simple element of a | ||
| 1115 | complex data type, move point there in the speedbar and type @key{RET} | ||
| 1116 | (@code{gdb-edit-value}). Or you can click @kbd{Mouse-2} on a value to | ||
| 1117 | edit it. Either way, this reads the new value using the minibuffer. | ||
| 1118 | |||
| 1119 | @vindex gdb-show-changed-values | ||
| 1120 | If you set the variable @code{gdb-show-changed-values} to | ||
| 1121 | non-@code{nil} (the default value), Emacs uses | ||
| 1122 | @code{font-lock-warning-face} to highlight values that have recently | ||
| 1123 | changed and @code{shadow} face to make variables which have gone out of | ||
| 1124 | scope less noticeable. When a variable goes out of scope you can't | ||
| 1125 | edit its value. | ||
| 1126 | |||
| 1127 | @vindex gdb-use-colon-colon-notation | ||
| 1128 | If the variable @code{gdb-use-colon-colon-notation} is | ||
| 1129 | non-@code{nil}, Emacs uses the @samp{@var{function}::@var{variable}} | ||
| 1130 | format. This allows the user to display watch expressions which share | ||
| 1131 | the same variable name. The default value is @code{nil}. | ||
| 1132 | |||
| 1133 | @vindex gdb-speedbar-auto-raise | ||
| 1134 | To automatically raise the speedbar every time the display of watch | ||
| 1135 | expressions updates, set @code{gdb-speedbar-auto-raise} to | ||
| 1136 | non-@code{nil}. This can be useful if you are debugging with a full | ||
| 1137 | screen Emacs frame. | ||
| 1138 | |||
| 1139 | @node Executing Lisp | ||
| 1140 | @section Executing Lisp Expressions | ||
| 1141 | |||
| 1142 | Emacs has several different major modes for Lisp and Scheme. They are | ||
| 1143 | the same in terms of editing commands, but differ in the commands for | ||
| 1144 | executing Lisp expressions. Each mode has its own purpose. | ||
| 1145 | |||
| 1146 | @table @asis | ||
| 1147 | @item Emacs-Lisp mode | ||
| 1148 | The mode for editing source files of programs to run in Emacs Lisp. | ||
| 1149 | This mode defines @kbd{C-M-x} to evaluate the current defun. | ||
| 1150 | @xref{Lisp Libraries}. | ||
| 1151 | @item Lisp Interaction mode | ||
| 1152 | The mode for an interactive session with Emacs Lisp. It defines | ||
| 1153 | @kbd{C-j} to evaluate the sexp before point and insert its value in the | ||
| 1154 | buffer. @xref{Lisp Interaction}. | ||
| 1155 | @item Lisp mode | ||
| 1156 | The mode for editing source files of programs that run in Lisps other | ||
| 1157 | than Emacs Lisp. This mode defines @kbd{C-M-x} to send the current defun | ||
| 1158 | to an inferior Lisp process. @xref{External Lisp}. | ||
| 1159 | @item Inferior Lisp mode | ||
| 1160 | The mode for an interactive session with an inferior Lisp process. | ||
| 1161 | This mode combines the special features of Lisp mode and Shell mode | ||
| 1162 | (@pxref{Shell Mode}). | ||
| 1163 | @item Scheme mode | ||
| 1164 | Like Lisp mode but for Scheme programs. | ||
| 1165 | @item Inferior Scheme mode | ||
| 1166 | The mode for an interactive session with an inferior Scheme process. | ||
| 1167 | @end table | ||
| 1168 | |||
| 1169 | Most editing commands for working with Lisp programs are in fact | ||
| 1170 | available globally. @xref{Programs}. | ||
| 1171 | |||
| 1172 | @node Lisp Libraries | ||
| 1173 | @section Libraries of Lisp Code for Emacs | ||
| 1174 | @cindex libraries | ||
| 1175 | @cindex loading Lisp code | ||
| 1176 | |||
| 1177 | Lisp code for Emacs editing commands is stored in files whose names | ||
| 1178 | conventionally end in @file{.el}. This ending tells Emacs to edit them in | ||
| 1179 | Emacs-Lisp mode (@pxref{Executing Lisp}). | ||
| 1180 | |||
| 1181 | @cindex byte code | ||
| 1182 | Emacs Lisp code can be compiled into byte-code, which loads faster, | ||
| 1183 | takes up less space, and executes faster. @xref{Byte Compilation,, | ||
| 1184 | Byte Compilation, elisp, the Emacs Lisp Reference Manual}. By | ||
| 1185 | convention, the compiled code for a library goes in a separate file | ||
| 1186 | whose name ends in @samp{.elc}. Thus, the compiled code for | ||
| 1187 | @file{foo.el} goes in @file{foo.elc}. | ||
| 1188 | |||
| 1189 | @findex load-file | ||
| 1190 | To execute a file of Emacs Lisp code, use @kbd{M-x load-file}. This | ||
| 1191 | command reads a file name using the minibuffer and then executes the | ||
| 1192 | contents of that file as Lisp code. It is not necessary to visit the | ||
| 1193 | file first; in any case, this command reads the file as found on disk, | ||
| 1194 | not text in an Emacs buffer. | ||
| 1195 | |||
| 1196 | @findex load | ||
| 1197 | @findex load-library | ||
| 1198 | Once a file of Lisp code is installed in the Emacs Lisp library | ||
| 1199 | directories, users can load it using @kbd{M-x load-library}. Programs | ||
| 1200 | can load it by calling @code{load}, a more primitive function that is | ||
| 1201 | similar but accepts some additional arguments. | ||
| 1202 | |||
| 1203 | @kbd{M-x load-library} differs from @kbd{M-x load-file} in that it | ||
| 1204 | searches a sequence of directories and tries three file names in each | ||
| 1205 | directory. Suppose your argument is @var{lib}; the three names are | ||
| 1206 | @file{@var{lib}.elc}, @file{@var{lib}.el}, and lastly just | ||
| 1207 | @file{@var{lib}}. If @file{@var{lib}.elc} exists, it is by convention | ||
| 1208 | the result of compiling @file{@var{lib}.el}; it is better to load the | ||
| 1209 | compiled file, since it will load and run faster. | ||
| 1210 | |||
| 1211 | If @code{load-library} finds that @file{@var{lib}.el} is newer than | ||
| 1212 | @file{@var{lib}.elc} file, it issues a warning, because it's likely | ||
| 1213 | that somebody made changes to the @file{.el} file and forgot to | ||
| 1214 | recompile it. Nonetheless, it loads @file{@var{lib}.elc}. This is | ||
| 1215 | because people often leave unfinished edits the source file, and don't | ||
| 1216 | recompile it until they think it is ready to use. | ||
| 1217 | |||
| 1218 | Because the argument to @code{load-library} is usually not in itself | ||
| 1219 | a valid file name, file name completion is not available. Indeed, when | ||
| 1220 | using this command, you usually do not know exactly what file name | ||
| 1221 | will be used. | ||
| 1222 | |||
| 1223 | @vindex load-path | ||
| 1224 | The sequence of directories searched by @kbd{M-x load-library} is | ||
| 1225 | specified by the variable @code{load-path}, a list of strings that are | ||
| 1226 | directory names. The default value of the list contains the directories where | ||
| 1227 | the Lisp code for Emacs itself is stored. If you have libraries of | ||
| 1228 | your own, put them in a single directory and add that directory | ||
| 1229 | to @code{load-path}. @code{nil} in this list stands for the current default | ||
| 1230 | directory, but it is probably not a good idea to put @code{nil} in the | ||
| 1231 | list. If you find yourself wishing that @code{nil} were in the list, | ||
| 1232 | most likely what you really want to do is use @kbd{M-x load-file} | ||
| 1233 | this once. | ||
| 1234 | |||
| 1235 | @cindex autoload | ||
| 1236 | Often you do not have to give any command to load a library, because | ||
| 1237 | the commands defined in the library are set up to @dfn{autoload} that | ||
| 1238 | library. Trying to run any of those commands calls @code{load} to load | ||
| 1239 | the library; this replaces the autoload definitions with the real ones | ||
| 1240 | from the library. | ||
| 1241 | |||
| 1242 | @vindex load-dangerous-libraries | ||
| 1243 | @cindex Lisp files byte-compiled by XEmacs | ||
| 1244 | By default, Emacs refuses to load compiled Lisp files which were | ||
| 1245 | compiled with XEmacs, a modified versions of Emacs---they can cause | ||
| 1246 | Emacs to crash. Set the variable @code{load-dangerous-libraries} to | ||
| 1247 | @code{t} if you want to try loading them. | ||
| 1248 | |||
| 1249 | @node Lisp Eval | ||
| 1250 | @section Evaluating Emacs Lisp Expressions | ||
| 1251 | @cindex Emacs-Lisp mode | ||
| 1252 | @cindex mode, Emacs-Lisp | ||
| 1253 | |||
| 1254 | @findex emacs-lisp-mode | ||
| 1255 | Lisp programs intended to be run in Emacs should be edited in | ||
| 1256 | Emacs-Lisp mode; this happens automatically for file names ending in | ||
| 1257 | @file{.el}. By contrast, Lisp mode itself is used for editing Lisp | ||
| 1258 | programs intended for other Lisp systems. To switch to Emacs-Lisp mode | ||
| 1259 | explicitly, use the command @kbd{M-x emacs-lisp-mode}. | ||
| 1260 | |||
| 1261 | For testing of Lisp programs to run in Emacs, it is often useful to | ||
| 1262 | evaluate part of the program as it is found in the Emacs buffer. For | ||
| 1263 | example, after changing the text of a Lisp function definition, | ||
| 1264 | evaluating the definition installs the change for future calls to the | ||
| 1265 | function. Evaluation of Lisp expressions is also useful in any kind of | ||
| 1266 | editing, for invoking noninteractive functions (functions that are | ||
| 1267 | not commands). | ||
| 1268 | |||
| 1269 | @table @kbd | ||
| 1270 | @item M-: | ||
| 1271 | Read a single Lisp expression in the minibuffer, evaluate it, and print | ||
| 1272 | the value in the echo area (@code{eval-expression}). | ||
| 1273 | @item C-x C-e | ||
| 1274 | Evaluate the Lisp expression before point, and print the value in the | ||
| 1275 | echo area (@code{eval-last-sexp}). | ||
| 1276 | @item C-M-x | ||
| 1277 | Evaluate the defun containing or after point, and print the value in | ||
| 1278 | the echo area (@code{eval-defun}). | ||
| 1279 | @item M-x eval-region | ||
| 1280 | Evaluate all the Lisp expressions in the region. | ||
| 1281 | @item M-x eval-buffer | ||
| 1282 | Evaluate all the Lisp expressions in the buffer. | ||
| 1283 | @end table | ||
| 1284 | |||
| 1285 | @ifinfo | ||
| 1286 | @c This uses ``colon'' instead of a literal `:' because Info cannot | ||
| 1287 | @c cope with a `:' in a menu | ||
| 1288 | @kindex M-@key{colon} | ||
| 1289 | @end ifinfo | ||
| 1290 | @ifnotinfo | ||
| 1291 | @kindex M-: | ||
| 1292 | @end ifnotinfo | ||
| 1293 | @findex eval-expression | ||
| 1294 | @kbd{M-:} (@code{eval-expression}) is the most basic command for evaluating | ||
| 1295 | a Lisp expression interactively. It reads the expression using the | ||
| 1296 | minibuffer, so you can execute any expression on a buffer regardless of | ||
| 1297 | what the buffer contains. When the expression is evaluated, the current | ||
| 1298 | buffer is once again the buffer that was current when @kbd{M-:} was | ||
| 1299 | typed. | ||
| 1300 | |||
| 1301 | @kindex C-M-x @r{(Emacs-Lisp mode)} | ||
| 1302 | @findex eval-defun | ||
| 1303 | In Emacs-Lisp mode, the key @kbd{C-M-x} is bound to the command | ||
| 1304 | @code{eval-defun}, which parses the defun containing or following point | ||
| 1305 | as a Lisp expression and evaluates it. The value is printed in the echo | ||
| 1306 | area. This command is convenient for installing in the Lisp environment | ||
| 1307 | changes that you have just made in the text of a function definition. | ||
| 1308 | |||
| 1309 | @kbd{C-M-x} treats @code{defvar} expressions specially. Normally, | ||
| 1310 | evaluating a @code{defvar} expression does nothing if the variable it | ||
| 1311 | defines already has a value. But @kbd{C-M-x} unconditionally resets the | ||
| 1312 | variable to the initial value specified in the @code{defvar} expression. | ||
| 1313 | @code{defcustom} expressions are treated similarly. | ||
| 1314 | This special feature is convenient for debugging Lisp programs. | ||
| 1315 | Typing @kbd{C-M-x} on a @code{defface} expression reinitializes | ||
| 1316 | the face according to the @code{defface} specification. | ||
| 1317 | |||
| 1318 | @kindex C-x C-e | ||
| 1319 | @findex eval-last-sexp | ||
| 1320 | The command @kbd{C-x C-e} (@code{eval-last-sexp}) evaluates the Lisp | ||
| 1321 | expression preceding point in the buffer, and displays the value in the | ||
| 1322 | echo area. It is available in all major modes, not just Emacs-Lisp | ||
| 1323 | mode. It does not treat @code{defvar} specially. | ||
| 1324 | |||
| 1325 | When the result of an evaluation is an integer, you can type | ||
| 1326 | @kbd{C-x C-e} a second time to display the value of the integer result | ||
| 1327 | in additional formats (octal, hexadecimal, and character). | ||
| 1328 | |||
| 1329 | If @kbd{C-x C-e}, or @kbd{M-:} is given a numeric argument, it | ||
| 1330 | inserts the value into the current buffer at point, rather than | ||
| 1331 | displaying it in the echo area. The argument's value does not matter. | ||
| 1332 | @kbd{C-M-x} with a numeric argument instruments the function | ||
| 1333 | definition for Edebug (@pxref{Instrumenting, Instrumenting for Edebug,, elisp, the Emacs Lisp Reference Manual}). | ||
| 1334 | |||
| 1335 | @findex eval-region | ||
| 1336 | @findex eval-buffer | ||
| 1337 | The most general command for evaluating Lisp expressions from a buffer | ||
| 1338 | is @code{eval-region}. @kbd{M-x eval-region} parses the text of the | ||
| 1339 | region as one or more Lisp expressions, evaluating them one by one. | ||
| 1340 | @kbd{M-x eval-buffer} is similar but evaluates the entire | ||
| 1341 | buffer. This is a reasonable way to install the contents of a file of | ||
| 1342 | Lisp code that you are ready to test. Later, as you find bugs and | ||
| 1343 | change individual functions, use @kbd{C-M-x} on each function that you | ||
| 1344 | change. This keeps the Lisp world in step with the source file. | ||
| 1345 | |||
| 1346 | @vindex eval-expression-print-level | ||
| 1347 | @vindex eval-expression-print-length | ||
| 1348 | @vindex eval-expression-debug-on-error | ||
| 1349 | The two customizable variables @code{eval-expression-print-level} and | ||
| 1350 | @code{eval-expression-print-length} control the maximum depth and length | ||
| 1351 | of lists to print in the result of the evaluation commands before | ||
| 1352 | abbreviating them. @code{eval-expression-debug-on-error} controls | ||
| 1353 | whether evaluation errors invoke the debugger when these commands are | ||
| 1354 | used; its default is @code{t}. | ||
| 1355 | |||
| 1356 | @node Lisp Interaction | ||
| 1357 | @section Lisp Interaction Buffers | ||
| 1358 | |||
| 1359 | The buffer @samp{*scratch*} which is selected when Emacs starts up is | ||
| 1360 | provided for evaluating Lisp expressions interactively inside Emacs. | ||
| 1361 | |||
| 1362 | The simplest way to use the @samp{*scratch*} buffer is to insert Lisp | ||
| 1363 | expressions and type @kbd{C-j} after each expression. This command | ||
| 1364 | reads the Lisp expression before point, evaluates it, and inserts the | ||
| 1365 | value in printed representation before point. The result is a complete | ||
| 1366 | typescript of the expressions you have evaluated and their values. | ||
| 1367 | |||
| 1368 | The @samp{*scratch*} buffer's major mode is Lisp Interaction mode, which | ||
| 1369 | is the same as Emacs-Lisp mode except for the binding of @kbd{C-j}. | ||
| 1370 | |||
| 1371 | @findex lisp-interaction-mode | ||
| 1372 | The rationale for this feature is that Emacs must have a buffer when | ||
| 1373 | it starts up, but that buffer is not useful for editing files since a | ||
| 1374 | new buffer is made for every file that you visit. The Lisp interpreter | ||
| 1375 | typescript is the most useful thing I can think of for the initial | ||
| 1376 | buffer to do. Type @kbd{M-x lisp-interaction-mode} to put the current | ||
| 1377 | buffer in Lisp Interaction mode. | ||
| 1378 | |||
| 1379 | @findex ielm | ||
| 1380 | An alternative way of evaluating Emacs Lisp expressions interactively | ||
| 1381 | is to use Inferior Emacs-Lisp mode, which provides an interface rather | ||
| 1382 | like Shell mode (@pxref{Shell Mode}) for evaluating Emacs Lisp | ||
| 1383 | expressions. Type @kbd{M-x ielm} to create an @samp{*ielm*} buffer | ||
| 1384 | which uses this mode. For more information see that command's | ||
| 1385 | documentation. | ||
| 1386 | |||
| 1387 | @node External Lisp | ||
| 1388 | @section Running an External Lisp | ||
| 1389 | |||
| 1390 | Emacs has facilities for running programs in other Lisp systems. You can | ||
| 1391 | run a Lisp process as an inferior of Emacs, and pass expressions to it to | ||
| 1392 | be evaluated. You can also pass changed function definitions directly from | ||
| 1393 | the Emacs buffers in which you edit the Lisp programs to the inferior Lisp | ||
| 1394 | process. | ||
| 1395 | |||
| 1396 | @findex run-lisp | ||
| 1397 | @vindex inferior-lisp-program | ||
| 1398 | @kindex C-x C-z | ||
| 1399 | To run an inferior Lisp process, type @kbd{M-x run-lisp}. This runs | ||
| 1400 | the program named @code{lisp}, the same program you would run by typing | ||
| 1401 | @code{lisp} as a shell command, with both input and output going through | ||
| 1402 | an Emacs buffer named @samp{*lisp*}. That is to say, any ``terminal | ||
| 1403 | output'' from Lisp will go into the buffer, advancing point, and any | ||
| 1404 | ``terminal input'' for Lisp comes from text in the buffer. (You can | ||
| 1405 | change the name of the Lisp executable file by setting the variable | ||
| 1406 | @code{inferior-lisp-program}.) | ||
| 1407 | |||
| 1408 | To give input to Lisp, go to the end of the buffer and type the input, | ||
| 1409 | terminated by @key{RET}. The @samp{*lisp*} buffer is in Inferior Lisp | ||
| 1410 | mode, which combines the special characteristics of Lisp mode with most | ||
| 1411 | of the features of Shell mode (@pxref{Shell Mode}). The definition of | ||
| 1412 | @key{RET} to send a line to a subprocess is one of the features of Shell | ||
| 1413 | mode. | ||
| 1414 | |||
| 1415 | @findex lisp-mode | ||
| 1416 | For the source files of programs to run in external Lisps, use Lisp | ||
| 1417 | mode. You can switch to this mode with @kbd{M-x lisp-mode}, and it is | ||
| 1418 | used automatically for files whose names end in @file{.l}, | ||
| 1419 | @file{.lsp}, or @file{.lisp}. | ||
| 1420 | |||
| 1421 | @kindex C-M-x @r{(Lisp mode)} | ||
| 1422 | @findex lisp-eval-defun | ||
| 1423 | When you edit a function in a Lisp program you are running, the easiest | ||
| 1424 | way to send the changed definition to the inferior Lisp process is the key | ||
| 1425 | @kbd{C-M-x}. In Lisp mode, this runs the function @code{lisp-eval-defun}, | ||
| 1426 | which finds the defun around or following point and sends it as input to | ||
| 1427 | the Lisp process. (Emacs can send input to any inferior process regardless | ||
| 1428 | of what buffer is current.) | ||
| 1429 | |||
| 1430 | Contrast the meanings of @kbd{C-M-x} in Lisp mode (for editing | ||
| 1431 | programs to be run in another Lisp system) and Emacs-Lisp mode (for | ||
| 1432 | editing Lisp programs to be run in Emacs; see @pxref{Lisp Eval}): in | ||
| 1433 | both modes it has the effect of installing the function definition | ||
| 1434 | that point is in, but the way of doing so is different according to | ||
| 1435 | where the relevant Lisp environment is found. | ||
| 1436 | |||
| 1437 | |||
| 1438 | @ignore | ||
| 1439 | arch-tag: 9c3c2f71-b332-4144-8500-3ff9945a50ed | ||
| 1440 | @end ignore | ||
diff --git a/doc/emacs/cal-xtra.texi b/doc/emacs/cal-xtra.texi new file mode 100644 index 00000000000..61d519cbd12 --- /dev/null +++ b/doc/emacs/cal-xtra.texi | |||
| @@ -0,0 +1,838 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | @c | ||
| 5 | @c This file is included either in emacs-xtra.texi (when producing the | ||
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | ||
| 7 | |||
| 8 | @c Moved here from the Emacs Lisp Reference Manual, 2005-03-26. | ||
| 9 | @node Advanced Calendar/Diary Usage | ||
| 10 | @section Customizing the Calendar and Diary | ||
| 11 | |||
| 12 | There are many customizations that you can use to make the calendar and | ||
| 13 | diary suit your personal tastes. | ||
| 14 | |||
| 15 | @menu | ||
| 16 | * Calendar Customizing:: Defaults you can set. | ||
| 17 | * Holiday Customizing:: Defining your own holidays. | ||
| 18 | * Date Display Format:: Changing the format. | ||
| 19 | * Time Display Format:: Changing the format. | ||
| 20 | * Diary Customizing:: Defaults you can set. | ||
| 21 | * Hebrew/Islamic Entries:: How to obtain them. | ||
| 22 | * Fancy Diary Display:: Enhancing the diary display, sorting entries, | ||
| 23 | using included diary files. | ||
| 24 | * Sexp Diary Entries:: Fancy things you can do. | ||
| 25 | @end menu | ||
| 26 | |||
| 27 | @node Calendar Customizing | ||
| 28 | @subsection Customizing the Calendar | ||
| 29 | @vindex calendar-holiday-marker | ||
| 30 | @vindex diary-entry-marker | ||
| 31 | The variable @code{calendar-holiday-marker} specifies how to mark a | ||
| 32 | date as being a holiday. Its value may be a single-character string | ||
| 33 | to insert next to the date, or a face name to use for displaying the | ||
| 34 | date. Likewise, the variable @code{diary-entry-marker} specifies how | ||
| 35 | to mark a date that has diary entries. The calendar creates faces | ||
| 36 | named @code{holiday-face} and @code{diary-face} for these purposes; | ||
| 37 | those symbols are the default values of these variables. | ||
| 38 | |||
| 39 | @vindex calendar-load-hook | ||
| 40 | The variable @code{calendar-load-hook} is a normal hook run when the | ||
| 41 | calendar package is first loaded (before actually starting to display | ||
| 42 | the calendar). | ||
| 43 | |||
| 44 | @vindex initial-calendar-window-hook | ||
| 45 | Starting the calendar runs the normal hook | ||
| 46 | @code{initial-calendar-window-hook}. Recomputation of the calendar | ||
| 47 | display does not run this hook. But if you leave the calendar with the | ||
| 48 | @kbd{q} command and reenter it, the hook runs again.@refill | ||
| 49 | |||
| 50 | @vindex today-visible-calendar-hook | ||
| 51 | The variable @code{today-visible-calendar-hook} is a normal hook run | ||
| 52 | after the calendar buffer has been prepared with the calendar when the | ||
| 53 | current date is visible in the window. One use of this hook is to | ||
| 54 | replace today's date with asterisks; to do that, use the hook function | ||
| 55 | @code{calendar-star-date}. | ||
| 56 | |||
| 57 | @findex calendar-star-date | ||
| 58 | @example | ||
| 59 | (add-hook 'today-visible-calendar-hook 'calendar-star-date) | ||
| 60 | @end example | ||
| 61 | |||
| 62 | @noindent | ||
| 63 | Another standard hook function marks the current date, either by | ||
| 64 | changing its face or by adding an asterisk. Here's how to use it: | ||
| 65 | |||
| 66 | @findex calendar-mark-today | ||
| 67 | @example | ||
| 68 | (add-hook 'today-visible-calendar-hook 'calendar-mark-today) | ||
| 69 | @end example | ||
| 70 | |||
| 71 | @noindent | ||
| 72 | @vindex calendar-today-marker | ||
| 73 | The variable @code{calendar-today-marker} specifies how to mark | ||
| 74 | today's date. Its value should be a single-character string to insert | ||
| 75 | next to the date or a face name to use for displaying the date. A | ||
| 76 | face named @code{calendar-today-face} is provided for this purpose; | ||
| 77 | that symbol is the default for this variable. | ||
| 78 | |||
| 79 | @vindex today-invisible-calendar-hook | ||
| 80 | @noindent | ||
| 81 | A similar normal hook, @code{today-invisible-calendar-hook} is run if | ||
| 82 | the current date is @emph{not} visible in the window. | ||
| 83 | |||
| 84 | @vindex calendar-move-hook | ||
| 85 | Each of the calendar cursor motion commands runs the hook | ||
| 86 | @code{calendar-move-hook} after it moves the cursor. | ||
| 87 | |||
| 88 | @node Holiday Customizing | ||
| 89 | @subsection Customizing the Holidays | ||
| 90 | |||
| 91 | @vindex calendar-holidays | ||
| 92 | @vindex christian-holidays | ||
| 93 | @vindex hebrew-holidays | ||
| 94 | @vindex islamic-holidays | ||
| 95 | Emacs knows about holidays defined by entries on one of several lists. | ||
| 96 | You can customize these lists of holidays to your own needs, adding or | ||
| 97 | deleting holidays. The lists of holidays that Emacs uses are for | ||
| 98 | general holidays (@code{general-holidays}), local holidays | ||
| 99 | (@code{local-holidays}), Christian holidays (@code{christian-holidays}), | ||
| 100 | Hebrew (Jewish) holidays (@code{hebrew-holidays}), Islamic (Muslim) | ||
| 101 | holidays (@code{islamic-holidays}), and other holidays | ||
| 102 | (@code{other-holidays}). | ||
| 103 | |||
| 104 | @vindex general-holidays | ||
| 105 | The general holidays are, by default, holidays common throughout the | ||
| 106 | United States. To eliminate these holidays, set @code{general-holidays} | ||
| 107 | to @code{nil}. | ||
| 108 | |||
| 109 | @vindex local-holidays | ||
| 110 | There are no default local holidays (but sites may supply some). You | ||
| 111 | can set the variable @code{local-holidays} to any list of holidays, as | ||
| 112 | described below. | ||
| 113 | |||
| 114 | @vindex all-christian-calendar-holidays | ||
| 115 | @vindex all-hebrew-calendar-holidays | ||
| 116 | @vindex all-islamic-calendar-holidays | ||
| 117 | By default, Emacs does not include all the holidays of the religions | ||
| 118 | that it knows, only those commonly found in secular calendars. For a | ||
| 119 | more extensive collection of religious holidays, you can set any (or | ||
| 120 | all) of the variables @code{all-christian-calendar-holidays}, | ||
| 121 | @code{all-hebrew-calendar-holidays}, or | ||
| 122 | @code{all-islamic-calendar-holidays} to @code{t}. If you want to | ||
| 123 | eliminate the religious holidays, set any or all of the corresponding | ||
| 124 | variables @code{christian-holidays}, @code{hebrew-holidays}, and | ||
| 125 | @code{islamic-holidays} to @code{nil}.@refill | ||
| 126 | |||
| 127 | @vindex other-holidays | ||
| 128 | You can set the variable @code{other-holidays} to any list of | ||
| 129 | holidays. This list, normally empty, is intended for individual use. | ||
| 130 | |||
| 131 | @cindex holiday forms | ||
| 132 | Each of the lists (@code{general-holidays}, @code{local-holidays}, | ||
| 133 | @code{christian-holidays}, @code{hebrew-holidays}, | ||
| 134 | @code{islamic-holidays}, and @code{other-holidays}) is a list of | ||
| 135 | @dfn{holiday forms}, each holiday form describing a holiday (or | ||
| 136 | sometimes a list of holidays). | ||
| 137 | |||
| 138 | Here is a table of the possible kinds of holiday form. Day numbers | ||
| 139 | and month numbers count starting from 1, but ``dayname'' numbers | ||
| 140 | count Sunday as 0. The element @var{string} is always the | ||
| 141 | name of the holiday, as a string. | ||
| 142 | |||
| 143 | @table @code | ||
| 144 | @item (holiday-fixed @var{month} @var{day} @var{string}) | ||
| 145 | A fixed date on the Gregorian calendar. | ||
| 146 | |||
| 147 | @item (holiday-float @var{month} @var{dayname} @var{k} @var{string}) | ||
| 148 | The @var{k}th @var{dayname} in @var{month} on the Gregorian calendar | ||
| 149 | (@var{dayname}=0 for Sunday, and so on); negative @var{k} means count back | ||
| 150 | from the end of the month. | ||
| 151 | |||
| 152 | @item (holiday-hebrew @var{month} @var{day} @var{string}) | ||
| 153 | A fixed date on the Hebrew calendar. | ||
| 154 | |||
| 155 | @item (holiday-islamic @var{month} @var{day} @var{string}) | ||
| 156 | A fixed date on the Islamic calendar. | ||
| 157 | |||
| 158 | @item (holiday-julian @var{month} @var{day} @var{string}) | ||
| 159 | A fixed date on the Julian calendar. | ||
| 160 | |||
| 161 | @item (holiday-sexp @var{sexp} @var{string}) | ||
| 162 | A date calculated by the Lisp expression @var{sexp}. The expression | ||
| 163 | should use the variable @code{year} to compute and return the date of a | ||
| 164 | holiday, or @code{nil} if the holiday doesn't happen this year. The | ||
| 165 | value of @var{sexp} must represent the date as a list of the form | ||
| 166 | @code{(@var{month} @var{day} @var{year})}. | ||
| 167 | |||
| 168 | @item (if @var{condition} @var{holiday-form}) | ||
| 169 | A holiday that happens only if @var{condition} is true. | ||
| 170 | |||
| 171 | @item (@var{function} @r{[}@var{args}@r{]}) | ||
| 172 | A list of dates calculated by the function @var{function}, called with | ||
| 173 | arguments @var{args}. | ||
| 174 | @end table | ||
| 175 | |||
| 176 | For example, suppose you want to add Bastille Day, celebrated in | ||
| 177 | France on July 14. You can do this as follows: | ||
| 178 | |||
| 179 | @smallexample | ||
| 180 | (setq other-holidays '((holiday-fixed 7 14 "Bastille Day"))) | ||
| 181 | @end smallexample | ||
| 182 | |||
| 183 | @noindent | ||
| 184 | The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the | ||
| 185 | fourteenth day of the seventh month (July). | ||
| 186 | |||
| 187 | Many holidays occur on a specific day of the week, at a specific time | ||
| 188 | of month. Here is a holiday form describing Hurricane Supplication Day, | ||
| 189 | celebrated in the Virgin Islands on the fourth Monday in August: | ||
| 190 | |||
| 191 | @smallexample | ||
| 192 | (holiday-float 8 1 4 "Hurricane Supplication Day") | ||
| 193 | @end smallexample | ||
| 194 | |||
| 195 | @noindent | ||
| 196 | Here the 8 specifies August, the 1 specifies Monday (Sunday is 0, | ||
| 197 | Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in | ||
| 198 | the month (1 specifies the first occurrence, 2 the second occurrence, | ||
| 199 | @minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and | ||
| 200 | so on). | ||
| 201 | |||
| 202 | You can specify holidays that occur on fixed days of the Hebrew, | ||
| 203 | Islamic, and Julian calendars too. For example, | ||
| 204 | |||
| 205 | @smallexample | ||
| 206 | (setq other-holidays | ||
| 207 | '((holiday-hebrew 10 2 "Last day of Hanukkah") | ||
| 208 | (holiday-islamic 3 12 "Mohammed's Birthday") | ||
| 209 | (holiday-julian 4 2 "Jefferson's Birthday"))) | ||
| 210 | @end smallexample | ||
| 211 | |||
| 212 | @noindent | ||
| 213 | adds the last day of Hanukkah (since the Hebrew months are numbered with | ||
| 214 | 1 starting from Nisan), the Islamic feast celebrating Mohammed's | ||
| 215 | birthday (since the Islamic months are numbered from 1 starting with | ||
| 216 | Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the | ||
| 217 | Julian calendar. | ||
| 218 | |||
| 219 | To include a holiday conditionally, use either Emacs Lisp's @code{if} or the | ||
| 220 | @code{holiday-sexp} form. For example, American presidential elections | ||
| 221 | occur on the first Tuesday after the first Monday in November of years | ||
| 222 | divisible by 4: | ||
| 223 | |||
| 224 | @smallexample | ||
| 225 | (holiday-sexp '(if (= 0 (% year 4)) | ||
| 226 | (calendar-gregorian-from-absolute | ||
| 227 | (1+ (calendar-dayname-on-or-before | ||
| 228 | 1 (+ 6 (calendar-absolute-from-gregorian | ||
| 229 | (list 11 1 year))))))) | ||
| 230 | "US Presidential Election") | ||
| 231 | @end smallexample | ||
| 232 | |||
| 233 | @noindent | ||
| 234 | or | ||
| 235 | |||
| 236 | @smallexample | ||
| 237 | (if (= 0 (% displayed-year 4)) | ||
| 238 | (fixed 11 | ||
| 239 | (extract-calendar-day | ||
| 240 | (calendar-gregorian-from-absolute | ||
| 241 | (1+ (calendar-dayname-on-or-before | ||
| 242 | 1 (+ 6 (calendar-absolute-from-gregorian | ||
| 243 | (list 11 1 displayed-year))))))) | ||
| 244 | "US Presidential Election")) | ||
| 245 | @end smallexample | ||
| 246 | |||
| 247 | Some holidays just don't fit into any of these forms because special | ||
| 248 | calculations are involved in their determination. In such cases you | ||
| 249 | must write a Lisp function to do the calculation. To include eclipses, | ||
| 250 | for example, add @code{(eclipses)} to @code{other-holidays} | ||
| 251 | and write an Emacs Lisp function @code{eclipses} that returns a | ||
| 252 | (possibly empty) list of the relevant Gregorian dates among the range | ||
| 253 | visible in the calendar window, with descriptive strings, like this: | ||
| 254 | |||
| 255 | @smallexample | ||
| 256 | (((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... ) | ||
| 257 | @end smallexample | ||
| 258 | |||
| 259 | @node Date Display Format | ||
| 260 | @subsection Date Display Format | ||
| 261 | @vindex calendar-date-display-form | ||
| 262 | |||
| 263 | You can customize the manner of displaying dates in the diary, in mode | ||
| 264 | lines, and in messages by setting @code{calendar-date-display-form}. | ||
| 265 | This variable holds a list of expressions that can involve the variables | ||
| 266 | @code{month}, @code{day}, and @code{year}, which are all numbers in | ||
| 267 | string form, and @code{monthname} and @code{dayname}, which are both | ||
| 268 | alphabetic strings. In the American style, the default value of this | ||
| 269 | list is as follows: | ||
| 270 | |||
| 271 | @smallexample | ||
| 272 | ((if dayname (concat dayname ", ")) monthname " " day ", " year) | ||
| 273 | @end smallexample | ||
| 274 | |||
| 275 | @noindent | ||
| 276 | while in the European style this value is the default: | ||
| 277 | |||
| 278 | @smallexample | ||
| 279 | ((if dayname (concat dayname ", ")) day " " monthname " " year) | ||
| 280 | @end smallexample | ||
| 281 | |||
| 282 | @noindent | ||
| 283 | The ISO standard date representation is this: | ||
| 284 | |||
| 285 | @smallexample | ||
| 286 | (year "-" month "-" day) | ||
| 287 | @end smallexample | ||
| 288 | |||
| 289 | @noindent | ||
| 290 | This specifies a typical American format: | ||
| 291 | |||
| 292 | @smallexample | ||
| 293 | (month "/" day "/" (substring year -2)) | ||
| 294 | @end smallexample | ||
| 295 | |||
| 296 | @node Time Display Format | ||
| 297 | @subsection Time Display Format | ||
| 298 | @vindex calendar-time-display-form | ||
| 299 | |||
| 300 | The calendar and diary by default display times of day in the | ||
| 301 | conventional American style with the hours from 1 through 12, minutes, | ||
| 302 | and either @samp{am} or @samp{pm}. If you prefer the European style, | ||
| 303 | also known in the US as military, in which the hours go from 00 to 23, | ||
| 304 | you can alter the variable @code{calendar-time-display-form}. This | ||
| 305 | variable is a list of expressions that can involve the variables | ||
| 306 | @code{12-hours}, @code{24-hours}, and @code{minutes}, which are all | ||
| 307 | numbers in string form, and @code{am-pm} and @code{time-zone}, which are | ||
| 308 | both alphabetic strings. The default value of | ||
| 309 | @code{calendar-time-display-form} is as follows: | ||
| 310 | |||
| 311 | @smallexample | ||
| 312 | (12-hours ":" minutes am-pm | ||
| 313 | (if time-zone " (") time-zone (if time-zone ")")) | ||
| 314 | @end smallexample | ||
| 315 | |||
| 316 | @noindent | ||
| 317 | Here is a value that provides European style times: | ||
| 318 | |||
| 319 | @smallexample | ||
| 320 | (24-hours ":" minutes | ||
| 321 | (if time-zone " (") time-zone (if time-zone ")")) | ||
| 322 | @end smallexample | ||
| 323 | |||
| 324 | @node Diary Customizing | ||
| 325 | @subsection Customizing the Diary | ||
| 326 | |||
| 327 | @vindex holidays-in-diary-buffer | ||
| 328 | Ordinarily, the mode line of the diary buffer window indicates any | ||
| 329 | holidays that fall on the date of the diary entries. The process of | ||
| 330 | checking for holidays can take several seconds, so including holiday | ||
| 331 | information delays the display of the diary buffer noticeably. If you'd | ||
| 332 | prefer to have a faster display of the diary buffer but without the | ||
| 333 | holiday information, set the variable @code{holidays-in-diary-buffer} to | ||
| 334 | @code{nil}.@refill | ||
| 335 | |||
| 336 | @vindex number-of-diary-entries | ||
| 337 | The variable @code{number-of-diary-entries} controls the number of | ||
| 338 | days of diary entries to be displayed at one time. It affects the | ||
| 339 | initial display when @code{view-diary-entries-initially} is @code{t}, as | ||
| 340 | well as the command @kbd{M-x diary}. For example, the default value is | ||
| 341 | 1, which says to display only the current day's diary entries. If the | ||
| 342 | value is 2, both the current day's and the next day's entries are | ||
| 343 | displayed. The value can also be a vector of seven elements: for | ||
| 344 | example, if the value is @code{[0 2 2 2 2 4 1]} then no diary entries | ||
| 345 | appear on Sunday, the current date's and the next day's diary entries | ||
| 346 | appear Monday through Thursday, Friday through Monday's entries appear | ||
| 347 | on Friday, while on Saturday only that day's entries appear. | ||
| 348 | |||
| 349 | @vindex print-diary-entries-hook | ||
| 350 | @findex print-diary-entries | ||
| 351 | The variable @code{print-diary-entries-hook} is a normal hook run | ||
| 352 | after preparation of a temporary buffer containing just the diary | ||
| 353 | entries currently visible in the diary buffer. (The other, irrelevant | ||
| 354 | diary entries are really absent from the temporary buffer; in the diary | ||
| 355 | buffer, they are merely hidden.) The default value of this hook does | ||
| 356 | the printing with the command @code{lpr-buffer}. If you want to use a | ||
| 357 | different command to do the printing, just change the value of this | ||
| 358 | hook. Other uses might include, for example, rearranging the lines into | ||
| 359 | order by day and time. | ||
| 360 | |||
| 361 | @vindex diary-date-forms | ||
| 362 | You can customize the form of dates in your diary file, if neither the | ||
| 363 | standard American nor European styles suits your needs, by setting the | ||
| 364 | variable @code{diary-date-forms}. This variable is a list of patterns | ||
| 365 | for recognizing a date. Each date pattern is a list whose elements may | ||
| 366 | be regular expressions (@pxref{Regular Expressions,,, elisp, the Emacs | ||
| 367 | Lisp Reference Manual}) or the symbols @code{month}, @code{day}, | ||
| 368 | @code{year}, @code{monthname}, and @code{dayname}. All these elements | ||
| 369 | serve as patterns that match certain kinds of text in the diary file. | ||
| 370 | In order for the date pattern, as a whole, to match, all of its elements | ||
| 371 | must match consecutively. | ||
| 372 | |||
| 373 | A regular expression in a date pattern matches in its usual fashion, | ||
| 374 | using the standard syntax table altered so that @samp{*} is a word | ||
| 375 | constituent. | ||
| 376 | |||
| 377 | The symbols @code{month}, @code{day}, @code{year}, @code{monthname}, | ||
| 378 | and @code{dayname} match the month number, day number, year number, | ||
| 379 | month name, and day name of the date being considered. The symbols that | ||
| 380 | match numbers allow leading zeros; those that match names allow | ||
| 381 | three-letter abbreviations and capitalization. All the symbols can | ||
| 382 | match @samp{*}; since @samp{*} in a diary entry means ``any day'', ``any | ||
| 383 | month'', and so on, it should match regardless of the date being | ||
| 384 | considered. | ||
| 385 | |||
| 386 | The default value of @code{diary-date-forms} in the American style is | ||
| 387 | this: | ||
| 388 | |||
| 389 | @example | ||
| 390 | ((month "/" day "[^/0-9]") | ||
| 391 | (month "/" day "/" year "[^0-9]") | ||
| 392 | (monthname " *" day "[^,0-9]") | ||
| 393 | (monthname " *" day ", *" year "[^0-9]") | ||
| 394 | (dayname "\\W")) | ||
| 395 | @end example | ||
| 396 | |||
| 397 | The date patterns in the list must be @emph{mutually exclusive} and | ||
| 398 | must not match any portion of the diary entry itself, just the date and | ||
| 399 | one character of whitespace. If, to be mutually exclusive, the pattern | ||
| 400 | must match a portion of the diary entry text---beyond the whitespace | ||
| 401 | that ends the date---then the first element of the date pattern | ||
| 402 | @emph{must} be @code{backup}. This causes the date recognizer to back | ||
| 403 | up to the beginning of the current word of the diary entry, after | ||
| 404 | finishing the match. Even if you use @code{backup}, the date pattern | ||
| 405 | must absolutely not match more than a portion of the first word of the | ||
| 406 | diary entry. The default value of @code{diary-date-forms} in the | ||
| 407 | European style is this list: | ||
| 408 | |||
| 409 | @example | ||
| 410 | ((day "/" month "[^/0-9]") | ||
| 411 | (day "/" month "/" year "[^0-9]") | ||
| 412 | (backup day " *" monthname "\\W+\\<[^*0-9]") | ||
| 413 | (day " *" monthname " *" year "[^0-9]") | ||
| 414 | (dayname "\\W")) | ||
| 415 | @end example | ||
| 416 | |||
| 417 | @noindent | ||
| 418 | Notice the use of @code{backup} in the third pattern, because it needs | ||
| 419 | to match part of a word beyond the date itself to distinguish it from | ||
| 420 | the fourth pattern. | ||
| 421 | |||
| 422 | @node Hebrew/Islamic Entries | ||
| 423 | @subsection Hebrew- and Islamic-Date Diary Entries | ||
| 424 | |||
| 425 | Your diary file can have entries based on Hebrew or Islamic dates, as | ||
| 426 | well as entries based on the world-standard Gregorian calendar. | ||
| 427 | However, because recognition of such entries is time-consuming and most | ||
| 428 | people don't use them, you must explicitly enable their use. If you | ||
| 429 | want the diary to recognize Hebrew-date diary entries, for example, | ||
| 430 | you must do this: | ||
| 431 | |||
| 432 | @vindex nongregorian-diary-listing-hook | ||
| 433 | @vindex nongregorian-diary-marking-hook | ||
| 434 | @findex list-hebrew-diary-entries | ||
| 435 | @findex mark-hebrew-diary-entries | ||
| 436 | @smallexample | ||
| 437 | (add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries) | ||
| 438 | (add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries) | ||
| 439 | @end smallexample | ||
| 440 | |||
| 441 | @noindent | ||
| 442 | If you want Islamic-date entries, do this: | ||
| 443 | |||
| 444 | @findex list-islamic-diary-entries | ||
| 445 | @findex mark-islamic-diary-entries | ||
| 446 | @smallexample | ||
| 447 | (add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries) | ||
| 448 | (add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries) | ||
| 449 | @end smallexample | ||
| 450 | |||
| 451 | Hebrew- and Islamic-date diary entries have the same formats as | ||
| 452 | Gregorian-date diary entries, except that @samp{H} precedes a Hebrew | ||
| 453 | date and @samp{I} precedes an Islamic date. Moreover, because the | ||
| 454 | Hebrew and Islamic month names are not uniquely specified by the first | ||
| 455 | three letters, you may not abbreviate them. For example, a diary entry | ||
| 456 | for the Hebrew date Heshvan 25 could look like this: | ||
| 457 | |||
| 458 | @smallexample | ||
| 459 | HHeshvan 25 Happy Hebrew birthday! | ||
| 460 | @end smallexample | ||
| 461 | |||
| 462 | @noindent | ||
| 463 | and would appear in the diary for any date that corresponds to Heshvan 25 | ||
| 464 | on the Hebrew calendar. And here is an Islamic-date diary entry that matches | ||
| 465 | Dhu al-Qada 25: | ||
| 466 | |||
| 467 | @smallexample | ||
| 468 | IDhu al-Qada 25 Happy Islamic birthday! | ||
| 469 | @end smallexample | ||
| 470 | |||
| 471 | As with Gregorian-date diary entries, Hebrew- and Islamic-date entries | ||
| 472 | are nonmarking if they are preceded with an ampersand (@samp{&}). | ||
| 473 | |||
| 474 | Here is a table of commands used in the calendar to create diary entries | ||
| 475 | that match the selected date and other dates that are similar in the Hebrew | ||
| 476 | or Islamic calendar: | ||
| 477 | |||
| 478 | @table @kbd | ||
| 479 | @item i h d | ||
| 480 | Add a diary entry for the Hebrew date corresponding to the selected date | ||
| 481 | (@code{insert-hebrew-diary-entry}). | ||
| 482 | @item i h m | ||
| 483 | Add a diary entry for the day of the Hebrew month corresponding to the | ||
| 484 | selected date (@code{insert-monthly-hebrew-diary-entry}). This diary | ||
| 485 | entry matches any date that has the same Hebrew day-within-month as the | ||
| 486 | selected date. | ||
| 487 | @item i h y | ||
| 488 | Add a diary entry for the day of the Hebrew year corresponding to the | ||
| 489 | selected date (@code{insert-yearly-hebrew-diary-entry}). This diary | ||
| 490 | entry matches any date which has the same Hebrew month and day-within-month | ||
| 491 | as the selected date. | ||
| 492 | @item i i d | ||
| 493 | Add a diary entry for the Islamic date corresponding to the selected date | ||
| 494 | (@code{insert-islamic-diary-entry}). | ||
| 495 | @item i i m | ||
| 496 | Add a diary entry for the day of the Islamic month corresponding to the | ||
| 497 | selected date (@code{insert-monthly-islamic-diary-entry}). | ||
| 498 | @item i i y | ||
| 499 | Add a diary entry for the day of the Islamic year corresponding to the | ||
| 500 | selected date (@code{insert-yearly-islamic-diary-entry}). | ||
| 501 | @end table | ||
| 502 | |||
| 503 | @findex insert-hebrew-diary-entry | ||
| 504 | @findex insert-monthly-hebrew-diary-entry | ||
| 505 | @findex insert-yearly-hebrew-diary-entry | ||
| 506 | @findex insert-islamic-diary-entry | ||
| 507 | @findex insert-monthly-islamic-diary-entry | ||
| 508 | @findex insert-yearly-islamic-diary-entry | ||
| 509 | These commands work much like the corresponding commands for ordinary | ||
| 510 | diary entries: they apply to the date that point is on in the calendar | ||
| 511 | window, and what they do is insert just the date portion of a diary entry | ||
| 512 | at the end of your diary file. You must then insert the rest of the | ||
| 513 | diary entry. | ||
| 514 | |||
| 515 | @node Fancy Diary Display | ||
| 516 | @subsection Fancy Diary Display | ||
| 517 | @vindex diary-display-hook | ||
| 518 | @findex simple-diary-display | ||
| 519 | |||
| 520 | Diary display works by preparing the diary buffer and then running the | ||
| 521 | hook @code{diary-display-hook}. The default value of this hook | ||
| 522 | (@code{simple-diary-display}) hides the irrelevant diary entries and | ||
| 523 | then displays the buffer. However, if you specify the hook as follows, | ||
| 524 | |||
| 525 | @cindex diary buffer | ||
| 526 | @findex fancy-diary-display | ||
| 527 | @example | ||
| 528 | (add-hook 'diary-display-hook 'fancy-diary-display) | ||
| 529 | @end example | ||
| 530 | |||
| 531 | @noindent | ||
| 532 | this enables fancy diary display. It displays diary entries and | ||
| 533 | holidays by copying them into a special buffer that exists only for the | ||
| 534 | sake of display. Copying to a separate buffer provides an opportunity | ||
| 535 | to change the displayed text to make it prettier---for example, to sort | ||
| 536 | the entries by the dates they apply to. | ||
| 537 | |||
| 538 | As with simple diary display, you can print a hard copy of the buffer | ||
| 539 | with @code{print-diary-entries}. To print a hard copy of a day-by-day | ||
| 540 | diary for a week, position point on Sunday of that week, type | ||
| 541 | @kbd{7 d}, and then do @kbd{M-x print-diary-entries}. As usual, the | ||
| 542 | inclusion of the holidays slows down the display slightly; you can speed | ||
| 543 | things up by setting the variable @code{holidays-in-diary-buffer} to | ||
| 544 | @code{nil}. | ||
| 545 | |||
| 546 | @vindex diary-list-include-blanks | ||
| 547 | Ordinarily, the fancy diary buffer does not show days for which there are | ||
| 548 | no diary entries, even if that day is a holiday. If you want such days to be | ||
| 549 | shown in the fancy diary buffer, set the variable | ||
| 550 | @code{diary-list-include-blanks} to @code{t}.@refill | ||
| 551 | |||
| 552 | @cindex sorting diary entries | ||
| 553 | If you use the fancy diary display, you can use the normal hook | ||
| 554 | @code{list-diary-entries-hook} to sort each day's diary entries by their | ||
| 555 | time of day. Here's how: | ||
| 556 | |||
| 557 | @findex sort-diary-entries | ||
| 558 | @example | ||
| 559 | (add-hook 'list-diary-entries-hook 'sort-diary-entries t) | ||
| 560 | @end example | ||
| 561 | |||
| 562 | @noindent | ||
| 563 | For each day, this sorts diary entries that begin with a recognizable | ||
| 564 | time of day according to their times. Diary entries without times come | ||
| 565 | first within each day. | ||
| 566 | |||
| 567 | Fancy diary display also has the ability to process included diary | ||
| 568 | files. This permits a group of people to share a diary file for events | ||
| 569 | that apply to all of them. Lines in the diary file of this form: | ||
| 570 | |||
| 571 | @smallexample | ||
| 572 | #include "@var{filename}" | ||
| 573 | @end smallexample | ||
| 574 | |||
| 575 | @noindent | ||
| 576 | includes the diary entries from the file @var{filename} in the fancy | ||
| 577 | diary buffer. The include mechanism is recursive, so that included files | ||
| 578 | can include other files, and so on; you must be careful not to have a | ||
| 579 | cycle of inclusions, of course. Here is how to enable the include | ||
| 580 | facility: | ||
| 581 | |||
| 582 | @vindex list-diary-entries-hook | ||
| 583 | @vindex mark-diary-entries-hook | ||
| 584 | @findex include-other-diary-files | ||
| 585 | @findex mark-included-diary-files | ||
| 586 | @smallexample | ||
| 587 | (add-hook 'list-diary-entries-hook 'include-other-diary-files) | ||
| 588 | (add-hook 'mark-diary-entries-hook 'mark-included-diary-files) | ||
| 589 | @end smallexample | ||
| 590 | |||
| 591 | The include mechanism works only with the fancy diary display, because | ||
| 592 | ordinary diary display shows the entries directly from your diary file. | ||
| 593 | |||
| 594 | @node Sexp Diary Entries | ||
| 595 | @subsection Sexp Entries and the Fancy Diary Display | ||
| 596 | @cindex sexp diary entries | ||
| 597 | |||
| 598 | Sexp diary entries allow you to do more than just have complicated | ||
| 599 | conditions under which a diary entry applies. If you use the fancy | ||
| 600 | diary display, sexp entries can generate the text of the entry depending | ||
| 601 | on the date itself. For example, an anniversary diary entry can insert | ||
| 602 | the number of years since the anniversary date into the text of the | ||
| 603 | diary entry. Thus the @samp{%d} in this diary entry: | ||
| 604 | |||
| 605 | @findex diary-anniversary | ||
| 606 | @smallexample | ||
| 607 | %%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old) | ||
| 608 | @end smallexample | ||
| 609 | |||
| 610 | @noindent | ||
| 611 | gets replaced by the age, so on October 31, 1990 the entry appears in | ||
| 612 | the fancy diary buffer like this: | ||
| 613 | |||
| 614 | @smallexample | ||
| 615 | Arthur's birthday (42 years old) | ||
| 616 | @end smallexample | ||
| 617 | |||
| 618 | @noindent | ||
| 619 | If the diary file instead contains this entry: | ||
| 620 | |||
| 621 | @smallexample | ||
| 622 | %%(diary-anniversary 10 31 1948) Arthur's %d%s birthday | ||
| 623 | @end smallexample | ||
| 624 | |||
| 625 | @noindent | ||
| 626 | the entry in the fancy diary buffer for October 31, 1990 appears like this: | ||
| 627 | |||
| 628 | @smallexample | ||
| 629 | Arthur's 42nd birthday | ||
| 630 | @end smallexample | ||
| 631 | |||
| 632 | Similarly, cyclic diary entries can interpolate the number of repetitions | ||
| 633 | that have occurred: | ||
| 634 | |||
| 635 | @findex diary-cyclic | ||
| 636 | @smallexample | ||
| 637 | %%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time) | ||
| 638 | @end smallexample | ||
| 639 | |||
| 640 | @noindent | ||
| 641 | looks like this: | ||
| 642 | |||
| 643 | @smallexample | ||
| 644 | Renew medication (5th time) | ||
| 645 | @end smallexample | ||
| 646 | |||
| 647 | @noindent | ||
| 648 | in the fancy diary display on September 8, 1990. | ||
| 649 | |||
| 650 | There is an early reminder diary sexp that includes its entry in the | ||
| 651 | diary not only on the date of occurrence, but also on earlier dates. | ||
| 652 | For example, if you want a reminder a week before your anniversary, you | ||
| 653 | can use | ||
| 654 | |||
| 655 | @findex diary-remind | ||
| 656 | @smallexample | ||
| 657 | %%(diary-remind '(diary-anniversary 12 22 1968) 7) Ed's anniversary | ||
| 658 | @end smallexample | ||
| 659 | |||
| 660 | @noindent | ||
| 661 | and the fancy diary will show | ||
| 662 | @smallexample | ||
| 663 | Ed's anniversary | ||
| 664 | @end smallexample | ||
| 665 | @noindent | ||
| 666 | both on December 15 and on December 22. | ||
| 667 | |||
| 668 | @findex diary-date | ||
| 669 | The function @code{diary-date} applies to dates described by a month, | ||
| 670 | day, year combination, each of which can be an integer, a list of | ||
| 671 | integers, or @code{t}. The value @code{t} means all values. For | ||
| 672 | example, | ||
| 673 | |||
| 674 | @smallexample | ||
| 675 | %%(diary-date '(10 11 12) 22 t) Rake leaves | ||
| 676 | @end smallexample | ||
| 677 | |||
| 678 | @noindent | ||
| 679 | causes the fancy diary to show | ||
| 680 | |||
| 681 | @smallexample | ||
| 682 | Rake leaves | ||
| 683 | @end smallexample | ||
| 684 | |||
| 685 | @noindent | ||
| 686 | on October 22, November 22, and December 22 of every year. | ||
| 687 | |||
| 688 | @findex diary-float | ||
| 689 | The function @code{diary-float} allows you to describe diary entries | ||
| 690 | that apply to dates like the third Friday of November, or the last | ||
| 691 | Tuesday in April. The parameters are the @var{month}, @var{dayname}, | ||
| 692 | and an index @var{n}. The entry appears on the @var{n}th @var{dayname} | ||
| 693 | of @var{month}, where @var{dayname}=0 means Sunday, 1 means Monday, and | ||
| 694 | so on. If @var{n} is negative it counts backward from the end of | ||
| 695 | @var{month}. The value of @var{month} can be a list of months, a single | ||
| 696 | month, or @code{t} to specify all months. You can also use an optional | ||
| 697 | parameter @var{day} to specify the @var{n}th @var{dayname} of | ||
| 698 | @var{month} on or after/before @var{day}; the value of @var{day} defaults | ||
| 699 | to 1 if @var{n} is positive and to the last day of @var{month} if | ||
| 700 | @var{n} is negative. For example, | ||
| 701 | |||
| 702 | @smallexample | ||
| 703 | %%(diary-float t 1 -1) Pay rent | ||
| 704 | @end smallexample | ||
| 705 | |||
| 706 | @noindent | ||
| 707 | causes the fancy diary to show | ||
| 708 | |||
| 709 | @smallexample | ||
| 710 | Pay rent | ||
| 711 | @end smallexample | ||
| 712 | |||
| 713 | @noindent | ||
| 714 | on the last Monday of every month. | ||
| 715 | |||
| 716 | The generality of sexp diary entries lets you specify any diary | ||
| 717 | entry that you can describe algorithmically. A sexp diary entry | ||
| 718 | contains an expression that computes whether the entry applies to any | ||
| 719 | given date. If its value is non-@code{nil}, the entry applies to that | ||
| 720 | date; otherwise, it does not. The expression can use the variable | ||
| 721 | @code{date} to find the date being considered; its value is a list | ||
| 722 | (@var{month} @var{day} @var{year}) that refers to the Gregorian | ||
| 723 | calendar. | ||
| 724 | |||
| 725 | The sexp diary entry applies to a date when the expression's value | ||
| 726 | is non-@code{nil}, but some values have more specific meanings. If | ||
| 727 | the value is a string, that string is a description of the event which | ||
| 728 | occurs on that date. The value can also have the form | ||
| 729 | @code{(@var{mark} . @var{string})}; then @var{mark} specifies how to | ||
| 730 | mark the date in the calendar, and @var{string} is the description of | ||
| 731 | the event. If @var{mark} is a single-character string, that character | ||
| 732 | appears next to the date in the calendar. If @var{mark} is a face | ||
| 733 | name, the date is displayed in that face. If @var{mark} is | ||
| 734 | @code{nil}, that specifies no particular highlighting for the date. | ||
| 735 | |||
| 736 | Suppose you get paid on the 21st of the month if it is a weekday, and | ||
| 737 | on the Friday before if the 21st is on a weekend. Here is how to write | ||
| 738 | a sexp diary entry that matches those dates: | ||
| 739 | |||
| 740 | @smallexample | ||
| 741 | &%%(let ((dayname (calendar-day-of-week date)) | ||
| 742 | (day (car (cdr date)))) | ||
| 743 | (or (and (= day 21) (memq dayname '(1 2 3 4 5))) | ||
| 744 | (and (memq day '(19 20)) (= dayname 5))) | ||
| 745 | ) Pay check deposited | ||
| 746 | @end smallexample | ||
| 747 | |||
| 748 | The following sexp diary entries take advantage of the ability (in the fancy | ||
| 749 | diary display) to concoct diary entries whose text varies based on the date: | ||
| 750 | |||
| 751 | @findex diary-sunrise-sunset | ||
| 752 | @findex diary-phases-of-moon | ||
| 753 | @findex diary-day-of-year | ||
| 754 | @findex diary-iso-date | ||
| 755 | @findex diary-julian-date | ||
| 756 | @findex diary-astro-day-number | ||
| 757 | @findex diary-hebrew-date | ||
| 758 | @findex diary-islamic-date | ||
| 759 | @findex diary-french-date | ||
| 760 | @findex diary-mayan-date | ||
| 761 | @table @code | ||
| 762 | @item %%(diary-sunrise-sunset) | ||
| 763 | Make a diary entry for the local times of today's sunrise and sunset. | ||
| 764 | @item %%(diary-phases-of-moon) | ||
| 765 | Make a diary entry for the phases (quarters) of the moon. | ||
| 766 | @item %%(diary-day-of-year) | ||
| 767 | Make a diary entry with today's day number in the current year and the number | ||
| 768 | of days remaining in the current year. | ||
| 769 | @item %%(diary-iso-date) | ||
| 770 | Make a diary entry with today's equivalent ISO commercial date. | ||
| 771 | @item %%(diary-julian-date) | ||
| 772 | Make a diary entry with today's equivalent date on the Julian calendar. | ||
| 773 | @item %%(diary-astro-day-number) | ||
| 774 | Make a diary entry with today's equivalent astronomical (Julian) day number. | ||
| 775 | @item %%(diary-hebrew-date) | ||
| 776 | Make a diary entry with today's equivalent date on the Hebrew calendar. | ||
| 777 | @item %%(diary-islamic-date) | ||
| 778 | Make a diary entry with today's equivalent date on the Islamic calendar. | ||
| 779 | @item %%(diary-french-date) | ||
| 780 | Make a diary entry with today's equivalent date on the French Revolutionary | ||
| 781 | calendar. | ||
| 782 | @item %%(diary-mayan-date) | ||
| 783 | Make a diary entry with today's equivalent date on the Mayan calendar. | ||
| 784 | @end table | ||
| 785 | |||
| 786 | @noindent | ||
| 787 | Thus including the diary entry | ||
| 788 | |||
| 789 | @example | ||
| 790 | &%%(diary-hebrew-date) | ||
| 791 | @end example | ||
| 792 | |||
| 793 | @noindent | ||
| 794 | causes every day's diary display to contain the equivalent date on the | ||
| 795 | Hebrew calendar, if you are using the fancy diary display. (With simple | ||
| 796 | diary display, the line @samp{&%%(diary-hebrew-date)} appears in the | ||
| 797 | diary for any date, but does nothing particularly useful.) | ||
| 798 | |||
| 799 | These functions can be used to construct sexp diary entries based on | ||
| 800 | the Hebrew calendar in certain standard ways: | ||
| 801 | |||
| 802 | @cindex rosh hodesh | ||
| 803 | @findex diary-rosh-hodesh | ||
| 804 | @cindex parasha, weekly | ||
| 805 | @findex diary-parasha | ||
| 806 | @cindex candle lighting times | ||
| 807 | @findex diary-sabbath-candles | ||
| 808 | @cindex omer count | ||
| 809 | @findex diary-omer | ||
| 810 | @cindex yahrzeits | ||
| 811 | @findex diary-yahrzeit | ||
| 812 | @table @code | ||
| 813 | @item %%(diary-rosh-hodesh) | ||
| 814 | Make a diary entry that tells the occurrence and ritual announcement of each | ||
| 815 | new Hebrew month. | ||
| 816 | @item %%(diary-parasha) | ||
| 817 | Make a Saturday diary entry that tells the weekly synagogue scripture reading. | ||
| 818 | @item %%(diary-sabbath-candles) | ||
| 819 | Make a Friday diary entry that tells the @emph{local time} of Sabbath | ||
| 820 | candle lighting. | ||
| 821 | @item %%(diary-omer) | ||
| 822 | Make a diary entry that gives the omer count, when appropriate. | ||
| 823 | @item %%(diary-yahrzeit @var{month} @var{day} @var{year}) @var{name} | ||
| 824 | Make a diary entry marking the anniversary of a date of death. The date | ||
| 825 | is the @emph{Gregorian} (civil) date of death. The diary entry appears | ||
| 826 | on the proper Hebrew calendar anniversary and on the day before. (In | ||
| 827 | the European style, the order of the parameters is changed to @var{day}, | ||
| 828 | @var{month}, @var{year}.) | ||
| 829 | @end table | ||
| 830 | |||
| 831 | All the functions documented above take an optional argument | ||
| 832 | @var{mark} which specifies how to mark the date in the calendar display. | ||
| 833 | If one of these functions decides that it applies to a certain date, | ||
| 834 | it returns a value that contains @var{mark}. | ||
| 835 | |||
| 836 | @ignore | ||
| 837 | arch-tag: 52cb299f-fd1f-4616-bfe6-91b988669431 | ||
| 838 | @end ignore | ||
diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi new file mode 100644 index 00000000000..5182474622d --- /dev/null +++ b/doc/emacs/calendar.texi | |||
| @@ -0,0 +1,1687 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Calendar/Diary, Gnus, Dired, Top | ||
| 6 | @chapter The Calendar and the Diary | ||
| 7 | @cindex calendar | ||
| 8 | @findex calendar | ||
| 9 | |||
| 10 | Emacs provides the functions of a desk calendar, with a diary of | ||
| 11 | planned or past events. It also has facilities for managing your | ||
| 12 | appointments, and keeping track of how much time you spend working on | ||
| 13 | certain projects. | ||
| 14 | |||
| 15 | To enter the calendar, type @kbd{M-x calendar}; this displays a | ||
| 16 | three-month calendar centered on the current month, with point on the | ||
| 17 | current date. With a numeric argument, as in @kbd{C-u M-x calendar}, it | ||
| 18 | prompts you for the month and year to be the center of the three-month | ||
| 19 | calendar. The calendar uses its own buffer, whose major mode is | ||
| 20 | Calendar mode. | ||
| 21 | |||
| 22 | @kbd{Mouse-2} in the calendar brings up a menu of operations on a | ||
| 23 | particular date; @kbd{Mouse-3} brings up a menu of commonly used | ||
| 24 | calendar features that are independent of any particular date. To exit | ||
| 25 | the calendar, type @kbd{q}. | ||
| 26 | |||
| 27 | @iftex | ||
| 28 | This chapter describes the basic calendar features. | ||
| 29 | @inforef{Advanced Calendar/Diary Usage,, emacs-xtra}, for information | ||
| 30 | about more specialized features. | ||
| 31 | @end iftex | ||
| 32 | |||
| 33 | @menu | ||
| 34 | * Calendar Motion:: Moving through the calendar; selecting a date. | ||
| 35 | * Scroll Calendar:: Bringing earlier or later months onto the screen. | ||
| 36 | * Counting Days:: How many days are there between two dates? | ||
| 37 | * General Calendar:: Exiting or recomputing the calendar. | ||
| 38 | * Writing Calendar Files:: Writing calendars to files of various formats. | ||
| 39 | * Holidays:: Displaying dates of holidays. | ||
| 40 | * Sunrise/Sunset:: Displaying local times of sunrise and sunset. | ||
| 41 | * Lunar Phases:: Displaying phases of the moon. | ||
| 42 | * Other Calendars:: Converting dates to other calendar systems. | ||
| 43 | * Diary:: Displaying events from your diary. | ||
| 44 | * Appointments:: Reminders when it's time to do something. | ||
| 45 | * Importing Diary:: Converting diary events to/from other formats. | ||
| 46 | * Daylight Saving:: How to specify when daylight saving time is active. | ||
| 47 | * Time Intervals:: Keeping track of time intervals. | ||
| 48 | @ifnottex | ||
| 49 | * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. | ||
| 50 | @end ifnottex | ||
| 51 | @end menu | ||
| 52 | |||
| 53 | @node Calendar Motion | ||
| 54 | @section Movement in the Calendar | ||
| 55 | |||
| 56 | @cindex moving inside the calendar | ||
| 57 | Calendar mode provides commands to move through the calendar in | ||
| 58 | logical units of time such as days, weeks, months, and years. If you | ||
| 59 | move outside the three months originally displayed, the calendar | ||
| 60 | display ``scrolls'' automatically through time to make the selected | ||
| 61 | date visible. Moving to a date lets you view its holidays or diary | ||
| 62 | entries, or convert it to other calendars; moving by long time periods | ||
| 63 | is also useful simply to scroll the calendar. | ||
| 64 | |||
| 65 | @menu | ||
| 66 | * Calendar Unit Motion:: Moving by days, weeks, months, and years. | ||
| 67 | * Move to Beginning or End:: Moving to start/end of weeks, months, and years. | ||
| 68 | * Specified Dates:: Moving to the current date or another | ||
| 69 | specific date. | ||
| 70 | @end menu | ||
| 71 | |||
| 72 | @node Calendar Unit Motion | ||
| 73 | @subsection Motion by Standard Lengths of Time | ||
| 74 | |||
| 75 | The commands for movement in the calendar buffer parallel the | ||
| 76 | commands for movement in text. You can move forward and backward by | ||
| 77 | days, weeks, months, and years. | ||
| 78 | |||
| 79 | @table @kbd | ||
| 80 | @item C-f | ||
| 81 | Move point one day forward (@code{calendar-forward-day}). | ||
| 82 | @item C-b | ||
| 83 | Move point one day backward (@code{calendar-backward-day}). | ||
| 84 | @item C-n | ||
| 85 | Move point one week forward (@code{calendar-forward-week}). | ||
| 86 | @item C-p | ||
| 87 | Move point one week backward (@code{calendar-backward-week}). | ||
| 88 | @item M-@} | ||
| 89 | Move point one month forward (@code{calendar-forward-month}). | ||
| 90 | @item M-@{ | ||
| 91 | Move point one month backward (@code{calendar-backward-month}). | ||
| 92 | @item C-x ] | ||
| 93 | Move point one year forward (@code{calendar-forward-year}). | ||
| 94 | @item C-x [ | ||
| 95 | Move point one year backward (@code{calendar-backward-year}). | ||
| 96 | @end table | ||
| 97 | |||
| 98 | @kindex C-f @r{(Calendar mode)} | ||
| 99 | @findex calendar-forward-day | ||
| 100 | @kindex C-b @r{(Calendar mode)} | ||
| 101 | @findex calendar-backward-day | ||
| 102 | @kindex C-n @r{(Calendar mode)} | ||
| 103 | @findex calendar-forward-week | ||
| 104 | @kindex C-p @r{(Calendar mode)} | ||
| 105 | @findex calendar-backward-week | ||
| 106 | The day and week commands are natural analogues of the usual Emacs | ||
| 107 | commands for moving by characters and by lines. Just as @kbd{C-n} | ||
| 108 | usually moves to the same column in the following line, in Calendar | ||
| 109 | mode it moves to the same day in the following week. And @kbd{C-p} | ||
| 110 | moves to the same day in the previous week. | ||
| 111 | |||
| 112 | The arrow keys are equivalent to @kbd{C-f}, @kbd{C-b}, @kbd{C-n} and | ||
| 113 | @kbd{C-p}, just as they normally are in other modes. | ||
| 114 | |||
| 115 | @kindex M-@} @r{(Calendar mode)} | ||
| 116 | @findex calendar-forward-month | ||
| 117 | @kindex M-@{ @r{(Calendar mode)} | ||
| 118 | @findex calendar-backward-month | ||
| 119 | @kindex C-x ] @r{(Calendar mode)} | ||
| 120 | @findex calendar-forward-year | ||
| 121 | @kindex C-x [ @r{(Calendar mode)} | ||
| 122 | @findex calendar-forward-year | ||
| 123 | The commands for motion by months and years work like those for | ||
| 124 | weeks, but move a larger distance. The month commands @kbd{M-@}} and | ||
| 125 | @kbd{M-@{} move forward or backward by an entire month. The year | ||
| 126 | commands @kbd{C-x ]} and @w{@kbd{C-x [}} move forward or backward a | ||
| 127 | whole year. | ||
| 128 | |||
| 129 | The easiest way to remember these commands is to consider months and | ||
| 130 | years analogous to paragraphs and pages of text, respectively. But | ||
| 131 | the commands themselves are not quite analogous. The ordinary Emacs | ||
| 132 | paragraph commands move to the beginning or end of a paragraph, | ||
| 133 | whereas these month and year commands move by an entire month or an | ||
| 134 | entire year, keeping the same date within the month or year. | ||
| 135 | |||
| 136 | All these commands accept a numeric argument as a repeat count. | ||
| 137 | For convenience, the digit keys and the minus sign specify numeric | ||
| 138 | arguments in Calendar mode even without the Meta modifier. For example, | ||
| 139 | @kbd{100 C-f} moves point 100 days forward from its present location. | ||
| 140 | |||
| 141 | @node Move to Beginning or End | ||
| 142 | @subsection Beginning or End of Week, Month or Year | ||
| 143 | |||
| 144 | A week (or month, or year) is not just a quantity of days; we think of | ||
| 145 | weeks (months, years) as starting on particular dates. So Calendar mode | ||
| 146 | provides commands to move to the beginning or end of a week, month or | ||
| 147 | year: | ||
| 148 | |||
| 149 | @table @kbd | ||
| 150 | @kindex C-a @r{(Calendar mode)} | ||
| 151 | @findex calendar-beginning-of-week | ||
| 152 | @item C-a | ||
| 153 | Move point to start of week (@code{calendar-beginning-of-week}). | ||
| 154 | @kindex C-e @r{(Calendar mode)} | ||
| 155 | @findex calendar-end-of-week | ||
| 156 | @item C-e | ||
| 157 | Move point to end of week (@code{calendar-end-of-week}). | ||
| 158 | @kindex M-a @r{(Calendar mode)} | ||
| 159 | @findex calendar-beginning-of-month | ||
| 160 | @item M-a | ||
| 161 | Move point to start of month (@code{calendar-beginning-of-month}). | ||
| 162 | @kindex M-e @r{(Calendar mode)} | ||
| 163 | @findex calendar-end-of-month | ||
| 164 | @item M-e | ||
| 165 | Move point to end of month (@code{calendar-end-of-month}). | ||
| 166 | @kindex M-< @r{(Calendar mode)} | ||
| 167 | @findex calendar-beginning-of-year | ||
| 168 | @item M-< | ||
| 169 | Move point to start of year (@code{calendar-beginning-of-year}). | ||
| 170 | @kindex M-> @r{(Calendar mode)} | ||
| 171 | @findex calendar-end-of-year | ||
| 172 | @item M-> | ||
| 173 | Move point to end of year (@code{calendar-end-of-year}). | ||
| 174 | @end table | ||
| 175 | |||
| 176 | These commands also take numeric arguments as repeat counts, with the | ||
| 177 | repeat count indicating how many weeks, months, or years to move | ||
| 178 | backward or forward. | ||
| 179 | |||
| 180 | @vindex calendar-week-start-day | ||
| 181 | @cindex weeks, which day they start on | ||
| 182 | @cindex calendar, first day of week | ||
| 183 | By default, weeks begin on Sunday. To make them begin on Monday | ||
| 184 | instead, set the variable @code{calendar-week-start-day} to 1. | ||
| 185 | |||
| 186 | @node Specified Dates | ||
| 187 | @subsection Specified Dates | ||
| 188 | |||
| 189 | Calendar mode provides commands for moving to a particular date | ||
| 190 | specified in various ways. | ||
| 191 | |||
| 192 | @table @kbd | ||
| 193 | @item g d | ||
| 194 | Move point to specified date (@code{calendar-goto-date}). | ||
| 195 | @item g D | ||
| 196 | Move point to specified day of year (@code{calendar-goto-day-of-year}). | ||
| 197 | @item g w | ||
| 198 | Move point to specified week of year (@code{calendar-goto-iso-week}). | ||
| 199 | @item o | ||
| 200 | Center calendar around specified month (@code{calendar-other-month}). | ||
| 201 | @item . | ||
| 202 | Move point to today's date (@code{calendar-goto-today}). | ||
| 203 | @end table | ||
| 204 | |||
| 205 | @kindex g d @r{(Calendar mode)} | ||
| 206 | @findex calendar-goto-date | ||
| 207 | @kbd{g d} (@code{calendar-goto-date}) prompts for a year, a month, and a day | ||
| 208 | of the month, and then moves to that date. Because the calendar includes all | ||
| 209 | dates from the beginning of the current era, you must type the year in its | ||
| 210 | entirety; that is, type @samp{1990}, not @samp{90}. | ||
| 211 | |||
| 212 | @kindex g D @r{(Calendar mode)} | ||
| 213 | @findex calendar-goto-day-of-year | ||
| 214 | @kindex g w @r{(Calendar mode)} | ||
| 215 | @findex calendar-goto-iso-week | ||
| 216 | @kbd{g D} (@code{calendar-goto-day-of-year}) prompts for a year and | ||
| 217 | day number, and moves to that date. Negative day numbers count | ||
| 218 | backward from the end of the year. @kbd{g w} | ||
| 219 | (@code{calendar-goto-iso-week}) prompts for a year and week number, | ||
| 220 | and moves to that week. | ||
| 221 | |||
| 222 | @kindex o @r{(Calendar mode)} | ||
| 223 | @findex calendar-other-month | ||
| 224 | @kbd{o} (@code{calendar-other-month}) prompts for a month and year, | ||
| 225 | then centers the three-month calendar around that month. | ||
| 226 | |||
| 227 | @kindex . @r{(Calendar mode)} | ||
| 228 | @findex calendar-goto-today | ||
| 229 | You can return to today's date with @kbd{.}@: | ||
| 230 | (@code{calendar-goto-today}). | ||
| 231 | |||
| 232 | @node Scroll Calendar | ||
| 233 | @section Scrolling in the Calendar | ||
| 234 | |||
| 235 | @cindex scrolling in the calendar | ||
| 236 | The calendar display scrolls automatically through time when you | ||
| 237 | move out of the visible portion. You can also scroll it manually. | ||
| 238 | Imagine that the calendar window contains a long strip of paper with | ||
| 239 | the months on it. Scrolling the calendar means moving the strip | ||
| 240 | horizontally, so that new months become visible in the window. | ||
| 241 | |||
| 242 | @table @kbd | ||
| 243 | @item > | ||
| 244 | Scroll calendar one month forward (@code{scroll-calendar-left}). | ||
| 245 | @item < | ||
| 246 | Scroll calendar one month backward (@code{scroll-calendar-right}). | ||
| 247 | @item C-v | ||
| 248 | @itemx @key{NEXT} | ||
| 249 | Scroll calendar three months forward | ||
| 250 | (@code{scroll-calendar-left-three-months}). | ||
| 251 | @item M-v | ||
| 252 | @itemx @key{PRIOR} | ||
| 253 | Scroll calendar three months backward | ||
| 254 | (@code{scroll-calendar-right-three-months}). | ||
| 255 | @end table | ||
| 256 | |||
| 257 | @kindex > @r{(Calendar mode)} | ||
| 258 | @findex scroll-calendar-left | ||
| 259 | @kindex < @r{(Calendar mode)} | ||
| 260 | @findex scroll-calendar-right | ||
| 261 | The most basic calendar scroll commands scroll by one month at a | ||
| 262 | time. This means that there are two months of overlap between the | ||
| 263 | display before the command and the display after. @kbd{>} scrolls the | ||
| 264 | calendar contents one month forward in time. @kbd{<} scrolls the | ||
| 265 | contents one month backwards in time. | ||
| 266 | |||
| 267 | @kindex C-v @r{(Calendar mode)} | ||
| 268 | @findex scroll-calendar-left-three-months | ||
| 269 | @kindex M-v @r{(Calendar mode)} | ||
| 270 | @findex scroll-calendar-right-three-months | ||
| 271 | The commands @kbd{C-v} and @kbd{M-v} scroll the calendar by an entire | ||
| 272 | ``screenful''---three months---in analogy with the usual meaning of | ||
| 273 | these commands. @kbd{C-v} makes later dates visible and @kbd{M-v} makes | ||
| 274 | earlier dates visible. These commands take a numeric argument as a | ||
| 275 | repeat count; in particular, since @kbd{C-u} multiplies the next command | ||
| 276 | by four, typing @kbd{C-u C-v} scrolls the calendar forward by a year and | ||
| 277 | typing @kbd{C-u M-v} scrolls the calendar backward by a year. | ||
| 278 | |||
| 279 | The function keys @key{NEXT} and @key{PRIOR} are equivalent to | ||
| 280 | @kbd{C-v} and @kbd{M-v}, just as they are in other modes. | ||
| 281 | |||
| 282 | @node Counting Days | ||
| 283 | @section Counting Days | ||
| 284 | |||
| 285 | @table @kbd | ||
| 286 | @item M-= | ||
| 287 | Display the number of days in the current region | ||
| 288 | (@code{calendar-count-days-region}). | ||
| 289 | @end table | ||
| 290 | |||
| 291 | @kindex M-= @r{(Calendar mode)} | ||
| 292 | @findex calendar-count-days-region | ||
| 293 | To determine the number of days in the region, type @kbd{M-=} | ||
| 294 | (@code{calendar-count-days-region}). The numbers of days shown is | ||
| 295 | @emph{inclusive}; that is, it includes the days specified by mark and | ||
| 296 | point. | ||
| 297 | |||
| 298 | @node General Calendar | ||
| 299 | @section Miscellaneous Calendar Commands | ||
| 300 | |||
| 301 | @table @kbd | ||
| 302 | @item p d | ||
| 303 | Display day-in-year (@code{calendar-print-day-of-year}). | ||
| 304 | @item C-c C-l | ||
| 305 | Regenerate the calendar window (@code{redraw-calendar}). | ||
| 306 | @item SPC | ||
| 307 | Scroll the next window up (@code{scroll-other-window}). | ||
| 308 | @item DEL | ||
| 309 | Scroll the next window down (@code{scroll-other-window-down}). | ||
| 310 | @item q | ||
| 311 | Exit from calendar (@code{exit-calendar}). | ||
| 312 | @end table | ||
| 313 | |||
| 314 | @kindex p d @r{(Calendar mode)} | ||
| 315 | @cindex day of year | ||
| 316 | @findex calendar-print-day-of-year | ||
| 317 | To display the number of days elapsed since the start of the year, or | ||
| 318 | the number of days remaining in the year, type the @kbd{p d} command | ||
| 319 | (@code{calendar-print-day-of-year}). This displays both of those | ||
| 320 | numbers in the echo area. The count of days elapsed includes the | ||
| 321 | selected date. The count of days remaining does not include that | ||
| 322 | date. | ||
| 323 | |||
| 324 | @kindex C-c C-l @r{(Calendar mode)} | ||
| 325 | @findex redraw-calendar | ||
| 326 | If the calendar window text gets corrupted, type @kbd{C-c C-l} | ||
| 327 | (@code{redraw-calendar}) to redraw it. (This can only happen if you use | ||
| 328 | non-Calendar-mode editing commands.) | ||
| 329 | |||
| 330 | @kindex SPC @r{(Calendar mode)} | ||
| 331 | In Calendar mode, you can use @kbd{SPC} (@code{scroll-other-window}) | ||
| 332 | and @kbd{DEL} (@code{scroll-other-window-down}) to scroll the other | ||
| 333 | window up or down, respectively. This is handy when you display a list | ||
| 334 | of holidays or diary entries in another window. | ||
| 335 | |||
| 336 | @kindex q @r{(Calendar mode)} | ||
| 337 | @findex exit-calendar | ||
| 338 | To exit from the calendar, type @kbd{q} (@code{exit-calendar}). This | ||
| 339 | buries all buffers related to the calendar, selecting other buffers. | ||
| 340 | (If a frame contains a dedicated calendar window, exiting from the | ||
| 341 | calendar iconifies that frame.) | ||
| 342 | |||
| 343 | @node Writing Calendar Files | ||
| 344 | @section Writing Calendar Files | ||
| 345 | |||
| 346 | These packages produce files of various formats containing calendar | ||
| 347 | and diary entries, for display purposes. | ||
| 348 | |||
| 349 | @cindex calendar and HTML | ||
| 350 | The Calendar HTML commands produce files of HTML code that contain | ||
| 351 | calendar and diary entries. Each file applies to one month, and has a | ||
| 352 | name of the format @file{@var{yyyy}-@var{mm}.html}, where @var{yyyy} and | ||
| 353 | @var{mm} are the four-digit year and two-digit month, respectively. The | ||
| 354 | variable @code{cal-html-directory} specifies the default output | ||
| 355 | directory for the HTML files. | ||
| 356 | |||
| 357 | @vindex cal-html-css-default | ||
| 358 | Diary entries enclosed by @code{<} and @code{>} are interpreted as | ||
| 359 | HTML tags (for example: this is a diary entry with <font | ||
| 360 | color=''red''>some red text</font>). You can change the overall | ||
| 361 | appearance of the displayed HTML pages (for example, the color of | ||
| 362 | various page elements, header styles) via a stylesheet @file{cal.css} in | ||
| 363 | the directory containing the HTML files (see the value of the variable | ||
| 364 | @code{cal-html-css-default} for relevant style settings). | ||
| 365 | |||
| 366 | @kindex t @r{(Calendar mode)} | ||
| 367 | @table @kbd | ||
| 368 | @item H m | ||
| 369 | Generate a one-month calendar (@code{cal-html-cursor-month}). | ||
| 370 | @item H y | ||
| 371 | Generate a calendar file for each month of a year, as well as an index | ||
| 372 | page (@code{cal-html-cursor-year}). By default, this command writes | ||
| 373 | files to a @var{yyyy} subdirectory - if this is altered some hyperlinks | ||
| 374 | between years will not work. | ||
| 375 | @end table | ||
| 376 | |||
| 377 | If the variable @code{cal-html-print-day-number-flag} is | ||
| 378 | non-@code{nil}, then the monthly calendars show the day-of-the-year | ||
| 379 | number. The variable @code{cal-html-year-index-cols} specifies the | ||
| 380 | number of columns in the yearly index page. | ||
| 381 | |||
| 382 | @cindex calendar and La@TeX{} | ||
| 383 | The Calendar La@TeX{} commands produce a buffer of La@TeX{} code that | ||
| 384 | prints as a calendar. Depending on the command you use, the printed | ||
| 385 | calendar covers the day, week, month or year that point is in. | ||
| 386 | |||
| 387 | @kindex t @r{(Calendar mode)} | ||
| 388 | @table @kbd | ||
| 389 | @item t m | ||
| 390 | Generate a one-month calendar (@code{cal-tex-cursor-month}). | ||
| 391 | @item t M | ||
| 392 | Generate a sideways-printing one-month calendar | ||
| 393 | (@code{cal-tex-cursor-month-landscape}). | ||
| 394 | @item t d | ||
| 395 | Generate a one-day calendar | ||
| 396 | (@code{cal-tex-cursor-day}). | ||
| 397 | @item t w 1 | ||
| 398 | Generate a one-page calendar for one week | ||
| 399 | (@code{cal-tex-cursor-week}). | ||
| 400 | @item t w 2 | ||
| 401 | Generate a two-page calendar for one week | ||
| 402 | (@code{cal-tex-cursor-week2}). | ||
| 403 | @item t w 3 | ||
| 404 | Generate an ISO-style calendar for one week | ||
| 405 | (@code{cal-tex-cursor-week-iso}). | ||
| 406 | @item t w 4 | ||
| 407 | Generate a calendar for one Monday-starting week | ||
| 408 | (@code{cal-tex-cursor-week-monday}). | ||
| 409 | @item t f w | ||
| 410 | Generate a Filofax-style two-weeks-at-a-glance calendar | ||
| 411 | (@code{cal-tex-cursor-filofax-2week}). | ||
| 412 | @item t f W | ||
| 413 | Generate a Filofax-style one-week-at-a-glance calendar | ||
| 414 | (@code{cal-tex-cursor-filofax-week}). | ||
| 415 | @item t y | ||
| 416 | Generate a calendar for one year | ||
| 417 | (@code{cal-tex-cursor-year}). | ||
| 418 | @item t Y | ||
| 419 | Generate a sideways-printing calendar for one year | ||
| 420 | (@code{cal-tex-cursor-year-landscape}). | ||
| 421 | @item t f y | ||
| 422 | Generate a Filofax-style calendar for one year | ||
| 423 | (@code{cal-tex-cursor-filofax-year}). | ||
| 424 | @end table | ||
| 425 | |||
| 426 | Some of these commands print the calendar sideways (in ``landscape | ||
| 427 | mode''), so it can be wider than it is long. Some of them use Filofax | ||
| 428 | paper size (3.75in x 6.75in). All of these commands accept a prefix | ||
| 429 | argument which specifies how many days, weeks, months or years to print | ||
| 430 | (starting always with the selected one). | ||
| 431 | |||
| 432 | If the variable @code{cal-tex-holidays} is non-@code{nil} (the default), | ||
| 433 | then the printed calendars show the holidays in @code{calendar-holidays}. | ||
| 434 | If the variable @code{cal-tex-diary} is non-@code{nil} (the default is | ||
| 435 | @code{nil}), diary entries are included also (in monthly, filofax, and | ||
| 436 | iso-week calendars only). If the variable @code{cal-tex-rules} is | ||
| 437 | non-@code{nil} (the default is @code{nil}), the calendar displays ruled | ||
| 438 | pages in styles that have sufficient room. Consult the documentation of | ||
| 439 | the individual cal-tex functions to see which calendars support which | ||
| 440 | features. | ||
| 441 | |||
| 442 | You can use the variable @code{cal-tex-preamble-extra} to insert extra | ||
| 443 | La@TeX{} commands in the preamble of the generated document if you need | ||
| 444 | to. | ||
| 445 | |||
| 446 | @node Holidays | ||
| 447 | @section Holidays | ||
| 448 | @cindex holidays | ||
| 449 | |||
| 450 | The Emacs calendar knows about all major and many minor holidays, | ||
| 451 | and can display them. | ||
| 452 | |||
| 453 | @table @kbd | ||
| 454 | @item h | ||
| 455 | Display holidays for the selected date | ||
| 456 | (@code{calendar-cursor-holidays}). | ||
| 457 | @item Mouse-2 Holidays | ||
| 458 | Display any holidays for the date you click on. | ||
| 459 | @item x | ||
| 460 | Mark holidays in the calendar window (@code{mark-calendar-holidays}). | ||
| 461 | @item u | ||
| 462 | Unmark calendar window (@code{calendar-unmark}). | ||
| 463 | @item a | ||
| 464 | List all holidays for the displayed three months in another window | ||
| 465 | (@code{list-calendar-holidays}). | ||
| 466 | @item M-x holidays | ||
| 467 | List all holidays for three months around today's date in another | ||
| 468 | window. | ||
| 469 | @item M-x list-holidays | ||
| 470 | List holidays in another window for a specified range of years. | ||
| 471 | @end table | ||
| 472 | |||
| 473 | @kindex h @r{(Calendar mode)} | ||
| 474 | @findex calendar-cursor-holidays | ||
| 475 | @vindex view-calendar-holidays-initially | ||
| 476 | To see if any holidays fall on a given date, position point on that | ||
| 477 | date in the calendar window and use the @kbd{h} command. Alternatively, | ||
| 478 | click on that date with @kbd{Mouse-2} and then choose @kbd{Holidays} | ||
| 479 | from the menu that appears. Either way, this displays the holidays for | ||
| 480 | that date, in the echo area if they fit there, otherwise in a separate | ||
| 481 | window. | ||
| 482 | |||
| 483 | @kindex x @r{(Calendar mode)} | ||
| 484 | @findex mark-calendar-holidays | ||
| 485 | @kindex u @r{(Calendar mode)} | ||
| 486 | @findex calendar-unmark | ||
| 487 | @vindex mark-holidays-in-calendar | ||
| 488 | To view the distribution of holidays for all the dates shown in the | ||
| 489 | calendar, use the @kbd{x} command. This displays the dates that are | ||
| 490 | holidays in a different face (or places a @samp{*} after these dates, if | ||
| 491 | display with multiple faces is not available). | ||
| 492 | @iftex | ||
| 493 | @inforef{Calendar Customizing, calendar-holiday-marker, emacs-xtra}. | ||
| 494 | @end iftex | ||
| 495 | @ifnottex | ||
| 496 | @xref{Calendar Customizing, calendar-holiday-marker}. | ||
| 497 | @end ifnottex | ||
| 498 | The command applies both to the currently visible months and to | ||
| 499 | other months that subsequently become visible by scrolling. To turn | ||
| 500 | marking off and erase the current marks, type @kbd{u}, which also | ||
| 501 | erases any diary marks (@pxref{Diary}). If the variable | ||
| 502 | @code{mark-holidays-in-calendar} is non-@code{nil}, creating or | ||
| 503 | updating the calendar marks holidays automatically. | ||
| 504 | |||
| 505 | @kindex a @r{(Calendar mode)} | ||
| 506 | @findex list-calendar-holidays | ||
| 507 | To get even more detailed information, use the @kbd{a} command, which | ||
| 508 | displays a separate buffer containing a list of all holidays in the | ||
| 509 | current three-month range. You can use @key{SPC} and @key{DEL} in the | ||
| 510 | calendar window to scroll that list up and down, respectively. | ||
| 511 | |||
| 512 | @findex holidays | ||
| 513 | The command @kbd{M-x holidays} displays the list of holidays for the | ||
| 514 | current month and the preceding and succeeding months; this works even | ||
| 515 | if you don't have a calendar window. If the variable | ||
| 516 | @code{view-calendar-holidays-initially} is non-@code{nil}, creating | ||
| 517 | the calendar displays holidays in this way. If you want the list of | ||
| 518 | holidays centered around a different month, use @kbd{C-u M-x | ||
| 519 | holidays}, which prompts for the month and year. | ||
| 520 | |||
| 521 | The holidays known to Emacs include United States holidays and the | ||
| 522 | major Christian, Jewish, and Islamic holidays; also the solstices and | ||
| 523 | equinoxes. | ||
| 524 | |||
| 525 | @findex list-holidays | ||
| 526 | The command @kbd{M-x list-holidays} displays the list of holidays for | ||
| 527 | a range of years. This function asks you for the starting and stopping | ||
| 528 | years, and allows you to choose all the holidays or one of several | ||
| 529 | categories of holidays. You can use this command even if you don't have | ||
| 530 | a calendar window. | ||
| 531 | |||
| 532 | The dates used by Emacs for holidays are based on @emph{current | ||
| 533 | practice}, not historical fact. For example Veteran's Day began in | ||
| 534 | 1919, but is shown in earlier years. | ||
| 535 | |||
| 536 | @node Sunrise/Sunset | ||
| 537 | @section Times of Sunrise and Sunset | ||
| 538 | @cindex sunrise and sunset | ||
| 539 | |||
| 540 | Special calendar commands can tell you, to within a minute or two, the | ||
| 541 | times of sunrise and sunset for any date. | ||
| 542 | |||
| 543 | @table @kbd | ||
| 544 | @item S | ||
| 545 | Display times of sunrise and sunset for the selected date | ||
| 546 | (@code{calendar-sunrise-sunset}). | ||
| 547 | @item Mouse-2 Sunrise/sunset | ||
| 548 | Display times of sunrise and sunset for the date you click on. | ||
| 549 | @item M-x sunrise-sunset | ||
| 550 | Display times of sunrise and sunset for today's date. | ||
| 551 | @item C-u M-x sunrise-sunset | ||
| 552 | Display times of sunrise and sunset for a specified date. | ||
| 553 | @end table | ||
| 554 | |||
| 555 | @kindex S @r{(Calendar mode)} | ||
| 556 | @findex calendar-sunrise-sunset | ||
| 557 | @findex sunrise-sunset | ||
| 558 | Within the calendar, to display the @emph{local times} of sunrise and | ||
| 559 | sunset in the echo area, move point to the date you want, and type | ||
| 560 | @kbd{S}. Alternatively, click @kbd{Mouse-2} on the date, then choose | ||
| 561 | @samp{Sunrise/sunset} from the menu that appears. The command @kbd{M-x | ||
| 562 | sunrise-sunset} is available outside the calendar to display this | ||
| 563 | information for today's date or a specified date. To specify a date | ||
| 564 | other than today, use @kbd{C-u M-x sunrise-sunset}, which prompts for | ||
| 565 | the year, month, and day. | ||
| 566 | |||
| 567 | You can display the times of sunrise and sunset for any location and | ||
| 568 | any date with @kbd{C-u C-u M-x sunrise-sunset}. This asks you for a | ||
| 569 | longitude, latitude, number of minutes difference from Coordinated | ||
| 570 | Universal Time, and date, and then tells you the times of sunrise and | ||
| 571 | sunset for that location on that date. | ||
| 572 | |||
| 573 | Because the times of sunrise and sunset depend on the location on | ||
| 574 | earth, you need to tell Emacs your latitude, longitude, and location | ||
| 575 | name before using these commands. Here is an example of what to set: | ||
| 576 | |||
| 577 | @vindex calendar-location-name | ||
| 578 | @vindex calendar-longitude | ||
| 579 | @vindex calendar-latitude | ||
| 580 | @example | ||
| 581 | (setq calendar-latitude 40.1) | ||
| 582 | (setq calendar-longitude -88.2) | ||
| 583 | (setq calendar-location-name "Urbana, IL") | ||
| 584 | @end example | ||
| 585 | |||
| 586 | @noindent | ||
| 587 | Use one decimal place in the values of @code{calendar-latitude} and | ||
| 588 | @code{calendar-longitude}. | ||
| 589 | |||
| 590 | Your time zone also affects the local time of sunrise and sunset. | ||
| 591 | Emacs usually gets time zone information from the operating system, but | ||
| 592 | if these values are not what you want (or if the operating system does | ||
| 593 | not supply them), you must set them yourself. Here is an example: | ||
| 594 | |||
| 595 | @vindex calendar-time-zone | ||
| 596 | @vindex calendar-standard-time-zone-name | ||
| 597 | @vindex calendar-daylight-time-zone-name | ||
| 598 | @example | ||
| 599 | (setq calendar-time-zone -360) | ||
| 600 | (setq calendar-standard-time-zone-name "CST") | ||
| 601 | (setq calendar-daylight-time-zone-name "CDT") | ||
| 602 | @end example | ||
| 603 | |||
| 604 | @noindent | ||
| 605 | The value of @code{calendar-time-zone} is the number of minutes | ||
| 606 | difference between your local standard time and Coordinated Universal | ||
| 607 | Time (Greenwich time). The values of | ||
| 608 | @code{calendar-standard-time-zone-name} and | ||
| 609 | @code{calendar-daylight-time-zone-name} are the abbreviations used in | ||
| 610 | your time zone. Emacs displays the times of sunrise and sunset | ||
| 611 | @emph{corrected for daylight saving time}. @xref{Daylight Saving}, | ||
| 612 | for how daylight saving time is determined. | ||
| 613 | |||
| 614 | As a user, you might find it convenient to set the calendar location | ||
| 615 | variables for your usual physical location in your @file{.emacs} file. | ||
| 616 | And when you install Emacs on a machine, you can create a | ||
| 617 | @file{default.el} file which sets them properly for the typical location | ||
| 618 | of most users of that machine. @xref{Init File}. | ||
| 619 | |||
| 620 | @node Lunar Phases | ||
| 621 | @section Phases of the Moon | ||
| 622 | @cindex phases of the moon | ||
| 623 | @cindex moon, phases of | ||
| 624 | |||
| 625 | These calendar commands display the dates and times of the phases of | ||
| 626 | the moon (new moon, first quarter, full moon, last quarter). This | ||
| 627 | feature is useful for debugging problems that ``depend on the phase of | ||
| 628 | the moon.'' | ||
| 629 | |||
| 630 | @table @kbd | ||
| 631 | @item M | ||
| 632 | Display the dates and times for all the quarters of the moon for the | ||
| 633 | three-month period shown (@code{calendar-phases-of-moon}). | ||
| 634 | @item M-x phases-of-moon | ||
| 635 | Display dates and times of the quarters of the moon for three months around | ||
| 636 | today's date. | ||
| 637 | @end table | ||
| 638 | |||
| 639 | @kindex M @r{(Calendar mode)} | ||
| 640 | @findex calendar-phases-of-moon | ||
| 641 | Within the calendar, use the @kbd{M} command to display a separate | ||
| 642 | buffer of the phases of the moon for the current three-month range. The | ||
| 643 | dates and times listed are accurate to within a few minutes. | ||
| 644 | |||
| 645 | @findex phases-of-moon | ||
| 646 | Outside the calendar, use the command @kbd{M-x phases-of-moon} to | ||
| 647 | display the list of the phases of the moon for the current month and the | ||
| 648 | preceding and succeeding months. For information about a different | ||
| 649 | month, use @kbd{C-u M-x phases-of-moon}, which prompts for the month and | ||
| 650 | year. | ||
| 651 | |||
| 652 | The dates and times given for the phases of the moon are given in | ||
| 653 | local time (corrected for daylight saving, when appropriate); but if | ||
| 654 | the variable @code{calendar-time-zone} is void, Coordinated Universal | ||
| 655 | Time (the Greenwich time zone) is used. @xref{Daylight Saving}. | ||
| 656 | |||
| 657 | @node Other Calendars | ||
| 658 | @section Conversion To and From Other Calendars | ||
| 659 | |||
| 660 | @cindex Gregorian calendar | ||
| 661 | The Emacs calendar displayed is @emph{always} the Gregorian calendar, | ||
| 662 | sometimes called the ``new style'' calendar, which is used in most of | ||
| 663 | the world today. However, this calendar did not exist before the | ||
| 664 | sixteenth century and was not widely used before the eighteenth century; | ||
| 665 | it did not fully displace the Julian calendar and gain universal | ||
| 666 | acceptance until the early twentieth century. The Emacs calendar can | ||
| 667 | display any month since January, year 1 of the current era, but the | ||
| 668 | calendar displayed is the Gregorian, even for a date at which the | ||
| 669 | Gregorian calendar did not exist. | ||
| 670 | |||
| 671 | While Emacs cannot display other calendars, it can convert dates to | ||
| 672 | and from several other calendars. | ||
| 673 | |||
| 674 | @menu | ||
| 675 | * Calendar Systems:: The calendars Emacs understands | ||
| 676 | (aside from Gregorian). | ||
| 677 | * To Other Calendar:: Converting the selected date to various calendars. | ||
| 678 | * From Other Calendar:: Moving to a date specified in another calendar. | ||
| 679 | * Mayan Calendar:: Moving to a date specified in a Mayan calendar. | ||
| 680 | @end menu | ||
| 681 | |||
| 682 | @node Calendar Systems | ||
| 683 | @subsection Supported Calendar Systems | ||
| 684 | |||
| 685 | @cindex ISO commercial calendar | ||
| 686 | The ISO commercial calendar is used largely in Europe. | ||
| 687 | |||
| 688 | @cindex Julian calendar | ||
| 689 | The Julian calendar, named after Julius Caesar, was the one used in Europe | ||
| 690 | throughout medieval times, and in many countries up until the nineteenth | ||
| 691 | century. | ||
| 692 | |||
| 693 | @cindex Julian day numbers | ||
| 694 | @cindex astronomical day numbers | ||
| 695 | Astronomers use a simple counting of days elapsed since noon, Monday, | ||
| 696 | January 1, 4713 B.C. on the Julian calendar. The number of days elapsed | ||
| 697 | is called the @dfn{Julian day number} or the @dfn{Astronomical day number}. | ||
| 698 | |||
| 699 | @cindex Hebrew calendar | ||
| 700 | The Hebrew calendar is used by tradition in the Jewish religion. The | ||
| 701 | Emacs calendar program uses the Hebrew calendar to determine the dates | ||
| 702 | of Jewish holidays. Hebrew calendar dates begin and end at sunset. | ||
| 703 | |||
| 704 | @cindex Islamic calendar | ||
| 705 | The Islamic calendar is used in many predominantly Islamic countries. | ||
| 706 | Emacs uses it to determine the dates of Islamic holidays. There is no | ||
| 707 | universal agreement in the Islamic world about the calendar; Emacs uses | ||
| 708 | a widely accepted version, but the precise dates of Islamic holidays | ||
| 709 | often depend on proclamation by religious authorities, not on | ||
| 710 | calculations. As a consequence, the actual dates of observance can vary | ||
| 711 | slightly from the dates computed by Emacs. Islamic calendar dates begin | ||
| 712 | and end at sunset. | ||
| 713 | |||
| 714 | @cindex French Revolutionary calendar | ||
| 715 | The French Revolutionary calendar was created by the Jacobins after the 1789 | ||
| 716 | revolution, to represent a more secular and nature-based view of the annual | ||
| 717 | cycle, and to install a 10-day week in a rationalization measure similar to | ||
| 718 | the metric system. The French government officially abandoned this | ||
| 719 | calendar at the end of 1805. | ||
| 720 | |||
| 721 | @cindex Mayan calendar | ||
| 722 | The Maya of Central America used three separate, overlapping calendar | ||
| 723 | systems, the @emph{long count}, the @emph{tzolkin}, and the @emph{haab}. | ||
| 724 | Emacs knows about all three of these calendars. Experts dispute the | ||
| 725 | exact correlation between the Mayan calendar and our calendar; Emacs uses the | ||
| 726 | Goodman-Martinez-Thompson correlation in its calculations. | ||
| 727 | |||
| 728 | @cindex Coptic calendar | ||
| 729 | @cindex Ethiopic calendar | ||
| 730 | The Copts use a calendar based on the ancient Egyptian solar calendar. | ||
| 731 | Their calendar consists of twelve 30-day months followed by an extra | ||
| 732 | five-day period. Once every fourth year they add a leap day to this | ||
| 733 | extra period to make it six days. The Ethiopic calendar is identical in | ||
| 734 | structure, but has different year numbers and month names. | ||
| 735 | |||
| 736 | @cindex Persian calendar | ||
| 737 | The Persians use a solar calendar based on a design of Omar Khayyam. | ||
| 738 | Their calendar consists of twelve months of which the first six have 31 | ||
| 739 | days, the next five have 30 days, and the last has 29 in ordinary years | ||
| 740 | and 30 in leap years. Leap years occur in a complicated pattern every | ||
| 741 | four or five years. | ||
| 742 | The calendar implemented here is the arithmetical Persian calendar | ||
| 743 | championed by Birashk, based on a 2,820-year cycle. It differs from | ||
| 744 | the astronomical Persian calendar, which is based on astronomical | ||
| 745 | events. As of this writing the first future discrepancy is projected | ||
| 746 | to occur on March 20, 2025. It is currently not clear what the | ||
| 747 | official calendar of Iran will be that far into the future. | ||
| 748 | |||
| 749 | @cindex Chinese calendar | ||
| 750 | The Chinese calendar is a complicated system of lunar months arranged | ||
| 751 | into solar years. The years go in cycles of sixty, each year containing | ||
| 752 | either twelve months in an ordinary year or thirteen months in a leap | ||
| 753 | year; each month has either 29 or 30 days. Years, ordinary months, and | ||
| 754 | days are named by combining one of ten ``celestial stems'' with one of | ||
| 755 | twelve ``terrestrial branches'' for a total of sixty names that are | ||
| 756 | repeated in a cycle of sixty. | ||
| 757 | |||
| 758 | @node To Other Calendar | ||
| 759 | @subsection Converting To Other Calendars | ||
| 760 | |||
| 761 | The following commands describe the selected date (the date at point) | ||
| 762 | in various other calendar systems: | ||
| 763 | |||
| 764 | @table @kbd | ||
| 765 | @item Mouse-2 Other calendars | ||
| 766 | Display the date that you click on, expressed in various other calendars. | ||
| 767 | @kindex p @r{(Calendar mode)} | ||
| 768 | @findex calendar-print-iso-date | ||
| 769 | @item p c | ||
| 770 | Display ISO commercial calendar equivalent for selected day | ||
| 771 | (@code{calendar-print-iso-date}). | ||
| 772 | @findex calendar-print-julian-date | ||
| 773 | @item p j | ||
| 774 | Display Julian date for selected day (@code{calendar-print-julian-date}). | ||
| 775 | @findex calendar-print-astro-day-number | ||
| 776 | @item p a | ||
| 777 | Display astronomical (Julian) day number for selected day | ||
| 778 | (@code{calendar-print-astro-day-number}). | ||
| 779 | @findex calendar-print-hebrew-date | ||
| 780 | @item p h | ||
| 781 | Display Hebrew date for selected day (@code{calendar-print-hebrew-date}). | ||
| 782 | @findex calendar-print-islamic-date | ||
| 783 | @item p i | ||
| 784 | Display Islamic date for selected day (@code{calendar-print-islamic-date}). | ||
| 785 | @findex calendar-print-french-date | ||
| 786 | @item p f | ||
| 787 | Display French Revolutionary date for selected day | ||
| 788 | (@code{calendar-print-french-date}). | ||
| 789 | @findex calendar-print-chinese-date | ||
| 790 | @item p C | ||
| 791 | Display Chinese date for selected day | ||
| 792 | (@code{calendar-print-chinese-date}). | ||
| 793 | @findex calendar-print-coptic-date | ||
| 794 | @item p k | ||
| 795 | Display Coptic date for selected day | ||
| 796 | (@code{calendar-print-coptic-date}). | ||
| 797 | @findex calendar-print-ethiopic-date | ||
| 798 | @item p e | ||
| 799 | Display Ethiopic date for selected day | ||
| 800 | (@code{calendar-print-ethiopic-date}). | ||
| 801 | @findex calendar-print-persian-date | ||
| 802 | @item p p | ||
| 803 | Display Persian date for selected day | ||
| 804 | (@code{calendar-print-persian-date}). | ||
| 805 | @findex calendar-print-mayan-date | ||
| 806 | @item p m | ||
| 807 | Display Mayan date for selected day (@code{calendar-print-mayan-date}). | ||
| 808 | @end table | ||
| 809 | |||
| 810 | If you are using X, the easiest way to translate a date into other | ||
| 811 | calendars is to click on it with @kbd{Mouse-2}, then choose @kbd{Other | ||
| 812 | calendars} from the menu that appears. This displays the equivalent | ||
| 813 | forms of the date in all the calendars Emacs understands, in the form of | ||
| 814 | a menu. (Choosing an alternative from this menu doesn't actually do | ||
| 815 | anything---the menu is used only for display.) | ||
| 816 | |||
| 817 | Otherwise, move point to the date you want to convert, then type the | ||
| 818 | appropriate command starting with @kbd{p} from the table above. The | ||
| 819 | prefix @kbd{p} is a mnemonic for ``print,'' since Emacs ``prints'' the | ||
| 820 | equivalent date in the echo area. | ||
| 821 | |||
| 822 | @node From Other Calendar | ||
| 823 | @subsection Converting From Other Calendars | ||
| 824 | |||
| 825 | You can use the other supported calendars to specify a date to move | ||
| 826 | to. This section describes the commands for doing this using calendars | ||
| 827 | other than Mayan; for the Mayan calendar, see the following section. | ||
| 828 | |||
| 829 | @kindex g @var{char} @r{(Calendar mode)} | ||
| 830 | @findex calendar-goto-iso-date | ||
| 831 | @findex calendar-goto-iso-week | ||
| 832 | @findex calendar-goto-julian-date | ||
| 833 | @findex calendar-goto-astro-day-number | ||
| 834 | @findex calendar-goto-hebrew-date | ||
| 835 | @findex calendar-goto-islamic-date | ||
| 836 | @findex calendar-goto-french-date | ||
| 837 | @findex calendar-goto-chinese-date | ||
| 838 | @findex calendar-goto-persian-date | ||
| 839 | @findex calendar-goto-coptic-date | ||
| 840 | @findex calendar-goto-ethiopic-date | ||
| 841 | @table @kbd | ||
| 842 | @item g c | ||
| 843 | Move to a date specified in the ISO commercial calendar | ||
| 844 | (@code{calendar-goto-iso-date}). | ||
| 845 | @item g w | ||
| 846 | Move to a week specified in the ISO commercial calendar | ||
| 847 | (@code{calendar-goto-iso-week}). | ||
| 848 | @item g j | ||
| 849 | Move to a date specified in the Julian calendar | ||
| 850 | (@code{calendar-goto-julian-date}). | ||
| 851 | @item g a | ||
| 852 | Move to a date specified with an astronomical (Julian) day number | ||
| 853 | (@code{calendar-goto-astro-day-number}). | ||
| 854 | @item g h | ||
| 855 | Move to a date specified in the Hebrew calendar | ||
| 856 | (@code{calendar-goto-hebrew-date}). | ||
| 857 | @item g i | ||
| 858 | Move to a date specified in the Islamic calendar | ||
| 859 | (@code{calendar-goto-islamic-date}). | ||
| 860 | @item g f | ||
| 861 | Move to a date specified in the French Revolutionary calendar | ||
| 862 | (@code{calendar-goto-french-date}). | ||
| 863 | @item g C | ||
| 864 | Move to a date specified in the Chinese calendar | ||
| 865 | (@code{calendar-goto-chinese-date}). | ||
| 866 | @item g p | ||
| 867 | Move to a date specified in the Persian calendar | ||
| 868 | (@code{calendar-goto-persian-date}). | ||
| 869 | @item g k | ||
| 870 | Move to a date specified in the Coptic calendar | ||
| 871 | (@code{calendar-goto-coptic-date}). | ||
| 872 | @item g e | ||
| 873 | Move to a date specified in the Ethiopic calendar | ||
| 874 | (@code{calendar-goto-ethiopic-date}). | ||
| 875 | @end table | ||
| 876 | |||
| 877 | These commands ask you for a date on the other calendar, move point to | ||
| 878 | the Gregorian calendar date equivalent to that date, and display the | ||
| 879 | other calendar's date in the echo area. Emacs uses strict completion | ||
| 880 | (@pxref{Completion}) whenever it asks you to type a month name, so you | ||
| 881 | don't have to worry about the spelling of Hebrew, Islamic, or French names. | ||
| 882 | |||
| 883 | @findex list-yahrzeit-dates | ||
| 884 | @cindex yahrzeits | ||
| 885 | One common question concerning the Hebrew calendar is the computation | ||
| 886 | of the anniversary of a date of death, called a ``yahrzeit.'' The Emacs | ||
| 887 | calendar includes a facility for such calculations. If you are in the | ||
| 888 | calendar, the command @kbd{M-x list-yahrzeit-dates} asks you for a | ||
| 889 | range of years and then displays a list of the yahrzeit dates for those | ||
| 890 | years for the date given by point. If you are not in the calendar, | ||
| 891 | this command first asks you for the date of death and the range of | ||
| 892 | years, and then displays the list of yahrzeit dates. | ||
| 893 | |||
| 894 | @node Mayan Calendar | ||
| 895 | @subsection Converting from the Mayan Calendar | ||
| 896 | |||
| 897 | Here are the commands to select dates based on the Mayan calendar: | ||
| 898 | |||
| 899 | @table @kbd | ||
| 900 | @item g m l | ||
| 901 | Move to a date specified by the long count calendar | ||
| 902 | (@code{calendar-goto-mayan-long-count-date}). | ||
| 903 | @item g m n t | ||
| 904 | Move to the next occurrence of a place in the | ||
| 905 | tzolkin calendar (@code{calendar-next-tzolkin-date}). | ||
| 906 | @item g m p t | ||
| 907 | Move to the previous occurrence of a place in the | ||
| 908 | tzolkin calendar (@code{calendar-previous-tzolkin-date}). | ||
| 909 | @item g m n h | ||
| 910 | Move to the next occurrence of a place in the | ||
| 911 | haab calendar (@code{calendar-next-haab-date}). | ||
| 912 | @item g m p h | ||
| 913 | Move to the previous occurrence of a place in the | ||
| 914 | haab calendar (@code{calendar-previous-haab-date}). | ||
| 915 | @item g m n c | ||
| 916 | Move to the next occurrence of a place in the | ||
| 917 | calendar round (@code{calendar-next-calendar-round-date}). | ||
| 918 | @item g m p c | ||
| 919 | Move to the previous occurrence of a place in the | ||
| 920 | calendar round (@code{calendar-previous-calendar-round-date}). | ||
| 921 | @end table | ||
| 922 | |||
| 923 | @cindex Mayan long count | ||
| 924 | To understand these commands, you need to understand the Mayan calendars. | ||
| 925 | The @dfn{long count} is a counting of days with these units: | ||
| 926 | |||
| 927 | @display | ||
| 928 | 1 kin = 1 day@ @ @ 1 uinal = 20 kin@ @ @ 1 tun = 18 uinal | ||
| 929 | 1 katun = 20 tun@ @ @ 1 baktun = 20 katun | ||
| 930 | @end display | ||
| 931 | |||
| 932 | @kindex g m @r{(Calendar mode)} | ||
| 933 | @findex calendar-goto-mayan-long-count-date | ||
| 934 | @noindent | ||
| 935 | Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11 | ||
| 936 | tun, 16 uinal, and 6 kin. The Emacs calendar can handle Mayan long | ||
| 937 | count dates as early as 7.17.18.13.3, but no earlier. When you use the | ||
| 938 | @kbd{g m l} command, type the Mayan long count date with the baktun, | ||
| 939 | katun, tun, uinal, and kin separated by periods. | ||
| 940 | |||
| 941 | @findex calendar-previous-tzolkin-date | ||
| 942 | @findex calendar-next-tzolkin-date | ||
| 943 | @cindex Mayan tzolkin calendar | ||
| 944 | The Mayan tzolkin calendar is a cycle of 260 days formed by a pair of | ||
| 945 | independent cycles of 13 and 20 days. Since this cycle repeats | ||
| 946 | endlessly, Emacs provides commands to move backward and forward to the | ||
| 947 | previous or next point in the cycle. Type @kbd{g m p t} to go to the | ||
| 948 | previous tzolkin date; Emacs asks you for a tzolkin date and moves point | ||
| 949 | to the previous occurrence of that date. Similarly, type @kbd{g m n t} | ||
| 950 | to go to the next occurrence of a tzolkin date. | ||
| 951 | |||
| 952 | @findex calendar-previous-haab-date | ||
| 953 | @findex calendar-next-haab-date | ||
| 954 | @cindex Mayan haab calendar | ||
| 955 | The Mayan haab calendar is a cycle of 365 days arranged as 18 months | ||
| 956 | of 20 days each, followed a 5-day monthless period. Like the tzolkin | ||
| 957 | cycle, this cycle repeats endlessly, and there are commands to move | ||
| 958 | backward and forward to the previous or next point in the cycle. Type | ||
| 959 | @kbd{g m p h} to go to the previous haab date; Emacs asks you for a haab | ||
| 960 | date and moves point to the previous occurrence of that date. | ||
| 961 | Similarly, type @kbd{g m n h} to go to the next occurrence of a haab | ||
| 962 | date. | ||
| 963 | |||
| 964 | @c This is omitted because it is too long for smallbook format. | ||
| 965 | @c @findex calendar-previous-calendar-round-date | ||
| 966 | @findex calendar-next-calendar-round-date | ||
| 967 | @cindex Mayan calendar round | ||
| 968 | The Maya also used the combination of the tzolkin date and the haab | ||
| 969 | date. This combination is a cycle of about 52 years called a | ||
| 970 | @emph{calendar round}. If you type @kbd{g m p c}, Emacs asks you for | ||
| 971 | both a haab and a tzolkin date and then moves point to the previous | ||
| 972 | occurrence of that combination. Use @kbd{g m n c} to move point to the | ||
| 973 | next occurrence of a combination. These commands signal an error if the | ||
| 974 | haab/tzolkin date combination you have typed is impossible. | ||
| 975 | |||
| 976 | Emacs uses strict completion (@pxref{Strict Completion}) whenever it | ||
| 977 | asks you to type a Mayan name, so you don't have to worry about | ||
| 978 | spelling. | ||
| 979 | |||
| 980 | @node Diary | ||
| 981 | @section The Diary | ||
| 982 | @cindex diary | ||
| 983 | |||
| 984 | The Emacs diary keeps track of appointments or other events on a daily | ||
| 985 | basis, in conjunction with the calendar. To use the diary feature, you | ||
| 986 | must first create a @dfn{diary file} containing a list of events and | ||
| 987 | their dates. Then Emacs can automatically pick out and display the | ||
| 988 | events for today, for the immediate future, or for any specified | ||
| 989 | date. | ||
| 990 | |||
| 991 | The name of the diary file is specified by the variable | ||
| 992 | @code{diary-file}; @file{~/diary} is the default. A sample diary file | ||
| 993 | is (note that the file format is essentially the same as that used by | ||
| 994 | the external shell utility @samp{calendar}): | ||
| 995 | |||
| 996 | @example | ||
| 997 | 12/22/1988 Twentieth wedding anniversary!! | ||
| 998 | &1/1. Happy New Year! | ||
| 999 | 10/22 Ruth's birthday. | ||
| 1000 | * 21, *: Payday | ||
| 1001 | Tuesday--weekly meeting with grad students at 10am | ||
| 1002 | Supowit, Shen, Bitner, and Kapoor to attend. | ||
| 1003 | 1/13/89 Friday the thirteenth!! | ||
| 1004 | &thu 4pm squash game with Lloyd. | ||
| 1005 | mar 16 Dad's birthday | ||
| 1006 | April 15, 1989 Income tax due. | ||
| 1007 | &* 15 time cards due. | ||
| 1008 | @end example | ||
| 1009 | |||
| 1010 | @noindent | ||
| 1011 | This example uses extra spaces to align the event descriptions of most | ||
| 1012 | of the entries. Such formatting is purely a matter of taste. | ||
| 1013 | |||
| 1014 | Although you probably will start by creating a diary manually, Emacs | ||
| 1015 | provides a number of commands to let you view, add, and change diary | ||
| 1016 | entries. | ||
| 1017 | |||
| 1018 | @menu | ||
| 1019 | * Displaying the Diary:: Viewing diary entries and associated calendar dates. | ||
| 1020 | * Format of Diary File:: Entering events in your diary. | ||
| 1021 | * Date Formats:: Various ways you can specify dates. | ||
| 1022 | * Adding to Diary:: Commands to create diary entries. | ||
| 1023 | * Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc. | ||
| 1024 | @end menu | ||
| 1025 | |||
| 1026 | @node Displaying the Diary | ||
| 1027 | @subsection Displaying the Diary | ||
| 1028 | |||
| 1029 | Once you have created a diary file, you can use the calendar to view | ||
| 1030 | it. You can also view today's events outside of Calendar mode. | ||
| 1031 | |||
| 1032 | @table @kbd | ||
| 1033 | @item d | ||
| 1034 | Display all diary entries for the selected date | ||
| 1035 | (@code{diary-view-entries}). | ||
| 1036 | @item Mouse-2 Diary | ||
| 1037 | Display all diary entries for the date you click on. | ||
| 1038 | @item s | ||
| 1039 | Display the entire diary file (@code{diary-show-all-entries}). | ||
| 1040 | @item m | ||
| 1041 | Mark all visible dates that have diary entries | ||
| 1042 | (@code{mark-diary-entries}). | ||
| 1043 | @item u | ||
| 1044 | Unmark the calendar window (@code{calendar-unmark}). | ||
| 1045 | @item M-x print-diary-entries | ||
| 1046 | Print hard copy of the diary display as it appears. | ||
| 1047 | @item M-x diary | ||
| 1048 | Display all diary entries for today's date. | ||
| 1049 | @item M-x diary-mail-entries | ||
| 1050 | Mail yourself email reminders about upcoming diary entries. | ||
| 1051 | @end table | ||
| 1052 | |||
| 1053 | @kindex d @r{(Calendar mode)} | ||
| 1054 | @findex diary-view-entries | ||
| 1055 | @vindex view-diary-entries-initially | ||
| 1056 | Displaying the diary entries with @kbd{d} shows in a separate window | ||
| 1057 | the diary entries for the selected date in the calendar. The mode line | ||
| 1058 | of the new window shows the date of the diary entries and any holidays | ||
| 1059 | that fall on that date. If you specify a numeric argument with @kbd{d}, | ||
| 1060 | it shows all the diary entries for that many successive days. Thus, | ||
| 1061 | @kbd{2 d} displays all the entries for the selected date and for the | ||
| 1062 | following day. | ||
| 1063 | |||
| 1064 | Another way to display the diary entries for a date is to click | ||
| 1065 | @kbd{Mouse-2} on the date, and then choose @kbd{Diary entries} from | ||
| 1066 | the menu that appears. If the variable | ||
| 1067 | @code{view-diary-entries-initially} is non-@code{nil}, creating the | ||
| 1068 | calendar lists the diary entries for the current date (provided the | ||
| 1069 | current date is visible). | ||
| 1070 | |||
| 1071 | @kindex m @r{(Calendar mode)} | ||
| 1072 | @findex mark-diary-entries | ||
| 1073 | @vindex mark-diary-entries-in-calendar | ||
| 1074 | To get a broader view of which days are mentioned in the diary, use | ||
| 1075 | the @kbd{m} command. This displays the dates that have diary entries in | ||
| 1076 | a different face (or places a @samp{+} after these dates, if display | ||
| 1077 | with multiple faces is not available). | ||
| 1078 | @iftex | ||
| 1079 | @inforef{Calendar Customizing, diary-entry-marker, emacs-xtra}. | ||
| 1080 | @end iftex | ||
| 1081 | @ifnottex | ||
| 1082 | @xref{Calendar Customizing, diary-entry-marker}. | ||
| 1083 | @end ifnottex | ||
| 1084 | The command applies both to the currently visible months and to | ||
| 1085 | other months that subsequently become visible by scrolling. To turn | ||
| 1086 | marking off and erase the current marks, type @kbd{u}, which also | ||
| 1087 | turns off holiday marks (@pxref{Holidays}). If the variable | ||
| 1088 | @code{mark-diary-entries-in-calendar} is non-@code{nil}, creating or | ||
| 1089 | updating the calendar marks diary dates automatically. | ||
| 1090 | |||
| 1091 | @kindex s @r{(Calendar mode)} | ||
| 1092 | @findex diary-show-all-entries | ||
| 1093 | To see the full diary file, rather than just some of the entries, use | ||
| 1094 | the @kbd{s} command. | ||
| 1095 | |||
| 1096 | Display of selected diary entries uses the selective display feature | ||
| 1097 | to hide entries that don't apply. The diary buffer as you see it is | ||
| 1098 | an illusion, so simply printing the buffer does not print what you see | ||
| 1099 | on your screen. There is a special command to print hard copy of the | ||
| 1100 | diary buffer @emph{as it appears}; this command is @kbd{M-x | ||
| 1101 | print-diary-entries}. It sends the data directly to the printer. You | ||
| 1102 | can customize it like @code{lpr-region} (@pxref{Printing}). | ||
| 1103 | |||
| 1104 | @findex diary | ||
| 1105 | The command @kbd{M-x diary} displays the diary entries for the current | ||
| 1106 | date, independently of the calendar display, and optionally for the next | ||
| 1107 | few days as well; the variable @code{number-of-diary-entries} specifies | ||
| 1108 | how many days to include. | ||
| 1109 | @iftex | ||
| 1110 | @inforef{Diary Customizing,, emacs-xtra}. | ||
| 1111 | @end iftex | ||
| 1112 | @ifnottex | ||
| 1113 | @xref{Diary Customizing, number-of-diary-entries}. | ||
| 1114 | @end ifnottex | ||
| 1115 | |||
| 1116 | If you put @code{(diary)} in your @file{.emacs} file, this | ||
| 1117 | automatically displays a window with the day's diary entries, when you | ||
| 1118 | enter Emacs. The mode line of the displayed window shows the date and | ||
| 1119 | any holidays that fall on that date. | ||
| 1120 | |||
| 1121 | @findex diary-mail-entries | ||
| 1122 | @vindex diary-mail-days | ||
| 1123 | Many users like to receive notice of events in their diary as email. | ||
| 1124 | To send such mail to yourself, use the command @kbd{M-x | ||
| 1125 | diary-mail-entries}. A prefix argument specifies how many days | ||
| 1126 | (starting with today) to check; otherwise, the variable | ||
| 1127 | @code{diary-mail-days} says how many days. | ||
| 1128 | |||
| 1129 | @node Format of Diary File | ||
| 1130 | @subsection The Diary File | ||
| 1131 | @cindex diary file | ||
| 1132 | |||
| 1133 | @vindex diary-file | ||
| 1134 | Your @dfn{diary file} is a file that records events associated with | ||
| 1135 | particular dates. The name of the diary file is specified by the | ||
| 1136 | variable @code{diary-file}; @file{~/diary} is the default. The | ||
| 1137 | @code{calendar} utility program supports a subset of the format allowed | ||
| 1138 | by the Emacs diary facilities, so you can use that utility to view the | ||
| 1139 | diary file, with reasonable results aside from the entries it cannot | ||
| 1140 | understand. | ||
| 1141 | |||
| 1142 | Each entry in the diary file describes one event and consists of one | ||
| 1143 | or more lines. An entry always begins with a date specification at the | ||
| 1144 | left margin. The rest of the entry is simply text to describe the | ||
| 1145 | event. If the entry has more than one line, then the lines after the | ||
| 1146 | first must begin with whitespace to indicate they continue a previous | ||
| 1147 | entry. Lines that do not begin with valid dates and do not continue a | ||
| 1148 | preceding entry are ignored. | ||
| 1149 | |||
| 1150 | You can inhibit the marking of certain diary entries in the calendar | ||
| 1151 | window; to do this, insert an ampersand (@samp{&}) at the beginning of | ||
| 1152 | the entry, before the date. This has no effect on display of the entry | ||
| 1153 | in the diary window; it affects only marks on dates in the calendar | ||
| 1154 | window. Nonmarking entries are especially useful for generic entries | ||
| 1155 | that would otherwise mark many different dates. | ||
| 1156 | |||
| 1157 | If the first line of a diary entry consists only of the date or day | ||
| 1158 | name with no following blanks or punctuation, then the diary window | ||
| 1159 | display doesn't include that line; only the continuation lines appear. | ||
| 1160 | For example, this entry: | ||
| 1161 | |||
| 1162 | @example | ||
| 1163 | 02/11/1989 | ||
| 1164 | Bill B. visits Princeton today | ||
| 1165 | 2pm Cognitive Studies Committee meeting | ||
| 1166 | 2:30-5:30 Liz at Lawrenceville | ||
| 1167 | 4:00pm Dentist appt | ||
| 1168 | 7:30pm Dinner at George's | ||
| 1169 | 8:00-10:00pm concert | ||
| 1170 | @end example | ||
| 1171 | |||
| 1172 | @noindent | ||
| 1173 | appears in the diary window without the date line at the beginning. | ||
| 1174 | This style of entry looks neater when you display just a single day's | ||
| 1175 | entries, but can cause confusion if you ask for more than one day's | ||
| 1176 | entries. | ||
| 1177 | |||
| 1178 | You can edit the diary entries as they appear in the window, but it is | ||
| 1179 | important to remember that the buffer displayed contains the @emph{entire} | ||
| 1180 | diary file, with portions of it concealed from view. This means, for | ||
| 1181 | instance, that the @kbd{C-f} (@code{forward-char}) command can put point | ||
| 1182 | at what appears to be the end of the line, but what is in reality the | ||
| 1183 | middle of some concealed line. | ||
| 1184 | |||
| 1185 | @emph{Be careful when editing the diary entries!} Inserting | ||
| 1186 | additional lines or adding/deleting characters in the middle of a | ||
| 1187 | visible line cannot cause problems, but editing at the end of a line may | ||
| 1188 | not do what you expect. Deleting a line may delete other invisible | ||
| 1189 | entries that follow it. Before editing the diary, it is best to display | ||
| 1190 | the entire file with @kbd{s} (@code{diary-show-all-entries}). | ||
| 1191 | |||
| 1192 | @node Date Formats | ||
| 1193 | @subsection Date Formats | ||
| 1194 | |||
| 1195 | Here are some sample diary entries, illustrating different ways of | ||
| 1196 | formatting a date. The examples all show dates in American order | ||
| 1197 | (month, day, year), but Calendar mode supports European order (day, | ||
| 1198 | month, year) as an option. | ||
| 1199 | |||
| 1200 | @example | ||
| 1201 | 4/20/93 Switch-over to new tabulation system | ||
| 1202 | apr. 25 Start tabulating annual results | ||
| 1203 | 4/30 Results for April are due | ||
| 1204 | */25 Monthly cycle finishes | ||
| 1205 | Friday Don't leave without backing up files | ||
| 1206 | @end example | ||
| 1207 | |||
| 1208 | The first entry appears only once, on April 20, 1993. The second and | ||
| 1209 | third appear every year on the specified dates, and the fourth uses a | ||
| 1210 | wildcard (asterisk) for the month, so it appears on the 25th of every | ||
| 1211 | month. The final entry appears every week on Friday. | ||
| 1212 | |||
| 1213 | You can use just numbers to express a date, as in | ||
| 1214 | @samp{@var{month}/@var{day}} or @samp{@var{month}/@var{day}/@var{year}}. | ||
| 1215 | This must be followed by a nondigit. In the date itself, @var{month} | ||
| 1216 | and @var{day} are numbers of one or two digits. The optional @var{year} | ||
| 1217 | is also a number, and may be abbreviated to the last two digits; that | ||
| 1218 | is, you can use @samp{11/12/1989} or @samp{11/12/89}. | ||
| 1219 | |||
| 1220 | Dates can also have the form @samp{@var{monthname} @var{day}} or | ||
| 1221 | @samp{@var{monthname} @var{day}, @var{year}}, where the month's name can | ||
| 1222 | be spelled in full or abbreviated (with or without a period). The | ||
| 1223 | preferred abbreviations can be controlled using the variables | ||
| 1224 | @code{calendar-abbrev-length}, @code{calendar-month-abbrev-array}, and | ||
| 1225 | @code{calendar-day-abbrev-array}. The default is to use the first three | ||
| 1226 | letters of a name as its abbreviation. Case is not significant. | ||
| 1227 | |||
| 1228 | A date may be @dfn{generic}; that is, partially unspecified. Then the | ||
| 1229 | entry applies to all dates that match the specification. If the date | ||
| 1230 | does not contain a year, it is generic and applies to any year. | ||
| 1231 | Alternatively, @var{month}, @var{day}, or @var{year} can be a @samp{*}; | ||
| 1232 | this matches any month, day, or year, respectively. Thus, a diary entry | ||
| 1233 | @samp{3/*/*} matches any day in March of any year; so does @samp{march | ||
| 1234 | *}. | ||
| 1235 | |||
| 1236 | @vindex european-calendar-style | ||
| 1237 | @findex european-calendar | ||
| 1238 | @findex american-calendar | ||
| 1239 | If you prefer the European style of writing dates---in which the day | ||
| 1240 | comes before the month---type @kbd{M-x european-calendar} while in the | ||
| 1241 | calendar, or set the variable @code{european-calendar-style} to @code{t} | ||
| 1242 | with @kbd{M-x customize}, or @emph{before} using any calendar or diary | ||
| 1243 | command. This mode interprets all dates in the diary in the European | ||
| 1244 | manner, and also uses European style for displaying diary dates. (Note | ||
| 1245 | that there is no comma after the @var{monthname} in the European style.) | ||
| 1246 | To go back to the (default) American style of writing dates, type | ||
| 1247 | @kbd{M-x american-calendar}. | ||
| 1248 | |||
| 1249 | You can use the name of a day of the week as a generic date which | ||
| 1250 | applies to any date falling on that day of the week. You can abbreviate | ||
| 1251 | the day of the week to three letters (with or without a period) or spell | ||
| 1252 | it in full; case is not significant. | ||
| 1253 | |||
| 1254 | @node Adding to Diary | ||
| 1255 | @subsection Commands to Add to the Diary | ||
| 1256 | |||
| 1257 | While in the calendar, there are several commands to create diary | ||
| 1258 | entries: | ||
| 1259 | |||
| 1260 | @table @kbd | ||
| 1261 | @item i d | ||
| 1262 | Add a diary entry for the selected date (@code{insert-diary-entry}). | ||
| 1263 | @item i w | ||
| 1264 | Add a diary entry for the selected day of the week (@code{insert-weekly-diary-entry}). | ||
| 1265 | @item i m | ||
| 1266 | Add a diary entry for the selected day of the month (@code{insert-monthly-diary-entry}). | ||
| 1267 | @item i y | ||
| 1268 | Add a diary entry for the selected day of the year (@code{insert-yearly-diary-entry}). | ||
| 1269 | @end table | ||
| 1270 | |||
| 1271 | @kindex i d @r{(Calendar mode)} | ||
| 1272 | @findex insert-diary-entry | ||
| 1273 | You can make a diary entry for a specific date by selecting that date | ||
| 1274 | in the calendar window and typing the @kbd{i d} command. This command | ||
| 1275 | displays the end of your diary file in another window and inserts the | ||
| 1276 | date; you can then type the rest of the diary entry. | ||
| 1277 | |||
| 1278 | @kindex i w @r{(Calendar mode)} | ||
| 1279 | @findex insert-weekly-diary-entry | ||
| 1280 | @kindex i m @r{(Calendar mode)} | ||
| 1281 | @findex insert-monthly-diary-entry | ||
| 1282 | @kindex i y @r{(Calendar mode)} | ||
| 1283 | @findex insert-yearly-diary-entry | ||
| 1284 | If you want to make a diary entry that applies to a specific day of | ||
| 1285 | the week, select that day of the week (any occurrence will do) and type | ||
| 1286 | @kbd{i w}. This inserts the day-of-week as a generic date; you can then | ||
| 1287 | type the rest of the diary entry. You can make a monthly diary entry in | ||
| 1288 | the same fashion: select the day of the month, use the @kbd{i m} | ||
| 1289 | command, and type the rest of the entry. Similarly, you can insert a | ||
| 1290 | yearly diary entry with the @kbd{i y} command. | ||
| 1291 | |||
| 1292 | All of the above commands make marking diary entries by default. To | ||
| 1293 | make a nonmarking diary entry, give a numeric argument to the command. | ||
| 1294 | For example, @kbd{C-u i w} makes a nonmarking weekly diary entry. | ||
| 1295 | |||
| 1296 | When you modify the diary file, be sure to save the file before | ||
| 1297 | exiting Emacs. Saving the diary file after using any of the above | ||
| 1298 | insertion commands will automatically update the diary marks in the | ||
| 1299 | calendar window, if appropriate. You can use the command | ||
| 1300 | @code{redraw-calendar} to force an update at any time. | ||
| 1301 | |||
| 1302 | @node Special Diary Entries | ||
| 1303 | @subsection Special Diary Entries | ||
| 1304 | |||
| 1305 | In addition to entries based on calendar dates, the diary file can | ||
| 1306 | contain @dfn{sexp entries} for regular events such as anniversaries. | ||
| 1307 | These entries are based on Lisp expressions (sexps) that Emacs evaluates | ||
| 1308 | as it scans the diary file. Instead of a date, a sexp entry contains | ||
| 1309 | @samp{%%} followed by a Lisp expression which must begin and end with | ||
| 1310 | parentheses. The Lisp expression determines which dates the entry | ||
| 1311 | applies to. | ||
| 1312 | |||
| 1313 | Calendar mode provides commands to insert certain commonly used | ||
| 1314 | sexp entries: | ||
| 1315 | |||
| 1316 | @table @kbd | ||
| 1317 | @item i a | ||
| 1318 | Add an anniversary diary entry for the selected date | ||
| 1319 | (@code{insert-anniversary-diary-entry}). | ||
| 1320 | @item i b | ||
| 1321 | Add a block diary entry for the current region | ||
| 1322 | (@code{insert-block-diary-entry}). | ||
| 1323 | @item i c | ||
| 1324 | Add a cyclic diary entry starting at the date | ||
| 1325 | (@code{insert-cyclic-diary-entry}). | ||
| 1326 | @end table | ||
| 1327 | |||
| 1328 | @kindex i a @r{(Calendar mode)} | ||
| 1329 | @findex insert-anniversary-diary-entry | ||
| 1330 | If you want to make a diary entry that applies to the anniversary of a | ||
| 1331 | specific date, move point to that date and use the @kbd{i a} command. | ||
| 1332 | This displays the end of your diary file in another window and inserts | ||
| 1333 | the anniversary description; you can then type the rest of the diary | ||
| 1334 | entry. The entry looks like this: | ||
| 1335 | |||
| 1336 | @findex diary-anniversary | ||
| 1337 | @example | ||
| 1338 | %%(diary-anniversary 10 31 1948) Arthur's birthday | ||
| 1339 | @end example | ||
| 1340 | |||
| 1341 | @noindent | ||
| 1342 | This entry applies to October 31 in any year after 1948; @samp{10 31 | ||
| 1343 | 1948} specifies the date. (If you are using the European calendar | ||
| 1344 | style, the month and day are interchanged.) The reason this expression | ||
| 1345 | requires a beginning year is that advanced diary functions can use it to | ||
| 1346 | calculate the number of elapsed years. | ||
| 1347 | |||
| 1348 | A @dfn{block} diary entry applies to a specified range of consecutive | ||
| 1349 | dates. Here is a block diary entry that applies to all dates from June | ||
| 1350 | 24, 1990 through July 10, 1990: | ||
| 1351 | |||
| 1352 | @findex diary-block | ||
| 1353 | @example | ||
| 1354 | %%(diary-block 6 24 1990 7 10 1990) Vacation | ||
| 1355 | @end example | ||
| 1356 | |||
| 1357 | @noindent | ||
| 1358 | The @samp{6 24 1990} indicates the starting date and the @samp{7 10 1990} | ||
| 1359 | indicates the stopping date. (Again, if you are using the European calendar | ||
| 1360 | style, the month and day are interchanged.) | ||
| 1361 | |||
| 1362 | @kindex i b @r{(Calendar mode)} | ||
| 1363 | @findex insert-block-diary-entry | ||
| 1364 | To insert a block entry, place point and the mark on the two | ||
| 1365 | dates that begin and end the range, and type @kbd{i b}. This command | ||
| 1366 | displays the end of your diary file in another window and inserts the | ||
| 1367 | block description; you can then type the diary entry. | ||
| 1368 | |||
| 1369 | @kindex i c @r{(Calendar mode)} | ||
| 1370 | @findex insert-cyclic-diary-entry | ||
| 1371 | @dfn{Cyclic} diary entries repeat after a fixed interval of days. To | ||
| 1372 | create one, select the starting date and use the @kbd{i c} command. The | ||
| 1373 | command prompts for the length of interval, then inserts the entry, | ||
| 1374 | which looks like this: | ||
| 1375 | |||
| 1376 | @findex diary-cyclic | ||
| 1377 | @example | ||
| 1378 | %%(diary-cyclic 50 3 1 1990) Renew medication | ||
| 1379 | @end example | ||
| 1380 | |||
| 1381 | @noindent | ||
| 1382 | This entry applies to March 1, 1990 and every 50th day following; | ||
| 1383 | @samp{3 1 1990} specifies the starting date. (If you are using the | ||
| 1384 | European calendar style, the month and day are interchanged.) | ||
| 1385 | |||
| 1386 | All three of these commands make marking diary entries. To insert a | ||
| 1387 | nonmarking entry, give a numeric argument to the command. For example, | ||
| 1388 | @kbd{C-u i a} makes a nonmarking anniversary diary entry. | ||
| 1389 | |||
| 1390 | Marking sexp diary entries in the calendar is @emph{extremely} | ||
| 1391 | time-consuming, since every date visible in the calendar window must be | ||
| 1392 | individually checked. So it's a good idea to make sexp diary entries | ||
| 1393 | nonmarking (with @samp{&}) when possible. | ||
| 1394 | |||
| 1395 | Another sophisticated kind of sexp entry, a @dfn{floating} diary entry, | ||
| 1396 | specifies a regularly occurring event by offsets specified in days, | ||
| 1397 | weeks, and months. It is comparable to a crontab entry interpreted by | ||
| 1398 | the @code{cron} utility. Here is a nonmarking, floating diary entry | ||
| 1399 | that applies to the last Thursday in November: | ||
| 1400 | |||
| 1401 | @findex diary-float | ||
| 1402 | @example | ||
| 1403 | &%%(diary-float 11 4 -1) American Thanksgiving | ||
| 1404 | @end example | ||
| 1405 | |||
| 1406 | @noindent | ||
| 1407 | The 11 specifies November (the eleventh month), the 4 specifies Thursday | ||
| 1408 | (the fourth day of the week, where Sunday is numbered zero), and the | ||
| 1409 | @minus{}1 specifies ``last'' (1 would mean ``first,'' 2 would mean | ||
| 1410 | ``second,'' @minus{}2 would mean ``second-to-last,'' and so on). The | ||
| 1411 | month can be a single month or a list of months. Thus you could change | ||
| 1412 | the 11 above to @samp{'(1 2 3)} and have the entry apply to the last | ||
| 1413 | Thursday of January, February, and March. If the month is @code{t}, the | ||
| 1414 | entry applies to all months of the year.@refill | ||
| 1415 | |||
| 1416 | Each of the standard sexp diary entries takes an optional parameter | ||
| 1417 | specifying the name of a face or a single-character string to use when | ||
| 1418 | marking the entry in the calendar. Most generally, sexp diary entries | ||
| 1419 | can perform arbitrary computations to determine when they apply. | ||
| 1420 | @iftex | ||
| 1421 | @inforef{Sexp Diary Entries,, emacs-xtra}. | ||
| 1422 | @end iftex | ||
| 1423 | @ifnottex | ||
| 1424 | @inforef{Sexp Diary Entries}. | ||
| 1425 | @end ifnottex | ||
| 1426 | |||
| 1427 | @node Appointments | ||
| 1428 | @section Appointments | ||
| 1429 | @cindex appointment notification | ||
| 1430 | |||
| 1431 | @vindex appt-display-format | ||
| 1432 | @vindex appt-audible | ||
| 1433 | @vindex appt-display-mode-line | ||
| 1434 | If you have a diary entry for an appointment, and that diary entry | ||
| 1435 | begins with a recognizable time of day, Emacs can warn you several | ||
| 1436 | minutes beforehand that that appointment is pending. Emacs alerts you | ||
| 1437 | to the appointment by displaying a message in your chosen format, as | ||
| 1438 | specified by the variable @code{appt-display-format}. If the value of | ||
| 1439 | @code{appt-audible} is non-@code{nil}, the warning includes an audible | ||
| 1440 | reminder. In addition, if @code{appt-display-mode-line} is | ||
| 1441 | non-@code{nil}, Emacs displays the number of minutes to the | ||
| 1442 | appointment on the mode line. | ||
| 1443 | |||
| 1444 | @vindex appt-display-duration | ||
| 1445 | @vindex appt-disp-window-function | ||
| 1446 | @vindex appt-delete-window-function | ||
| 1447 | If @code{appt-display-format} has the value @code{window}, then the | ||
| 1448 | variable @code{appt-display-duration} controls how long the reminder | ||
| 1449 | window is visible for; and the variables | ||
| 1450 | @code{appt-disp-window-function} and @code{appt-delete-window-function} | ||
| 1451 | give the names of functions used to create and destroy the window, | ||
| 1452 | respectively. | ||
| 1453 | |||
| 1454 | @findex appt-activate | ||
| 1455 | To enable appointment notification, use the command @kbd{M-x | ||
| 1456 | appt-activate}. With a positive argument, it enables notification; | ||
| 1457 | with a negative argument, it disables notification; with no argument, | ||
| 1458 | it toggles. Enabling notification also sets up an appointment list | ||
| 1459 | for today from the diary file, giving all diary entries found with | ||
| 1460 | recognizable times of day, and reminds you just before each of them. | ||
| 1461 | |||
| 1462 | For example, suppose the diary file contains these lines: | ||
| 1463 | |||
| 1464 | @example | ||
| 1465 | Monday | ||
| 1466 | 9:30am Coffee break | ||
| 1467 | 12:00pm Lunch | ||
| 1468 | @end example | ||
| 1469 | |||
| 1470 | @vindex appt-message-warning-time | ||
| 1471 | @noindent | ||
| 1472 | Then on Mondays, you will be reminded at around 9:20am about your | ||
| 1473 | coffee break and at around 11:50am about lunch. The variable | ||
| 1474 | @code{appt-message-warning-time} specifies how many minutes in advance | ||
| 1475 | to warn you; its default value is 12 (12 minutes). | ||
| 1476 | |||
| 1477 | You can write times in am/pm style (with @samp{12:00am} standing | ||
| 1478 | for midnight and @samp{12:00pm} standing for noon), or 24-hour | ||
| 1479 | European/military style. You need not be consistent; your diary file | ||
| 1480 | can have a mixture of the two styles. Times must be at the beginning | ||
| 1481 | of lines if they are to be recognized. | ||
| 1482 | |||
| 1483 | @vindex appt-display-diary | ||
| 1484 | Emacs updates the appointments list from the diary file | ||
| 1485 | automatically just after midnight. You can force an update at any | ||
| 1486 | time by re-enabling appointment notification. Both these actions also | ||
| 1487 | display the day's diary buffer, unless you set | ||
| 1488 | @code{appt-display-diary} to @code{nil}. The appointments list is | ||
| 1489 | also updated whenever the diary file is saved. | ||
| 1490 | |||
| 1491 | @findex appt-add | ||
| 1492 | @findex appt-delete | ||
| 1493 | @cindex alarm clock | ||
| 1494 | You can also use the appointment notification facility like an alarm | ||
| 1495 | clock. The command @kbd{M-x appt-add} adds entries to the appointment | ||
| 1496 | list without affecting your diary file. You delete entries from the | ||
| 1497 | appointment list with @kbd{M-x appt-delete}. | ||
| 1498 | |||
| 1499 | @node Importing Diary | ||
| 1500 | @section Importing and Exporting Diary Entries | ||
| 1501 | |||
| 1502 | You can transfer diary entries between Emacs diary files and a | ||
| 1503 | variety of other formats. | ||
| 1504 | |||
| 1505 | @vindex diary-outlook-formats | ||
| 1506 | You can import diary entries from Outlook-generated appointment | ||
| 1507 | messages. While viewing such a message in Rmail or Gnus, do @kbd{M-x | ||
| 1508 | diary-from-outlook} to import the entry. You can make this command | ||
| 1509 | recognize additional appointment message formats by customizing the | ||
| 1510 | variable @code{diary-outlook-formats}. | ||
| 1511 | |||
| 1512 | @cindex iCalendar support | ||
| 1513 | The icalendar package allows you to transfer data between your Emacs | ||
| 1514 | diary file and iCalendar files, which are defined in ``RFC | ||
| 1515 | 2445---Internet Calendaring and Scheduling Core Object Specification | ||
| 1516 | (iCalendar)'' (as well as the earlier vCalendar format). | ||
| 1517 | |||
| 1518 | Importing works for ``ordinary'' (i.e. non-recurring) events, but | ||
| 1519 | (at present) may not work correctly (if at all) for recurring events. | ||
| 1520 | Exporting of diary files into iCalendar files should work correctly | ||
| 1521 | for most diary entries. This feature is a work in progress, so the | ||
| 1522 | commands may evolve in future. | ||
| 1523 | |||
| 1524 | @findex icalendar-import-buffer | ||
| 1525 | The command @code{icalendar-import-buffer} extracts | ||
| 1526 | iCalendar data from the current buffer and adds it to your (default) | ||
| 1527 | diary file. This function is also suitable for automatic extraction of | ||
| 1528 | iCalendar data; for example with the Rmail mail client one could use: | ||
| 1529 | |||
| 1530 | @example | ||
| 1531 | (add-hook 'rmail-show-message-hook 'icalendar-import-buffer) | ||
| 1532 | @end example | ||
| 1533 | |||
| 1534 | @findex icalendar-import-file | ||
| 1535 | The command @code{icalendar-import-file} imports an iCalendar file | ||
| 1536 | and adds the results to an Emacs diary file. For example: | ||
| 1537 | |||
| 1538 | @example | ||
| 1539 | (icalendar-import-file "/here/is/calendar.ics" | ||
| 1540 | "/there/goes/ical-diary") | ||
| 1541 | @end example | ||
| 1542 | |||
| 1543 | @noindent | ||
| 1544 | You can use an @code{#include} directive to add the import file contents | ||
| 1545 | to the main diary file, if these are different files. | ||
| 1546 | @iftex | ||
| 1547 | @inforef{Fancy Diary Display,, emacs-xtra}. | ||
| 1548 | @end iftex | ||
| 1549 | @ifnottex | ||
| 1550 | @xref{Fancy Diary Display}. | ||
| 1551 | @end ifnottex | ||
| 1552 | |||
| 1553 | |||
| 1554 | @findex icalendar-export-file, icalendar-export-region | ||
| 1555 | Use @code{icalendar-export-file} to interactively export an entire | ||
| 1556 | Emacs diary file to iCalendar format. To export only a part of a diary | ||
| 1557 | file, mark the relevant area, and call @code{icalendar-export-region}. | ||
| 1558 | In both cases the result is appended to the target file. | ||
| 1559 | |||
| 1560 | @node Daylight Saving | ||
| 1561 | @section Daylight Saving Time | ||
| 1562 | @cindex daylight saving time | ||
| 1563 | |||
| 1564 | Emacs understands the difference between standard time and daylight | ||
| 1565 | saving time---the times given for sunrise, sunset, solstices, | ||
| 1566 | equinoxes, and the phases of the moon take that into account. The rules | ||
| 1567 | for daylight saving time vary from place to place and have also varied | ||
| 1568 | historically from year to year. To do the job properly, Emacs needs to | ||
| 1569 | know which rules to use. | ||
| 1570 | |||
| 1571 | @vindex calendar-daylight-savings-starts | ||
| 1572 | @vindex calendar-daylight-savings-ends | ||
| 1573 | Some operating systems keep track of the rules that apply to the place | ||
| 1574 | where you are; on these systems, Emacs gets the information it needs | ||
| 1575 | from the system automatically. If some or all of this information is | ||
| 1576 | missing, Emacs fills in the gaps with the rules currently used in | ||
| 1577 | Cambridge, Massachusetts. If the resulting rules are not what you want, | ||
| 1578 | you can tell Emacs the rules to use by setting certain variables: | ||
| 1579 | @code{calendar-daylight-savings-starts} and | ||
| 1580 | @code{calendar-daylight-savings-ends}. | ||
| 1581 | |||
| 1582 | These values should be Lisp expressions that refer to the variable | ||
| 1583 | @code{year}, and evaluate to the Gregorian date on which daylight | ||
| 1584 | saving time starts or (respectively) ends, in the form of a list | ||
| 1585 | @code{(@var{month} @var{day} @var{year})}. The values should be | ||
| 1586 | @code{nil} if your area does not use daylight saving time. | ||
| 1587 | |||
| 1588 | Emacs uses these expressions to determine the starting date of | ||
| 1589 | daylight saving time for the holiday list and for correcting times of | ||
| 1590 | day in the solar and lunar calculations. | ||
| 1591 | |||
| 1592 | The values for Cambridge, Massachusetts are as follows: | ||
| 1593 | |||
| 1594 | @example | ||
| 1595 | (calendar-nth-named-day 2 0 3 year) | ||
| 1596 | (calendar-nth-named-day 1 0 11 year) | ||
| 1597 | @end example | ||
| 1598 | |||
| 1599 | @noindent | ||
| 1600 | That is, the second 0th day (Sunday) of the third month (March) in | ||
| 1601 | the year specified by @code{year}, and the first Sunday of the eleventh month | ||
| 1602 | (November) of that year. If daylight saving time were | ||
| 1603 | changed to start on October 1, you would set | ||
| 1604 | @code{calendar-daylight-savings-starts} to this: | ||
| 1605 | |||
| 1606 | @example | ||
| 1607 | (list 10 1 year) | ||
| 1608 | @end example | ||
| 1609 | |||
| 1610 | If there is no daylight saving time at your location, or if you want | ||
| 1611 | all times in standard time, set @code{calendar-daylight-savings-starts} | ||
| 1612 | and @code{calendar-daylight-savings-ends} to @code{nil}. | ||
| 1613 | |||
| 1614 | @vindex calendar-daylight-time-offset | ||
| 1615 | The variable @code{calendar-daylight-time-offset} specifies the | ||
| 1616 | difference between daylight saving time and standard time, measured in | ||
| 1617 | minutes. The value for Cambridge, Massachusetts is 60. | ||
| 1618 | |||
| 1619 | @c @vindex calendar-daylight-savings-starts-time too long! | ||
| 1620 | @vindex calendar-daylight-savings-ends-time | ||
| 1621 | Finally, the two variables | ||
| 1622 | @code{calendar-daylight-savings-starts-time} and | ||
| 1623 | @code{calendar-daylight-savings-ends-time} specify the number of | ||
| 1624 | minutes after midnight local time when the transition to and from | ||
| 1625 | daylight saving time should occur. For Cambridge, Massachusetts both | ||
| 1626 | variables' values are 120. | ||
| 1627 | |||
| 1628 | @node Time Intervals | ||
| 1629 | @section Summing Time Intervals | ||
| 1630 | @cindex time intervals, summing | ||
| 1631 | @cindex summing time intervals | ||
| 1632 | @cindex timeclock | ||
| 1633 | |||
| 1634 | The timeclock feature adds up time intervals, so you can (for | ||
| 1635 | instance) keep track of how much time you spend working on particular | ||
| 1636 | projects. | ||
| 1637 | |||
| 1638 | @findex timeclock-in | ||
| 1639 | @findex timeclock-out | ||
| 1640 | @findex timeclock-change | ||
| 1641 | @findex timeclock-workday-remaining | ||
| 1642 | @findex timeclock-when-to-leave | ||
| 1643 | Use the @kbd{M-x timeclock-in} command when you start working on a | ||
| 1644 | project, and @kbd{M-x timeclock-out} command when you're done. Each | ||
| 1645 | time you do this, it adds one time interval to the record of the | ||
| 1646 | project. You can change to working on a different project with @kbd{M-x | ||
| 1647 | timeclock-change}. | ||
| 1648 | |||
| 1649 | Once you've collected data from a number of time intervals, you can use | ||
| 1650 | @kbd{M-x timeclock-workday-remaining} to see how much time is left to | ||
| 1651 | work today (assuming a typical average of 8 hours a day), and @kbd{M-x | ||
| 1652 | timeclock-when-to-leave} which will calculate when you're ``done.'' | ||
| 1653 | |||
| 1654 | @vindex timeclock-modeline-display | ||
| 1655 | @findex timeclock-modeline-display | ||
| 1656 | If you want Emacs to display the amount of time ``left'' of your | ||
| 1657 | workday in the mode line, either customize the | ||
| 1658 | @code{timeclock-modeline-display} variable and set its value to | ||
| 1659 | @code{t}, or invoke the @kbd{M-x timeclock-modeline-display} command. | ||
| 1660 | |||
| 1661 | @vindex timeclock-ask-before-exiting | ||
| 1662 | Terminating the current Emacs session might or might not mean that | ||
| 1663 | you have stopped working on the project and, by default, Emacs asks | ||
| 1664 | you. You can, however, set the value of the variable | ||
| 1665 | @code{timeclock-ask-before-exiting} to @code{nil} (via @kbd{M-x | ||
| 1666 | customize}) to avoid the question; then, only an explicit @kbd{M-x | ||
| 1667 | timeclock-out} or @kbd{M-x timeclock-change} will tell Emacs that the | ||
| 1668 | current interval is over. | ||
| 1669 | |||
| 1670 | @cindex @file{.timelog} file | ||
| 1671 | @vindex timeclock-file | ||
| 1672 | @findex timeclock-reread-log | ||
| 1673 | The timeclock functions work by accumulating the data in a file | ||
| 1674 | called @file{.timelog} in your home directory. You can specify a | ||
| 1675 | different name for this file by customizing the variable | ||
| 1676 | @code{timeclock-file}. If you edit the timeclock file manually, or if | ||
| 1677 | you change the value of any of timeclock's customizable variables, you | ||
| 1678 | should run the command @kbd{M-x timeclock-reread-log} to update the | ||
| 1679 | data in Emacs from the file. | ||
| 1680 | |||
| 1681 | @ifnottex | ||
| 1682 | @include cal-xtra.texi | ||
| 1683 | @end ifnottex | ||
| 1684 | |||
| 1685 | @ignore | ||
| 1686 | arch-tag: 4531ef09-9df3-449d-9c52-2b5a4a337f92 | ||
| 1687 | @end ignore | ||
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi new file mode 100644 index 00000000000..28bad72f0bf --- /dev/null +++ b/doc/emacs/cmdargs.texi | |||
| @@ -0,0 +1,1263 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Emacs Invocation, X Resources, GNU Free Documentation License, Top | ||
| 6 | @appendix Command Line Arguments for Emacs Invocation | ||
| 7 | @cindex command line arguments | ||
| 8 | @cindex arguments (command line) | ||
| 9 | @cindex options (command line) | ||
| 10 | @cindex switches (command line) | ||
| 11 | @cindex startup (command line arguments) | ||
| 12 | @cindex invocation (command line arguments) | ||
| 13 | |||
| 14 | GNU Emacs supports command line arguments to request various actions | ||
| 15 | when invoking Emacs. These are for compatibility with other editors and | ||
| 16 | for sophisticated activities. We don't recommend using them for | ||
| 17 | ordinary editing. | ||
| 18 | |||
| 19 | Arguments starting with @samp{-} are @dfn{options}, and so is | ||
| 20 | @samp{+@var{linenum}}. All other arguments specify files to visit. | ||
| 21 | Emacs visits the specified files while it starts up. The last file | ||
| 22 | name on your command line becomes the current buffer; the other files | ||
| 23 | are also visited in other buffers. If there are two files, they are | ||
| 24 | both displayed; otherwise the last file is displayed along with a | ||
| 25 | buffer list that shows what other buffers there are. As with most | ||
| 26 | programs, the special argument @samp{--} says that all subsequent | ||
| 27 | arguments are file names, not options, even if they start with | ||
| 28 | @samp{-}. | ||
| 29 | |||
| 30 | Emacs command options can specify many things, such as the size and | ||
| 31 | position of the X window Emacs uses, its colors, and so on. A few | ||
| 32 | options support advanced usage, such as running Lisp functions on files | ||
| 33 | in batch mode. The sections of this chapter describe the available | ||
| 34 | options, arranged according to their purpose. | ||
| 35 | |||
| 36 | There are two ways of writing options: the short forms that start with | ||
| 37 | a single @samp{-}, and the long forms that start with @samp{--}. For | ||
| 38 | example, @samp{-d} is a short form and @samp{--display} is the | ||
| 39 | corresponding long form. | ||
| 40 | |||
| 41 | The long forms with @samp{--} are easier to remember, but longer to | ||
| 42 | type. However, you don't have to spell out the whole option name; any | ||
| 43 | unambiguous abbreviation is enough. When a long option takes an | ||
| 44 | argument, you can use either a space or an equal sign to separate the | ||
| 45 | option name and the argument. Thus, you can write either | ||
| 46 | @samp{--display sugar-bombs:0.0} or @samp{--display=sugar-bombs:0.0}. | ||
| 47 | We recommend an equal sign because it makes the relationship clearer, | ||
| 48 | and the tables below always show an equal sign. | ||
| 49 | |||
| 50 | @cindex initial options (command line) | ||
| 51 | @cindex action options (command line) | ||
| 52 | @vindex command-line-args | ||
| 53 | Most options specify how to initialize Emacs, or set parameters for | ||
| 54 | the Emacs session. We call them @dfn{initial options}. A few options | ||
| 55 | specify things to do: for example, load libraries, call functions, or | ||
| 56 | terminate Emacs. These are called @dfn{action options}. These and file | ||
| 57 | names together are called @dfn{action arguments}. Emacs processes all | ||
| 58 | the action arguments in the order they are written. The @file{.emacs} file | ||
| 59 | can access the values of the action arguments as the elements of a list in | ||
| 60 | the variable @code{command-line-args}. | ||
| 61 | |||
| 62 | |||
| 63 | |||
| 64 | @menu | ||
| 65 | * Action Arguments:: Arguments to visit files, load libraries, | ||
| 66 | and call functions. | ||
| 67 | * Initial Options:: Arguments that take effect while starting Emacs. | ||
| 68 | * Command Example:: Examples of using command line arguments. | ||
| 69 | * Resume Arguments:: Specifying arguments when you resume a running Emacs. | ||
| 70 | * Environment:: Environment variables that Emacs uses. | ||
| 71 | * Display X:: Changing the default display and using remote login. | ||
| 72 | * Font X:: Choosing a font for text, under X. | ||
| 73 | * Colors:: Choosing display colors. | ||
| 74 | * Window Size X:: Start-up window size, under X. | ||
| 75 | * Borders X:: Internal and external borders, under X. | ||
| 76 | * Title X:: Specifying the initial frame's title. | ||
| 77 | * Icons X:: Choosing what sort of icon to use, under X. | ||
| 78 | * Misc X:: Other display options. | ||
| 79 | @end menu | ||
| 80 | |||
| 81 | @node Action Arguments | ||
| 82 | @appendixsec Action Arguments | ||
| 83 | |||
| 84 | Here is a table of the action arguments and options: | ||
| 85 | |||
| 86 | @table @samp | ||
| 87 | @item @var{file} | ||
| 88 | @opindex --file | ||
| 89 | @itemx --file=@var{file} | ||
| 90 | @opindex --find-file | ||
| 91 | @itemx --find-file=@var{file} | ||
| 92 | @opindex --visit | ||
| 93 | @itemx --visit=@var{file} | ||
| 94 | @cindex visiting files, command-line argument | ||
| 95 | @vindex inhibit-startup-buffer-menu | ||
| 96 | Visit @var{file} using @code{find-file}. @xref{Visiting}. | ||
| 97 | If you visit several files at startup in this way, Emacs | ||
| 98 | also displays a Buffer Menu buffer to show you what files it | ||
| 99 | has visited. You can inhibit that by setting @code{inhibit-startup-buffer-menu} to @code{t}. | ||
| 100 | |||
| 101 | @item +@var{linenum} @var{file} | ||
| 102 | @opindex +@var{linenum} | ||
| 103 | Visit @var{file} using @code{find-file}, then go to line number | ||
| 104 | @var{linenum} in it. | ||
| 105 | |||
| 106 | @item +@var{linenum}:@var{columnnum} @var{file} | ||
| 107 | Visit @var{file} using @code{find-file}, then go to line number | ||
| 108 | @var{linenum} and put point at column number @var{columnnum}. | ||
| 109 | |||
| 110 | @need 3000 | ||
| 111 | @item -l @var{file} | ||
| 112 | @opindex -l | ||
| 113 | @itemx --load=@var{file} | ||
| 114 | @opindex --load | ||
| 115 | @cindex loading Lisp libraries, command-line argument | ||
| 116 | Load a Lisp library named @var{file} with the function @code{load}. | ||
| 117 | @xref{Lisp Libraries}. If @var{file} is not an absolute file name, | ||
| 118 | the library can be found either in the current directory, or in the | ||
| 119 | Emacs library search path as specified with @env{EMACSLOADPATH} | ||
| 120 | (@pxref{General Variables}). | ||
| 121 | |||
| 122 | @strong{Warning:} If previous command-line arguments have visited | ||
| 123 | files, the current directory is the directory of the last file | ||
| 124 | visited. | ||
| 125 | |||
| 126 | @item -L @var{dir} | ||
| 127 | @opindex -L | ||
| 128 | @itemx --directory=@var{dir} | ||
| 129 | @opindex --directory | ||
| 130 | Add directory @var{dir} to the variable @code{load-path}. | ||
| 131 | |||
| 132 | @item -f @var{function} | ||
| 133 | @opindex -f | ||
| 134 | @itemx --funcall=@var{function} | ||
| 135 | @opindex --funcall | ||
| 136 | @cindex call Lisp functions, command-line argument | ||
| 137 | Call Lisp function @var{function}. If it is an interactive function | ||
| 138 | (a command), it reads the arguments interactively just as if you had | ||
| 139 | called the same function with a key sequence. Otherwise, it calls the | ||
| 140 | function with no arguments. | ||
| 141 | |||
| 142 | @item --eval=@var{expression} | ||
| 143 | @opindex --eval | ||
| 144 | @itemx --execute=@var{expression} | ||
| 145 | @opindex --execute | ||
| 146 | @cindex evaluate expression, command-line argument | ||
| 147 | Evaluate Lisp expression @var{expression}. | ||
| 148 | |||
| 149 | @item --insert=@var{file} | ||
| 150 | @opindex --insert | ||
| 151 | @cindex insert file contents, command-line argument | ||
| 152 | Insert the contents of @var{file} into the current buffer. This is like | ||
| 153 | what @kbd{M-x insert-file} does. @xref{Misc File Ops}. | ||
| 154 | |||
| 155 | @item --kill | ||
| 156 | @opindex --kill | ||
| 157 | Exit from Emacs without asking for confirmation. | ||
| 158 | |||
| 159 | @item --help | ||
| 160 | @opindex --help | ||
| 161 | Print a usage message listing all available options, then exit | ||
| 162 | successfully. | ||
| 163 | |||
| 164 | @item --version | ||
| 165 | @opindex --version | ||
| 166 | Print Emacs version, then exit successfully. | ||
| 167 | @end table | ||
| 168 | |||
| 169 | @node Initial Options | ||
| 170 | @appendixsec Initial Options | ||
| 171 | |||
| 172 | The initial options specify parameters for the Emacs session. This | ||
| 173 | section describes the more general initial options; some other options | ||
| 174 | specifically related to the X Window System appear in the following | ||
| 175 | sections. | ||
| 176 | |||
| 177 | Some initial options affect the loading of init files. The normal | ||
| 178 | actions of Emacs are to first load @file{site-start.el} if it exists, | ||
| 179 | then your own init file @file{~/.emacs} if it exists, and finally | ||
| 180 | @file{default.el} if it exists. @xref{Init File}. Certain options | ||
| 181 | prevent loading of some of these files or substitute other files for | ||
| 182 | them. | ||
| 183 | |||
| 184 | @table @samp | ||
| 185 | @item -t @var{device} | ||
| 186 | @opindex -t | ||
| 187 | @itemx --terminal=@var{device} | ||
| 188 | @opindex --terminal | ||
| 189 | @cindex device for Emacs terminal I/O | ||
| 190 | Use @var{device} as the device for terminal input and output. | ||
| 191 | @samp{--terminal} implies @samp{--no-window-system}. | ||
| 192 | |||
| 193 | @item -d @var{display} | ||
| 194 | @opindex -d | ||
| 195 | @itemx --display=@var{display} | ||
| 196 | @opindex --display | ||
| 197 | @cindex display for Emacs frame | ||
| 198 | Use the X Window System and use the display named @var{display} to open | ||
| 199 | the initial Emacs frame. @xref{Display X}, for more details. | ||
| 200 | |||
| 201 | @item -nw | ||
| 202 | @opindex -nw | ||
| 203 | @itemx --no-window-system | ||
| 204 | @opindex --no-window-system | ||
| 205 | @cindex disable window system | ||
| 206 | Don't communicate directly with the window system, disregarding the | ||
| 207 | @env{DISPLAY} environment variable even if it is set. This means that | ||
| 208 | Emacs uses the terminal from which it was launched for all its display | ||
| 209 | and input. | ||
| 210 | |||
| 211 | @need 3000 | ||
| 212 | @cindex batch mode | ||
| 213 | @item -batch | ||
| 214 | @opindex --batch | ||
| 215 | @itemx --batch | ||
| 216 | Run Emacs in @dfn{batch mode}. Batch mode is used for running | ||
| 217 | programs written in Emacs Lisp from shell scripts, makefiles, and so | ||
| 218 | on. You should also use the @samp{-l}, @samp{-f} or @samp{--eval} | ||
| 219 | option, to invoke a Lisp program to do batch processing. | ||
| 220 | |||
| 221 | In batch mode, Emacs does not display the text being edited, and the | ||
| 222 | standard terminal interrupt characters such as @kbd{C-z} and @kbd{C-c} | ||
| 223 | continue to have their normal effect. The functions @code{prin1}, | ||
| 224 | @code{princ} and @code{print} output to @code{stdout} instead of the | ||
| 225 | echo area, while @code{message} and error messages output to | ||
| 226 | @code{stderr}. Functions that would normally read from the minibuffer | ||
| 227 | take their input from @code{stdin} instead. | ||
| 228 | |||
| 229 | @samp{--batch} implies @samp{-q} (do not load an init file), but | ||
| 230 | @file{site-start.el} is loaded nonetheless. It also causes Emacs to | ||
| 231 | exit after processing all the command options. In addition, it | ||
| 232 | disables auto-saving except in buffers for which it has been | ||
| 233 | explicitly requested. | ||
| 234 | |||
| 235 | @item --script @var{file} | ||
| 236 | @opindex --script | ||
| 237 | @cindex script mode | ||
| 238 | Run Emacs in batch mode, like @samp{--batch}, and then read and | ||
| 239 | execute the Lisp code in @var{file}. | ||
| 240 | |||
| 241 | The normal use of this option is in executable script files that run | ||
| 242 | Emacs. They can start with this text on the first line | ||
| 243 | |||
| 244 | @example | ||
| 245 | #!/usr/bin/emacs --script | ||
| 246 | @end example | ||
| 247 | |||
| 248 | @noindent | ||
| 249 | which will invoke Emacs with @samp{--script} and supply the name of | ||
| 250 | the script file as @var{file}. Emacs Lisp then treats @samp{#!} as a | ||
| 251 | comment delimiter. | ||
| 252 | |||
| 253 | @item -q | ||
| 254 | @opindex -q | ||
| 255 | @itemx --no-init-file | ||
| 256 | @opindex --no-init-file | ||
| 257 | @cindex bypassing init and @file{default.el} file | ||
| 258 | @cindex init file, not loading | ||
| 259 | @cindex @file{default.el} file, not loading | ||
| 260 | Do not load your Emacs init file @file{~/.emacs}, or @file{default.el} | ||
| 261 | either. Regardless of this switch, @file{site-start.el} is still loaded. | ||
| 262 | When invoked like this, Emacs does not allow saving options | ||
| 263 | changed with the @kbd{M-x customize} command and its variants. | ||
| 264 | @xref{Easy Customization}. | ||
| 265 | |||
| 266 | @item --no-site-file | ||
| 267 | @opindex --no-site-file | ||
| 268 | @cindex @file{site-start.el} file, not loading | ||
| 269 | Do not load @file{site-start.el}. The options @samp{-q}, @samp{-u} | ||
| 270 | and @samp{--batch} have no effect on the loading of this file---this | ||
| 271 | option and @samp{-Q} are the only options that block it. | ||
| 272 | |||
| 273 | @item -Q | ||
| 274 | @opindex -Q | ||
| 275 | @itemx --quick | ||
| 276 | @opindex --quick | ||
| 277 | Start emacs with minimum customizations. This is like using @samp{-q} | ||
| 278 | and @samp{--no-site-file}, but also disables the startup screen. | ||
| 279 | |||
| 280 | @item --no-splash | ||
| 281 | @opindex --no-splash | ||
| 282 | @vindex inhibit-splash-screen | ||
| 283 | @cindex splash screen | ||
| 284 | @cindex startup message | ||
| 285 | Do not display a splash screen on startup. You can also achieve this | ||
| 286 | effect by setting the variable @code{inhibit-splash-screen} to | ||
| 287 | non-@code{nil} in you personal init file (but @emph{not} in | ||
| 288 | @file{site-start.el}). (This variable was called | ||
| 289 | @code{inhibit-startup-message} in previous Emacs versions.) | ||
| 290 | |||
| 291 | @item --no-desktop | ||
| 292 | @opindex --no-desktop | ||
| 293 | Do not reload any saved desktop. @xref{Saving Emacs Sessions}. | ||
| 294 | |||
| 295 | @item -u @var{user} | ||
| 296 | @opindex -u | ||
| 297 | @itemx --user=@var{user} | ||
| 298 | @opindex --user | ||
| 299 | @cindex load init file of another user | ||
| 300 | Load @var{user}'s Emacs init file @file{~@var{user}/.emacs} instead of | ||
| 301 | your own@footnote{ | ||
| 302 | This option has no effect on MS-Windows.}. | ||
| 303 | |||
| 304 | @item --debug-init | ||
| 305 | @opindex --debug-init | ||
| 306 | @cindex errors in init file | ||
| 307 | Enable the Emacs Lisp debugger for errors in the init file. | ||
| 308 | @xref{Error Debugging,, Entering the Debugger on an Error, elisp, The | ||
| 309 | GNU Emacs Lisp Reference Manual}. | ||
| 310 | |||
| 311 | @item --unibyte | ||
| 312 | @opindex --unibyte | ||
| 313 | @itemx --no-multibyte | ||
| 314 | @opindex --no-multibyte | ||
| 315 | @cindex unibyte operation, command-line argument | ||
| 316 | Do almost everything with single-byte buffers and strings. | ||
| 317 | All buffers and strings are unibyte unless you (or a Lisp program) | ||
| 318 | explicitly ask for a multibyte buffer or string. (Note that Emacs | ||
| 319 | always loads Lisp files in multibyte mode, even if @samp{--unibyte} is | ||
| 320 | specified; see @ref{Enabling Multibyte}.) Setting the environment | ||
| 321 | variable @env{EMACS_UNIBYTE} has the same effect | ||
| 322 | (@pxref{General Variables}). | ||
| 323 | |||
| 324 | @item --multibyte | ||
| 325 | @opindex --multibyte | ||
| 326 | @itemx --no-unibyte | ||
| 327 | @opindex --no-unibyte | ||
| 328 | Inhibit the effect of @env{EMACS_UNIBYTE}, so that Emacs | ||
| 329 | uses multibyte characters by default, as usual. | ||
| 330 | @end table | ||
| 331 | |||
| 332 | @node Command Example | ||
| 333 | @appendixsec Command Argument Example | ||
| 334 | |||
| 335 | Here is an example of using Emacs with arguments and options. It | ||
| 336 | assumes you have a Lisp program file called @file{hack-c.el} which, when | ||
| 337 | loaded, performs some useful operation on the current buffer, expected | ||
| 338 | to be a C program. | ||
| 339 | |||
| 340 | @example | ||
| 341 | emacs --batch foo.c -l hack-c -f save-buffer >& log | ||
| 342 | @end example | ||
| 343 | |||
| 344 | @noindent | ||
| 345 | This says to visit @file{foo.c}, load @file{hack-c.el} (which makes | ||
| 346 | changes in the visited file), save @file{foo.c} (note that | ||
| 347 | @code{save-buffer} is the function that @kbd{C-x C-s} is bound to), and | ||
| 348 | then exit back to the shell (because of @samp{--batch}). @samp{--batch} | ||
| 349 | also guarantees there will be no problem redirecting output to | ||
| 350 | @file{log}, because Emacs will not assume that it has a display terminal | ||
| 351 | to work with. | ||
| 352 | |||
| 353 | @node Resume Arguments | ||
| 354 | @appendixsec Resuming Emacs with Arguments | ||
| 355 | |||
| 356 | You can specify action arguments for Emacs when you resume it after | ||
| 357 | a suspension. To prepare for this, put the following code in your | ||
| 358 | @file{.emacs} file (@pxref{Hooks}): | ||
| 359 | |||
| 360 | @c `resume-suspend-hook' is correct. It is the name of a function. | ||
| 361 | @example | ||
| 362 | (add-hook 'suspend-hook 'resume-suspend-hook) | ||
| 363 | (add-hook 'suspend-resume-hook 'resume-process-args) | ||
| 364 | @end example | ||
| 365 | |||
| 366 | As further preparation, you must execute the shell script | ||
| 367 | @file{emacs.csh} (if you use csh as your shell) or @file{emacs.bash} | ||
| 368 | (if you use bash as your shell). These scripts define an alias named | ||
| 369 | @code{edit}, which will resume Emacs giving it new command line | ||
| 370 | arguments such as files to visit. The scripts are found in the | ||
| 371 | @file{etc} subdirectory of the Emacs distribution. | ||
| 372 | |||
| 373 | Only action arguments work properly when you resume Emacs. Initial | ||
| 374 | arguments are not recognized---it's too late to execute them anyway. | ||
| 375 | |||
| 376 | Note that resuming Emacs (with or without arguments) must be done from | ||
| 377 | within the shell that is the parent of the Emacs job. This is why | ||
| 378 | @code{edit} is an alias rather than a program or a shell script. It is | ||
| 379 | not possible to implement a resumption command that could be run from | ||
| 380 | other subjobs of the shell; there is no way to define a command that could | ||
| 381 | be made the value of @env{EDITOR}, for example. Therefore, this feature | ||
| 382 | does not take the place of the Emacs Server feature (@pxref{Emacs | ||
| 383 | Server}). | ||
| 384 | |||
| 385 | The aliases use the Emacs Server feature if you appear to have a | ||
| 386 | server Emacs running. However, they cannot determine this with complete | ||
| 387 | accuracy. They may think that a server is still running when in | ||
| 388 | actuality you have killed that Emacs, because the file | ||
| 389 | @file{/tmp/esrv@dots{}} still exists. If this happens, find that | ||
| 390 | file and delete it. | ||
| 391 | |||
| 392 | @node Environment | ||
| 393 | @appendixsec Environment Variables | ||
| 394 | @cindex environment variables | ||
| 395 | |||
| 396 | The @dfn{environment} is a feature of the operating system; it | ||
| 397 | consists of a collection of variables with names and values. Each | ||
| 398 | variable is called an @dfn{environment variable}; environment variable | ||
| 399 | names are case-sensitive, and it is conventional to use upper case | ||
| 400 | letters only. The values are all text strings. | ||
| 401 | |||
| 402 | What makes the environment useful is that subprocesses inherit the | ||
| 403 | environment automatically from their parent process. This means you | ||
| 404 | can set up an environment variable in your login shell, and all the | ||
| 405 | programs you run (including Emacs) will automatically see it. | ||
| 406 | Subprocesses of Emacs (such as shells, compilers, and version-control | ||
| 407 | software) inherit the environment from Emacs, too. | ||
| 408 | |||
| 409 | @findex setenv | ||
| 410 | @findex getenv | ||
| 411 | Inside Emacs, the command @kbd{M-x getenv} gets the value of an | ||
| 412 | environment variable. @kbd{M-x setenv} sets a variable in the Emacs | ||
| 413 | environment. (Environment variable substitutions with @samp{$} work | ||
| 414 | in the value just as in file names; see @ref{File Names with $}.) | ||
| 415 | |||
| 416 | The way to set environment variables outside of Emacs depends on the | ||
| 417 | operating system, and especially the shell that you are using. For | ||
| 418 | example, here's how to set the environment variable @env{ORGANIZATION} | ||
| 419 | to @samp{not very much} using Bash: | ||
| 420 | |||
| 421 | @example | ||
| 422 | export ORGANIZATION="not very much" | ||
| 423 | @end example | ||
| 424 | |||
| 425 | @noindent | ||
| 426 | and here's how to do it in csh or tcsh: | ||
| 427 | |||
| 428 | @example | ||
| 429 | setenv ORGANIZATION "not very much" | ||
| 430 | @end example | ||
| 431 | |||
| 432 | When Emacs is using the X Window System, various environment | ||
| 433 | variables that control X work for Emacs as well. See the X | ||
| 434 | documentation for more information. | ||
| 435 | |||
| 436 | @menu | ||
| 437 | * General Variables:: Environment variables that all versions of Emacs use. | ||
| 438 | * Misc Variables:: Certain system-specific variables. | ||
| 439 | * MS-Windows Registry:: An alternative to the environment on MS-Windows. | ||
| 440 | @end menu | ||
| 441 | |||
| 442 | @node General Variables | ||
| 443 | @appendixsubsec General Variables | ||
| 444 | |||
| 445 | Here is an alphabetical list of specific environment variables that | ||
| 446 | have special meanings in Emacs, giving the name of each variable and | ||
| 447 | its meaning. Most of these variables are also used by some other | ||
| 448 | programs. Emacs does not require any of these environment variables | ||
| 449 | to be set, but it uses their values if they are set. | ||
| 450 | |||
| 451 | @table @env | ||
| 452 | @item CDPATH | ||
| 453 | Used by the @code{cd} command to search for the directory you specify, | ||
| 454 | when you specify a relative directory name. | ||
| 455 | @item EMACS_UNIBYTE | ||
| 456 | @cindex unibyte operation, environment variable | ||
| 457 | Defining this environment variable with a nonempty value directs Emacs | ||
| 458 | to do almost everything with single-byte buffers and strings. It is | ||
| 459 | equivalent to using the @samp{--unibyte} command-line option on each | ||
| 460 | invocation. @xref{Initial Options}. | ||
| 461 | @item EMACSDATA | ||
| 462 | Directory for the architecture-independent files that come with Emacs. | ||
| 463 | This is used to initialize the Lisp variable @code{data-directory}. | ||
| 464 | @item EMACSDOC | ||
| 465 | Directory for the documentation string file, | ||
| 466 | @file{DOC-@var{emacsversion}}. This is used to initialize the Lisp | ||
| 467 | variable @code{doc-directory}. | ||
| 468 | @item EMACSLOADPATH | ||
| 469 | A colon-separated list of directories@footnote{ | ||
| 470 | Here and below, whenever we say ``colon-separated list of directories,'' | ||
| 471 | it pertains to Unix and GNU/Linux systems. On MS-DOS and MS-Windows, | ||
| 472 | the directories are separated by semi-colons instead, since DOS/Windows | ||
| 473 | file names might include a colon after a drive letter.} | ||
| 474 | to search for Emacs Lisp files---used to initialize @code{load-path}. | ||
| 475 | @item EMACSPATH | ||
| 476 | A colon-separated list of directories to search for executable | ||
| 477 | files---used to initialize @code{exec-path}. | ||
| 478 | @item EMAIL | ||
| 479 | @vindex user-mail-address@r{, initialization} | ||
| 480 | Your email address; used to initialize the Lisp variable | ||
| 481 | @code{user-mail-address}, which the Emacs mail interface puts into | ||
| 482 | the @samp{From} header of outgoing messages (@pxref{Mail Headers}). | ||
| 483 | @item ESHELL | ||
| 484 | Used for shell-mode to override the @env{SHELL} environment variable. | ||
| 485 | @item HISTFILE | ||
| 486 | The name of the file that shell commands are saved in between logins. | ||
| 487 | This variable defaults to @file{~/.bash_history} if you use Bash, to | ||
| 488 | @file{~/.sh_history} if you use ksh, and to @file{~/.history} | ||
| 489 | otherwise. | ||
| 490 | @item HOME | ||
| 491 | The location of your files in the directory tree; used for | ||
| 492 | expansion of file names starting with a tilde (@file{~}). On MS-DOS, | ||
| 493 | it defaults to the directory from which Emacs was started, with | ||
| 494 | @samp{/bin} removed from the end if it was present. On Windows, the | ||
| 495 | default value of @env{HOME} is the @file{Application Data} | ||
| 496 | subdirectory of the user profile directory (normally, this is | ||
| 497 | @file{C:/Documents and Settings/@var{username}/Application Data}, | ||
| 498 | where @var{username} is your user name), though for backwards | ||
| 499 | compatibility @file{C:/} will be used instead if a @file{.emacs} file | ||
| 500 | is found there. | ||
| 501 | @item HOSTNAME | ||
| 502 | The name of the machine that Emacs is running on. | ||
| 503 | @item INCPATH | ||
| 504 | A colon-separated list of directories. Used by the @code{complete} package | ||
| 505 | to search for files. | ||
| 506 | @item INFOPATH | ||
| 507 | A colon-separated list of directories in which to search for Info files. | ||
| 508 | @item LC_ALL | ||
| 509 | @itemx LC_COLLATE | ||
| 510 | @itemx LC_CTYPE | ||
| 511 | @itemx LC_MESSAGES | ||
| 512 | @itemx LC_MONETARY | ||
| 513 | @itemx LC_NUMERIC | ||
| 514 | @itemx LC_TIME | ||
| 515 | @itemx LANG | ||
| 516 | The user's preferred locale. The locale has six categories, specified | ||
| 517 | by the environment variables @env{LC_COLLATE} for sorting, | ||
| 518 | @env{LC_CTYPE} for character encoding, @env{LC_MESSAGES} for system | ||
| 519 | messages, @env{LC_MONETARY} for monetary formats, @env{LC_NUMERIC} for | ||
| 520 | numbers, and @env{LC_TIME} for dates and times. If one of these | ||
| 521 | variables is not set, the category defaults to the value of the | ||
| 522 | @env{LANG} environment variable, or to the default @samp{C} locale if | ||
| 523 | @env{LANG} is not set. But if @env{LC_ALL} is specified, it overrides | ||
| 524 | the settings of all the other locale environment variables. | ||
| 525 | |||
| 526 | On MS-Windows, if @env{LANG} is not already set in the environment | ||
| 527 | when Emacs starts, Emacs sets it based on the system-wide default | ||
| 528 | language, which you can set in the @samp{Regional Settings} Control Panel | ||
| 529 | on some versions of MS-Windows. | ||
| 530 | |||
| 531 | The value of the @env{LC_CTYPE} category is | ||
| 532 | matched against entries in @code{locale-language-names}, | ||
| 533 | @code{locale-charset-language-names}, and | ||
| 534 | @code{locale-preferred-coding-systems}, to select a default language | ||
| 535 | environment and coding system. @xref{Language Environments}. | ||
| 536 | @item LOGNAME | ||
| 537 | The user's login name. See also @env{USER}. | ||
| 538 | @item MAIL | ||
| 539 | The name of your system mail inbox. | ||
| 540 | @item MH | ||
| 541 | Name of setup file for the mh system. (The default is @file{~/.mh_profile}.) | ||
| 542 | @item NAME | ||
| 543 | Your real-world name. | ||
| 544 | @item NNTPSERVER | ||
| 545 | The name of the news server. Used by the mh and Gnus packages. | ||
| 546 | @item ORGANIZATION | ||
| 547 | The name of the organization to which you belong. Used for setting the | ||
| 548 | `Organization:' header in your posts from the Gnus package. | ||
| 549 | @item PATH | ||
| 550 | A colon-separated list of directories in which executables reside. This | ||
| 551 | is used to initialize the Emacs Lisp variable @code{exec-path}. | ||
| 552 | @item PWD | ||
| 553 | If set, this should be the default directory when Emacs was started. | ||
| 554 | @item REPLYTO | ||
| 555 | If set, this specifies an initial value for the variable | ||
| 556 | @code{mail-default-reply-to}. @xref{Mail Headers}. | ||
| 557 | @item SAVEDIR | ||
| 558 | The name of a directory in which news articles are saved by default. | ||
| 559 | Used by the Gnus package. | ||
| 560 | @item SHELL | ||
| 561 | The name of an interpreter used to parse and execute programs run from | ||
| 562 | inside Emacs. | ||
| 563 | @item SMTPSERVER | ||
| 564 | The name of the outgoing mail server. Used by the SMTP library | ||
| 565 | (@pxref{Top,,,smtpmail,Sending mail via SMTP}). | ||
| 566 | @cindex background mode, on @command{xterm} | ||
| 567 | @item TERM | ||
| 568 | The type of the terminal that Emacs is using. This variable must be | ||
| 569 | set unless Emacs is run in batch mode. On MS-DOS, it defaults to | ||
| 570 | @samp{internal}, which specifies a built-in terminal emulation that | ||
| 571 | handles the machine's own display. If the value of @env{TERM} indicates | ||
| 572 | that Emacs runs in non-windowed mode from @command{xterm} or a similar | ||
| 573 | terminal emulator, the background mode defaults to @samp{light}, and | ||
| 574 | Emacs will choose colors that are appropriate for a light background. | ||
| 575 | @item TERMCAP | ||
| 576 | The name of the termcap library file describing how to program the | ||
| 577 | terminal specified by the @env{TERM} variable. This defaults to | ||
| 578 | @file{/etc/termcap}. | ||
| 579 | @item TMPDIR | ||
| 580 | Used by the Emerge package as a prefix for temporary files. | ||
| 581 | @item TZ | ||
| 582 | This specifies the current time zone and possibly also daylight | ||
| 583 | saving time information. On MS-DOS, if @env{TZ} is not set in the | ||
| 584 | environment when Emacs starts, Emacs defines a default value as | ||
| 585 | appropriate for the country code returned by DOS. On MS-Windows, Emacs | ||
| 586 | does not use @env{TZ} at all. | ||
| 587 | @item USER | ||
| 588 | The user's login name. See also @env{LOGNAME}. On MS-DOS, this | ||
| 589 | defaults to @samp{root}. | ||
| 590 | @item VERSION_CONTROL | ||
| 591 | Used to initialize the @code{version-control} variable (@pxref{Numbered Backups}). | ||
| 592 | @end table | ||
| 593 | |||
| 594 | @node Misc Variables | ||
| 595 | @appendixsubsec Miscellaneous Variables | ||
| 596 | |||
| 597 | These variables are used only on particular configurations: | ||
| 598 | |||
| 599 | @table @env | ||
| 600 | @item COMSPEC | ||
| 601 | On MS-DOS and MS-Windows, the name of the command interpreter to use | ||
| 602 | when invoking batch files and commands internal to the shell. On MS-DOS | ||
| 603 | this is also used to make a default value for the @env{SHELL} environment | ||
| 604 | variable. | ||
| 605 | |||
| 606 | @item NAME | ||
| 607 | On MS-DOS, this variable defaults to the value of the @env{USER} | ||
| 608 | variable. | ||
| 609 | |||
| 610 | @item TEMP | ||
| 611 | @itemx TMP | ||
| 612 | On MS-DOS and MS-Windows, these specify the name of the directory for | ||
| 613 | storing temporary files in. | ||
| 614 | |||
| 615 | @item EMACSTEST | ||
| 616 | On MS-DOS, this specifies a file to use to log the operation of the | ||
| 617 | internal terminal emulator. This feature is useful for submitting bug | ||
| 618 | reports. | ||
| 619 | |||
| 620 | @item EMACSCOLORS | ||
| 621 | On MS-DOS, this specifies the screen colors. It is useful to set them | ||
| 622 | this way, since otherwise Emacs would display the default colors | ||
| 623 | momentarily when it starts up. | ||
| 624 | |||
| 625 | The value of this variable should be the two-character encoding of the | ||
| 626 | foreground (the first character) and the background (the second | ||
| 627 | character) colors of the default face. Each character should be the | ||
| 628 | hexadecimal code for the desired color on a standard PC text-mode | ||
| 629 | display. For example, to get blue text on a light gray background, | ||
| 630 | specify @samp{EMACSCOLORS=17}, since 1 is the code of the blue color and | ||
| 631 | 7 is the code of the light gray color. | ||
| 632 | |||
| 633 | The PC display usually supports only eight background colors. However, | ||
| 634 | Emacs switches the DOS display to a mode where all 16 colors can be used | ||
| 635 | for the background, so all four bits of the background color are | ||
| 636 | actually used. | ||
| 637 | |||
| 638 | @item WINDOW_GFX | ||
| 639 | Used when initializing the Sun windows system. | ||
| 640 | |||
| 641 | @item PRELOAD_WINSOCK | ||
| 642 | On MS-Windows, if you set this variable, Emacs will load and initialize | ||
| 643 | the network library at startup, instead of waiting until the first | ||
| 644 | time it is required. | ||
| 645 | |||
| 646 | @item emacs_dir | ||
| 647 | On MS-Windows, @env{emacs_dir} is a special environment variable, which | ||
| 648 | indicates the full path of the directory in which Emacs is installed. | ||
| 649 | If Emacs is installed in the standard directory structure, it | ||
| 650 | calculates this value automatically. It is not much use setting this | ||
| 651 | variable yourself unless your installation is non-standard, since | ||
| 652 | unlike other environment variables, it will be overridden by Emacs at | ||
| 653 | startup. When setting other environment variables, such as | ||
| 654 | @env{EMACSLOADPATH}, you may find it useful to use @env{emacs_dir} | ||
| 655 | rather than hard-coding an absolute path. This allows multiple | ||
| 656 | versions of Emacs to share the same environment variable settings, and | ||
| 657 | it allows you to move the Emacs installation directory, without | ||
| 658 | changing any environment or registry settings. | ||
| 659 | @end table | ||
| 660 | |||
| 661 | @node MS-Windows Registry | ||
| 662 | @appendixsubsec The MS-Windows System Registry | ||
| 663 | @pindex addpm, MS-Windows installation program | ||
| 664 | @cindex registry, setting environment variables and resources on MS-Windows | ||
| 665 | |||
| 666 | Under MS-Windows, the installation program @command{addpm.exe} adds | ||
| 667 | values for @env{emacs_dir}, @env{EMACSLOADPATH}, @env{EMACSDATA}, | ||
| 668 | @env{EMACSPATH}, @env{EMACSDOC}, @env{SHELL} and @env{TERM} to the | ||
| 669 | @file{HKEY_LOCAL_MACHINE} section of the system registry, under | ||
| 670 | @file{/Software/GNU/Emacs}. It does this because there is no standard | ||
| 671 | place to set environment variables across different versions of | ||
| 672 | Windows. Running @command{addpm.exe} is no longer strictly necessary | ||
| 673 | in recent versions of Emacs, but if you are upgrading from an older | ||
| 674 | version, running @command{addpm.exe} ensures that you do not have | ||
| 675 | older registry entries from a previous installation, which may not be | ||
| 676 | compatible with the latest version of Emacs. | ||
| 677 | |||
| 678 | When Emacs starts, as well as checking the environment, it also checks | ||
| 679 | the System Registry for those variables and for @env{HOME}, @env{LANG} | ||
| 680 | and @env{PRELOAD_WINSOCK}. | ||
| 681 | |||
| 682 | To determine the value of those variables, Emacs goes through the | ||
| 683 | following procedure. First, the environment is checked. If the | ||
| 684 | variable is not found there, Emacs looks for registry keys by that | ||
| 685 | name under @file{/Software/GNU/Emacs}; first in the | ||
| 686 | @file{HKEY_CURRENT_USER} section of the registry, and if not found | ||
| 687 | there, in the @file{HKEY_LOCAL_MACHINE} section. Finally, if Emacs | ||
| 688 | still cannot determine the values, compiled-in defaults are used. | ||
| 689 | |||
| 690 | In addition to the environment variables above, you can also add many | ||
| 691 | of the settings which on X belong in the @file{.Xdefaults} file | ||
| 692 | (@pxref{X Resources}) to the @file{/Software/GNU/Emacs} registry key. | ||
| 693 | Settings you add to the @file{HKEY_LOCAL_MACHINE} section will affect | ||
| 694 | all users of the machine. Settings you add to the | ||
| 695 | @file{HKEY_CURRENT_USER} section will only affect you, and will | ||
| 696 | override machine wide settings. | ||
| 697 | |||
| 698 | @node Display X | ||
| 699 | @appendixsec Specifying the Display Name | ||
| 700 | @cindex display name (X Window System) | ||
| 701 | @cindex @env{DISPLAY} environment variable | ||
| 702 | |||
| 703 | The environment variable @env{DISPLAY} tells all X clients, including | ||
| 704 | Emacs, where to display their windows. Its value is set by default | ||
| 705 | in ordinary circumstances, when you start an X server and run jobs | ||
| 706 | locally. Occasionally you may need to specify the display yourself; for | ||
| 707 | example, if you do a remote login and want to run a client program | ||
| 708 | remotely, displaying on your local screen. | ||
| 709 | |||
| 710 | With Emacs, the main reason people change the default display is to | ||
| 711 | let them log into another system, run Emacs on that system, but have the | ||
| 712 | window displayed at their local terminal. You might need to log in | ||
| 713 | to another system because the files you want to edit are there, or | ||
| 714 | because the Emacs executable file you want to run is there. | ||
| 715 | |||
| 716 | The syntax of the @env{DISPLAY} environment variable is | ||
| 717 | @samp{@var{host}:@var{display}.@var{screen}}, where @var{host} is the | ||
| 718 | host name of the X Window System server machine, @var{display} is an | ||
| 719 | arbitrarily-assigned number that distinguishes your server (X terminal) | ||
| 720 | from other servers on the same machine, and @var{screen} is a | ||
| 721 | rarely-used field that allows an X server to control multiple terminal | ||
| 722 | screens. The period and the @var{screen} field are optional. If | ||
| 723 | included, @var{screen} is usually zero. | ||
| 724 | |||
| 725 | For example, if your host is named @samp{glasperle} and your server is | ||
| 726 | the first (or perhaps the only) server listed in the configuration, your | ||
| 727 | @env{DISPLAY} is @samp{glasperle:0.0}. | ||
| 728 | |||
| 729 | You can specify the display name explicitly when you run Emacs, either | ||
| 730 | by changing the @env{DISPLAY} variable, or with the option @samp{-d | ||
| 731 | @var{display}} or @samp{--display=@var{display}}. Here is an example: | ||
| 732 | |||
| 733 | @smallexample | ||
| 734 | emacs --display=glasperle:0 & | ||
| 735 | @end smallexample | ||
| 736 | |||
| 737 | You can inhibit the direct use of the window system and GUI with the | ||
| 738 | @samp{-nw} option. It tells Emacs to display using ordinary @acronym{ASCII} on | ||
| 739 | its controlling terminal. This is also an initial option. | ||
| 740 | |||
| 741 | Sometimes, security arrangements prevent a program on a remote system | ||
| 742 | from displaying on your local system. In this case, trying to run Emacs | ||
| 743 | produces messages like this: | ||
| 744 | |||
| 745 | @smallexample | ||
| 746 | Xlib: connection to "glasperle:0.0" refused by server | ||
| 747 | @end smallexample | ||
| 748 | |||
| 749 | @noindent | ||
| 750 | You might be able to overcome this problem by using the @command{xhost} | ||
| 751 | command on the local system to give permission for access from your | ||
| 752 | remote machine. | ||
| 753 | |||
| 754 | @node Font X | ||
| 755 | @appendixsec Font Specification Options | ||
| 756 | @cindex font name (X Window System) | ||
| 757 | |||
| 758 | By default, Emacs displays text in a twelve point Courier font (when | ||
| 759 | using X). You can specify a different font on your command line | ||
| 760 | through the option @samp{-fn @var{name}} (or @samp{--font}, which is | ||
| 761 | an alias for @samp{-fn}). | ||
| 762 | |||
| 763 | @table @samp | ||
| 764 | @item -fn @var{name} | ||
| 765 | @opindex -fn | ||
| 766 | @itemx --font=@var{name} | ||
| 767 | @opindex --font | ||
| 768 | @cindex specify default font from the command line | ||
| 769 | Use font @var{name} as the default font. | ||
| 770 | @end table | ||
| 771 | |||
| 772 | Under X, each font has a long name which consists of fourteen words | ||
| 773 | or numbers, separated by dashes. Some fonts also have shorter | ||
| 774 | nicknames. For instance, @samp{9x15} is such a nickname. This font | ||
| 775 | makes each character nine pixels wide and fifteen pixels high. You | ||
| 776 | can use either kind of name. Case is insignificant in both kinds. | ||
| 777 | You can use wildcard patterns for the font name; then Emacs lets X | ||
| 778 | choose one of the fonts that match the pattern. The wildcard | ||
| 779 | character @samp{*} matches any sequence of characters (including none) | ||
| 780 | and @samp{?} matches any single character. However, matching is | ||
| 781 | implementation-dependent, and can be inaccurate when wildcards match | ||
| 782 | dashes in a long name. For reliable results, supply all 14 dashes and | ||
| 783 | use wildcards only within a field. Here is an example, which happens | ||
| 784 | to specify the font whose nickname is @samp{6x13}: | ||
| 785 | |||
| 786 | @smallexample | ||
| 787 | emacs -fn \ | ||
| 788 | "-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1" & | ||
| 789 | @end smallexample | ||
| 790 | |||
| 791 | @noindent | ||
| 792 | You can also specify the font in your @file{.Xdefaults} file: | ||
| 793 | |||
| 794 | @smallexample | ||
| 795 | emacs.font: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1 | ||
| 796 | @end smallexample | ||
| 797 | |||
| 798 | Note that if you use a wildcard pattern on the command line, you | ||
| 799 | need to enclose it in single or double quotes, to prevent the shell | ||
| 800 | from accidentally expanding it into a list of file names. On the | ||
| 801 | other hand, you should not quote the name in the @file{.Xdefaults} | ||
| 802 | file. | ||
| 803 | |||
| 804 | The default font used by Emacs (under X) is: | ||
| 805 | |||
| 806 | @smallexample | ||
| 807 | -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1 | ||
| 808 | @end smallexample | ||
| 809 | |||
| 810 | A long font name has the following form: | ||
| 811 | |||
| 812 | @smallexample | ||
| 813 | -@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{} | ||
| 814 | @dots{}-@var{pixels}-@var{height}-@var{horiz}-@var{vert}-@var{spacing}-@var{width}-@var{registry}-@var{encoding} | ||
| 815 | @end smallexample | ||
| 816 | |||
| 817 | @table @var | ||
| 818 | @item maker | ||
| 819 | This is the name of the font manufacturer. | ||
| 820 | @item family | ||
| 821 | This is the name of the font family---for example, @samp{courier}. | ||
| 822 | @item weight | ||
| 823 | This is normally @samp{bold}, @samp{medium} or @samp{light}. Other | ||
| 824 | words may appear here in some font names. | ||
| 825 | @item slant | ||
| 826 | This is @samp{r} (roman), @samp{i} (italic), @samp{o} (oblique), | ||
| 827 | @samp{ri} (reverse italic), or @samp{ot} (other). | ||
| 828 | @item widthtype | ||
| 829 | This is normally @samp{condensed}, @samp{extended}, @samp{semicondensed} | ||
| 830 | or @samp{normal}. Other words may appear here in some font names. | ||
| 831 | @item style | ||
| 832 | This is an optional additional style name. Usually it is empty---most | ||
| 833 | long font names have two hyphens in a row at this point. | ||
| 834 | @item pixels | ||
| 835 | This is the font height, in pixels. | ||
| 836 | @item height | ||
| 837 | This is the font height on the screen, measured in tenths of a printer's | ||
| 838 | point---approximately 1/720 of an inch. In other words, it is the point | ||
| 839 | size of the font, times ten. For a given vertical resolution, | ||
| 840 | @var{height} and @var{pixels} are proportional; therefore, it is common | ||
| 841 | to specify just one of them and use @samp{*} for the other. | ||
| 842 | @item horiz | ||
| 843 | This is the horizontal resolution, in pixels per inch, of the screen for | ||
| 844 | which the font is intended. | ||
| 845 | @item vert | ||
| 846 | This is the vertical resolution, in pixels per inch, of the screen for | ||
| 847 | which the font is intended. Normally the resolution of the fonts on | ||
| 848 | your system is the right value for your screen; therefore, you normally | ||
| 849 | specify @samp{*} for this and @var{horiz}. | ||
| 850 | @item spacing | ||
| 851 | This is @samp{m} (monospace), @samp{p} (proportional) or @samp{c} | ||
| 852 | (character cell). | ||
| 853 | @item width | ||
| 854 | This is the average character width, in pixels, multiplied by ten. | ||
| 855 | @item registry | ||
| 856 | @itemx encoding | ||
| 857 | These together make up the X font character set that the font depicts. | ||
| 858 | (X font character sets are not the same as Emacs charsets, but they | ||
| 859 | are solutions for the same problem.) You can use the | ||
| 860 | @command{xfontsel} program to check which choices you have. However, | ||
| 861 | normally you should use @samp{iso8859} for @var{registry} and @samp{1} | ||
| 862 | for @var{encoding}. | ||
| 863 | @end table | ||
| 864 | |||
| 865 | @cindex listing system fonts | ||
| 866 | You will probably want to use a fixed-width default font---that is, | ||
| 867 | a font in which all characters have the same width. Any font with | ||
| 868 | @samp{m} or @samp{c} in the @var{spacing} field of the long name is a | ||
| 869 | fixed-width font. Here's how to use the @command{xlsfonts} program to | ||
| 870 | list all the fixed-width fonts available on your system: | ||
| 871 | |||
| 872 | @example | ||
| 873 | xlsfonts -fn '*x*' | egrep "^[0-9]+x[0-9]+" | ||
| 874 | xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-m*' | ||
| 875 | xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-c*' | ||
| 876 | @end example | ||
| 877 | |||
| 878 | @noindent | ||
| 879 | To see what a particular font looks like, use the @command{xfd} command. | ||
| 880 | For example: | ||
| 881 | |||
| 882 | @example | ||
| 883 | xfd -fn 6x13 | ||
| 884 | @end example | ||
| 885 | |||
| 886 | @noindent | ||
| 887 | displays the entire font @samp{6x13}. | ||
| 888 | |||
| 889 | While running Emacs, you can set the font of the current frame | ||
| 890 | (@pxref{Frame Parameters}) or for a specific kind of text | ||
| 891 | (@pxref{Faces}). | ||
| 892 | |||
| 893 | @node Colors | ||
| 894 | @appendixsec Window Color Options | ||
| 895 | @cindex color of window, from command line | ||
| 896 | @cindex text colors, from command line | ||
| 897 | |||
| 898 | @findex list-colors-display | ||
| 899 | @cindex available colors | ||
| 900 | On a color display, you can specify which color to use for various | ||
| 901 | parts of the Emacs display. To find out what colors are available on | ||
| 902 | your system, type @kbd{M-x list-colors-display}, or press | ||
| 903 | @kbd{C-Mouse-2} and select @samp{Display Colors} from the pop-up menu. | ||
| 904 | (A particular window system might support many more colors, but the | ||
| 905 | list displayed by @code{list-colors-display} shows their portable | ||
| 906 | subset that can be safely used on any display supported by Emacs.) | ||
| 907 | If you do not specify colors, on windowed displays the default for the | ||
| 908 | background is white and the default for all other colors is black. On a | ||
| 909 | monochrome display, the foreground is black, the background is white, | ||
| 910 | and the border is gray if the display supports that. On terminals, the | ||
| 911 | background is usually black and the foreground is white. | ||
| 912 | |||
| 913 | Here is a list of the command-line options for specifying colors: | ||
| 914 | |||
| 915 | @table @samp | ||
| 916 | @item -fg @var{color} | ||
| 917 | @opindex -fg | ||
| 918 | @itemx --foreground-color=@var{color} | ||
| 919 | @opindex --foreground-color | ||
| 920 | @cindex foreground color, command-line argument | ||
| 921 | Specify the foreground color. @var{color} should be a standard color | ||
| 922 | name, or a numeric specification of the color's red, green, and blue | ||
| 923 | components as in @samp{#4682B4} or @samp{RGB:46/82/B4}. | ||
| 924 | @item -bg @var{color} | ||
| 925 | @opindex -bg | ||
| 926 | @itemx --background-color=@var{color} | ||
| 927 | @opindex --background-color | ||
| 928 | @cindex background color, command-line argument | ||
| 929 | Specify the background color. | ||
| 930 | @item -bd @var{color} | ||
| 931 | @opindex -bd | ||
| 932 | @itemx --border-color=@var{color} | ||
| 933 | @opindex --border-color | ||
| 934 | @cindex border color, command-line argument | ||
| 935 | Specify the color of the border of the X window. | ||
| 936 | @item -cr @var{color} | ||
| 937 | @opindex -cr | ||
| 938 | @itemx --cursor-color=@var{color} | ||
| 939 | @opindex --cursor-color | ||
| 940 | @cindex cursor color, command-line argument | ||
| 941 | Specify the color of the Emacs cursor which indicates where point is. | ||
| 942 | @item -ms @var{color} | ||
| 943 | @opindex -ms | ||
| 944 | @itemx --mouse-color=@var{color} | ||
| 945 | @opindex --mouse-color | ||
| 946 | @cindex mouse pointer color, command-line argument | ||
| 947 | Specify the color for the mouse cursor when the mouse is in the Emacs window. | ||
| 948 | @item -r | ||
| 949 | @opindex -r | ||
| 950 | @itemx -rv | ||
| 951 | @opindex -rv | ||
| 952 | @itemx --reverse-video | ||
| 953 | @opindex --reverse-video | ||
| 954 | @cindex reverse video, command-line argument | ||
| 955 | Reverse video---swap the foreground and background colors. | ||
| 956 | @item --color=@var{mode} | ||
| 957 | @opindex --color | ||
| 958 | @cindex standard colors on a character terminal | ||
| 959 | @cindex override character terminal color support | ||
| 960 | For a character terminal only, specify the mode of color support. | ||
| 961 | This option is intended for overriding the number of supported colors | ||
| 962 | that the character terminal advertises in its @code{termcap} or | ||
| 963 | @code{terminfo} database. The parameter @var{mode} can be one of the | ||
| 964 | following: | ||
| 965 | @table @samp | ||
| 966 | @item never | ||
| 967 | @itemx no | ||
| 968 | Don't use colors even if the terminal's capabilities specify color | ||
| 969 | support. | ||
| 970 | @item default | ||
| 971 | @itemx auto | ||
| 972 | Same as when @option{--color} is not used at all: Emacs detects at | ||
| 973 | startup whether the terminal supports colors, and if it does, turns on | ||
| 974 | colored display. | ||
| 975 | @item always | ||
| 976 | @itemx yes | ||
| 977 | @itemx ansi8 | ||
| 978 | Turn on the color support unconditionally, and use color commands | ||
| 979 | specified by the ANSI escape sequences for the 8 standard colors. | ||
| 980 | @item @var{num} | ||
| 981 | Use color mode for @var{num} colors. If @var{num} is -1, turn off | ||
| 982 | color support (equivalent to @samp{never}); if it is 0, use the | ||
| 983 | default color support for this terminal (equivalent to @samp{auto}); | ||
| 984 | otherwise use an appropriate standard mode for @var{num} colors. | ||
| 985 | Depending on your terminal's capabilities, Emacs might be able to turn | ||
| 986 | on a color mode for 8, 16, 88, or 256 as the value of @var{num}. If | ||
| 987 | there is no mode that supports @var{num} colors, Emacs acts as if | ||
| 988 | @var{num} were 0, i.e.@: it uses the terminal's default color support | ||
| 989 | mode. | ||
| 990 | @end table | ||
| 991 | If @var{mode} is omitted, it defaults to @var{ansi8}. | ||
| 992 | @end table | ||
| 993 | |||
| 994 | For example, to use a coral mouse cursor and a slate blue text cursor, | ||
| 995 | enter: | ||
| 996 | |||
| 997 | @example | ||
| 998 | emacs -ms coral -cr 'slate blue' & | ||
| 999 | @end example | ||
| 1000 | |||
| 1001 | You can reverse the foreground and background colors through the | ||
| 1002 | @samp{-rv} option or with the X resource @samp{reverseVideo}. | ||
| 1003 | |||
| 1004 | The @samp{-fg}, @samp{-bg}, and @samp{-rv} options function on | ||
| 1005 | text-only terminals as well as on graphical displays. | ||
| 1006 | |||
| 1007 | @node Window Size X | ||
| 1008 | @appendixsec Options for Window Size and Position | ||
| 1009 | @cindex geometry of Emacs window | ||
| 1010 | @cindex position and size of Emacs frame | ||
| 1011 | @cindex width and height of Emacs frame | ||
| 1012 | @cindex specifying fullscreen for Emacs frame | ||
| 1013 | |||
| 1014 | Here is a list of the command-line options for specifying size and | ||
| 1015 | position of the initial Emacs frame: | ||
| 1016 | |||
| 1017 | @table @samp | ||
| 1018 | @item -g @var{width}x@var{height}@r{[@{}+-@r{@}}@var{xoffset}@r{@{}+-@r{@}}@var{yoffset}@r{]]} | ||
| 1019 | @opindex -g | ||
| 1020 | @itemx --geometry=@var{width}x@var{height}@r{[@{}+-@r{@}}@var{xoffset}@r{@{}+-@r{@}}@var{yoffset}@r{]]} | ||
| 1021 | @opindex --geometry | ||
| 1022 | @cindex geometry, command-line argument | ||
| 1023 | Specify the size @var{width} and @var{height} (measured in character | ||
| 1024 | columns and lines), and positions @var{xoffset} and @var{yoffset} | ||
| 1025 | (measured in pixels). The @var{width} and @var{height} parameters | ||
| 1026 | apply to all frames, whereas @var{xoffset} and @var{yoffset} only to | ||
| 1027 | the initial frame. | ||
| 1028 | |||
| 1029 | @item -fs | ||
| 1030 | @opindex -fs | ||
| 1031 | @itemx --fullscreen | ||
| 1032 | @opindex --fullscreen | ||
| 1033 | @cindex fullscreen, command-line argument | ||
| 1034 | Specify that width and height shall be the size of the screen. | ||
| 1035 | |||
| 1036 | @item -fh | ||
| 1037 | @opindex -fh | ||
| 1038 | @itemx --fullheight | ||
| 1039 | @opindex --fullheight | ||
| 1040 | @cindex fullheight, command-line argument | ||
| 1041 | Specify that the height shall be the height of the screen. | ||
| 1042 | |||
| 1043 | @item -fw | ||
| 1044 | @opindex -fw | ||
| 1045 | @itemx --fullwidth | ||
| 1046 | @opindex --fullwidth | ||
| 1047 | @cindex fullwidth, command-line argument | ||
| 1048 | Specify that the width shall be the width of the screen. | ||
| 1049 | @end table | ||
| 1050 | |||
| 1051 | |||
| 1052 | @noindent | ||
| 1053 | In the @samp{--geometry} option, @code{@r{@{}+-@r{@}}} means either a plus | ||
| 1054 | sign or a minus sign. A plus | ||
| 1055 | sign before @var{xoffset} means it is the distance from the left side of | ||
| 1056 | the screen; a minus sign means it counts from the right side. A plus | ||
| 1057 | sign before @var{yoffset} means it is the distance from the top of the | ||
| 1058 | screen, and a minus sign there indicates the distance from the bottom. | ||
| 1059 | The values @var{xoffset} and @var{yoffset} may themselves be positive or | ||
| 1060 | negative, but that doesn't change their meaning, only their direction. | ||
| 1061 | |||
| 1062 | Emacs uses the same units as @command{xterm} does to interpret the geometry. | ||
| 1063 | The @var{width} and @var{height} are measured in characters, so a large font | ||
| 1064 | creates a larger frame than a small font. (If you specify a proportional | ||
| 1065 | font, Emacs uses its maximum bounds width as the width unit.) The | ||
| 1066 | @var{xoffset} and @var{yoffset} are measured in pixels. | ||
| 1067 | |||
| 1068 | You do not have to specify all of the fields in the geometry | ||
| 1069 | specification. If you omit both @var{xoffset} and @var{yoffset}, the | ||
| 1070 | window manager decides where to put the Emacs frame, possibly by | ||
| 1071 | letting you place it with the mouse. For example, @samp{164x55} | ||
| 1072 | specifies a window 164 columns wide, enough for two ordinary width | ||
| 1073 | windows side by side, and 55 lines tall. | ||
| 1074 | |||
| 1075 | The default width for Emacs is 80 characters and the default height is | ||
| 1076 | 40 lines. You can omit either the width or the height or both. If | ||
| 1077 | you start the geometry with an integer, Emacs interprets it as the | ||
| 1078 | width. If you start with an @samp{x} followed by an integer, Emacs | ||
| 1079 | interprets it as the height. Thus, @samp{81} specifies just the width; | ||
| 1080 | @samp{x45} specifies just the height. | ||
| 1081 | |||
| 1082 | If you start with @samp{+} or @samp{-}, that introduces an offset, | ||
| 1083 | which means both sizes are omitted. Thus, @samp{-3} specifies the | ||
| 1084 | @var{xoffset} only. (If you give just one offset, it is always | ||
| 1085 | @var{xoffset}.) @samp{+3-3} specifies both the @var{xoffset} and the | ||
| 1086 | @var{yoffset}, placing the frame near the bottom left of the screen. | ||
| 1087 | |||
| 1088 | You can specify a default for any or all of the fields in | ||
| 1089 | @file{.Xdefaults} file, and then override selected fields with a | ||
| 1090 | @samp{--geometry} option. | ||
| 1091 | |||
| 1092 | Since the mode line and the echo area occupy the last 2 lines of the | ||
| 1093 | frame, the height of the initial text window is 2 less than the height | ||
| 1094 | specified in your geometry. In non-X-toolkit versions of Emacs, the | ||
| 1095 | menu bar also takes one line of the specified number. But in the X | ||
| 1096 | toolkit version, the menu bar is additional and does not count against | ||
| 1097 | the specified height. The tool bar, if present, is also additional. | ||
| 1098 | |||
| 1099 | Enabling or disabling the menu bar or tool bar alters the amount of | ||
| 1100 | space available for ordinary text. Therefore, if Emacs starts up with | ||
| 1101 | a tool bar (which is the default), and handles the geometry | ||
| 1102 | specification assuming there is a tool bar, and then your | ||
| 1103 | @file{~/.emacs} file disables the tool bar, you will end up with a | ||
| 1104 | frame geometry different from what you asked for. To get the intended | ||
| 1105 | size with no tool bar, use an X resource to specify ``no tool bar'' | ||
| 1106 | (@pxref{Table of Resources}); then Emacs will already know there's no | ||
| 1107 | tool bar when it processes the specified geometry. | ||
| 1108 | |||
| 1109 | When using one of @samp{--fullscreen}, @samp{--fullwidth} or | ||
| 1110 | @samp{--fullheight} there may be some space around the frame | ||
| 1111 | anyway. That is because Emacs rounds the sizes so they are an | ||
| 1112 | even number of character heights and widths. | ||
| 1113 | |||
| 1114 | Some window managers have options that can make them ignore both | ||
| 1115 | program-specified and user-specified positions (sawfish is one). | ||
| 1116 | If these are set, Emacs fails to position the window correctly. | ||
| 1117 | |||
| 1118 | @node Borders X | ||
| 1119 | @appendixsec Internal and External Borders | ||
| 1120 | @cindex borders (X Window System) | ||
| 1121 | |||
| 1122 | An Emacs frame has an internal border and an external border. The | ||
| 1123 | internal border is an extra strip of the background color around the | ||
| 1124 | text portion of the frame. Emacs itself draws the internal border. | ||
| 1125 | The external border is added by the window manager outside the frame; | ||
| 1126 | depending on the window manager you use, it may contain various boxes | ||
| 1127 | you can click on to move or iconify the window. | ||
| 1128 | |||
| 1129 | @table @samp | ||
| 1130 | @item -ib @var{width} | ||
| 1131 | @opindex -ib | ||
| 1132 | @itemx --internal-border=@var{width} | ||
| 1133 | @opindex --internal-border | ||
| 1134 | @cindex internal border width, command-line argument | ||
| 1135 | Specify @var{width} as the width of the internal border (between the text | ||
| 1136 | and the main border), in pixels. | ||
| 1137 | |||
| 1138 | @item -bw @var{width} | ||
| 1139 | @opindex -bw | ||
| 1140 | @itemx --border-width=@var{width} | ||
| 1141 | @opindex --border-width | ||
| 1142 | @cindex main border width, command-line argument | ||
| 1143 | Specify @var{width} as the width of the main border, in pixels. | ||
| 1144 | @end table | ||
| 1145 | |||
| 1146 | When you specify the size of the frame, that does not count the | ||
| 1147 | borders. The frame's position is measured from the outside edge of the | ||
| 1148 | external border. | ||
| 1149 | |||
| 1150 | Use the @samp{-ib @var{n}} option to specify an internal border | ||
| 1151 | @var{n} pixels wide. The default is 1. Use @samp{-bw @var{n}} to | ||
| 1152 | specify the width of the external border (though the window manager may | ||
| 1153 | not pay attention to what you specify). The default width of the | ||
| 1154 | external border is 2. | ||
| 1155 | |||
| 1156 | @node Title X | ||
| 1157 | @appendixsec Frame Titles | ||
| 1158 | |||
| 1159 | An Emacs frame may or may not have a specified title. The frame | ||
| 1160 | title, if specified, appears in window decorations and icons as the | ||
| 1161 | name of the frame. If an Emacs frame has no specified title, the | ||
| 1162 | default title has the form @samp{@var{invocation-name}@@@var{machine}} | ||
| 1163 | (if there is only one frame) or the selected window's buffer name (if | ||
| 1164 | there is more than one frame). | ||
| 1165 | |||
| 1166 | You can specify a title for the initial Emacs frame with a command | ||
| 1167 | line option: | ||
| 1168 | |||
| 1169 | @table @samp | ||
| 1170 | @item -T @var{title} | ||
| 1171 | @opindex -T | ||
| 1172 | @itemx --title=@var{title} | ||
| 1173 | @opindex --title | ||
| 1174 | @cindex frame title, command-line argument | ||
| 1175 | Specify @var{title} as the title for the initial Emacs frame. | ||
| 1176 | @end table | ||
| 1177 | |||
| 1178 | The @samp{--name} option (@pxref{Resources}) also specifies the title | ||
| 1179 | for the initial Emacs frame. | ||
| 1180 | |||
| 1181 | @node Icons X | ||
| 1182 | @appendixsec Icons | ||
| 1183 | @cindex icons (X Window System) | ||
| 1184 | |||
| 1185 | Most window managers allow you to ``iconify'' a frame, removing | ||
| 1186 | it from sight, and leaving a small, distinctive ``icon'' window in its | ||
| 1187 | place. Clicking on the icon window makes the frame itself appear again. | ||
| 1188 | If you have many clients running at once, you can avoid cluttering up | ||
| 1189 | the screen by iconifying most of the clients. | ||
| 1190 | |||
| 1191 | @table @samp | ||
| 1192 | @item -nbi | ||
| 1193 | @opindex -nbi | ||
| 1194 | @itemx --no-bitmap-icon | ||
| 1195 | @opindex --no-bitmap-icon | ||
| 1196 | @cindex Emacs icon, a gnu | ||
| 1197 | Do not use a picture of a gnu as the Emacs icon. | ||
| 1198 | |||
| 1199 | @item -iconic | ||
| 1200 | @opindex --iconic | ||
| 1201 | @itemx --iconic | ||
| 1202 | @cindex start iconified, command-line argument | ||
| 1203 | Start Emacs in iconified state. | ||
| 1204 | @end table | ||
| 1205 | |||
| 1206 | By default Emacs uses an icon window containing a picture of the GNU gnu. | ||
| 1207 | The @samp{-nbi} or @samp{--no-bitmap-icon} option tells Emacs to let the | ||
| 1208 | window manager choose what sort of icon to use---usually just a small | ||
| 1209 | rectangle containing the frame's title. | ||
| 1210 | |||
| 1211 | The @samp{-iconic} option tells Emacs to begin running as an icon, | ||
| 1212 | rather than showing a frame right away. In this situation, the icon | ||
| 1213 | is the only indication that Emacs has started; the text frame doesn't | ||
| 1214 | appear until you deiconify it. | ||
| 1215 | |||
| 1216 | @node Misc X | ||
| 1217 | @appendixsec Other Display Options | ||
| 1218 | |||
| 1219 | @table @samp | ||
| 1220 | @item -hb | ||
| 1221 | @opindex -hb | ||
| 1222 | @itemx --horizontal-scroll-bars | ||
| 1223 | @opindex --horizontal-scroll-bars | ||
| 1224 | @c @cindex horizontal scroll bars, command-line argument | ||
| 1225 | Enable horizontal scroll bars. Since horizontal scroll bars | ||
| 1226 | are not yet implemented, this actually does nothing. | ||
| 1227 | |||
| 1228 | @item -vb | ||
| 1229 | @opindex -vb | ||
| 1230 | @itemx --vertical-scroll-bars | ||
| 1231 | @opindex --vertical-scroll-bars | ||
| 1232 | @cindex vertical scroll bars, command-line argument | ||
| 1233 | Enable vertical scroll bars. | ||
| 1234 | |||
| 1235 | @item -lsp @var{pixels} | ||
| 1236 | @opindex -lsp | ||
| 1237 | @itemx --line-spacing=@var{pixels} | ||
| 1238 | @opindex --line-spacing | ||
| 1239 | @cindex line spacing, command-line argument | ||
| 1240 | Specify @var{pixels} as additional space to put between lines, in pixels. | ||
| 1241 | |||
| 1242 | @item -nbc | ||
| 1243 | @opindex -nbc | ||
| 1244 | @itemx --no-blinking-cursor | ||
| 1245 | @opindex --no-blinking-cursor | ||
| 1246 | @cindex blinking cursor disable, command-line argument | ||
| 1247 | Disable the blinking cursor on graphical displays. | ||
| 1248 | |||
| 1249 | @item -D | ||
| 1250 | @opindex -D | ||
| 1251 | @itemx --basic-display | ||
| 1252 | @opindex --basic-display | ||
| 1253 | Disable the menu-bar, the tool-bar, the scroll-bars, and tool tips, | ||
| 1254 | and turn off the blinking cursor. This can be useful for making a | ||
| 1255 | test case that simplifies debugging of display problems. | ||
| 1256 | @end table | ||
| 1257 | |||
| 1258 | The @samp{--xrm} option (@pxref{Resources}) specifies additional | ||
| 1259 | X resource values. | ||
| 1260 | |||
| 1261 | @ignore | ||
| 1262 | arch-tag: fffecd9e-7329-4a51-a3cc-dd4a9889340e | ||
| 1263 | @end ignore | ||
diff --git a/doc/emacs/commands.texi b/doc/emacs/commands.texi new file mode 100644 index 00000000000..d2daffe00bb --- /dev/null +++ b/doc/emacs/commands.texi | |||
| @@ -0,0 +1,294 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @iftex | ||
| 6 | @chapter Characters, Keys and Commands | ||
| 7 | |||
| 8 | This chapter explains the character sets used by Emacs for input | ||
| 9 | commands and for the contents of files, and the fundamental concepts of | ||
| 10 | @dfn{keys} and @dfn{commands}, whereby Emacs interprets your keyboard | ||
| 11 | and mouse input. | ||
| 12 | @end iftex | ||
| 13 | |||
| 14 | @ifnottex | ||
| 15 | @raisesections | ||
| 16 | @end ifnottex | ||
| 17 | |||
| 18 | @node User Input, Keys, Screen, Top | ||
| 19 | @section Kinds of User Input | ||
| 20 | @cindex input with the keyboard | ||
| 21 | @cindex keyboard input | ||
| 22 | @cindex character set (keyboard) | ||
| 23 | @cindex @acronym{ASCII} | ||
| 24 | @cindex C- | ||
| 25 | @cindex Control | ||
| 26 | @cindex control characters | ||
| 27 | |||
| 28 | GNU Emacs is designed for use with keyboard commands because that is | ||
| 29 | the most efficient way to edit. You can do editing with the mouse, as | ||
| 30 | in other editors, and you can give commands with the menu bar and tool | ||
| 31 | bar, and scroll with the scroll bar. But if you keep on editing that | ||
| 32 | way, you won't get the benefits of Emacs. Therefore, this manual | ||
| 33 | documents primarily how to edit with the keyboard. You can force | ||
| 34 | yourself to practice using the keyboard by using the shell command | ||
| 35 | @samp{emacs -nw} to start Emacs, so that the mouse won't work. | ||
| 36 | |||
| 37 | Emacs uses an extension of the @acronym{ASCII} character set for | ||
| 38 | keyboard input; it also accepts non-character input events including | ||
| 39 | function keys and mouse button actions. | ||
| 40 | |||
| 41 | @acronym{ASCII} consists of 128 character codes. Some of these codes are | ||
| 42 | assigned graphic symbols such as @samp{a} and @samp{=}; the rest are | ||
| 43 | control characters, such as @kbd{Control-a} (usually written @kbd{C-a} | ||
| 44 | for short). @kbd{C-a} gets its name from the fact that you type it by | ||
| 45 | holding down the @key{CTRL} key while pressing @kbd{a}. | ||
| 46 | |||
| 47 | Some @acronym{ASCII} control characters have special names, and most | ||
| 48 | terminals have special keys you can type them with: for example, | ||
| 49 | @key{RET}, @key{TAB}, @key{DEL} and @key{ESC}. The space character is | ||
| 50 | usually known as @key{SPC}, even though strictly speaking it is a | ||
| 51 | graphic character that is blank. | ||
| 52 | |||
| 53 | Emacs extends the @acronym{ASCII} character set with thousands more printing | ||
| 54 | characters (@pxref{International}), additional control characters, and a | ||
| 55 | few more modifiers that can be combined with any character. | ||
| 56 | |||
| 57 | On @acronym{ASCII} terminals, there are only 32 possible control characters. | ||
| 58 | These are the control variants of letters and @samp{@@[]\^_}. In | ||
| 59 | addition, the shift key is meaningless with control characters: | ||
| 60 | @kbd{C-a} and @kbd{C-A} are the same character, and Emacs cannot | ||
| 61 | distinguish them. | ||
| 62 | |||
| 63 | The Emacs character set has room for control variants of all | ||
| 64 | printing characters, and distinguishes @kbd{C-A} from @kbd{C-a}. | ||
| 65 | Graphical terminals make it possible to enter all these characters. | ||
| 66 | For example, @kbd{C--} (that's Control-Minus) and @kbd{C-5} are | ||
| 67 | meaningful Emacs commands on a graphical terminal. | ||
| 68 | |||
| 69 | Another Emacs character-set extension is additional modifier bits. | ||
| 70 | Only one modifier bit is commonly used; it is called Meta. Every | ||
| 71 | character has a Meta variant; examples include @kbd{Meta-a} (normally | ||
| 72 | written @kbd{M-a}, for short), @kbd{M-A} (different from @kbd{M-a}, | ||
| 73 | but they are normally equivalent in Emacs), @kbd{M-@key{RET}}, and | ||
| 74 | @kbd{M-C-a}. That last means @kbd{a} with both the @key{CTRL} and | ||
| 75 | @key{META} modifiers. We usually write it as @kbd{C-M-a} rather than | ||
| 76 | @kbd{M-C-a}, for reasons of tradition. | ||
| 77 | |||
| 78 | @cindex Meta | ||
| 79 | @cindex M- | ||
| 80 | @cindex @key{ESC} replacing @key{META} key | ||
| 81 | Some terminals have a @key{META} key, and allow you to type Meta | ||
| 82 | characters by holding this key down. Thus, you can type @kbd{Meta-a} | ||
| 83 | by holding down @key{META} and pressing @kbd{a}. The @key{META} key | ||
| 84 | works much like the @key{SHIFT} key. In fact, this key is more often | ||
| 85 | labeled @key{ALT} or @key{EDIT}, instead of @key{META}; on a Sun | ||
| 86 | keyboard, it may have a diamond on it. | ||
| 87 | |||
| 88 | If there is no @key{META} key, you can still type Meta characters | ||
| 89 | using two-character sequences starting with @key{ESC}. Thus, you can | ||
| 90 | enter @kbd{M-a} by typing @kbd{@key{ESC} a}. You can enter | ||
| 91 | @kbd{C-M-a} by typing @kbd{@key{ESC} C-a}. Unlike @key{META}, which | ||
| 92 | modifies other characters, @key{ESC} is a separate character. You | ||
| 93 | don't hold down @key{ESC} while typing the next character; instead, | ||
| 94 | you press it and release it, then you enter the next character. | ||
| 95 | @key{ESC} is allowed on terminals with @key{META} keys, too, in case | ||
| 96 | you have formed a habit of using it. | ||
| 97 | |||
| 98 | Emacs defines several other modifier keys that can be applied to any | ||
| 99 | input character. These are called @key{SUPER}, @key{HYPER} and | ||
| 100 | @key{ALT}. We write @samp{s-}, @samp{H-} and @samp{A-} to say that a | ||
| 101 | character uses these modifiers. Thus, @kbd{s-H-C-x} is short for | ||
| 102 | @kbd{Super-Hyper-Control-x}. Not all graphical terminals actually | ||
| 103 | provide keys for these modifier flags---in fact, many terminals have a | ||
| 104 | key labeled @key{ALT} which is really a @key{META} key. The standard | ||
| 105 | key bindings of Emacs do not include any characters with these | ||
| 106 | modifiers. But you can assign them meanings of your own by | ||
| 107 | customizing Emacs. | ||
| 108 | |||
| 109 | If your keyboard lacks one of these modifier keys, you can enter it | ||
| 110 | using @kbd{C-x @@}: @kbd{C-x @@ h} adds the ``hyper'' flag to the next | ||
| 111 | character, @kbd{C-x @@ s} adds the ``super'' flag, and @kbd{C-x @@ a} | ||
| 112 | adds the ``alt'' flag. For instance, @kbd{C-x @@ h C-a} is a way to | ||
| 113 | enter @kbd{Hyper-Control-a}. (Unfortunately there is no way to add | ||
| 114 | two modifiers by using @kbd{C-x @@} twice for the same character, | ||
| 115 | because the first one goes to work on the @kbd{C-x}.) | ||
| 116 | |||
| 117 | Keyboard input includes keyboard keys that are not characters at | ||
| 118 | all, such as function keys and arrow keys. Mouse buttons are also not | ||
| 119 | characters. However, you can modify these events with the modifier | ||
| 120 | keys @key{CTRL}, @key{META}, @key{SUPER}, @key{HYPER} and @key{ALT}, | ||
| 121 | just like keyboard characters. | ||
| 122 | |||
| 123 | @cindex input event | ||
| 124 | Input characters and non-character inputs are collectively called | ||
| 125 | @dfn{input events}. @xref{Input Events,,, elisp, The Emacs Lisp | ||
| 126 | Reference Manual}, for the full Lisp-level details. If you are not | ||
| 127 | doing Lisp programming, but simply want to redefine the meaning of | ||
| 128 | some characters or non-character events, see @ref{Customization}. | ||
| 129 | |||
| 130 | @acronym{ASCII} terminals cannot really send anything to the computer except | ||
| 131 | @acronym{ASCII} characters. These terminals use a sequence of characters to | ||
| 132 | represent each function key. But that is invisible to the Emacs user, | ||
| 133 | because the keyboard input routines catch these special sequences | ||
| 134 | and convert them to function key events before any other part of Emacs | ||
| 135 | gets to see them. | ||
| 136 | |||
| 137 | @cindex keys stolen by window manager | ||
| 138 | @cindex window manager, keys stolen by | ||
| 139 | On graphical displays, the window manager is likely to block the | ||
| 140 | character @kbd{Meta-@key{TAB}} before Emacs can see it. It may also | ||
| 141 | block @kbd{Meta-@key{SPC}}, @kbd{C-M-d} and @kbd{C-M-l}. If you have | ||
| 142 | these problems, we recommend that you customize your window manager to | ||
| 143 | turn off those commands, or put them on key combinations that Emacs | ||
| 144 | does not use. | ||
| 145 | |||
| 146 | @node Keys, Commands, User Input, Top | ||
| 147 | @section Keys | ||
| 148 | |||
| 149 | @cindex key sequence | ||
| 150 | @cindex key | ||
| 151 | A @dfn{key sequence} (@dfn{key}, for short) is a sequence of input | ||
| 152 | events that is meaningful as a unit---a ``single command.'' Some | ||
| 153 | Emacs command sequences are invoked by just one character or one | ||
| 154 | event; for example, just @kbd{C-f} moves forward one character in the | ||
| 155 | buffer. But Emacs also has commands that take two or more events to | ||
| 156 | invoke. | ||
| 157 | |||
| 158 | @cindex complete key | ||
| 159 | @cindex prefix key | ||
| 160 | If a sequence of events is enough to invoke a command, it is a | ||
| 161 | @dfn{complete key}. Examples of complete keys include @kbd{C-a}, | ||
| 162 | @kbd{X}, @key{RET}, @key{NEXT} (a function key), @key{DOWN} (an arrow | ||
| 163 | key), @kbd{C-x C-f}, and @kbd{C-x 4 C-f}. If it isn't long enough to be | ||
| 164 | complete, we call it a @dfn{prefix key}. The above examples show that | ||
| 165 | @kbd{C-x} and @kbd{C-x 4} are prefix keys. Every key sequence is either | ||
| 166 | a complete key or a prefix key. | ||
| 167 | |||
| 168 | Most single characters constitute complete keys in the standard Emacs | ||
| 169 | command bindings. A few of them are prefix keys. A prefix key combines | ||
| 170 | with the following input event to make a longer key sequence, which may | ||
| 171 | itself be complete or a prefix. For example, @kbd{C-x} is a prefix key, | ||
| 172 | so @kbd{C-x} and the next input event combine to make a two-event | ||
| 173 | key sequence. Most of these key sequences are complete keys, including | ||
| 174 | @kbd{C-x C-f} and @kbd{C-x b}. A few, such as @kbd{C-x 4} and @kbd{C-x | ||
| 175 | r}, are themselves prefix keys that lead to three-event key | ||
| 176 | sequences. There's no limit to the length of a key sequence, but in | ||
| 177 | practice people rarely use sequences longer than four events. | ||
| 178 | |||
| 179 | You can't add input events onto a complete key. For example, the | ||
| 180 | two-event sequence @kbd{C-f C-k} is not a key, because the @kbd{C-f} | ||
| 181 | is a complete key in itself. It's impossible to give @kbd{C-f C-k} an | ||
| 182 | independent meaning as a command. @kbd{C-f C-k} is two key sequences, | ||
| 183 | not one.@refill | ||
| 184 | |||
| 185 | All told, the prefix keys in Emacs are @kbd{C-c}, @kbd{C-h}, | ||
| 186 | @kbd{C-x}, @kbd{C-x @key{RET}}, @kbd{C-x @@}, @kbd{C-x a}, @kbd{C-x | ||
| 187 | n}, @w{@kbd{C-x r}}, @kbd{C-x v}, @kbd{C-x 4}, @kbd{C-x 5}, @kbd{C-x | ||
| 188 | 6}, @key{ESC}, @kbd{M-g}, and @kbd{M-o}. (@key{F1} and @key{F2} are | ||
| 189 | aliases for @kbd{C-h} and @kbd{C-x 6}.) This list is not cast in stone; | ||
| 190 | it describes the standard key bindings. If you customize Emacs, you can make | ||
| 191 | new prefix keys, or eliminate some of the standard ones (not | ||
| 192 | recommended for most users). @xref{Key Bindings}. | ||
| 193 | |||
| 194 | If you make or eliminate prefix keys, that changes the set of | ||
| 195 | possible key sequences. For example, if you redefine @kbd{C-f} as a | ||
| 196 | prefix, @kbd{C-f C-k} automatically becomes a key (complete, unless | ||
| 197 | you define that too as a prefix). Conversely, if you remove the | ||
| 198 | prefix definition of @kbd{C-x 4}, then @kbd{C-x 4 f} and @kbd{C-x 4 | ||
| 199 | @var{anything}} are no longer keys. | ||
| 200 | |||
| 201 | Typing the help character (@kbd{C-h} or @key{F1}) after a prefix key | ||
| 202 | displays a list of the commands starting with that prefix. There are | ||
| 203 | a few prefix keys after which @kbd{C-h} does not work---for historical | ||
| 204 | reasons, they define other meanings for @kbd{C-h} which are painful to | ||
| 205 | change. @key{F1} works after all prefix keys. | ||
| 206 | |||
| 207 | @node Commands, Text Characters, Keys, Top | ||
| 208 | @section Keys and Commands | ||
| 209 | |||
| 210 | @cindex binding | ||
| 211 | @cindex command | ||
| 212 | @cindex function definition | ||
| 213 | This manual is full of passages that tell you what particular keys | ||
| 214 | do. But Emacs does not assign meanings to keys directly. Instead, | ||
| 215 | Emacs assigns meanings to named @dfn{commands}, and then gives keys | ||
| 216 | their meanings by @dfn{binding} them to commands. | ||
| 217 | |||
| 218 | Every command has a name chosen by a programmer. The name is | ||
| 219 | usually made of a few English words separated by dashes; for example, | ||
| 220 | @code{next-line} or @code{forward-word}. A command also has a | ||
| 221 | @dfn{function definition} which is a Lisp program; this is how the | ||
| 222 | command does its work. In Emacs Lisp, a command is a Lisp function with | ||
| 223 | special options to read arguments and for interactive use. For more | ||
| 224 | information on commands and functions, see @ref{What Is a Function,, | ||
| 225 | What Is a Function, elisp, The Emacs Lisp Reference Manual}. (The | ||
| 226 | definition here is simplified slightly.) | ||
| 227 | |||
| 228 | The bindings between keys and commands are recorded in tables called | ||
| 229 | @dfn{keymaps}. @xref{Keymaps}. | ||
| 230 | |||
| 231 | When we say that ``@kbd{C-n} moves down vertically one line'' we are | ||
| 232 | glossing over a subtle distinction that is irrelevant in ordinary use, | ||
| 233 | but vital for Emacs customization. The command @code{next-line} does | ||
| 234 | a vertical move downward. @kbd{C-n} has this effect @emph{because} it | ||
| 235 | is bound to @code{next-line}. If you rebind @kbd{C-n} to the command | ||
| 236 | @code{forward-word}, @kbd{C-n} will move forward one word instead. | ||
| 237 | Rebinding keys is an important method of customization. | ||
| 238 | |||
| 239 | In the rest of this manual, we usually ignore this distinction to | ||
| 240 | keep things simple. We will often speak of keys like @kbd{C-n} as | ||
| 241 | commands, even though strictly speaking the key is bound to a command. | ||
| 242 | Usually we state the name of the command which really does the work in | ||
| 243 | parentheses after mentioning the key that runs it. For example, we | ||
| 244 | will say that ``The command @kbd{C-n} (@code{next-line}) moves point | ||
| 245 | vertically down,'' meaning that the command @code{next-line} moves | ||
| 246 | vertically down, and the key @kbd{C-n} is normally bound to it. | ||
| 247 | |||
| 248 | Since we are discussing customization, we should tell you about | ||
| 249 | @dfn{variables}. Often the description of a command will say, ``To | ||
| 250 | change this, set the variable @code{mumble-foo}.'' A variable is a | ||
| 251 | name used to store a value. Most of the variables documented in this | ||
| 252 | manual are meant for customization: some command or other part of | ||
| 253 | Emacs examines the variable and behaves differently according to the | ||
| 254 | value that you set. You can ignore the information about variables | ||
| 255 | until you are interested in customizing them. Then read the basic | ||
| 256 | information on variables (@pxref{Variables}) and the information about | ||
| 257 | specific variables will make sense. | ||
| 258 | |||
| 259 | @node Text Characters, Entering Emacs, Commands, Top | ||
| 260 | @section Character Set for Text | ||
| 261 | @cindex characters (in text) | ||
| 262 | |||
| 263 | Text in Emacs buffers is a sequence of characters. In the simplest | ||
| 264 | case, these are @acronym{ASCII} characters, each stored in one 8-bit | ||
| 265 | byte. Both @acronym{ASCII} control characters (octal codes 000 | ||
| 266 | through 037, and 0177) and @acronym{ASCII} printing characters (codes | ||
| 267 | 040 through 0176) are allowed. The other modifier flags used in | ||
| 268 | keyboard input, such as Meta, are not allowed in buffers. | ||
| 269 | |||
| 270 | Non-@acronym{ASCII} printing characters can also appear in buffers, | ||
| 271 | when multibyte characters are enabled. They have character codes | ||
| 272 | starting at 256, octal 0400, and each one is represented as a sequence | ||
| 273 | of two or more bytes. @xref{International}. Single-byte characters | ||
| 274 | with codes 128 through 255 can also appear in multibyte buffers. | ||
| 275 | However, non-@acronym{ASCII} control characters cannot appear in a | ||
| 276 | buffer. | ||
| 277 | |||
| 278 | Some @acronym{ASCII} control characters serve special purposes in text, and have | ||
| 279 | special names. For example, the newline character (octal code 012) is | ||
| 280 | used in the buffer to end a line, and the tab character (octal code 011) | ||
| 281 | is used for indenting to the next tab stop column (normally every 8 | ||
| 282 | columns). @xref{Text Display}. | ||
| 283 | |||
| 284 | If you disable multibyte characters, then you can use only one | ||
| 285 | alphabet of non-@acronym{ASCII} characters, which all fit in one byte. | ||
| 286 | They use octal codes 0200 through 0377. @xref{Unibyte Mode}. | ||
| 287 | |||
| 288 | @ifnottex | ||
| 289 | @lowersections | ||
| 290 | @end ifnottex | ||
| 291 | |||
| 292 | @ignore | ||
| 293 | arch-tag: 9be43eef-d1f4-4d03-a916-c741ea713a45 | ||
| 294 | @end ignore | ||
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi new file mode 100644 index 00000000000..d496ab84b19 --- /dev/null +++ b/doc/emacs/custom.texi | |||
| @@ -0,0 +1,2515 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Customization, Quitting, Amusements, Top | ||
| 6 | @chapter Customization | ||
| 7 | @cindex customization | ||
| 8 | |||
| 9 | This chapter talks about various topics relevant to adapting the | ||
| 10 | behavior of Emacs in ways we have anticipated. | ||
| 11 | @iftex | ||
| 12 | See @cite{The Emacs Lisp Reference Manual} | ||
| 13 | @end iftex | ||
| 14 | @ifnottex | ||
| 15 | @xref{Top, Emacs Lisp, Emacs Lisp, elisp, The Emacs Lisp | ||
| 16 | Reference Manual}, | ||
| 17 | @end ifnottex | ||
| 18 | for how to make more far-reaching and open-ended changes. @xref{X | ||
| 19 | Resources}, for information on using X resources to customize Emacs. | ||
| 20 | |||
| 21 | Customization that you do within Emacs normally affects only the | ||
| 22 | particular Emacs session that you do it in---it does not persist | ||
| 23 | between sessions unless you save the customization in a file such as | ||
| 24 | your init file (@file{.emacs}) that will affect future sessions. | ||
| 25 | (@xref{Init File}.) When you tell the customization buffer to save | ||
| 26 | customizations for future sessions, this actually works by editing | ||
| 27 | @file{.emacs} for you. | ||
| 28 | |||
| 29 | Another means of customization is the keyboard macro, which is a | ||
| 30 | sequence of keystrokes to be replayed with a single command. | ||
| 31 | @xref{Keyboard Macros}, for full instruction how to record, manage, and | ||
| 32 | replay sequences of keys. | ||
| 33 | |||
| 34 | @menu | ||
| 35 | * Minor Modes:: Each minor mode is one feature you can turn on | ||
| 36 | independently of any others. | ||
| 37 | * Easy Customization:: Convenient way to browse and change settings. | ||
| 38 | * Variables:: Many Emacs commands examine Emacs variables | ||
| 39 | to decide what to do; by setting variables, | ||
| 40 | you can control their functioning. | ||
| 41 | * Key Bindings:: The keymaps say what command each key runs. | ||
| 42 | By changing them, you can "redefine keys". | ||
| 43 | * Syntax:: The syntax table controls how words and | ||
| 44 | expressions are parsed. | ||
| 45 | * Init File:: How to write common customizations in the | ||
| 46 | @file{.emacs} file. | ||
| 47 | @end menu | ||
| 48 | |||
| 49 | @node Minor Modes | ||
| 50 | @section Minor Modes | ||
| 51 | @cindex minor modes | ||
| 52 | @cindex mode, minor | ||
| 53 | |||
| 54 | Minor modes are optional features which you can turn on or off. For | ||
| 55 | example, Auto Fill mode is a minor mode in which @key{SPC} breaks lines | ||
| 56 | between words as you type. All the minor modes are independent of each | ||
| 57 | other and of the selected major mode. Most minor modes say in the mode | ||
| 58 | line when they are enabled; for example, @samp{Fill} in the mode line means | ||
| 59 | that Auto Fill mode is enabled. | ||
| 60 | |||
| 61 | You should append @code{-mode} to the name of a minor mode to | ||
| 62 | produce the name of the command that turns the mode on or off. Thus, | ||
| 63 | the command to enable or disable Auto Fill mode is called | ||
| 64 | @code{auto-fill-mode}. These commands are usually invoked with | ||
| 65 | @kbd{M-x}, but you can bind keys to them if you wish. | ||
| 66 | |||
| 67 | With no argument, the minor mode function turns the mode on if it | ||
| 68 | was off, and off if it was on. This is known as @dfn{toggling}. A | ||
| 69 | positive argument always turns the mode on, and an explicit zero | ||
| 70 | argument or a negative argument always turns it off. | ||
| 71 | |||
| 72 | Some minor modes are global: while enabled, they affect everything | ||
| 73 | you do in the Emacs session, in all buffers. Other minor modes are | ||
| 74 | buffer-local; they apply only to the current buffer, so you can enable | ||
| 75 | the mode in certain buffers and not others. | ||
| 76 | |||
| 77 | For most minor modes, the command name is also the name of a | ||
| 78 | variable. The variable's value is non-@code{nil} if the mode is | ||
| 79 | enabled and @code{nil} if it is disabled. Some minor-mode commands | ||
| 80 | work by just setting the variable. For example, the command | ||
| 81 | @code{abbrev-mode} works by setting the value of @code{abbrev-mode} as | ||
| 82 | a variable; it is this variable that directly turns Abbrev mode on and | ||
| 83 | off. You can directly set the variable's value instead of calling the | ||
| 84 | mode function. For other minor modes, you need to either set the | ||
| 85 | variable through the Customize interface or call the mode function to | ||
| 86 | correctly enable or disable the mode. To check which of these two | ||
| 87 | possibilities applies to a given minor mode, use @kbd{C-h v} to ask | ||
| 88 | for documentation on the variable name. | ||
| 89 | |||
| 90 | For minor mode commands that work by just setting the minor mode | ||
| 91 | variable, that variable provides a good way for Lisp programs to turn | ||
| 92 | minor modes on and off; it is also useful in a file's local variables | ||
| 93 | list (@pxref{File Variables}). But please think twice before setting | ||
| 94 | minor modes with a local variables list, because most minor modes are | ||
| 95 | a matter of user preference---other users editing the same file might | ||
| 96 | not want the same minor modes you prefer. | ||
| 97 | |||
| 98 | The most useful buffer-local minor modes include Abbrev mode, Auto | ||
| 99 | Fill mode, Auto Save mode, Font-Lock mode, Glasses mode, Outline minor | ||
| 100 | mode, Overwrite mode, and Binary Overwrite mode. | ||
| 101 | |||
| 102 | Abbrev mode allows you to define abbreviations that automatically expand | ||
| 103 | as you type them. For example, @samp{amd} might expand to @samp{abbrev | ||
| 104 | mode}. @xref{Abbrevs}, for full information. | ||
| 105 | |||
| 106 | Auto Fill mode allows you to enter filled text without breaking lines | ||
| 107 | explicitly. Emacs inserts newlines as necessary to prevent lines from | ||
| 108 | becoming too long. @xref{Filling}. | ||
| 109 | |||
| 110 | Auto Save mode saves the buffer contents periodically to reduce the | ||
| 111 | amount of work you can lose in case of a crash. @xref{Auto Save}. | ||
| 112 | |||
| 113 | Enriched mode enables editing and saving of formatted text. | ||
| 114 | @xref{Formatted Text}. | ||
| 115 | |||
| 116 | Flyspell mode automatically highlights misspelled words. | ||
| 117 | @xref{Spelling}. | ||
| 118 | |||
| 119 | Font-Lock mode automatically highlights certain textual units found | ||
| 120 | in programs, such as comments, strings, and function names being | ||
| 121 | defined. This requires a display that can show multiple fonts or | ||
| 122 | colors. @xref{Faces}. | ||
| 123 | |||
| 124 | @ignore | ||
| 125 | ISO Accents mode makes the characters @samp{`}, @samp{'}, @samp{"}, | ||
| 126 | @samp{^}, @samp{/} and @samp{~} combine with the following letter, to | ||
| 127 | produce an accented letter in the ISO Latin-1 character set. The | ||
| 128 | newer and more general feature of input methods more or less | ||
| 129 | supersedes ISO Accents mode. @xref{Unibyte Mode}. | ||
| 130 | @end ignore | ||
| 131 | |||
| 132 | Outline minor mode provides the same facilities as the major mode | ||
| 133 | called Outline mode; but since it is a minor mode instead, you can | ||
| 134 | combine it with any major mode. @xref{Outline Mode}. | ||
| 135 | |||
| 136 | @cindex Overwrite mode | ||
| 137 | @cindex mode, Overwrite | ||
| 138 | Overwrite mode causes ordinary printing characters to replace existing | ||
| 139 | text instead of shoving it to the right. For example, if point is in | ||
| 140 | front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing a | ||
| 141 | @kbd{G} changes it to @samp{FOOGAR}, instead of producing @samp{FOOGBAR} | ||
| 142 | as usual. In Overwrite mode, the command @kbd{C-q} inserts the next | ||
| 143 | character whatever it may be, even if it is a digit---this gives you a | ||
| 144 | way to insert a character instead of replacing an existing character. | ||
| 145 | |||
| 146 | @findex overwrite-mode | ||
| 147 | @kindex INSERT | ||
| 148 | The command @code{overwrite-mode} is an exception to the rule that | ||
| 149 | commands which toggle minor modes are normally not bound to keys: it is | ||
| 150 | bound to the @key{INSERT} function key. This is because many other | ||
| 151 | programs bind @key{INSERT} to similar functions. | ||
| 152 | |||
| 153 | @findex binary-overwrite-mode | ||
| 154 | Binary Overwrite mode is a variant of Overwrite mode for editing | ||
| 155 | binary files; it treats newlines and tabs like other characters, so that | ||
| 156 | they overwrite other characters and can be overwritten by them. | ||
| 157 | In Binary Overwrite mode, digits after @kbd{C-q} specify an | ||
| 158 | octal character code, as usual. | ||
| 159 | |||
| 160 | Here are some useful minor modes that normally apply to all buffers | ||
| 161 | at once. Since Line Number mode and Transient Mark mode can be | ||
| 162 | enabled or disabled just by setting the value of the minor mode | ||
| 163 | variable, you @emph{can} set them differently for particular buffers, | ||
| 164 | by explicitly making the corresponding variable local in those | ||
| 165 | buffers. @xref{Locals}. | ||
| 166 | |||
| 167 | Icomplete mode displays an indication of available completions when | ||
| 168 | you are in the minibuffer and completion is active. @xref{Completion | ||
| 169 | Options}. | ||
| 170 | |||
| 171 | Line Number mode enables continuous display in the mode line of the | ||
| 172 | line number of point, and Column Number mode enables display of the | ||
| 173 | column number. @xref{Mode Line}. | ||
| 174 | |||
| 175 | Scroll Bar mode gives each window a scroll bar (@pxref{Scroll Bars}). | ||
| 176 | Menu Bar mode gives each frame a menu bar (@pxref{Menu Bars}). Both of | ||
| 177 | these modes are enabled by default when you use the X Window System. | ||
| 178 | |||
| 179 | In Transient Mark mode, every change in the buffer contents | ||
| 180 | ``deactivates'' the mark, so that commands that operate on the region | ||
| 181 | will get an error. This means you must either set the mark, or | ||
| 182 | explicitly ``reactivate'' it, before each command that uses the region. | ||
| 183 | The advantage of Transient Mark mode is that Emacs can display the | ||
| 184 | region highlighted. @xref{Mark}. | ||
| 185 | |||
| 186 | @node Easy Customization | ||
| 187 | @section Easy Customization Interface | ||
| 188 | |||
| 189 | @cindex settings | ||
| 190 | Emacs has many @dfn{settings} which have values that you can specify | ||
| 191 | in order to customize various commands. Many are documented in this | ||
| 192 | manual. Most settings are @dfn{user options}---that is to say, Lisp | ||
| 193 | variables (@pxref{Variables})---so their names appear in the Variable | ||
| 194 | Index (@pxref{Variable Index}). The other settings are faces and | ||
| 195 | their attributes (@pxref{Faces}). | ||
| 196 | |||
| 197 | @findex customize | ||
| 198 | @cindex customization buffer | ||
| 199 | You can browse interactively through settings and change them using | ||
| 200 | @kbd{M-x customize}. This command creates a @dfn{customization | ||
| 201 | buffer}, which offers commands to navigate through a logically | ||
| 202 | organized structure of the Emacs settings; you can also use it to edit | ||
| 203 | and set their values, and to save settings permanently in your | ||
| 204 | @file{~/.emacs} file (@pxref{Init File}). | ||
| 205 | |||
| 206 | The appearance of the example buffers in this section is typically | ||
| 207 | different under a graphical display, since faces are then used to indicate | ||
| 208 | buttons, links and editable fields. | ||
| 209 | |||
| 210 | @menu | ||
| 211 | * Groups: Customization Groups. How settings are classified in a structure. | ||
| 212 | * Browsing: Browsing Custom. Browsing and searching for settings. | ||
| 213 | * Changing a Variable:: How to edit an option's value and set the option. | ||
| 214 | * Saving Customizations:: Specifying the file for saving customizations. | ||
| 215 | * Face Customization:: How to edit the attributes of a face. | ||
| 216 | * Specific Customization:: Making a customization buffer for specific | ||
| 217 | variables, faces, or groups. | ||
| 218 | * Custom Themes:: How to define collections of customized options | ||
| 219 | that can be loaded and unloaded together. | ||
| 220 | @end menu | ||
| 221 | |||
| 222 | @node Customization Groups | ||
| 223 | @subsection Customization Groups | ||
| 224 | @cindex customization groups | ||
| 225 | |||
| 226 | For customization purposes, settings are organized into @dfn{groups} | ||
| 227 | to help you find them. Groups are collected into bigger groups, all | ||
| 228 | the way up to a master group called @code{Emacs}. | ||
| 229 | |||
| 230 | @kbd{M-x customize} creates a customization buffer that shows the | ||
| 231 | top-level @code{Emacs} group and the second-level groups immediately | ||
| 232 | under it. It looks like this, in part: | ||
| 233 | |||
| 234 | @c we want the buffer example to all be on one page, but unfortunately | ||
| 235 | @c that's quite a bit of text, so force all space to the bottom. | ||
| 236 | @page | ||
| 237 | @smallexample | ||
| 238 | @group | ||
| 239 | /- Emacs group: ---------------------------------------------------\ | ||
| 240 | [State]: visible group members are all at standard values. | ||
| 241 | Customization of the One True Editor. | ||
| 242 | See also [Manual]. | ||
| 243 | |||
| 244 | Editing group: [Go to Group] | ||
| 245 | Basic text editing facilities. | ||
| 246 | |||
| 247 | External group: [Go to Group] | ||
| 248 | Interfacing to external utilities. | ||
| 249 | |||
| 250 | @var{more second-level groups} | ||
| 251 | |||
| 252 | \- Emacs group end ------------------------------------------------/ | ||
| 253 | @end group | ||
| 254 | @end smallexample | ||
| 255 | |||
| 256 | @noindent | ||
| 257 | This says that the buffer displays the contents of the @code{Emacs} | ||
| 258 | group. The other groups are listed because they are its contents. But | ||
| 259 | they are listed differently, without indentation and dashes, because | ||
| 260 | @emph{their} contents are not included. Each group has a single-line | ||
| 261 | documentation string; the @code{Emacs} group also has a @samp{[State]} | ||
| 262 | line. | ||
| 263 | |||
| 264 | @cindex editable fields (customization buffer) | ||
| 265 | @cindex buttons (customization buffer) | ||
| 266 | @cindex links (customization buffer) | ||
| 267 | Most of the text in the customization buffer is read-only, but it | ||
| 268 | typically includes some @dfn{editable fields} that you can edit. | ||
| 269 | There are also @dfn{buttons} and @dfn{links}, which do something when | ||
| 270 | you @dfn{invoke} them. To invoke a button or a link, either click on | ||
| 271 | it with @kbd{Mouse-1}, or move point to it and type @key{RET}. | ||
| 272 | |||
| 273 | For example, the phrase @samp{[State]} that appears in | ||
| 274 | a second-level group is a button. It operates on the same | ||
| 275 | customization buffer. The phrase @samp{[Go to Group]} is a kind | ||
| 276 | of hypertext link to another group. Invoking it creates a new | ||
| 277 | customization buffer, which shows that group and its contents. | ||
| 278 | |||
| 279 | The @code{Emacs} group includes a few settings, but mainly it | ||
| 280 | contains other groups, which contain more groups, which contain the | ||
| 281 | settings. By browsing the hierarchy of groups, you will eventually | ||
| 282 | find the feature you are interested in customizing. Then you can use | ||
| 283 | the customization buffer to set that feature's settings. You can also | ||
| 284 | go straight to a particular group by name, using the command @kbd{M-x | ||
| 285 | customize-group}. | ||
| 286 | |||
| 287 | @node Browsing Custom | ||
| 288 | @subsection Browsing and Searching for Options and Faces | ||
| 289 | @findex customize-browse | ||
| 290 | |||
| 291 | @kbd{M-x customize-browse} is another way to browse the available | ||
| 292 | settings. This command creates a special customization buffer which | ||
| 293 | shows only the names of groups and settings, and puts them in a | ||
| 294 | structure. | ||
| 295 | |||
| 296 | In this buffer, you can show the contents of a group by invoking the | ||
| 297 | @samp{[+]} button. When the group contents are visible, this button | ||
| 298 | changes to @samp{[-]}; invoking that hides the group contents again. | ||
| 299 | |||
| 300 | Each group or setting in this buffer has a link which says | ||
| 301 | @samp{[Group]}, @samp{[Option]} or @samp{[Face]}. Invoking this link | ||
| 302 | creates an ordinary customization buffer showing just that group and | ||
| 303 | its contents, just that user option, or just that face. This is the | ||
| 304 | way to change settings that you find with @kbd{M-x customize-browse}. | ||
| 305 | |||
| 306 | If you can guess part of the name of the settings you are interested | ||
| 307 | in, @kbd{M-x customize-apropos} is another way to search for settings. | ||
| 308 | However, unlike @code{customize} and @code{customize-browse}, | ||
| 309 | @code{customize-apropos} can only find groups and settings that are | ||
| 310 | loaded in the current Emacs session. @xref{Specific Customization,, | ||
| 311 | Customizing Specific Items}. | ||
| 312 | |||
| 313 | @node Changing a Variable | ||
| 314 | @subsection Changing a Variable | ||
| 315 | |||
| 316 | Here is an example of what a variable (a user option) looks like in | ||
| 317 | the customization buffer: | ||
| 318 | |||
| 319 | @smallexample | ||
| 320 | Kill Ring Max: [Hide Value] 60 | ||
| 321 | [State]: STANDARD. | ||
| 322 | Maximum length of kill ring before oldest elements are thrown away. | ||
| 323 | @end smallexample | ||
| 324 | |||
| 325 | The text following @samp{[Hide Value]}, @samp{60} in this case, indicates | ||
| 326 | the current value of the variable. If you see @samp{[Show Value]} instead of | ||
| 327 | @samp{[Hide Value]}, it means that the value is hidden; the customization | ||
| 328 | buffer initially hides values that take up several lines. Invoke | ||
| 329 | @samp{[Show Value]} to show the value. | ||
| 330 | |||
| 331 | The line after the variable name indicates the @dfn{customization | ||
| 332 | state} of the variable: in the example above, it says you have not | ||
| 333 | changed the option yet. The @samp{[State]} button at the beginning of | ||
| 334 | this line gives you a menu of various operations for customizing the | ||
| 335 | variable. | ||
| 336 | |||
| 337 | The line after the @samp{[State]} line displays the beginning of the | ||
| 338 | variable's documentation string. If there are more lines of | ||
| 339 | documentation, this line ends with a @samp{[More]} button; invoke that | ||
| 340 | to show the full documentation string. | ||
| 341 | |||
| 342 | To enter a new value for @samp{Kill Ring Max}, move point to the | ||
| 343 | value and edit it textually. For example, you can type @kbd{M-d}, | ||
| 344 | then insert another number. As you begin to alter the text, you will | ||
| 345 | see the @samp{[State]} line change to say that you have edited the | ||
| 346 | value: | ||
| 347 | |||
| 348 | @smallexample | ||
| 349 | [State]: EDITED, shown value does not take effect until you set or @r{@dots{}} | ||
| 350 | save it. | ||
| 351 | @end smallexample | ||
| 352 | |||
| 353 | @cindex user options, how to set | ||
| 354 | @cindex variables, how to set | ||
| 355 | @cindex settings, how to set | ||
| 356 | Editing the value does not actually set the variable. To do that, | ||
| 357 | you must @dfn{set} the variable. To do this, invoke the | ||
| 358 | @samp{[State]} button and choose @samp{Set for Current Session}. | ||
| 359 | |||
| 360 | The state of the variable changes visibly when you set it: | ||
| 361 | |||
| 362 | @smallexample | ||
| 363 | [State]: SET for current session only. | ||
| 364 | @end smallexample | ||
| 365 | |||
| 366 | You don't have to worry about specifying a value that is not valid; | ||
| 367 | the @samp{Set for Current Session} operation checks for validity and | ||
| 368 | will not install an unacceptable value. | ||
| 369 | |||
| 370 | @kindex M-TAB @r{(customization buffer)} | ||
| 371 | @findex widget-complete | ||
| 372 | While editing a field that is a file name, directory name, | ||
| 373 | command name, or anything else for which completion is defined, you | ||
| 374 | can type @kbd{M-@key{TAB}} (@code{widget-complete}) to do completion. | ||
| 375 | (@kbd{@key{ESC} @key{TAB}} and @kbd{C-M-i} do the same thing.) | ||
| 376 | |||
| 377 | Some variables have a small fixed set of possible legitimate values. | ||
| 378 | These variables don't let you edit the value textually. Instead, a | ||
| 379 | @samp{[Value Menu]} button appears before the value; invoke this | ||
| 380 | button to change the value. For a boolean ``on or off'' value, the | ||
| 381 | button says @samp{[Toggle]}, and it changes to the other value. | ||
| 382 | @samp{[Value Menu]} and @samp{[Toggle]} simply edit the buffer; the | ||
| 383 | changes take real effect when you use the @samp{Set for Current | ||
| 384 | Session} operation. | ||
| 385 | |||
| 386 | Some variables have values with complex structure. For example, the | ||
| 387 | value of @code{file-coding-system-alist} is an association list. Here | ||
| 388 | is how it appears in the customization buffer: | ||
| 389 | |||
| 390 | @smallexample | ||
| 391 | File Coding System Alist: [Hide Value] | ||
| 392 | [INS] [DEL] File regexp: \.elc\' | ||
| 393 | Choice: [Value Menu] Encoding/decoding pair: | ||
| 394 | Decoding: emacs-mule | ||
| 395 | Encoding: emacs-mule | ||
| 396 | [INS] [DEL] File regexp: \(\`\|/\)loaddefs.el\' | ||
| 397 | Choice: [Value Menu] Encoding/decoding pair: | ||
| 398 | Decoding: raw-text | ||
| 399 | Encoding: raw-text-unix | ||
| 400 | [INS] [DEL] File regexp: \.tar\' | ||
| 401 | Choice: [Value Menu] Encoding/decoding pair: | ||
| 402 | Decoding: no-conversion | ||
| 403 | Encoding: no-conversion | ||
| 404 | [INS] [DEL] File regexp: | ||
| 405 | Choice: [Value Menu] Encoding/decoding pair: | ||
| 406 | Decoding: undecided | ||
| 407 | Encoding: nil | ||
| 408 | [INS] | ||
| 409 | [State]: STANDARD. | ||
| 410 | Alist to decide a coding system to use for a file I/O @r{@dots{}} | ||
| 411 | operation. [Hide Rest] | ||
| 412 | The format is ((PATTERN . VAL) ...), | ||
| 413 | where PATTERN is a regular expression matching a file name, | ||
| 414 | @r{[@dots{}more lines of documentation@dots{}]} | ||
| 415 | @end smallexample | ||
| 416 | |||
| 417 | @noindent | ||
| 418 | Each association in the list appears on four lines, with several | ||
| 419 | editable fields and/or buttons. You can edit the regexps and coding | ||
| 420 | systems using ordinary editing commands. You can also invoke | ||
| 421 | @samp{[Value Menu]} to switch to a different kind of value---for | ||
| 422 | instance, to specify a function instead of a pair of coding systems. | ||
| 423 | |||
| 424 | To delete an association from the list, invoke the @samp{[DEL]} button | ||
| 425 | for that item. To add an association, invoke @samp{[INS]} at the | ||
| 426 | position where you want to add it. There is an @samp{[INS]} button | ||
| 427 | between each pair of associations, another at the beginning and another | ||
| 428 | at the end, so you can add a new association at any position in the | ||
| 429 | list. | ||
| 430 | |||
| 431 | @kindex TAB @r{(customization buffer)} | ||
| 432 | @kindex S-TAB @r{(customization buffer)} | ||
| 433 | @findex widget-forward | ||
| 434 | @findex widget-backward | ||
| 435 | Two special commands, @key{TAB} and @kbd{S-@key{TAB}}, are useful | ||
| 436 | for moving through the customization buffer. @key{TAB} | ||
| 437 | (@code{widget-forward}) moves forward to the next button or editable | ||
| 438 | field; @kbd{S-@key{TAB}} (@code{widget-backward}) moves backward to | ||
| 439 | the previous button or editable field. | ||
| 440 | |||
| 441 | Typing @key{RET} on an editable field also moves forward, just like | ||
| 442 | @key{TAB}. We set it up this way because people often type @key{RET} | ||
| 443 | when they are finished editing a field. To insert a newline within an | ||
| 444 | editable field, use @kbd{C-o} or @kbd{C-q C-j}. | ||
| 445 | |||
| 446 | @cindex saving a setting | ||
| 447 | @cindex settings, how to save | ||
| 448 | Setting the variable changes its value in the current Emacs session; | ||
| 449 | @dfn{saving} the value changes it for future sessions as well. To | ||
| 450 | save the variable, invoke @samp{[State]} and select the @samp{Save for | ||
| 451 | Future Sessions} operation. This works by writing code so as to set | ||
| 452 | the variable again, each time you start Emacs (@pxref{Saving | ||
| 453 | Customizations}). | ||
| 454 | |||
| 455 | You can also restore the variable to its standard value by invoking | ||
| 456 | @samp{[State]} and selecting the @samp{Erase Customization} operation. | ||
| 457 | There are actually four reset operations: | ||
| 458 | |||
| 459 | @table @samp | ||
| 460 | @item Undo Edits | ||
| 461 | If you have made some modifications and not yet set the variable, | ||
| 462 | this restores the text in the customization buffer to match | ||
| 463 | the actual value. | ||
| 464 | |||
| 465 | @item Reset to Saved | ||
| 466 | This restores the value of the variable to the last saved value, | ||
| 467 | and updates the text accordingly. | ||
| 468 | |||
| 469 | @item Erase Customization | ||
| 470 | This sets the variable to its standard value, and updates the text | ||
| 471 | accordingly. This also eliminates any saved value for the variable, | ||
| 472 | so that you will get the standard value in future Emacs sessions. | ||
| 473 | |||
| 474 | @item Set to Backup Value | ||
| 475 | This sets the variable to a previous value that was set in the | ||
| 476 | customization buffer in this session. If you customize a variable | ||
| 477 | and then reset it, which discards the customized value, | ||
| 478 | you can get the discarded value back again with this operation. | ||
| 479 | @end table | ||
| 480 | |||
| 481 | @cindex comments on customized settings | ||
| 482 | Sometimes it is useful to record a comment about a specific | ||
| 483 | customization. Use the @samp{Add Comment} item from the | ||
| 484 | @samp{[State]} menu to create a field for entering the comment. The | ||
| 485 | comment you enter will be saved, and displayed again if you again view | ||
| 486 | the same variable in a customization buffer, even in another session. | ||
| 487 | |||
| 488 | The state of a group indicates whether anything in that group has been | ||
| 489 | edited, set or saved. | ||
| 490 | |||
| 491 | Near the top of the customization buffer there are two lines of buttons: | ||
| 492 | |||
| 493 | @smallexample | ||
| 494 | [Set for Current Session] [Save for Future Sessions] | ||
| 495 | [Undo Edits] [Reset to Saved] [Erase Customization] [Finish] | ||
| 496 | @end smallexample | ||
| 497 | |||
| 498 | @vindex custom-buffer-done-function | ||
| 499 | @noindent | ||
| 500 | Invoking @samp{[Finish]} either buries or kills this customization | ||
| 501 | buffer according to the setting of the option | ||
| 502 | @code{custom-buffer-done-kill}; the default is to bury the buffer. | ||
| 503 | Each of the other buttons performs an operation---set, save or | ||
| 504 | reset---on each of the settings in the buffer that could meaningfully | ||
| 505 | be set, saved or reset. They do not operate on settings whose values | ||
| 506 | are hidden, nor on subgroups which are hidden or not visible in the buffer. | ||
| 507 | |||
| 508 | @node Saving Customizations | ||
| 509 | @subsection Saving Customizations | ||
| 510 | |||
| 511 | Saving customizations from the customization buffer works by writing | ||
| 512 | code that future sessions will read, code to set up those | ||
| 513 | customizations again. | ||
| 514 | |||
| 515 | @vindex custom-file | ||
| 516 | Normally this saves customizations in your init file, | ||
| 517 | @file{~/.emacs}. If you wish, you can save customizations in another | ||
| 518 | file instead. To make this work, your @file{~/.emacs} should set | ||
| 519 | @code{custom-file} to the name of that file. Then you should load the | ||
| 520 | file by calling @code{load}. For example: | ||
| 521 | |||
| 522 | @example | ||
| 523 | (setq custom-file "~/.emacs-custom.el") | ||
| 524 | (load custom-file) | ||
| 525 | @end example | ||
| 526 | |||
| 527 | You can use @code{custom-file} to specify different customization | ||
| 528 | files for different Emacs versions, like this: | ||
| 529 | |||
| 530 | @example | ||
| 531 | (cond ((< emacs-major-version 21) | ||
| 532 | ;; @r{Emacs 20 customization.} | ||
| 533 | (setq custom-file "~/.custom-20.el")) | ||
| 534 | ((and (= emacs-major-version 21) (< emacs-minor-version 4)) | ||
| 535 | ;; @r{Emacs 21 customization, before version 21.4.} | ||
| 536 | (setq custom-file "~/.custom-21.el")) | ||
| 537 | ((< emacs-major-version 22) | ||
| 538 | ;; @r{Emacs version 21.4 or later.} | ||
| 539 | (setq custom-file "~/.custom-21.4.el")) | ||
| 540 | (t | ||
| 541 | ;; @r{Emacs version 22.1 or later.} | ||
| 542 | (setq custom-file "~/.custom-22.el"))) | ||
| 543 | |||
| 544 | (load custom-file) | ||
| 545 | @end example | ||
| 546 | |||
| 547 | If Emacs was invoked with the @option{-q} or @option{--no-init-file} | ||
| 548 | options (@pxref{Initial Options}), it will not let you save your | ||
| 549 | customizations in your @file{~/.emacs} init file. This is because | ||
| 550 | saving customizations from such a session would wipe out all the other | ||
| 551 | customizations you might have on your init file. | ||
| 552 | |||
| 553 | @node Face Customization | ||
| 554 | @subsection Customizing Faces | ||
| 555 | @cindex customizing faces | ||
| 556 | @cindex bold font | ||
| 557 | @cindex italic font | ||
| 558 | @cindex fonts and faces | ||
| 559 | |||
| 560 | In addition to variables, some customization groups also include | ||
| 561 | faces. When you show the contents of a group, both the variables and | ||
| 562 | the faces in the group appear in the customization buffer. Here is an | ||
| 563 | example of how a face looks: | ||
| 564 | |||
| 565 | @smallexample | ||
| 566 | Custom Changed Face:(sample) [Hide Face] | ||
| 567 | [State]: STANDARD. | ||
| 568 | Face used when the customize item has been changed. | ||
| 569 | Parent groups: [Custom Magic Faces] | ||
| 570 | Attributes: [ ] Font Family: * | ||
| 571 | [ ] Width: * | ||
| 572 | [ ] Height: * | ||
| 573 | [ ] Weight: * | ||
| 574 | [ ] Slant: * | ||
| 575 | [ ] Underline: * | ||
| 576 | [ ] Overline: * | ||
| 577 | [ ] Strike-through: * | ||
| 578 | [ ] Box around text: * | ||
| 579 | [ ] Inverse-video: * | ||
| 580 | [X] Foreground: white (sample) | ||
| 581 | [X] Background: blue (sample) | ||
| 582 | [ ] Stipple: * | ||
| 583 | [ ] Inherit: * | ||
| 584 | @end smallexample | ||
| 585 | |||
| 586 | Each face attribute has its own line. The @samp{[@var{x}]} button | ||
| 587 | before the attribute name indicates whether the attribute is | ||
| 588 | @dfn{enabled}; @samp{[X]} means that it's enabled, and @samp{[ ]} | ||
| 589 | means that it's disabled. You can enable or disable the attribute by | ||
| 590 | clicking that button. When the attribute is enabled, you can change | ||
| 591 | the attribute value in the usual ways. | ||
| 592 | |||
| 593 | For the colors, you can specify a color name (use @kbd{M-x | ||
| 594 | list-colors-display} for a list of them) or a hexadecimal color | ||
| 595 | specification of the form @samp{#@var{rr}@var{gg}@var{bb}}. | ||
| 596 | (@samp{#000000} is black, @samp{#ff0000} is red, @samp{#00ff00} is | ||
| 597 | green, @samp{#0000ff} is blue, and @samp{#ffffff} is white.) On a | ||
| 598 | black-and-white display, the colors you can use for the background are | ||
| 599 | @samp{black}, @samp{white}, @samp{gray}, @samp{gray1}, and | ||
| 600 | @samp{gray3}. Emacs supports these shades of gray by using background | ||
| 601 | stipple patterns instead of a color. | ||
| 602 | |||
| 603 | Setting, saving and resetting a face work like the same operations for | ||
| 604 | variables (@pxref{Changing a Variable}). | ||
| 605 | |||
| 606 | A face can specify different appearances for different types of | ||
| 607 | display. For example, a face can make text red on a color display, but | ||
| 608 | use a bold font on a monochrome display. To specify multiple | ||
| 609 | appearances for a face, select @samp{For All Kinds of Displays} in the | ||
| 610 | menu you get from invoking @samp{[State]}. | ||
| 611 | |||
| 612 | @findex modify-face | ||
| 613 | Another more basic way to set the attributes of a specific face is | ||
| 614 | with @kbd{M-x modify-face}. This command reads the name of a face, then | ||
| 615 | reads the attributes one by one. For the color and stipple attributes, | ||
| 616 | the attribute's current value is the default---type just @key{RET} if | ||
| 617 | you don't want to change that attribute. Type @samp{none} if you want | ||
| 618 | to clear out the attribute. | ||
| 619 | |||
| 620 | @node Specific Customization | ||
| 621 | @subsection Customizing Specific Items | ||
| 622 | |||
| 623 | Instead of finding the setting you want to change by navigating the | ||
| 624 | structure of groups, here are other ways to specify the settings that | ||
| 625 | you want to customize. | ||
| 626 | |||
| 627 | @table @kbd | ||
| 628 | @item M-x customize-option @key{RET} @var{option} @key{RET} | ||
| 629 | Set up a customization buffer with just one user option variable, | ||
| 630 | @var{option}. | ||
| 631 | @item M-x customize-face @key{RET} @var{face} @key{RET} | ||
| 632 | Set up a customization buffer with just one face, @var{face}. | ||
| 633 | @item M-x customize-group @key{RET} @var{group} @key{RET} | ||
| 634 | Set up a customization buffer with just one group, @var{group}. | ||
| 635 | @item M-x customize-apropos @key{RET} @var{regexp} @key{RET} | ||
| 636 | Set up a customization buffer with all the settings and groups that | ||
| 637 | match @var{regexp}. | ||
| 638 | @item M-x customize-changed @key{RET} @var{version} @key{RET} | ||
| 639 | Set up a customization buffer with all the settings and groups | ||
| 640 | whose meaning has changed since Emacs version @var{version}. | ||
| 641 | @item M-x customize-saved | ||
| 642 | Set up a customization buffer containing all settings that you | ||
| 643 | have saved with customization buffers. | ||
| 644 | @item M-x customize-unsaved | ||
| 645 | Set up a customization buffer containing all settings that you have | ||
| 646 | set but not saved. | ||
| 647 | @end table | ||
| 648 | |||
| 649 | @findex customize-option | ||
| 650 | If you want to alter a particular user option with the customization | ||
| 651 | buffer, and you know its name, you can use the command @kbd{M-x | ||
| 652 | customize-option} and specify the user option (variable) name. This | ||
| 653 | sets up the customization buffer with just one user option---the one | ||
| 654 | that you asked for. Editing, setting and saving the value work as | ||
| 655 | described above, but only for the specified user option. Minibuffer | ||
| 656 | completion is handy if you only know part of the name. However, this | ||
| 657 | command can only see options that have been loaded in the current | ||
| 658 | Emacs session. | ||
| 659 | |||
| 660 | @findex customize-face | ||
| 661 | Likewise, you can modify a specific face, chosen by name, using | ||
| 662 | @kbd{M-x customize-face}. By default it operates on the face used | ||
| 663 | on the character after point. | ||
| 664 | |||
| 665 | @findex customize-group | ||
| 666 | You can also set up the customization buffer with a specific group, | ||
| 667 | using @kbd{M-x customize-group}. The immediate contents of the chosen | ||
| 668 | group, including settings (user options and faces), and other groups, | ||
| 669 | all appear as well (even if not already loaded). However, the | ||
| 670 | subgroups' own contents are not included. | ||
| 671 | |||
| 672 | @findex customize-apropos | ||
| 673 | For a more general way of controlling what to customize, you can use | ||
| 674 | @kbd{M-x customize-apropos}. You specify a regular expression as | ||
| 675 | argument; then all @emph{loaded} settings and groups whose names match | ||
| 676 | this regular expression are set up in the customization buffer. If | ||
| 677 | you specify an empty regular expression, this includes @emph{all} | ||
| 678 | loaded groups and settings---which takes a long time to set up. | ||
| 679 | |||
| 680 | @findex customize-changed | ||
| 681 | When you upgrade to a new Emacs version, you might want to consider | ||
| 682 | customizing new settings, and settings whose meanings or default | ||
| 683 | values have changed. To do this, use @kbd{M-x customize-changed} and | ||
| 684 | specify a previous Emacs version number using the minibuffer. It | ||
| 685 | creates a customization buffer which shows all the settings and groups | ||
| 686 | whose definitions have been changed since the specified version, | ||
| 687 | loading them if necessary. | ||
| 688 | |||
| 689 | @findex customize-saved | ||
| 690 | @findex customize-unsaved | ||
| 691 | If you change settings and then decide the change was a mistake, you | ||
| 692 | can use two special commands to revisit your previous changes. Use | ||
| 693 | @kbd{M-x customize-saved} to look at the settings that you have saved. | ||
| 694 | Use @kbd{M-x customize-unsaved} to look at the settings that you | ||
| 695 | have set but not saved. | ||
| 696 | |||
| 697 | @node Custom Themes | ||
| 698 | @subsection Customization Themes | ||
| 699 | @cindex custom themes | ||
| 700 | |||
| 701 | @dfn{Custom themes} are collections of settings that can be enabled | ||
| 702 | or disabled as a unit. You can use Custom themes to switch quickly | ||
| 703 | and easily between various collections of settings, and to transfer | ||
| 704 | such collections from one computer to another. | ||
| 705 | |||
| 706 | @findex customize-create-theme | ||
| 707 | To define a Custom theme, use @kbd{M-x customize-create-theme}, | ||
| 708 | which brings up a buffer named @samp{*New Custom Theme*}. At the top | ||
| 709 | of the buffer is an editable field where you can specify the name of | ||
| 710 | the theme. Click on the button labelled @samp{Insert Variable} to add | ||
| 711 | a variable to the theme, and click on @samp{Insert Face} to add a | ||
| 712 | face. You can edit these values in the @samp{*New Custom Theme*} | ||
| 713 | buffer like in an ordinary Customize buffer. To remove an option from | ||
| 714 | the theme, click on its @samp{State} button and select @samp{Delete}. | ||
| 715 | |||
| 716 | @vindex custom-theme-directory | ||
| 717 | After adding the desired options, click on @samp{Save Theme} to save | ||
| 718 | the Custom theme. This writes the theme definition to a file | ||
| 719 | @file{@var{foo}-theme.el} (where @var{foo} is the theme name you | ||
| 720 | supplied), in the directory @file{~/.emacs.d/}. You can specify the | ||
| 721 | directory by setting @code{custom-theme-directory}. | ||
| 722 | |||
| 723 | You can view and edit the settings of a previously-defined theme by | ||
| 724 | clicking on @samp{Visit Theme} and specifying the theme name. You can | ||
| 725 | also import the variables and faces that you have set using Customize | ||
| 726 | by visiting the ``special'' theme named @samp{user}. This theme, which | ||
| 727 | records all the options that you set in the ordinary customization | ||
| 728 | buffer, is always enabled, and always takes precedence over all other | ||
| 729 | enabled Custom themes. Additionally, the @samp{user} theme is | ||
| 730 | recorded with code in your @file{.emacs} file, rather than a | ||
| 731 | @file{user-theme.el} file. | ||
| 732 | |||
| 733 | @vindex custom-enabled-themes | ||
| 734 | Once you have defined a Custom theme, you can use it by customizing | ||
| 735 | the variable @code{custom-enabled-themes}. This is a list of Custom | ||
| 736 | themes that are @dfn{enabled}, or put into effect. If you set | ||
| 737 | @code{custom-enabled-themes} using the Customize interface, the theme | ||
| 738 | definitions are automatically loaded from the theme files, if they | ||
| 739 | aren't already. If you save the value of @code{custom-enabled-themes} | ||
| 740 | for future Emacs sessions, those Custom themes will be enabled | ||
| 741 | whenever Emacs is started up. | ||
| 742 | |||
| 743 | If two enabled themes specify different values for an option, the | ||
| 744 | theme occurring earlier in @code{custom-enabled-themes} takes effect. | ||
| 745 | |||
| 746 | @findex load-theme | ||
| 747 | @findex enable-theme | ||
| 748 | @findex disable-theme | ||
| 749 | You can temporarily enable a Custom theme with @kbd{M-x | ||
| 750 | enable-theme}. This prompts for a theme name in the minibuffer, loads | ||
| 751 | the theme from the theme file if necessary, and enables the theme. | ||
| 752 | You can @dfn{disable} any enabled theme with the command @kbd{M-x | ||
| 753 | disable-theme}; this returns the options specified in the theme to | ||
| 754 | their original values. To re-enable the theme, type @kbd{M-x | ||
| 755 | enable-theme} again. If a theme file is changed during your Emacs | ||
| 756 | session, you can reload it by typing @kbd{M-x load-theme}. (This also | ||
| 757 | enables the theme.) | ||
| 758 | |||
| 759 | @node Variables | ||
| 760 | @section Variables | ||
| 761 | @cindex variable | ||
| 762 | @cindex option, user | ||
| 763 | @cindex user option | ||
| 764 | |||
| 765 | A @dfn{variable} is a Lisp symbol which has a value. The symbol's | ||
| 766 | name is also called the name of the variable. A variable name can | ||
| 767 | contain any characters that can appear in a file, but conventionally | ||
| 768 | variable names consist of words separated by hyphens. A variable can | ||
| 769 | have a documentation string which describes what kind of value it should | ||
| 770 | have and how the value will be used. | ||
| 771 | |||
| 772 | Emacs Lisp allows any variable (with a few exceptions) to have any | ||
| 773 | kind of value, but most variables that Emacs uses expect a value of a | ||
| 774 | certain type. Often the value should always be a string, or should | ||
| 775 | always be a number. Sometimes we say that a certain feature is turned | ||
| 776 | on if a variable is ``non-@code{nil},'' meaning that if the variable's | ||
| 777 | value is @code{nil}, the feature is off, but the feature is on for | ||
| 778 | @emph{any} other value. The conventional value to use to turn on the | ||
| 779 | feature---since you have to pick one particular value when you set the | ||
| 780 | variable---is @code{t}. | ||
| 781 | |||
| 782 | Emacs uses many Lisp variables for internal record keeping, but the | ||
| 783 | most interesting variables for a non-programmer user are those meant | ||
| 784 | for users to change---these are called @dfn{user options}. | ||
| 785 | |||
| 786 | Each user option that you can set with the customization buffer is | ||
| 787 | in fact a Lisp variable. Emacs does not (usually) change the values | ||
| 788 | of these variables on its own; instead, you set the values in order to | ||
| 789 | control the behavior of certain Emacs commands. Use of the | ||
| 790 | customization buffer is explained above (@pxref{Easy Customization}); | ||
| 791 | here we describe other aspects of Emacs variables. | ||
| 792 | |||
| 793 | @menu | ||
| 794 | * Examining:: Examining or setting one variable's value. | ||
| 795 | * Hooks:: Hook variables let you specify programs for parts | ||
| 796 | of Emacs to run on particular occasions. | ||
| 797 | * Locals:: Per-buffer values of variables. | ||
| 798 | * File Variables:: How files can specify variable values. | ||
| 799 | @end menu | ||
| 800 | |||
| 801 | @node Examining | ||
| 802 | @subsection Examining and Setting Variables | ||
| 803 | @cindex setting variables | ||
| 804 | |||
| 805 | @table @kbd | ||
| 806 | @item C-h v @var{var} @key{RET} | ||
| 807 | Display the value and documentation of variable @var{var} | ||
| 808 | (@code{describe-variable}). | ||
| 809 | @item M-x set-variable @key{RET} @var{var} @key{RET} @var{value} @key{RET} | ||
| 810 | Change the value of variable @var{var} to @var{value}. | ||
| 811 | @end table | ||
| 812 | |||
| 813 | To examine the value of a single variable, use @kbd{C-h v} | ||
| 814 | (@code{describe-variable}), which reads a variable name using the | ||
| 815 | minibuffer, with completion. It displays both the value and the | ||
| 816 | documentation of the variable. For example, | ||
| 817 | |||
| 818 | @example | ||
| 819 | C-h v fill-column @key{RET} | ||
| 820 | @end example | ||
| 821 | |||
| 822 | @noindent | ||
| 823 | displays something like this: | ||
| 824 | |||
| 825 | @smallexample | ||
| 826 | fill-column is a variable defined in `C source code'. | ||
| 827 | fill-column's value is 70 | ||
| 828 | Local in buffer custom.texi; global value is 70 | ||
| 829 | Automatically becomes buffer-local when set in any fashion. | ||
| 830 | |||
| 831 | This variable is safe to use as a file local variable only if its value | ||
| 832 | satisfies the predicate `integerp'. | ||
| 833 | |||
| 834 | Documentation: | ||
| 835 | *Column beyond which automatic line-wrapping should happen. | ||
| 836 | Interactively, you can set the buffer local value using C-x f. | ||
| 837 | |||
| 838 | You can customize this variable. | ||
| 839 | @end smallexample | ||
| 840 | |||
| 841 | @noindent | ||
| 842 | The line that says you can customize the variable indicates that this | ||
| 843 | variable is a user option. (The star also indicates this, but it is | ||
| 844 | an obsolete indicator that may eventually disappear.) @kbd{C-h v} is | ||
| 845 | not restricted to user options; it allows any variable name. | ||
| 846 | |||
| 847 | @findex set-variable | ||
| 848 | The most convenient way to set a specific user option variable is with | ||
| 849 | @kbd{M-x set-variable}. This reads the variable name with the | ||
| 850 | minibuffer (with completion), and then reads a Lisp expression for the | ||
| 851 | new value using the minibuffer a second time (you can insert the old | ||
| 852 | value into the minibuffer for editing via @kbd{M-n}). For example, | ||
| 853 | |||
| 854 | @example | ||
| 855 | M-x set-variable @key{RET} fill-column @key{RET} 75 @key{RET} | ||
| 856 | @end example | ||
| 857 | |||
| 858 | @noindent | ||
| 859 | sets @code{fill-column} to 75. | ||
| 860 | |||
| 861 | @kbd{M-x set-variable} is limited to user option variables, but you can | ||
| 862 | set any variable with a Lisp expression, using the function @code{setq}. | ||
| 863 | Here is a @code{setq} expression to set @code{fill-column}: | ||
| 864 | |||
| 865 | @example | ||
| 866 | (setq fill-column 75) | ||
| 867 | @end example | ||
| 868 | |||
| 869 | To execute an expression like this one, go to the @samp{*scratch*} | ||
| 870 | buffer, type in the expression, and then type @kbd{C-j}. @xref{Lisp | ||
| 871 | Interaction}. | ||
| 872 | |||
| 873 | Setting variables, like all means of customizing Emacs except where | ||
| 874 | otherwise stated, affects only the current Emacs session. The only | ||
| 875 | way to alter the variable in future sessions is to put something in | ||
| 876 | the @file{~/.emacs} file to set it those sessions (@pxref{Init File}). | ||
| 877 | |||
| 878 | @node Hooks | ||
| 879 | @subsection Hooks | ||
| 880 | @cindex hook | ||
| 881 | @cindex running a hook | ||
| 882 | |||
| 883 | @dfn{Hooks} are an important mechanism for customization of Emacs. A | ||
| 884 | hook is a Lisp variable which holds a list of functions, to be called on | ||
| 885 | some well-defined occasion. (This is called @dfn{running the hook}.) | ||
| 886 | The individual functions in the list are called the @dfn{hook functions} | ||
| 887 | of the hook. With rare exceptions, hooks in Emacs are empty when Emacs | ||
| 888 | starts up, so the only hook functions in any given hook are the ones you | ||
| 889 | explicitly put there as customization. | ||
| 890 | |||
| 891 | Most major modes run one or more @dfn{mode hooks} as the last step of | ||
| 892 | initialization. This makes it easy for you to customize the behavior of | ||
| 893 | the mode, by setting up a hook function to override the local variable | ||
| 894 | assignments already made by the mode. But hooks are also used in other | ||
| 895 | contexts. For example, the hook @code{suspend-hook} runs just before | ||
| 896 | Emacs suspends itself (@pxref{Exiting}). | ||
| 897 | |||
| 898 | @cindex normal hook | ||
| 899 | Most Emacs hooks are @dfn{normal hooks}. This means that running the | ||
| 900 | hook operates by calling all the hook functions, unconditionally, with | ||
| 901 | no arguments. We have made an effort to keep most hooks normal so that | ||
| 902 | you can use them in a uniform way. Every variable in Emacs whose name | ||
| 903 | ends in @samp{-hook} is a normal hook. | ||
| 904 | |||
| 905 | @cindex abnormal hook | ||
| 906 | There are also a few @dfn{abnormal hooks}. These variables' names end | ||
| 907 | in @samp{-hooks} or @samp{-functions}, instead of @samp{-hook}. What | ||
| 908 | makes these hooks abnormal is that there is something peculiar about the | ||
| 909 | way its functions are called---perhaps they are given arguments, or | ||
| 910 | perhaps the values they return are used in some way. For example, | ||
| 911 | @code{find-file-not-found-functions} (@pxref{Visiting}) is abnormal because | ||
| 912 | as soon as one hook function returns a non-@code{nil} value, the rest | ||
| 913 | are not called at all. The documentation of each abnormal hook variable | ||
| 914 | explains in detail what is peculiar about it. | ||
| 915 | |||
| 916 | @findex add-hook | ||
| 917 | You can set a hook variable with @code{setq} like any other Lisp | ||
| 918 | variable, but the recommended way to add a hook function to a hook | ||
| 919 | (either normal or abnormal) is by calling @code{add-hook}. | ||
| 920 | @xref{Hooks,,, elisp, The Emacs Lisp Reference Manual}. | ||
| 921 | |||
| 922 | For example, here's how to set up a hook to turn on Auto Fill mode | ||
| 923 | when entering Text mode and other modes based on Text mode: | ||
| 924 | |||
| 925 | @example | ||
| 926 | (add-hook 'text-mode-hook 'turn-on-auto-fill) | ||
| 927 | @end example | ||
| 928 | |||
| 929 | The next example shows how to use a hook to customize the indentation | ||
| 930 | of C code. (People often have strong personal preferences for one | ||
| 931 | format compared to another.) Here the hook function is an anonymous | ||
| 932 | lambda expression. | ||
| 933 | |||
| 934 | @example | ||
| 935 | @group | ||
| 936 | (setq my-c-style | ||
| 937 | '((c-comment-only-line-offset . 4) | ||
| 938 | @end group | ||
| 939 | @group | ||
| 940 | (c-cleanup-list . (scope-operator | ||
| 941 | empty-defun-braces | ||
| 942 | defun-close-semi)) | ||
| 943 | @end group | ||
| 944 | @group | ||
| 945 | (c-offsets-alist . ((arglist-close . c-lineup-arglist) | ||
| 946 | (substatement-open . 0))))) | ||
| 947 | @end group | ||
| 948 | |||
| 949 | @group | ||
| 950 | (add-hook 'c-mode-common-hook | ||
| 951 | '(lambda () | ||
| 952 | (c-add-style "my-style" my-c-style t))) | ||
| 953 | @end group | ||
| 954 | @end example | ||
| 955 | |||
| 956 | It is best to design your hook functions so that the order in which | ||
| 957 | they are executed does not matter. Any dependence on the order is | ||
| 958 | ``asking for trouble.'' However, the order is predictable: the most | ||
| 959 | recently added hook functions are executed first. | ||
| 960 | |||
| 961 | @findex remove-hook | ||
| 962 | If you play with adding various different versions of a hook | ||
| 963 | function by calling @code{add-hook} over and over, remember that all | ||
| 964 | the versions you added will remain in the hook variable together. You | ||
| 965 | can clear out individual functions by calling @code{remove-hook}, or | ||
| 966 | do @code{(setq @var{hook-variable} nil)} to remove everything. | ||
| 967 | |||
| 968 | @node Locals | ||
| 969 | @subsection Local Variables | ||
| 970 | |||
| 971 | @table @kbd | ||
| 972 | @item M-x make-local-variable @key{RET} @var{var} @key{RET} | ||
| 973 | Make variable @var{var} have a local value in the current buffer. | ||
| 974 | @item M-x kill-local-variable @key{RET} @var{var} @key{RET} | ||
| 975 | Make variable @var{var} use its global value in the current buffer. | ||
| 976 | @item M-x make-variable-buffer-local @key{RET} @var{var} @key{RET} | ||
| 977 | Mark variable @var{var} so that setting it will make it local to the | ||
| 978 | buffer that is current at that time. | ||
| 979 | @end table | ||
| 980 | |||
| 981 | @cindex local variables | ||
| 982 | Almost any variable can be made @dfn{local} to a specific Emacs | ||
| 983 | buffer. This means that its value in that buffer is independent of its | ||
| 984 | value in other buffers. A few variables are always local in every | ||
| 985 | buffer. Every other Emacs variable has a @dfn{global} value which is in | ||
| 986 | effect in all buffers that have not made the variable local. | ||
| 987 | |||
| 988 | @findex make-local-variable | ||
| 989 | @kbd{M-x make-local-variable} reads the name of a variable and makes | ||
| 990 | it local to the current buffer. Changing its value subsequently in | ||
| 991 | this buffer will not affect others, and changes in its global value | ||
| 992 | will not affect this buffer. | ||
| 993 | |||
| 994 | @findex make-variable-buffer-local | ||
| 995 | @cindex per-buffer variables | ||
| 996 | @kbd{M-x make-variable-buffer-local} marks a variable so it will | ||
| 997 | become local automatically whenever it is set. More precisely, once a | ||
| 998 | variable has been marked in this way, the usual ways of setting the | ||
| 999 | variable automatically do @code{make-local-variable} first. We call | ||
| 1000 | such variables @dfn{per-buffer} variables. Many variables in Emacs | ||
| 1001 | are normally per-buffer; the variable's document string tells you when | ||
| 1002 | this is so. A per-buffer variable's global value is normally never | ||
| 1003 | effective in any buffer, but it still has a meaning: it is the initial | ||
| 1004 | value of the variable for each new buffer. | ||
| 1005 | |||
| 1006 | Major modes (@pxref{Major Modes}) always make variables local to the | ||
| 1007 | buffer before setting the variables. This is why changing major modes | ||
| 1008 | in one buffer has no effect on other buffers. Minor modes also work | ||
| 1009 | by setting variables---normally, each minor mode has one controlling | ||
| 1010 | variable which is non-@code{nil} when the mode is enabled | ||
| 1011 | (@pxref{Minor Modes}). For many minor modes, the controlling variable | ||
| 1012 | is per buffer, and thus always buffer-local. Otherwise, you can make | ||
| 1013 | it local in a specific buffer like any other variable. | ||
| 1014 | |||
| 1015 | A few variables cannot be local to a buffer because they are always | ||
| 1016 | local to each display instead (@pxref{Multiple Displays}). If you try to | ||
| 1017 | make one of these variables buffer-local, you'll get an error message. | ||
| 1018 | |||
| 1019 | @findex kill-local-variable | ||
| 1020 | @kbd{M-x kill-local-variable} makes a specified variable cease to be | ||
| 1021 | local to the current buffer. The global value of the variable | ||
| 1022 | henceforth is in effect in this buffer. Setting the major mode kills | ||
| 1023 | all the local variables of the buffer except for a few variables | ||
| 1024 | specially marked as @dfn{permanent locals}. | ||
| 1025 | |||
| 1026 | @findex setq-default | ||
| 1027 | To set the global value of a variable, regardless of whether the | ||
| 1028 | variable has a local value in the current buffer, you can use the Lisp | ||
| 1029 | construct @code{setq-default}. This construct is used just like | ||
| 1030 | @code{setq}, but it sets variables' global values instead of their local | ||
| 1031 | values (if any). When the current buffer does have a local value, the | ||
| 1032 | new global value may not be visible until you switch to another buffer. | ||
| 1033 | Here is an example: | ||
| 1034 | |||
| 1035 | @example | ||
| 1036 | (setq-default fill-column 75) | ||
| 1037 | @end example | ||
| 1038 | |||
| 1039 | @noindent | ||
| 1040 | @code{setq-default} is the only way to set the global value of a variable | ||
| 1041 | that has been marked with @code{make-variable-buffer-local}. | ||
| 1042 | |||
| 1043 | @findex default-value | ||
| 1044 | Lisp programs can use @code{default-value} to look at a variable's | ||
| 1045 | default value. This function takes a symbol as argument and returns its | ||
| 1046 | default value. The argument is evaluated; usually you must quote it | ||
| 1047 | explicitly. For example, here's how to obtain the default value of | ||
| 1048 | @code{fill-column}: | ||
| 1049 | |||
| 1050 | @example | ||
| 1051 | (default-value 'fill-column) | ||
| 1052 | @end example | ||
| 1053 | |||
| 1054 | @node File Variables | ||
| 1055 | @subsection Local Variables in Files | ||
| 1056 | @cindex local variables in files | ||
| 1057 | @cindex file local variables | ||
| 1058 | |||
| 1059 | A file can specify local variable values for use when you edit the | ||
| 1060 | file with Emacs. Visiting the file checks for local variable | ||
| 1061 | specifications; it automatically makes these variables local to the | ||
| 1062 | buffer, and sets them to the values specified in the file. | ||
| 1063 | |||
| 1064 | @menu | ||
| 1065 | * Specifying File Variables:: Specifying file local variables. | ||
| 1066 | * Safe File Variables:: Making sure file local variables are safe. | ||
| 1067 | @end menu | ||
| 1068 | |||
| 1069 | @node Specifying File Variables | ||
| 1070 | @subsubsection Specifying File Variables | ||
| 1071 | |||
| 1072 | There are two ways to specify file local variable values: in the first | ||
| 1073 | line, or with a local variables list. Here's how to specify them in the | ||
| 1074 | first line: | ||
| 1075 | |||
| 1076 | @example | ||
| 1077 | -*- mode: @var{modename}; @var{var}: @var{value}; @dots{} -*- | ||
| 1078 | @end example | ||
| 1079 | |||
| 1080 | @noindent | ||
| 1081 | You can specify any number of variables/value pairs in this way, each | ||
| 1082 | pair with a colon and semicolon as shown above. @code{mode: | ||
| 1083 | @var{modename};} specifies the major mode; this should come first in the | ||
| 1084 | line. The @var{value}s are not evaluated; they are used literally. | ||
| 1085 | Here is an example that specifies Lisp mode and sets two variables with | ||
| 1086 | numeric values: | ||
| 1087 | |||
| 1088 | @smallexample | ||
| 1089 | ;; -*- mode: Lisp; fill-column: 75; comment-column: 50; -*- | ||
| 1090 | @end smallexample | ||
| 1091 | |||
| 1092 | You can also specify the coding system for a file in this way: just | ||
| 1093 | specify a value for the ``variable'' named @code{coding}. The ``value'' | ||
| 1094 | must be a coding system name that Emacs recognizes. @xref{Coding | ||
| 1095 | Systems}. @w{@samp{unibyte: t}} specifies unibyte loading for a | ||
| 1096 | particular Lisp file. @xref{Enabling Multibyte}. | ||
| 1097 | |||
| 1098 | The @code{eval} pseudo-variable, described below, can be specified in | ||
| 1099 | the first line as well. | ||
| 1100 | |||
| 1101 | @cindex shell scripts, and local file variables | ||
| 1102 | In shell scripts, the first line is used to identify the script | ||
| 1103 | interpreter, so you cannot put any local variables there. To | ||
| 1104 | accommodate this, Emacs looks for local variable specifications in the | ||
| 1105 | @emph{second} line when the first line specifies an interpreter. | ||
| 1106 | |||
| 1107 | A @dfn{local variables list} goes near the end of the file, in the | ||
| 1108 | last page. (It is often best to put it on a page by itself.) The local | ||
| 1109 | variables list starts with a line containing the string @samp{Local | ||
| 1110 | Variables:}, and ends with a line containing the string @samp{End:}. In | ||
| 1111 | between come the variable names and values, one set per line, as | ||
| 1112 | @samp{@var{variable}:@: @var{value}}. The @var{value}s are not | ||
| 1113 | evaluated; they are used literally. If a file has both a local | ||
| 1114 | variables list and a @samp{-*-} line, Emacs processes @emph{everything} | ||
| 1115 | in the @samp{-*-} line first, and @emph{everything} in the local | ||
| 1116 | variables list afterward. | ||
| 1117 | |||
| 1118 | Here is an example of a local variables list: | ||
| 1119 | |||
| 1120 | @example | ||
| 1121 | ;; Local Variables: ** | ||
| 1122 | ;; mode:lisp ** | ||
| 1123 | ;; comment-column:0 ** | ||
| 1124 | ;; comment-start: ";; " ** | ||
| 1125 | ;; comment-end:"**" ** | ||
| 1126 | ;; End: ** | ||
| 1127 | @end example | ||
| 1128 | |||
| 1129 | Each line starts with the prefix @samp{;; } and each line ends with | ||
| 1130 | the suffix @samp{ **}. Emacs recognizes these as the prefix and | ||
| 1131 | suffix based on the first line of the list, by finding them | ||
| 1132 | surrounding the magic string @samp{Local Variables:}; then it | ||
| 1133 | automatically discards them from the other lines of the list. | ||
| 1134 | |||
| 1135 | The usual reason for using a prefix and/or suffix is to embed the | ||
| 1136 | local variables list in a comment, so it won't confuse other programs | ||
| 1137 | that the file is intended as input for. The example above is for a | ||
| 1138 | language where comment lines start with @samp{;; } and end with | ||
| 1139 | @samp{**}; the local values for @code{comment-start} and | ||
| 1140 | @code{comment-end} customize the rest of Emacs for this unusual | ||
| 1141 | syntax. Don't use a prefix (or a suffix) if you don't need one. | ||
| 1142 | |||
| 1143 | If you write a multi-line string value, you should put the prefix | ||
| 1144 | and suffix on each line, even lines that start or end within the | ||
| 1145 | string. They will be stripped off for processing the list. If you | ||
| 1146 | want to split a long string across multiple lines of the file, you can | ||
| 1147 | use backslash-newline, which is ignored in Lisp string constants. | ||
| 1148 | Here's an example of doing this: | ||
| 1149 | |||
| 1150 | @example | ||
| 1151 | # Local Variables: | ||
| 1152 | # compile-command: "cc foo.c -Dfoo=bar -Dhack=whatever \ | ||
| 1153 | # -Dmumble=blaah" | ||
| 1154 | # End: | ||
| 1155 | @end example | ||
| 1156 | |||
| 1157 | Some ``variable names'' have special meanings in a local variables | ||
| 1158 | list. Specifying the ``variable'' @code{mode} really sets the major | ||
| 1159 | mode, while any value specified for the ``variable'' @code{eval} is | ||
| 1160 | simply evaluated as an expression (its value is ignored). A value for | ||
| 1161 | @code{coding} specifies the coding system for character code | ||
| 1162 | conversion of this file, and a value of @code{t} for @code{unibyte} | ||
| 1163 | says to visit the file in a unibyte buffer. These four ``variables'' | ||
| 1164 | are not really variables; setting them in any other context has no | ||
| 1165 | special meaning. | ||
| 1166 | |||
| 1167 | @emph{If @code{mode} is used to set a major mode, it should be the | ||
| 1168 | first ``variable'' in the list.} Otherwise, the entries that precede | ||
| 1169 | it will usually be ignored, since most modes kill all local variables | ||
| 1170 | as part of their initialization. | ||
| 1171 | |||
| 1172 | You can use the @code{mode} ``variable'' to set minor modes as well | ||
| 1173 | as the major modes; in fact, you can use it more than once, first to | ||
| 1174 | set the major mode and then to set minor modes which are specific to | ||
| 1175 | particular buffers. But most minor modes should not be specified in | ||
| 1176 | the file at all, because they represent user preferences. | ||
| 1177 | |||
| 1178 | For example, you may be tempted to try to turn on Auto Fill mode with | ||
| 1179 | a local variable list. That is a mistake. The choice of Auto Fill mode | ||
| 1180 | or not is a matter of individual taste, not a matter of the contents of | ||
| 1181 | particular files. If you want to use Auto Fill, set up major mode hooks | ||
| 1182 | with your @file{.emacs} file to turn it on (when appropriate) for you | ||
| 1183 | alone (@pxref{Init File}). Don't use a local variable list to impose | ||
| 1184 | your taste on everyone. | ||
| 1185 | |||
| 1186 | The start of the local variables list must be no more than 3000 | ||
| 1187 | characters from the end of the file, and must be in the last page if the | ||
| 1188 | file is divided into pages. Otherwise, Emacs will not notice it is | ||
| 1189 | there. The purpose of this rule is so that a stray @samp{Local | ||
| 1190 | Variables:}@: not in the last page does not confuse Emacs, and so that | ||
| 1191 | visiting a long file that is all one page and has no local variables | ||
| 1192 | list need not take the time to search the whole file. | ||
| 1193 | |||
| 1194 | Use the command @code{normal-mode} to reset the local variables and | ||
| 1195 | major mode of a buffer according to the file name and contents, | ||
| 1196 | including the local variables list if any. @xref{Choosing Modes}. | ||
| 1197 | |||
| 1198 | @node Safe File Variables | ||
| 1199 | @subsubsection Safety of File Variables | ||
| 1200 | |||
| 1201 | File-local variables can be dangerous; when you visit someone else's | ||
| 1202 | file, there's no telling what its local variables list could do to | ||
| 1203 | your Emacs. Improper values of the @code{eval} ``variable,'' and | ||
| 1204 | other variables such as @code{load-path}, could execute Lisp code you | ||
| 1205 | didn't intend to run. | ||
| 1206 | |||
| 1207 | Therefore, whenever Emacs encounters file local variable values that | ||
| 1208 | are not known to be safe, it displays the file's entire local | ||
| 1209 | variables list, and asks you for confirmation before setting them. | ||
| 1210 | You can type @kbd{y} or @key{SPC} to put the local variables list into | ||
| 1211 | effect, or @kbd{n} to ignore it. When Emacs is run in batch mode | ||
| 1212 | (@pxref{Initial Options}), it can't really ask you, so it assumes the | ||
| 1213 | answer @kbd{n}. | ||
| 1214 | |||
| 1215 | Emacs normally recognizes certain variables/value pairs as safe. | ||
| 1216 | For instance, it is safe to give @code{comment-column} or | ||
| 1217 | @code{fill-column} any integer value. If a file specifies only | ||
| 1218 | known-safe variable/value pairs, Emacs does not ask for confirmation | ||
| 1219 | before setting them. Otherwise, you can tell Emacs to record all the | ||
| 1220 | variable/value pairs in this file as safe, by typing @kbd{!} at the | ||
| 1221 | confirmation prompt. When Emacs encounters these variable/value pairs | ||
| 1222 | subsequently, in the same file or others, it will assume they are | ||
| 1223 | safe. | ||
| 1224 | |||
| 1225 | @vindex safe-local-variable-values | ||
| 1226 | @cindex risky variable | ||
| 1227 | Some variables, such as @code{load-path}, are considered | ||
| 1228 | particularly @dfn{risky}: there is seldom any reason to specify them | ||
| 1229 | as local variables, and changing them can be dangerous. If a file | ||
| 1230 | contains only risky local variables, Emacs neither offers nor accepts | ||
| 1231 | @kbd{!} as input at the confirmation prompt. If some of the local | ||
| 1232 | variables in a file are risky, and some are only potentially unsafe, you | ||
| 1233 | can enter @kbd{!} at the prompt. It applies all the variables, but only | ||
| 1234 | marks the non-risky ones as safe for the future. If you really want to | ||
| 1235 | record safe values for risky variables, do it directly by customizing | ||
| 1236 | @samp{safe-local-variable-values} (@pxref{Easy Customization}). | ||
| 1237 | |||
| 1238 | @vindex enable-local-variables | ||
| 1239 | The variable @code{enable-local-variables} allows you to change the | ||
| 1240 | way Emacs processes local variables. Its default value is @code{t}, | ||
| 1241 | which specifies the behavior described above. If it is @code{nil}, | ||
| 1242 | Emacs simply ignores all file local variables. @code{:safe} means use | ||
| 1243 | only the safe values and ignore the rest. Any other value says to | ||
| 1244 | query you about each file that has local variables, without trying to | ||
| 1245 | determine whether the values are known to be safe. | ||
| 1246 | |||
| 1247 | @vindex enable-local-eval | ||
| 1248 | The variable @code{enable-local-eval} controls whether Emacs | ||
| 1249 | processes @code{eval} variables. The three possibilities for the | ||
| 1250 | variable's value are @code{t}, @code{nil}, and anything else, just as | ||
| 1251 | for @code{enable-local-variables}. The default is @code{maybe}, which | ||
| 1252 | is neither @code{t} nor @code{nil}, so normally Emacs does ask for | ||
| 1253 | confirmation about processing @code{eval} variables. | ||
| 1254 | |||
| 1255 | @vindex safe-local-eval-forms | ||
| 1256 | But there is an exception. The @code{safe-local-eval-forms} is a | ||
| 1257 | customizable list of eval forms which are safe. Emacs does not ask | ||
| 1258 | for confirmation when it finds these forms for the @code{eval} | ||
| 1259 | variable. | ||
| 1260 | |||
| 1261 | @node Key Bindings | ||
| 1262 | @section Customizing Key Bindings | ||
| 1263 | @cindex key bindings | ||
| 1264 | |||
| 1265 | This section describes @dfn{key bindings}, which map keys to commands, | ||
| 1266 | and @dfn{keymaps}, which record key bindings. It also explains how | ||
| 1267 | to customize key bindings. | ||
| 1268 | |||
| 1269 | Recall that a command is a Lisp function whose definition provides for | ||
| 1270 | interactive use. Like every Lisp function, a command has a function | ||
| 1271 | name, which usually consists of lower-case letters and hyphens. | ||
| 1272 | |||
| 1273 | @menu | ||
| 1274 | * Keymaps:: Generalities. The global keymap. | ||
| 1275 | * Prefix Keymaps:: Keymaps for prefix keys. | ||
| 1276 | * Local Keymaps:: Major and minor modes have their own keymaps. | ||
| 1277 | * Minibuffer Maps:: The minibuffer uses its own local keymaps. | ||
| 1278 | * Rebinding:: How to redefine one key's meaning conveniently. | ||
| 1279 | * Init Rebinding:: Rebinding keys with your init file, @file{.emacs}. | ||
| 1280 | * Function Keys:: Rebinding terminal function keys. | ||
| 1281 | * Named ASCII Chars:: Distinguishing @key{TAB} from @kbd{C-i}, and so on. | ||
| 1282 | * Mouse Buttons:: Rebinding mouse buttons in Emacs. | ||
| 1283 | * Disabling:: Disabling a command means confirmation is required | ||
| 1284 | before it can be executed. This is done to protect | ||
| 1285 | beginners from surprises. | ||
| 1286 | @end menu | ||
| 1287 | |||
| 1288 | @node Keymaps | ||
| 1289 | @subsection Keymaps | ||
| 1290 | @cindex keymap | ||
| 1291 | |||
| 1292 | The bindings between key sequences and command functions are recorded | ||
| 1293 | in data structures called @dfn{keymaps}. Emacs has many of these, each | ||
| 1294 | used on particular occasions. | ||
| 1295 | |||
| 1296 | Recall that a @dfn{key sequence} (@dfn{key}, for short) is a sequence | ||
| 1297 | of @dfn{input events} that have a meaning as a unit. Input events | ||
| 1298 | include characters, function keys and mouse buttons---all the inputs | ||
| 1299 | that you can send to the computer with your terminal. A key sequence | ||
| 1300 | gets its meaning from its @dfn{binding}, which says what command it | ||
| 1301 | runs. The function of keymaps is to record these bindings. | ||
| 1302 | |||
| 1303 | @cindex global keymap | ||
| 1304 | The @dfn{global} keymap is the most important keymap because it is | ||
| 1305 | always in effect. The global keymap defines keys for Fundamental mode; | ||
| 1306 | most of these definitions are common to most or all major modes. Each | ||
| 1307 | major or minor mode can have its own keymap which overrides the global | ||
| 1308 | definitions of some keys. | ||
| 1309 | |||
| 1310 | For example, a self-inserting character such as @kbd{g} is | ||
| 1311 | self-inserting because the global keymap binds it to the command | ||
| 1312 | @code{self-insert-command}. The standard Emacs editing characters such | ||
| 1313 | as @kbd{C-a} also get their standard meanings from the global keymap. | ||
| 1314 | Commands to rebind keys, such as @kbd{M-x global-set-key}, actually work | ||
| 1315 | by storing the new binding in the proper place in the global map. | ||
| 1316 | @xref{Rebinding}. | ||
| 1317 | |||
| 1318 | Meta characters work differently; Emacs translates each Meta | ||
| 1319 | character into a pair of characters starting with @key{ESC}. When you | ||
| 1320 | type the character @kbd{M-a} in a key sequence, Emacs replaces it with | ||
| 1321 | @kbd{@key{ESC} a}. A meta key comes in as a single input event, but | ||
| 1322 | becomes two events for purposes of key bindings. The reason for this is | ||
| 1323 | historical, and we might change it someday. | ||
| 1324 | |||
| 1325 | @cindex function key | ||
| 1326 | Most modern keyboards have function keys as well as character keys. | ||
| 1327 | Function keys send input events just as character keys do, and keymaps | ||
| 1328 | can have bindings for them. | ||
| 1329 | |||
| 1330 | On text terminals, typing a function key actually sends the computer a | ||
| 1331 | sequence of characters; the precise details of the sequence depends on | ||
| 1332 | which function key and on the model of terminal you are using. (Often | ||
| 1333 | the sequence starts with @kbd{@key{ESC} [}.) If Emacs understands your | ||
| 1334 | terminal type properly, it recognizes the character sequences forming | ||
| 1335 | function keys wherever they occur in a key sequence (not just at the | ||
| 1336 | beginning). Thus, for most purposes, you can pretend the function keys | ||
| 1337 | reach Emacs directly and ignore their encoding as character sequences. | ||
| 1338 | |||
| 1339 | @cindex mouse | ||
| 1340 | Mouse buttons also produce input events. These events come with other | ||
| 1341 | data---the window and position where you pressed or released the button, | ||
| 1342 | and a time stamp. But only the choice of button matters for key | ||
| 1343 | bindings; the other data matters only if a command looks at it. | ||
| 1344 | (Commands designed for mouse invocation usually do look at the other | ||
| 1345 | data.) | ||
| 1346 | |||
| 1347 | A keymap records definitions for single events. Interpreting a key | ||
| 1348 | sequence of multiple events involves a chain of keymaps. The first | ||
| 1349 | keymap gives a definition for the first event; this definition is | ||
| 1350 | another keymap, which is used to look up the second event in the | ||
| 1351 | sequence, and so on. | ||
| 1352 | |||
| 1353 | Key sequences can mix function keys and characters. For example, | ||
| 1354 | @kbd{C-x @key{SELECT}} is meaningful. If you make @key{SELECT} a prefix | ||
| 1355 | key, then @kbd{@key{SELECT} C-n} makes sense. You can even mix mouse | ||
| 1356 | events with keyboard events, but we recommend against it, because such | ||
| 1357 | key sequences are inconvenient to use. | ||
| 1358 | |||
| 1359 | As a user, you can redefine any key; but it is usually best to stick | ||
| 1360 | to key sequences that consist of @kbd{C-c} followed by a letter (upper | ||
| 1361 | or lower case). These keys are ``reserved for users,'' so they won't | ||
| 1362 | conflict with any properly designed Emacs extension. The function | ||
| 1363 | keys @key{F5} through @key{F9} are also reserved for users. If you | ||
| 1364 | redefine some other key, your definition may be overridden by certain | ||
| 1365 | extensions or major modes which redefine the same key. | ||
| 1366 | |||
| 1367 | @node Prefix Keymaps | ||
| 1368 | @subsection Prefix Keymaps | ||
| 1369 | |||
| 1370 | A prefix key such as @kbd{C-x} or @key{ESC} has its own keymap, | ||
| 1371 | which holds the definition for the event that immediately follows | ||
| 1372 | that prefix. | ||
| 1373 | |||
| 1374 | The definition of a prefix key is usually the keymap to use for | ||
| 1375 | looking up the following event. The definition can also be a Lisp | ||
| 1376 | symbol whose function definition is the following keymap; the effect is | ||
| 1377 | the same, but it provides a command name for the prefix key that can be | ||
| 1378 | used as a description of what the prefix key is for. Thus, the binding | ||
| 1379 | of @kbd{C-x} is the symbol @code{Control-X-prefix}, whose function | ||
| 1380 | definition is the keymap for @kbd{C-x} commands. The definitions of | ||
| 1381 | @kbd{C-c}, @kbd{C-x}, @kbd{C-h} and @key{ESC} as prefix keys appear in | ||
| 1382 | the global map, so these prefix keys are always available. | ||
| 1383 | |||
| 1384 | Aside from ordinary prefix keys, there is a fictitious ``prefix key'' | ||
| 1385 | which represents the menu bar; see @ref{Menu Bar,,,elisp, The Emacs Lisp | ||
| 1386 | Reference Manual}, for special information about menu bar key bindings. | ||
| 1387 | Mouse button events that invoke pop-up menus are also prefix keys; see | ||
| 1388 | @ref{Menu Keymaps,,,elisp, The Emacs Lisp Reference Manual}, for more | ||
| 1389 | details. | ||
| 1390 | |||
| 1391 | Some prefix keymaps are stored in variables with names: | ||
| 1392 | |||
| 1393 | @itemize @bullet | ||
| 1394 | @item | ||
| 1395 | @vindex ctl-x-map | ||
| 1396 | @code{ctl-x-map} is the variable name for the map used for characters that | ||
| 1397 | follow @kbd{C-x}. | ||
| 1398 | @item | ||
| 1399 | @vindex help-map | ||
| 1400 | @code{help-map} is for characters that follow @kbd{C-h}. | ||
| 1401 | @item | ||
| 1402 | @vindex esc-map | ||
| 1403 | @code{esc-map} is for characters that follow @key{ESC}. Thus, all Meta | ||
| 1404 | characters are actually defined by this map. | ||
| 1405 | @item | ||
| 1406 | @vindex ctl-x-4-map | ||
| 1407 | @code{ctl-x-4-map} is for characters that follow @kbd{C-x 4}. | ||
| 1408 | @item | ||
| 1409 | @vindex mode-specific-map | ||
| 1410 | @code{mode-specific-map} is for characters that follow @kbd{C-c}. | ||
| 1411 | @end itemize | ||
| 1412 | |||
| 1413 | @node Local Keymaps | ||
| 1414 | @subsection Local Keymaps | ||
| 1415 | |||
| 1416 | @cindex local keymap | ||
| 1417 | So far we have explained the ins and outs of the global map. Major | ||
| 1418 | modes customize Emacs by providing their own key bindings in @dfn{local | ||
| 1419 | keymaps}. For example, C mode overrides @key{TAB} to make it indent the | ||
| 1420 | current line for C code. Portions of text in the buffer can specify | ||
| 1421 | their own keymaps to substitute for the keymap of the buffer's major | ||
| 1422 | mode. | ||
| 1423 | |||
| 1424 | @cindex minor mode keymap | ||
| 1425 | Minor modes can also have local keymaps. Whenever a minor mode is | ||
| 1426 | in effect, the definitions in its keymap override both the major | ||
| 1427 | mode's local keymap and the global keymap. | ||
| 1428 | |||
| 1429 | A local keymap can locally redefine a key as a prefix key by defining | ||
| 1430 | it as a prefix keymap. If the key is also defined globally as a prefix, | ||
| 1431 | then its local and global definitions (both keymaps) effectively | ||
| 1432 | combine: both of them are used to look up the event that follows the | ||
| 1433 | prefix key. Thus, if the mode's local keymap defines @kbd{C-c} as | ||
| 1434 | another keymap, and that keymap defines @kbd{C-z} as a command, this | ||
| 1435 | provides a local meaning for @kbd{C-c C-z}. This does not affect other | ||
| 1436 | sequences that start with @kbd{C-c}; if those sequences don't have their | ||
| 1437 | own local bindings, their global bindings remain in effect. | ||
| 1438 | |||
| 1439 | Another way to think of this is that Emacs handles a multi-event key | ||
| 1440 | sequence by looking in several keymaps, one by one, for a binding of the | ||
| 1441 | whole key sequence. First it checks the minor mode keymaps for minor | ||
| 1442 | modes that are enabled, then it checks the major mode's keymap, and then | ||
| 1443 | it checks the global keymap. This is not precisely how key lookup | ||
| 1444 | works, but it's good enough for understanding the results in ordinary | ||
| 1445 | circumstances. | ||
| 1446 | |||
| 1447 | @cindex rebinding major mode keys | ||
| 1448 | Most major modes construct their keymaps when the mode is used for | ||
| 1449 | the first time in a session. If you wish to change one of these | ||
| 1450 | keymaps, you must use the major mode's @dfn{mode hook} | ||
| 1451 | (@pxref{Hooks}). | ||
| 1452 | |||
| 1453 | @findex define-key | ||
| 1454 | For example, the command @code{texinfo-mode} to select Texinfo mode | ||
| 1455 | runs the hook @code{texinfo-mode-hook}. Here's how you can use the hook | ||
| 1456 | to add local bindings (not very useful, we admit) for @kbd{C-c n} and | ||
| 1457 | @kbd{C-c p} in Texinfo mode: | ||
| 1458 | |||
| 1459 | @example | ||
| 1460 | (add-hook 'texinfo-mode-hook | ||
| 1461 | '(lambda () | ||
| 1462 | (define-key texinfo-mode-map "\C-cp" | ||
| 1463 | 'backward-paragraph) | ||
| 1464 | (define-key texinfo-mode-map "\C-cn" | ||
| 1465 | 'forward-paragraph))) | ||
| 1466 | @end example | ||
| 1467 | |||
| 1468 | @node Minibuffer Maps | ||
| 1469 | @subsection Minibuffer Keymaps | ||
| 1470 | |||
| 1471 | @cindex minibuffer keymaps | ||
| 1472 | @vindex minibuffer-local-map | ||
| 1473 | @vindex minibuffer-local-ns-map | ||
| 1474 | @vindex minibuffer-local-completion-map | ||
| 1475 | @vindex minibuffer-local-must-match-map | ||
| 1476 | @vindex minibuffer-local-filename-completion-map | ||
| 1477 | @vindex minibuffer-local-must-match-filename-map | ||
| 1478 | The minibuffer has its own set of local keymaps; they contain various | ||
| 1479 | completion and exit commands. | ||
| 1480 | |||
| 1481 | @itemize @bullet | ||
| 1482 | @item | ||
| 1483 | @code{minibuffer-local-map} is used for ordinary input (no completion). | ||
| 1484 | @item | ||
| 1485 | @code{minibuffer-local-ns-map} is similar, except that @key{SPC} exits | ||
| 1486 | just like @key{RET}. This is used mainly for Mocklisp compatibility. | ||
| 1487 | @item | ||
| 1488 | @code{minibuffer-local-completion-map} is for permissive completion. | ||
| 1489 | @item | ||
| 1490 | @code{minibuffer-local-must-match-map} is for strict completion and | ||
| 1491 | for cautious completion. | ||
| 1492 | @item | ||
| 1493 | Finally, @code{minibuffer-local-filename-completion-map} and | ||
| 1494 | @code{minibuffer-local-must-match-filename-map} are like the two | ||
| 1495 | previous ones, but they are specifically for file name completion. | ||
| 1496 | They do not bind @key{SPC}. | ||
| 1497 | @end itemize | ||
| 1498 | |||
| 1499 | @node Rebinding | ||
| 1500 | @subsection Changing Key Bindings Interactively | ||
| 1501 | @cindex key rebinding, this session | ||
| 1502 | @cindex redefining keys, this session | ||
| 1503 | |||
| 1504 | The way to redefine an Emacs key is to change its entry in a keymap. | ||
| 1505 | You can change the global keymap, in which case the change is effective in | ||
| 1506 | all major modes (except those that have their own overriding local | ||
| 1507 | definitions for the same key). Or you can change the current buffer's | ||
| 1508 | local map, which affects all buffers using the same major mode. | ||
| 1509 | |||
| 1510 | @findex global-set-key | ||
| 1511 | @findex local-set-key | ||
| 1512 | @findex global-unset-key | ||
| 1513 | @findex local-unset-key | ||
| 1514 | @table @kbd | ||
| 1515 | @item M-x global-set-key @key{RET} @var{key} @var{cmd} @key{RET} | ||
| 1516 | Define @var{key} globally to run @var{cmd}. | ||
| 1517 | @item M-x local-set-key @key{RET} @var{key} @var{cmd} @key{RET} | ||
| 1518 | Define @var{key} locally (in the major mode now in effect) to run | ||
| 1519 | @var{cmd}. | ||
| 1520 | @item M-x global-unset-key @key{RET} @var{key} | ||
| 1521 | Make @var{key} undefined in the global map. | ||
| 1522 | @item M-x local-unset-key @key{RET} @var{key} | ||
| 1523 | Make @var{key} undefined locally (in the major mode now in effect). | ||
| 1524 | @end table | ||
| 1525 | |||
| 1526 | For example, suppose you like to execute commands in a subshell within | ||
| 1527 | an Emacs buffer, instead of suspending Emacs and executing commands in | ||
| 1528 | your login shell. Normally, @kbd{C-z} is bound to the function | ||
| 1529 | @code{suspend-emacs} (when not using the X Window System), but you can | ||
| 1530 | change @kbd{C-z} to invoke an interactive subshell within Emacs, by | ||
| 1531 | binding it to @code{shell} as follows: | ||
| 1532 | |||
| 1533 | @example | ||
| 1534 | M-x global-set-key @key{RET} C-z shell @key{RET} | ||
| 1535 | @end example | ||
| 1536 | |||
| 1537 | @noindent | ||
| 1538 | @code{global-set-key} reads the command name after the key. After you | ||
| 1539 | press the key, a message like this appears so that you can confirm that | ||
| 1540 | you are binding the key you want: | ||
| 1541 | |||
| 1542 | @example | ||
| 1543 | Set key C-z to command: | ||
| 1544 | @end example | ||
| 1545 | |||
| 1546 | You can redefine function keys and mouse events in the same way; just | ||
| 1547 | type the function key or click the mouse when it's time to specify the | ||
| 1548 | key to rebind. | ||
| 1549 | |||
| 1550 | You can rebind a key that contains more than one event in the same | ||
| 1551 | way. Emacs keeps reading the key to rebind until it is a complete key | ||
| 1552 | (that is, not a prefix key). Thus, if you type @kbd{C-f} for | ||
| 1553 | @var{key}, that's the end; it enters the minibuffer immediately to | ||
| 1554 | read @var{cmd}. But if you type @kbd{C-x}, since that's a prefix, it | ||
| 1555 | reads another character; if that is @kbd{4}, another prefix character, | ||
| 1556 | it reads one more character, and so on. For example, | ||
| 1557 | |||
| 1558 | @example | ||
| 1559 | M-x global-set-key @key{RET} C-x 4 $ spell-other-window @key{RET} | ||
| 1560 | @end example | ||
| 1561 | |||
| 1562 | @noindent | ||
| 1563 | redefines @kbd{C-x 4 $} to run the (fictitious) command | ||
| 1564 | @code{spell-other-window}. | ||
| 1565 | |||
| 1566 | The two-character keys consisting of @kbd{C-c} followed by a letter | ||
| 1567 | are reserved for user customizations. Lisp programs are not supposed to | ||
| 1568 | define these keys, so the bindings you make for them will be available | ||
| 1569 | in all major modes and will never get in the way of anything. | ||
| 1570 | |||
| 1571 | You can remove the global definition of a key with | ||
| 1572 | @code{global-unset-key}. This makes the key @dfn{undefined}; if you | ||
| 1573 | type it, Emacs will just beep. Similarly, @code{local-unset-key} makes | ||
| 1574 | a key undefined in the current major mode keymap, which makes the global | ||
| 1575 | definition (or lack of one) come back into effect in that major mode. | ||
| 1576 | |||
| 1577 | If you have redefined (or undefined) a key and you subsequently wish | ||
| 1578 | to retract the change, undefining the key will not do the job---you need | ||
| 1579 | to redefine the key with its standard definition. To find the name of | ||
| 1580 | the standard definition of a key, go to a Fundamental mode buffer in a | ||
| 1581 | fresh Emacs and use @kbd{C-h c}. The documentation of keys in this | ||
| 1582 | manual also lists their command names. | ||
| 1583 | |||
| 1584 | If you want to prevent yourself from invoking a command by mistake, it | ||
| 1585 | is better to disable the command than to undefine the key. A disabled | ||
| 1586 | command is less work to invoke when you really want to. | ||
| 1587 | @xref{Disabling}. | ||
| 1588 | |||
| 1589 | @node Init Rebinding | ||
| 1590 | @subsection Rebinding Keys in Your Init File | ||
| 1591 | |||
| 1592 | If you have a set of key bindings that you like to use all the time, | ||
| 1593 | you can specify them in your @file{.emacs} file by using their Lisp | ||
| 1594 | syntax. (@xref{Init File}.) | ||
| 1595 | |||
| 1596 | The simplest method for doing this works for @acronym{ASCII} characters and | ||
| 1597 | Meta-modified @acronym{ASCII} characters only. This method uses a string to | ||
| 1598 | represent the key sequence you want to rebind. For example, here's how | ||
| 1599 | to bind @kbd{C-z} to @code{shell}: | ||
| 1600 | |||
| 1601 | @example | ||
| 1602 | (global-set-key "\C-z" 'shell) | ||
| 1603 | @end example | ||
| 1604 | |||
| 1605 | @noindent | ||
| 1606 | This example uses a string constant containing one character, | ||
| 1607 | @kbd{C-z}. (@samp{\C-} is string syntax for a control character.) The | ||
| 1608 | single-quote before the command name, @code{shell}, marks it as a | ||
| 1609 | constant symbol rather than a variable. If you omit the quote, Emacs | ||
| 1610 | would try to evaluate @code{shell} immediately as a variable. This | ||
| 1611 | probably causes an error; it certainly isn't what you want. | ||
| 1612 | |||
| 1613 | Here is another example that binds the key sequence @kbd{C-x M-l}: | ||
| 1614 | |||
| 1615 | @example | ||
| 1616 | (global-set-key "\C-x\M-l" 'make-symbolic-link) | ||
| 1617 | @end example | ||
| 1618 | |||
| 1619 | To put @key{TAB}, @key{RET}, @key{ESC}, or @key{DEL} in the | ||
| 1620 | string, you can use the Emacs Lisp escape sequences, @samp{\t}, | ||
| 1621 | @samp{\r}, @samp{\e}, and @samp{\d}. Here is an example which binds | ||
| 1622 | @kbd{C-x @key{TAB}}: | ||
| 1623 | |||
| 1624 | @example | ||
| 1625 | (global-set-key "\C-x\t" 'indent-rigidly) | ||
| 1626 | @end example | ||
| 1627 | |||
| 1628 | These examples show how to write some other special @acronym{ASCII} characters | ||
| 1629 | in strings for key bindings: | ||
| 1630 | |||
| 1631 | @example | ||
| 1632 | (global-set-key "\r" 'newline) ;; @key{RET} | ||
| 1633 | (global-set-key "\d" 'delete-backward-char) ;; @key{DEL} | ||
| 1634 | (global-set-key "\C-x\e\e" 'repeat-complex-command) ;; @key{ESC} | ||
| 1635 | @end example | ||
| 1636 | |||
| 1637 | When the key sequence includes function keys or mouse button events, | ||
| 1638 | or non-@acronym{ASCII} characters such as @code{C-=} or @code{H-a}, you must use | ||
| 1639 | the more general method of rebinding, which uses a vector to specify the | ||
| 1640 | key sequence. | ||
| 1641 | |||
| 1642 | The way to write a vector in Emacs Lisp is with square brackets around | ||
| 1643 | the vector elements. Use spaces to separate the elements. If an | ||
| 1644 | element is a symbol, simply write the symbol's name---no other | ||
| 1645 | delimiters or punctuation are needed. If a vector element is a | ||
| 1646 | character, write it as a Lisp character constant: @samp{?} followed by | ||
| 1647 | the character as it would appear in a string. | ||
| 1648 | |||
| 1649 | Here are examples of using vectors to rebind @kbd{C-=} (a control | ||
| 1650 | character not in @acronym{ASCII}), @kbd{C-M-=} (not in @acronym{ASCII} because @kbd{C-=} | ||
| 1651 | is not), @kbd{H-a} (a Hyper character; @acronym{ASCII} doesn't have Hyper at | ||
| 1652 | all), @key{F7} (a function key), and @kbd{C-Mouse-1} (a | ||
| 1653 | keyboard-modified mouse button): | ||
| 1654 | |||
| 1655 | @example | ||
| 1656 | (global-set-key [?\C-=] 'make-symbolic-link) | ||
| 1657 | (global-set-key [?\M-\C-=] 'make-symbolic-link) | ||
| 1658 | (global-set-key [?\H-a] 'make-symbolic-link) | ||
| 1659 | (global-set-key [f7] 'make-symbolic-link) | ||
| 1660 | (global-set-key [C-mouse-1] 'make-symbolic-link) | ||
| 1661 | @end example | ||
| 1662 | |||
| 1663 | You can use a vector for the simple cases too. Here's how to | ||
| 1664 | rewrite the first six examples above to use vectors: | ||
| 1665 | |||
| 1666 | @example | ||
| 1667 | (global-set-key [?\C-z] 'shell) | ||
| 1668 | (global-set-key [?\C-x ?l] 'make-symbolic-link) | ||
| 1669 | (global-set-key [?\C-x ?\t] 'indent-rigidly) | ||
| 1670 | (global-set-key [?\r] 'newline) | ||
| 1671 | (global-set-key [?\d] 'delete-backward-char) | ||
| 1672 | (global-set-key [?\C-x ?\e ?\e] 'repeat-complex-command) | ||
| 1673 | @end example | ||
| 1674 | |||
| 1675 | @noindent | ||
| 1676 | As you see, you represent a multi-character key sequence with a vector | ||
| 1677 | by listing all of the characters, in order, within the square brackets | ||
| 1678 | that delimit the vector. | ||
| 1679 | |||
| 1680 | Language and coding systems can cause problems with key bindings | ||
| 1681 | for non-@acronym{ASCII} characters. @xref{Init Non-ASCII}. | ||
| 1682 | |||
| 1683 | @node Function Keys | ||
| 1684 | @subsection Rebinding Function Keys | ||
| 1685 | |||
| 1686 | Key sequences can contain function keys as well as ordinary | ||
| 1687 | characters. Just as Lisp characters (actually integers) represent | ||
| 1688 | keyboard characters, Lisp symbols represent function keys. If the | ||
| 1689 | function key has a word as its label, then that word is also the name of | ||
| 1690 | the corresponding Lisp symbol. Here are the conventional Lisp names for | ||
| 1691 | common function keys: | ||
| 1692 | |||
| 1693 | @table @asis | ||
| 1694 | @item @code{left}, @code{up}, @code{right}, @code{down} | ||
| 1695 | Cursor arrow keys. | ||
| 1696 | |||
| 1697 | @item @code{begin}, @code{end}, @code{home}, @code{next}, @code{prior} | ||
| 1698 | Other cursor repositioning keys. | ||
| 1699 | |||
| 1700 | @item @code{select}, @code{print}, @code{execute}, @code{backtab} | ||
| 1701 | @itemx @code{insert}, @code{undo}, @code{redo}, @code{clearline} | ||
| 1702 | @itemx @code{insertline}, @code{deleteline}, @code{insertchar}, @code{deletechar} | ||
| 1703 | Miscellaneous function keys. | ||
| 1704 | |||
| 1705 | @item @code{f1}, @code{f2}, @dots{} @code{f35} | ||
| 1706 | Numbered function keys (across the top of the keyboard). | ||
| 1707 | |||
| 1708 | @item @code{kp-add}, @code{kp-subtract}, @code{kp-multiply}, @code{kp-divide} | ||
| 1709 | @itemx @code{kp-backtab}, @code{kp-space}, @code{kp-tab}, @code{kp-enter} | ||
| 1710 | @itemx @code{kp-separator}, @code{kp-decimal}, @code{kp-equal} | ||
| 1711 | Keypad keys (to the right of the regular keyboard), with names or punctuation. | ||
| 1712 | |||
| 1713 | @item @code{kp-0}, @code{kp-1}, @dots{} @code{kp-9} | ||
| 1714 | Keypad keys with digits. | ||
| 1715 | |||
| 1716 | @item @code{kp-f1}, @code{kp-f2}, @code{kp-f3}, @code{kp-f4} | ||
| 1717 | Keypad PF keys. | ||
| 1718 | @end table | ||
| 1719 | |||
| 1720 | These names are conventional, but some systems (especially when using | ||
| 1721 | X) may use different names. To make certain what symbol is used for a | ||
| 1722 | given function key on your terminal, type @kbd{C-h c} followed by that | ||
| 1723 | key. | ||
| 1724 | |||
| 1725 | A key sequence which contains function key symbols (or anything but | ||
| 1726 | @acronym{ASCII} characters) must be a vector rather than a string. | ||
| 1727 | Thus, to bind function key @samp{f1} to the command @code{rmail}, | ||
| 1728 | write the following: | ||
| 1729 | |||
| 1730 | @example | ||
| 1731 | (global-set-key [f1] 'rmail) | ||
| 1732 | @end example | ||
| 1733 | |||
| 1734 | @noindent | ||
| 1735 | To bind the right-arrow key to the command @code{forward-char}, you can | ||
| 1736 | use this expression: | ||
| 1737 | |||
| 1738 | @example | ||
| 1739 | (global-set-key [right] 'forward-char) | ||
| 1740 | @end example | ||
| 1741 | |||
| 1742 | @noindent | ||
| 1743 | This uses the Lisp syntax for a vector containing the symbol | ||
| 1744 | @code{right}. (This binding is present in Emacs by default.) | ||
| 1745 | |||
| 1746 | @xref{Init Rebinding}, for more information about using vectors for | ||
| 1747 | rebinding. | ||
| 1748 | |||
| 1749 | You can mix function keys and characters in a key sequence. This | ||
| 1750 | example binds @kbd{C-x @key{NEXT}} to the command @code{forward-page}. | ||
| 1751 | |||
| 1752 | @example | ||
| 1753 | (global-set-key [?\C-x next] 'forward-page) | ||
| 1754 | @end example | ||
| 1755 | |||
| 1756 | @noindent | ||
| 1757 | where @code{?\C-x} is the Lisp character constant for the character | ||
| 1758 | @kbd{C-x}. The vector element @code{next} is a symbol and therefore | ||
| 1759 | does not take a question mark. | ||
| 1760 | |||
| 1761 | You can use the modifier keys @key{CTRL}, @key{META}, @key{HYPER}, | ||
| 1762 | @key{SUPER}, @key{ALT} and @key{SHIFT} with function keys. To represent | ||
| 1763 | these modifiers, add the strings @samp{C-}, @samp{M-}, @samp{H-}, | ||
| 1764 | @samp{s-}, @samp{A-} and @samp{S-} at the front of the symbol name. | ||
| 1765 | Thus, here is how to make @kbd{Hyper-Meta-@key{RIGHT}} move forward a | ||
| 1766 | word: | ||
| 1767 | |||
| 1768 | @example | ||
| 1769 | (global-set-key [H-M-right] 'forward-word) | ||
| 1770 | @end example | ||
| 1771 | |||
| 1772 | @cindex keypad | ||
| 1773 | Many keyboards have a ``numeric keypad'' on the right hand side. | ||
| 1774 | The numeric keys in the keypad double up as cursor motion keys, | ||
| 1775 | toggled by a key labeled @samp{Num Lock}. By default, Emacs | ||
| 1776 | translates these keys to the corresponding keys in the main keyboard. | ||
| 1777 | For example, when @samp{Num Lock} is on, the key labeled @samp{8} on | ||
| 1778 | the numeric keypad produces @code{kp-8}, which is translated to | ||
| 1779 | @kbd{8}; when @samp{Num Lock} is off, the same key produces | ||
| 1780 | @code{kp-up}, which is translated to @key{UP}. If you rebind a key | ||
| 1781 | such as @kbd{8} or @key{UP}, it affects the equivalent keypad key too. | ||
| 1782 | However, if you rebind a @samp{kp-} key directly, that won't affect | ||
| 1783 | its non-keypad equivalent. | ||
| 1784 | |||
| 1785 | Emacs provides a convenient method for binding the numeric keypad | ||
| 1786 | keys, using the variables @code{keypad-setup}, | ||
| 1787 | @code{keypad-numlock-setup}, @code{keypad-shifted-setup}, and | ||
| 1788 | @code{keypad-numlock-shifted-setup}. These can be found in the | ||
| 1789 | @samp{keyboard} customization group (@pxref{Easy Customization}). You | ||
| 1790 | can rebind the keys to perform other tasks, such as issuing numeric | ||
| 1791 | prefix arguments. | ||
| 1792 | |||
| 1793 | @node Named ASCII Chars | ||
| 1794 | @subsection Named @acronym{ASCII} Control Characters | ||
| 1795 | |||
| 1796 | @key{TAB}, @key{RET}, @key{BS}, @key{LFD}, @key{ESC} and @key{DEL} | ||
| 1797 | started out as names for certain @acronym{ASCII} control characters, | ||
| 1798 | used so often that they have special keys of their own. For instance, | ||
| 1799 | @key{TAB} was another name for @kbd{C-i}. Later, users found it | ||
| 1800 | convenient to distinguish in Emacs between these keys and the ``same'' | ||
| 1801 | control characters typed with the @key{CTRL} key. Therefore, on most | ||
| 1802 | modern terminals, they are no longer the same, and @key{TAB} is | ||
| 1803 | distinguishable from @kbd{C-i}. | ||
| 1804 | |||
| 1805 | Emacs can distinguish these two kinds of input if the keyboard does. | ||
| 1806 | It treats the ``special'' keys as function keys named @code{tab}, | ||
| 1807 | @code{return}, @code{backspace}, @code{linefeed}, @code{escape}, and | ||
| 1808 | @code{delete}. These function keys translate automatically into the | ||
| 1809 | corresponding @acronym{ASCII} characters @emph{if} they have no | ||
| 1810 | bindings of their own. As a result, neither users nor Lisp programs | ||
| 1811 | need to pay attention to the distinction unless they care to. | ||
| 1812 | |||
| 1813 | If you do not want to distinguish between (for example) @key{TAB} and | ||
| 1814 | @kbd{C-i}, make just one binding, for the @acronym{ASCII} character @key{TAB} | ||
| 1815 | (octal code 011). If you do want to distinguish, make one binding for | ||
| 1816 | this @acronym{ASCII} character, and another for the ``function key'' @code{tab}. | ||
| 1817 | |||
| 1818 | With an ordinary @acronym{ASCII} terminal, there is no way to distinguish | ||
| 1819 | between @key{TAB} and @kbd{C-i} (and likewise for other such pairs), | ||
| 1820 | because the terminal sends the same character in both cases. | ||
| 1821 | |||
| 1822 | @node Mouse Buttons | ||
| 1823 | @subsection Rebinding Mouse Buttons | ||
| 1824 | @cindex mouse button events | ||
| 1825 | @cindex rebinding mouse buttons | ||
| 1826 | @cindex click events | ||
| 1827 | @cindex drag events | ||
| 1828 | @cindex down events | ||
| 1829 | @cindex button down events | ||
| 1830 | |||
| 1831 | Emacs uses Lisp symbols to designate mouse buttons, too. The ordinary | ||
| 1832 | mouse events in Emacs are @dfn{click} events; these happen when you | ||
| 1833 | press a button and release it without moving the mouse. You can also | ||
| 1834 | get @dfn{drag} events, when you move the mouse while holding the button | ||
| 1835 | down. Drag events happen when you finally let go of the button. | ||
| 1836 | |||
| 1837 | The symbols for basic click events are @code{mouse-1} for the leftmost | ||
| 1838 | button, @code{mouse-2} for the next, and so on. Here is how you can | ||
| 1839 | redefine the second mouse button to split the current window: | ||
| 1840 | |||
| 1841 | @example | ||
| 1842 | (global-set-key [mouse-2] 'split-window-vertically) | ||
| 1843 | @end example | ||
| 1844 | |||
| 1845 | The symbols for drag events are similar, but have the prefix | ||
| 1846 | @samp{drag-} before the word @samp{mouse}. For example, dragging the | ||
| 1847 | first button generates a @code{drag-mouse-1} event. | ||
| 1848 | |||
| 1849 | You can also define bindings for events that occur when a mouse button | ||
| 1850 | is pressed down. These events start with @samp{down-} instead of | ||
| 1851 | @samp{drag-}. Such events are generated only if they have key bindings. | ||
| 1852 | When you get a button-down event, a corresponding click or drag event | ||
| 1853 | will always follow. | ||
| 1854 | |||
| 1855 | @cindex double clicks | ||
| 1856 | @cindex triple clicks | ||
| 1857 | If you wish, you can distinguish single, double, and triple clicks. A | ||
| 1858 | double click means clicking a mouse button twice in approximately the | ||
| 1859 | same place. The first click generates an ordinary click event. The | ||
| 1860 | second click, if it comes soon enough, generates a double-click event | ||
| 1861 | instead. The event type for a double-click event starts with | ||
| 1862 | @samp{double-}: for example, @code{double-mouse-3}. | ||
| 1863 | |||
| 1864 | This means that you can give a special meaning to the second click at | ||
| 1865 | the same place, but it must act on the assumption that the ordinary | ||
| 1866 | single click definition has run when the first click was received. | ||
| 1867 | |||
| 1868 | This constrains what you can do with double clicks, but user interface | ||
| 1869 | designers say that this constraint ought to be followed in any case. A | ||
| 1870 | double click should do something similar to the single click, only | ||
| 1871 | ``more so.'' The command for the double-click event should perform the | ||
| 1872 | extra work for the double click. | ||
| 1873 | |||
| 1874 | If a double-click event has no binding, it changes to the | ||
| 1875 | corresponding single-click event. Thus, if you don't define a | ||
| 1876 | particular double click specially, it executes the single-click command | ||
| 1877 | twice. | ||
| 1878 | |||
| 1879 | Emacs also supports triple-click events whose names start with | ||
| 1880 | @samp{triple-}. Emacs does not distinguish quadruple clicks as event | ||
| 1881 | types; clicks beyond the third generate additional triple-click events. | ||
| 1882 | However, the full number of clicks is recorded in the event list, so | ||
| 1883 | if you know Emacs Lisp you can distinguish if you really want to | ||
| 1884 | (@pxref{Accessing Events,,, elisp, The Emacs Lisp Reference Manual}). | ||
| 1885 | We don't recommend distinct meanings for more than three clicks, but | ||
| 1886 | sometimes it is useful for subsequent clicks to cycle through the same | ||
| 1887 | set of three meanings, so that four clicks are equivalent to one | ||
| 1888 | click, five are equivalent to two, and six are equivalent to three. | ||
| 1889 | |||
| 1890 | Emacs also records multiple presses in drag and button-down events. | ||
| 1891 | For example, when you press a button twice, then move the mouse while | ||
| 1892 | holding the button, Emacs gets a @samp{double-drag-} event. And at the | ||
| 1893 | moment when you press it down for the second time, Emacs gets a | ||
| 1894 | @samp{double-down-} event (which is ignored, like all button-down | ||
| 1895 | events, if it has no binding). | ||
| 1896 | |||
| 1897 | @vindex double-click-time | ||
| 1898 | The variable @code{double-click-time} specifies how much time can | ||
| 1899 | elapse between clicks and still allow them to be grouped as a multiple | ||
| 1900 | click. Its value is in units of milliseconds. If the value is | ||
| 1901 | @code{nil}, double clicks are not detected at all. If the value is | ||
| 1902 | @code{t}, then there is no time limit. The default is 500. | ||
| 1903 | |||
| 1904 | @vindex double-click-fuzz | ||
| 1905 | The variable @code{double-click-fuzz} specifies how much the mouse | ||
| 1906 | can move between clicks and still allow them to be grouped as a multiple | ||
| 1907 | click. Its value is in units of pixels on windowed displays and in | ||
| 1908 | units of 1/8 of a character cell on text-mode terminals; the default is | ||
| 1909 | 3. | ||
| 1910 | |||
| 1911 | The symbols for mouse events also indicate the status of the modifier | ||
| 1912 | keys, with the usual prefixes @samp{C-}, @samp{M-}, @samp{H-}, | ||
| 1913 | @samp{s-}, @samp{A-} and @samp{S-}. These always precede @samp{double-} | ||
| 1914 | or @samp{triple-}, which always precede @samp{drag-} or @samp{down-}. | ||
| 1915 | |||
| 1916 | A frame includes areas that don't show text from the buffer, such as | ||
| 1917 | the mode line and the scroll bar. You can tell whether a mouse button | ||
| 1918 | comes from a special area of the screen by means of dummy ``prefix | ||
| 1919 | keys.'' For example, if you click the mouse in the mode line, you get | ||
| 1920 | the prefix key @code{mode-line} before the ordinary mouse-button symbol. | ||
| 1921 | Thus, here is how to define the command for clicking the first button in | ||
| 1922 | a mode line to run @code{scroll-up}: | ||
| 1923 | |||
| 1924 | @example | ||
| 1925 | (global-set-key [mode-line mouse-1] 'scroll-up) | ||
| 1926 | @end example | ||
| 1927 | |||
| 1928 | Here is the complete list of these dummy prefix keys and their | ||
| 1929 | meanings: | ||
| 1930 | |||
| 1931 | @table @code | ||
| 1932 | @item mode-line | ||
| 1933 | The mouse was in the mode line of a window. | ||
| 1934 | @item vertical-line | ||
| 1935 | The mouse was in the vertical line separating side-by-side windows. (If | ||
| 1936 | you use scroll bars, they appear in place of these vertical lines.) | ||
| 1937 | @item vertical-scroll-bar | ||
| 1938 | The mouse was in a vertical scroll bar. (This is the only kind of | ||
| 1939 | scroll bar Emacs currently supports.) | ||
| 1940 | @item menu-bar | ||
| 1941 | The mouse was in the menu bar. | ||
| 1942 | @item header-line | ||
| 1943 | The mouse was in a header line. | ||
| 1944 | @ignore | ||
| 1945 | @item horizontal-scroll-bar | ||
| 1946 | The mouse was in a horizontal scroll bar. Horizontal scroll bars do | ||
| 1947 | horizontal scrolling, and people don't use them often. | ||
| 1948 | @end ignore | ||
| 1949 | @end table | ||
| 1950 | |||
| 1951 | You can put more than one mouse button in a key sequence, but it isn't | ||
| 1952 | usual to do so. | ||
| 1953 | |||
| 1954 | @node Disabling | ||
| 1955 | @subsection Disabling Commands | ||
| 1956 | @cindex disabled command | ||
| 1957 | |||
| 1958 | Disabling a command means that invoking it interactively asks for | ||
| 1959 | confirmation from the user. The purpose of disabling a command is to | ||
| 1960 | prevent users from executing it by accident; we do this for commands | ||
| 1961 | that might be confusing to the uninitiated. | ||
| 1962 | |||
| 1963 | Attempting to invoke a disabled command interactively in Emacs | ||
| 1964 | displays a window containing the command's name, its documentation, | ||
| 1965 | and some instructions on what to do immediately; then Emacs asks for | ||
| 1966 | input saying whether to execute the command as requested, enable it | ||
| 1967 | and execute it, or cancel. If you decide to enable the command, you | ||
| 1968 | must then answer another question---whether to do this permanently, or | ||
| 1969 | just for the current session. (Enabling permanently works by | ||
| 1970 | automatically editing your @file{.emacs} file.) You can also type | ||
| 1971 | @kbd{!} to enable @emph{all} commands, for the current session only. | ||
| 1972 | |||
| 1973 | The direct mechanism for disabling a command is to put a | ||
| 1974 | non-@code{nil} @code{disabled} property on the Lisp symbol for the | ||
| 1975 | command. Here is the Lisp program to do this: | ||
| 1976 | |||
| 1977 | @example | ||
| 1978 | (put 'delete-region 'disabled t) | ||
| 1979 | @end example | ||
| 1980 | |||
| 1981 | If the value of the @code{disabled} property is a string, that string | ||
| 1982 | is included in the message displayed when the command is used: | ||
| 1983 | |||
| 1984 | @example | ||
| 1985 | (put 'delete-region 'disabled | ||
| 1986 | "It's better to use `kill-region' instead.\n") | ||
| 1987 | @end example | ||
| 1988 | |||
| 1989 | @findex disable-command | ||
| 1990 | @findex enable-command | ||
| 1991 | You can make a command disabled either by editing the @file{.emacs} | ||
| 1992 | file directly, or with the command @kbd{M-x disable-command}, which edits | ||
| 1993 | the @file{.emacs} file for you. Likewise, @kbd{M-x enable-command} | ||
| 1994 | edits @file{.emacs} to enable a command permanently. @xref{Init File}. | ||
| 1995 | |||
| 1996 | If Emacs was invoked with the @option{-q} or @option{--no-init-file} | ||
| 1997 | options (@pxref{Initial Options}), it will not edit your | ||
| 1998 | @file{~/.emacs} init file. Doing so could lose information | ||
| 1999 | because Emacs has not read your init file. | ||
| 2000 | |||
| 2001 | Whether a command is disabled is independent of what key is used to | ||
| 2002 | invoke it; disabling also applies if the command is invoked using | ||
| 2003 | @kbd{M-x}. However, disabling a command has no effect on calling it | ||
| 2004 | as a function from Lisp programs. | ||
| 2005 | |||
| 2006 | @node Syntax | ||
| 2007 | @section The Syntax Table | ||
| 2008 | @cindex syntax table | ||
| 2009 | |||
| 2010 | All the Emacs commands which parse words or balance parentheses are | ||
| 2011 | controlled by the @dfn{syntax table}. The syntax table says which | ||
| 2012 | characters are opening delimiters, which are parts of words, which are | ||
| 2013 | string quotes, and so on. It does this by assigning each character to | ||
| 2014 | one of fifteen-odd @dfn{syntax classes}. In some cases it specifies | ||
| 2015 | some additional information also. | ||
| 2016 | |||
| 2017 | Each major mode has its own syntax table (though related major modes | ||
| 2018 | sometimes share one syntax table), which it installs in each buffer | ||
| 2019 | that uses the mode. The syntax table installed in the current buffer | ||
| 2020 | is the one that all commands use, so we call it ``the'' syntax table. | ||
| 2021 | |||
| 2022 | @kindex C-h s | ||
| 2023 | @findex describe-syntax | ||
| 2024 | To display a description of the contents of the current syntax | ||
| 2025 | table, type @kbd{C-h s} (@code{describe-syntax}). The description of | ||
| 2026 | each character includes the string you would have to give to | ||
| 2027 | @code{modify-syntax-entry} to set up that character's current syntax, | ||
| 2028 | starting with the character which designates its syntax class, plus | ||
| 2029 | some English text to explain its meaning. | ||
| 2030 | |||
| 2031 | A syntax table is actually a Lisp object, a char-table, whose | ||
| 2032 | elements are cons cells. For full information on the syntax table, | ||
| 2033 | see @ref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp | ||
| 2034 | Reference Manual}. | ||
| 2035 | |||
| 2036 | @node Init File | ||
| 2037 | @section The Init File, @file{~/.emacs} | ||
| 2038 | @cindex init file | ||
| 2039 | @cindex Emacs initialization file | ||
| 2040 | @cindex key rebinding, permanent | ||
| 2041 | @cindex rebinding keys, permanently | ||
| 2042 | @cindex startup (init file) | ||
| 2043 | |||
| 2044 | When Emacs is started, it normally loads a Lisp program from the file | ||
| 2045 | @file{.emacs} or @file{.emacs.el} in your home directory (@pxref{Find Init}). | ||
| 2046 | We call this file your @dfn{init file} because it specifies how to | ||
| 2047 | initialize Emacs for you. You can use the command line switch | ||
| 2048 | @samp{-q} to prevent loading your init file, and @samp{-u} (or | ||
| 2049 | @samp{--user}) to specify a different user's init file (@pxref{Initial | ||
| 2050 | Options}). | ||
| 2051 | |||
| 2052 | You can also use @file{~/.emacs.d/init.el} as the init file. Emacs | ||
| 2053 | tries this if it cannot find @file{~/.emacs} or @file{~/.emacs.el}. | ||
| 2054 | |||
| 2055 | @cindex @file{default.el}, the default init file | ||
| 2056 | There can also be a @dfn{default init file}, which is the library | ||
| 2057 | named @file{default.el}, found via the standard search path for | ||
| 2058 | libraries. The Emacs distribution contains no such library; your site | ||
| 2059 | may create one for local customizations. If this library exists, it is | ||
| 2060 | loaded whenever you start Emacs (except when you specify @samp{-q}). | ||
| 2061 | But your init file, if any, is loaded first; if it sets | ||
| 2062 | @code{inhibit-default-init} non-@code{nil}, then @file{default} is not | ||
| 2063 | loaded. | ||
| 2064 | |||
| 2065 | @cindex site init file | ||
| 2066 | @cindex @file{site-start.el}, the site startup file | ||
| 2067 | Your site may also have a @dfn{site startup file}; this is named | ||
| 2068 | @file{site-start.el}, if it exists. Like @file{default.el}, Emacs | ||
| 2069 | finds this file via the standard search path for Lisp libraries. | ||
| 2070 | Emacs loads this library before it loads your init file. To inhibit | ||
| 2071 | loading of this library, use the option @samp{--no-site-file}. | ||
| 2072 | @xref{Initial Options}. We recommend against using | ||
| 2073 | @file{site-start.el} for changes that some users may not like. It is | ||
| 2074 | better to put them in @file{default.el}, so that users can more easily | ||
| 2075 | override them. | ||
| 2076 | |||
| 2077 | You can place @file{default.el} and @file{site-start.el} in any of | ||
| 2078 | the directories which Emacs searches for Lisp libraries. The variable | ||
| 2079 | @code{load-path} (@pxref{Lisp Libraries}) specifies these directories. | ||
| 2080 | Many sites put these files in the @file{site-lisp} subdirectory of the | ||
| 2081 | Emacs installation directory, typically | ||
| 2082 | @file{/usr/local/share/emacs/site-lisp}. | ||
| 2083 | |||
| 2084 | If you have a large amount of code in your @file{.emacs} file, you | ||
| 2085 | should rename it to @file{~/.emacs.el}, and byte-compile it. @xref{Byte | ||
| 2086 | Compilation,, Byte Compilation, elisp, the Emacs Lisp Reference Manual}, | ||
| 2087 | for more information about compiling Emacs Lisp programs. | ||
| 2088 | |||
| 2089 | If you are going to write actual Emacs Lisp programs that go beyond | ||
| 2090 | minor customization, you should read the @cite{Emacs Lisp Reference Manual}. | ||
| 2091 | @ifnottex | ||
| 2092 | @xref{Top, Emacs Lisp, Emacs Lisp, elisp, the Emacs Lisp Reference | ||
| 2093 | Manual}. | ||
| 2094 | @end ifnottex | ||
| 2095 | |||
| 2096 | @menu | ||
| 2097 | * Init Syntax:: Syntax of constants in Emacs Lisp. | ||
| 2098 | * Init Examples:: How to do some things with an init file. | ||
| 2099 | * Terminal Init:: Each terminal type can have an init file. | ||
| 2100 | * Find Init:: How Emacs finds the init file. | ||
| 2101 | * Init Non-ASCII:: Using non-@acronym{ASCII} characters in an init file. | ||
| 2102 | @end menu | ||
| 2103 | |||
| 2104 | @node Init Syntax | ||
| 2105 | @subsection Init File Syntax | ||
| 2106 | |||
| 2107 | The @file{.emacs} file contains one or more Lisp function call | ||
| 2108 | expressions. Each of these consists of a function name followed by | ||
| 2109 | arguments, all surrounded by parentheses. For example, @code{(setq | ||
| 2110 | fill-column 60)} calls the function @code{setq} to set the variable | ||
| 2111 | @code{fill-column} (@pxref{Filling}) to 60. | ||
| 2112 | |||
| 2113 | You can set any Lisp variable with @code{setq}, but with certain | ||
| 2114 | variables @code{setq} won't do what you probably want in the | ||
| 2115 | @file{.emacs} file. Some variables automatically become buffer-local | ||
| 2116 | when set with @code{setq}; what you want in @file{.emacs} is to set | ||
| 2117 | the default value, using @code{setq-default}. Some customizable minor | ||
| 2118 | mode variables do special things to enable the mode when you set them | ||
| 2119 | with Customize, but ordinary @code{setq} won't do that; to enable the | ||
| 2120 | mode in your @file{.emacs} file, call the minor mode command. The | ||
| 2121 | following section has examples of both of these methods. | ||
| 2122 | |||
| 2123 | The second argument to @code{setq} is an expression for the new | ||
| 2124 | value of the variable. This can be a constant, a variable, or a | ||
| 2125 | function call expression. In @file{.emacs}, constants are used most | ||
| 2126 | of the time. They can be: | ||
| 2127 | |||
| 2128 | @table @asis | ||
| 2129 | @item Numbers: | ||
| 2130 | Numbers are written in decimal, with an optional initial minus sign. | ||
| 2131 | |||
| 2132 | @item Strings: | ||
| 2133 | @cindex Lisp string syntax | ||
| 2134 | @cindex string syntax | ||
| 2135 | Lisp string syntax is the same as C string syntax with a few extra | ||
| 2136 | features. Use a double-quote character to begin and end a string constant. | ||
| 2137 | |||
| 2138 | In a string, you can include newlines and special characters literally. | ||
| 2139 | But often it is cleaner to use backslash sequences for them: @samp{\n} | ||
| 2140 | for newline, @samp{\b} for backspace, @samp{\r} for carriage return, | ||
| 2141 | @samp{\t} for tab, @samp{\f} for formfeed (control-L), @samp{\e} for | ||
| 2142 | escape, @samp{\\} for a backslash, @samp{\"} for a double-quote, or | ||
| 2143 | @samp{\@var{ooo}} for the character whose octal code is @var{ooo}. | ||
| 2144 | Backslash and double-quote are the only characters for which backslash | ||
| 2145 | sequences are mandatory. | ||
| 2146 | |||
| 2147 | @samp{\C-} can be used as a prefix for a control character, as in | ||
| 2148 | @samp{\C-s} for @acronym{ASCII} control-S, and @samp{\M-} can be used as a prefix for | ||
| 2149 | a Meta character, as in @samp{\M-a} for @kbd{Meta-A} or @samp{\M-\C-a} for | ||
| 2150 | @kbd{Control-Meta-A}.@refill | ||
| 2151 | |||
| 2152 | @xref{Init Non-ASCII}, for information about including | ||
| 2153 | non-@acronym{ASCII} in your init file. | ||
| 2154 | |||
| 2155 | @item Characters: | ||
| 2156 | Lisp character constant syntax consists of a @samp{?} followed by | ||
| 2157 | either a character or an escape sequence starting with @samp{\}. | ||
| 2158 | Examples: @code{?x}, @code{?\n}, @code{?\"}, @code{?\)}. Note that | ||
| 2159 | strings and characters are not interchangeable in Lisp; some contexts | ||
| 2160 | require one and some contexts require the other. | ||
| 2161 | |||
| 2162 | @xref{Init Non-ASCII}, for information about binding commands to | ||
| 2163 | keys which send non-@acronym{ASCII} characters. | ||
| 2164 | |||
| 2165 | @item True: | ||
| 2166 | @code{t} stands for `true'. | ||
| 2167 | |||
| 2168 | @item False: | ||
| 2169 | @code{nil} stands for `false'. | ||
| 2170 | |||
| 2171 | @item Other Lisp objects: | ||
| 2172 | Write a single-quote (@code{'}) followed by the Lisp object you want. | ||
| 2173 | @end table | ||
| 2174 | |||
| 2175 | @node Init Examples | ||
| 2176 | @subsection Init File Examples | ||
| 2177 | |||
| 2178 | Here are some examples of doing certain commonly desired things with | ||
| 2179 | Lisp expressions: | ||
| 2180 | |||
| 2181 | @itemize @bullet | ||
| 2182 | @item | ||
| 2183 | Make @key{TAB} in C mode just insert a tab if point is in the middle of a | ||
| 2184 | line. | ||
| 2185 | |||
| 2186 | @example | ||
| 2187 | (setq c-tab-always-indent nil) | ||
| 2188 | @end example | ||
| 2189 | |||
| 2190 | Here we have a variable whose value is normally @code{t} for `true' | ||
| 2191 | and the alternative is @code{nil} for `false'. | ||
| 2192 | |||
| 2193 | @item | ||
| 2194 | Make searches case sensitive by default (in all buffers that do not | ||
| 2195 | override this). | ||
| 2196 | |||
| 2197 | @example | ||
| 2198 | (setq-default case-fold-search nil) | ||
| 2199 | @end example | ||
| 2200 | |||
| 2201 | This sets the default value, which is effective in all buffers that do | ||
| 2202 | not have local values for the variable. Setting @code{case-fold-search} | ||
| 2203 | with @code{setq} affects only the current buffer's local value, which | ||
| 2204 | is not what you probably want to do in an init file. | ||
| 2205 | |||
| 2206 | @item | ||
| 2207 | @vindex user-mail-address | ||
| 2208 | Specify your own email address, if Emacs can't figure it out correctly. | ||
| 2209 | |||
| 2210 | @example | ||
| 2211 | (setq user-mail-address "rumsfeld@@torture.gov") | ||
| 2212 | @end example | ||
| 2213 | |||
| 2214 | Various Emacs packages that need your own email address use the value of | ||
| 2215 | @code{user-mail-address}. | ||
| 2216 | |||
| 2217 | @item | ||
| 2218 | Make Text mode the default mode for new buffers. | ||
| 2219 | |||
| 2220 | @example | ||
| 2221 | (setq default-major-mode 'text-mode) | ||
| 2222 | @end example | ||
| 2223 | |||
| 2224 | Note that @code{text-mode} is used because it is the command for | ||
| 2225 | entering Text mode. The single-quote before it makes the symbol a | ||
| 2226 | constant; otherwise, @code{text-mode} would be treated as a variable | ||
| 2227 | name. | ||
| 2228 | |||
| 2229 | @need 1500 | ||
| 2230 | @item | ||
| 2231 | Set up defaults for the Latin-1 character set | ||
| 2232 | which supports most of the languages of Western Europe. | ||
| 2233 | |||
| 2234 | @example | ||
| 2235 | (set-language-environment "Latin-1") | ||
| 2236 | @end example | ||
| 2237 | |||
| 2238 | @need 1500 | ||
| 2239 | @item | ||
| 2240 | Turn off Line Number mode, a global minor mode. | ||
| 2241 | |||
| 2242 | @example | ||
| 2243 | (line-number-mode 0) | ||
| 2244 | @end example | ||
| 2245 | |||
| 2246 | @need 1500 | ||
| 2247 | @item | ||
| 2248 | Turn on Auto Fill mode automatically in Text mode and related modes. | ||
| 2249 | |||
| 2250 | @example | ||
| 2251 | (add-hook 'text-mode-hook | ||
| 2252 | '(lambda () (auto-fill-mode 1))) | ||
| 2253 | @end example | ||
| 2254 | |||
| 2255 | This shows how to add a hook function to a normal hook variable | ||
| 2256 | (@pxref{Hooks}). The function we supply is a list starting with | ||
| 2257 | @code{lambda}, with a single-quote in front of it to make it a list | ||
| 2258 | constant rather than an expression. | ||
| 2259 | |||
| 2260 | It's beyond the scope of this manual to explain Lisp functions, but for | ||
| 2261 | this example it is enough to know that the effect is to execute | ||
| 2262 | @code{(auto-fill-mode 1)} when Text mode is entered. You can replace | ||
| 2263 | that with any other expression that you like, or with several | ||
| 2264 | expressions in a row. | ||
| 2265 | |||
| 2266 | Emacs comes with a function named @code{turn-on-auto-fill} whose | ||
| 2267 | definition is @code{(lambda () (auto-fill-mode 1))}. Thus, a simpler | ||
| 2268 | way to write the above example is as follows: | ||
| 2269 | |||
| 2270 | @example | ||
| 2271 | (add-hook 'text-mode-hook 'turn-on-auto-fill) | ||
| 2272 | @end example | ||
| 2273 | |||
| 2274 | @item | ||
| 2275 | Load the installed Lisp library named @file{foo} (actually a file | ||
| 2276 | @file{foo.elc} or @file{foo.el} in a standard Emacs directory). | ||
| 2277 | |||
| 2278 | @example | ||
| 2279 | (load "foo") | ||
| 2280 | @end example | ||
| 2281 | |||
| 2282 | When the argument to @code{load} is a relative file name, not starting | ||
| 2283 | with @samp{/} or @samp{~}, @code{load} searches the directories in | ||
| 2284 | @code{load-path} (@pxref{Lisp Libraries}). | ||
| 2285 | |||
| 2286 | @item | ||
| 2287 | Load the compiled Lisp file @file{foo.elc} from your home directory. | ||
| 2288 | |||
| 2289 | @example | ||
| 2290 | (load "~/foo.elc") | ||
| 2291 | @end example | ||
| 2292 | |||
| 2293 | Here an absolute file name is used, so no searching is done. | ||
| 2294 | |||
| 2295 | @item | ||
| 2296 | @cindex loading Lisp libraries automatically | ||
| 2297 | @cindex autoload Lisp libraries | ||
| 2298 | Tell Emacs to find the definition for the function @code{myfunction} | ||
| 2299 | by loading a Lisp library named @file{mypackage} (i.e.@: a file | ||
| 2300 | @file{mypackage.elc} or @file{mypackage.el}): | ||
| 2301 | |||
| 2302 | @example | ||
| 2303 | (autoload 'myfunction "mypackage" "Do what I say." t) | ||
| 2304 | @end example | ||
| 2305 | |||
| 2306 | @noindent | ||
| 2307 | Here the string @code{"Do what I say."} is the function's | ||
| 2308 | documentation string. You specify it in the @code{autoload} | ||
| 2309 | definition so it will be available for help commands even when the | ||
| 2310 | package is not loaded. The last argument, @code{t}, indicates that | ||
| 2311 | this function is interactive; that is, it can be invoked interactively | ||
| 2312 | by typing @kbd{M-x myfunction @key{RET}} or by binding it to a key. | ||
| 2313 | If the function is not interactive, omit the @code{t} or use | ||
| 2314 | @code{nil}. | ||
| 2315 | |||
| 2316 | @item | ||
| 2317 | Rebind the key @kbd{C-x l} to run the function @code{make-symbolic-link} | ||
| 2318 | (@pxref{Init Rebinding}). | ||
| 2319 | |||
| 2320 | @example | ||
| 2321 | (global-set-key "\C-xl" 'make-symbolic-link) | ||
| 2322 | @end example | ||
| 2323 | |||
| 2324 | or | ||
| 2325 | |||
| 2326 | @example | ||
| 2327 | (define-key global-map "\C-xl" 'make-symbolic-link) | ||
| 2328 | @end example | ||
| 2329 | |||
| 2330 | Note once again the single-quote used to refer to the symbol | ||
| 2331 | @code{make-symbolic-link} instead of its value as a variable. | ||
| 2332 | |||
| 2333 | @item | ||
| 2334 | Do the same thing for Lisp mode only. | ||
| 2335 | |||
| 2336 | @example | ||
| 2337 | (define-key lisp-mode-map "\C-xl" 'make-symbolic-link) | ||
| 2338 | @end example | ||
| 2339 | |||
| 2340 | @item | ||
| 2341 | Redefine all keys which now run @code{next-line} in Fundamental mode | ||
| 2342 | so that they run @code{forward-line} instead. | ||
| 2343 | |||
| 2344 | @findex substitute-key-definition | ||
| 2345 | @example | ||
| 2346 | (substitute-key-definition 'next-line 'forward-line | ||
| 2347 | global-map) | ||
| 2348 | @end example | ||
| 2349 | |||
| 2350 | @item | ||
| 2351 | Make @kbd{C-x C-v} undefined. | ||
| 2352 | |||
| 2353 | @example | ||
| 2354 | (global-unset-key "\C-x\C-v") | ||
| 2355 | @end example | ||
| 2356 | |||
| 2357 | One reason to undefine a key is so that you can make it a prefix. | ||
| 2358 | Simply defining @kbd{C-x C-v @var{anything}} will make @kbd{C-x C-v} a | ||
| 2359 | prefix, but @kbd{C-x C-v} must first be freed of its usual non-prefix | ||
| 2360 | definition. | ||
| 2361 | |||
| 2362 | @item | ||
| 2363 | Make @samp{$} have the syntax of punctuation in Text mode. | ||
| 2364 | Note the use of a character constant for @samp{$}. | ||
| 2365 | |||
| 2366 | @example | ||
| 2367 | (modify-syntax-entry ?\$ "." text-mode-syntax-table) | ||
| 2368 | @end example | ||
| 2369 | |||
| 2370 | @item | ||
| 2371 | Enable the use of the command @code{narrow-to-region} without confirmation. | ||
| 2372 | |||
| 2373 | @example | ||
| 2374 | (put 'narrow-to-region 'disabled nil) | ||
| 2375 | @end example | ||
| 2376 | |||
| 2377 | @item | ||
| 2378 | Adjusting the configuration to various platforms and Emacs versions. | ||
| 2379 | |||
| 2380 | Users typically want Emacs to behave the same on all systems, so the | ||
| 2381 | same init file is right for all platforms. However, sometimes it | ||
| 2382 | happens that a function you use for customizing Emacs is not available | ||
| 2383 | on some platforms or in older Emacs versions. To deal with that | ||
| 2384 | situation, put the customization inside a conditional that tests whether | ||
| 2385 | the function or facility is available, like this: | ||
| 2386 | |||
| 2387 | @example | ||
| 2388 | (if (fboundp 'blink-cursor-mode) | ||
| 2389 | (blink-cursor-mode 0)) | ||
| 2390 | |||
| 2391 | (if (boundp 'coding-category-utf-8) | ||
| 2392 | (set-coding-priority '(coding-category-utf-8))) | ||
| 2393 | @end example | ||
| 2394 | |||
| 2395 | @noindent | ||
| 2396 | You can also simply disregard the errors that occur if the | ||
| 2397 | function is not defined. | ||
| 2398 | |||
| 2399 | @example | ||
| 2400 | (condition case () | ||
| 2401 | (set-face-background 'region "grey75") | ||
| 2402 | (error nil)) | ||
| 2403 | @end example | ||
| 2404 | |||
| 2405 | A @code{setq} on a variable which does not exist is generally | ||
| 2406 | harmless, so those do not need a conditional. | ||
| 2407 | @end itemize | ||
| 2408 | |||
| 2409 | @node Terminal Init | ||
| 2410 | @subsection Terminal-specific Initialization | ||
| 2411 | |||
| 2412 | Each terminal type can have a Lisp library to be loaded into Emacs when | ||
| 2413 | it is run on that type of terminal. For a terminal type named | ||
| 2414 | @var{termtype}, the library is called @file{term/@var{termtype}} and it is | ||
| 2415 | found by searching the directories @code{load-path} as usual and trying the | ||
| 2416 | suffixes @samp{.elc} and @samp{.el}. Normally it appears in the | ||
| 2417 | subdirectory @file{term} of the directory where most Emacs libraries are | ||
| 2418 | kept.@refill | ||
| 2419 | |||
| 2420 | The usual purpose of the terminal-specific library is to map the | ||
| 2421 | escape sequences used by the terminal's function keys onto more | ||
| 2422 | meaningful names, using @code{function-key-map}. See the file | ||
| 2423 | @file{term/lk201.el} for an example of how this is done. Many function | ||
| 2424 | keys are mapped automatically according to the information in the | ||
| 2425 | Termcap data base; the terminal-specific library needs to map only the | ||
| 2426 | function keys that Termcap does not specify. | ||
| 2427 | |||
| 2428 | When the terminal type contains a hyphen, only the part of the name | ||
| 2429 | before the first hyphen is significant in choosing the library name. | ||
| 2430 | Thus, terminal types @samp{aaa-48} and @samp{aaa-30-rv} both use | ||
| 2431 | the library @file{term/aaa}. The code in the library can use | ||
| 2432 | @code{(getenv "TERM")} to find the full terminal type name.@refill | ||
| 2433 | |||
| 2434 | @vindex term-file-prefix | ||
| 2435 | The library's name is constructed by concatenating the value of the | ||
| 2436 | variable @code{term-file-prefix} and the terminal type. Your @file{.emacs} | ||
| 2437 | file can prevent the loading of the terminal-specific library by setting | ||
| 2438 | @code{term-file-prefix} to @code{nil}. | ||
| 2439 | |||
| 2440 | @vindex term-setup-hook | ||
| 2441 | Emacs runs the hook @code{term-setup-hook} at the end of | ||
| 2442 | initialization, after both your @file{.emacs} file and any | ||
| 2443 | terminal-specific library have been read in. Add hook functions to this | ||
| 2444 | hook if you wish to override part of any of the terminal-specific | ||
| 2445 | libraries and to define initializations for terminals that do not have a | ||
| 2446 | library. @xref{Hooks}. | ||
| 2447 | |||
| 2448 | @node Find Init | ||
| 2449 | @subsection How Emacs Finds Your Init File | ||
| 2450 | |||
| 2451 | Normally Emacs uses the environment variable @env{HOME} | ||
| 2452 | (@pxref{General Variables, HOME}) to find @file{.emacs}; that's what | ||
| 2453 | @samp{~} means in a file name. If @file{.emacs} is not found inside | ||
| 2454 | @file{~/} (nor @file{.emacs.el}), Emacs looks for | ||
| 2455 | @file{~/.emacs.d/init.el} (which, like @file{~/.emacs.el}, can be | ||
| 2456 | byte-compiled). | ||
| 2457 | |||
| 2458 | However, if you run Emacs from a shell started by @code{su}, Emacs | ||
| 2459 | tries to find your own @file{.emacs}, not that of the user you are | ||
| 2460 | currently pretending to be. The idea is that you should get your own | ||
| 2461 | editor customizations even if you are running as the super user. | ||
| 2462 | |||
| 2463 | More precisely, Emacs first determines which user's init file to use. | ||
| 2464 | It gets your user name from the environment variables @env{LOGNAME} and | ||
| 2465 | @env{USER}; if neither of those exists, it uses effective user-ID. | ||
| 2466 | If that user name matches the real user-ID, then Emacs uses @env{HOME}; | ||
| 2467 | otherwise, it looks up the home directory corresponding to that user | ||
| 2468 | name in the system's data base of users. | ||
| 2469 | @c LocalWords: backtab | ||
| 2470 | |||
| 2471 | @node Init Non-ASCII | ||
| 2472 | @subsection Non-@acronym{ASCII} Characters in Init Files | ||
| 2473 | @cindex international characters in @file{.emacs} | ||
| 2474 | @cindex non-@acronym{ASCII} characters in @file{.emacs} | ||
| 2475 | @cindex non-@acronym{ASCII} keys, binding | ||
| 2476 | @cindex rebinding non-@acronym{ASCII} keys | ||
| 2477 | |||
| 2478 | Language and coding systems may cause problems if your init file | ||
| 2479 | contains non-@acronym{ASCII} characters, such as accented letters, in | ||
| 2480 | strings or key bindings. | ||
| 2481 | |||
| 2482 | If you want to use non-@acronym{ASCII} characters in your init file, | ||
| 2483 | you should put a @w{@samp{-*-coding: @var{coding-system}-*-}} tag on | ||
| 2484 | the first line of the init file, and specify a coding system that | ||
| 2485 | supports the character(s) in question. @xref{Recognize Coding}. This | ||
| 2486 | is because the defaults for decoding non-@acronym{ASCII} text might | ||
| 2487 | not yet be set up by the time Emacs reads those parts of your init | ||
| 2488 | file which use such strings, possibly leading Emacs to decode those | ||
| 2489 | strings incorrectly. You should then avoid adding Emacs Lisp code | ||
| 2490 | that modifies the coding system in other ways, such as calls to | ||
| 2491 | @code{set-language-environment}. | ||
| 2492 | |||
| 2493 | To bind non-@acronym{ASCII} keys, you must use a vector (@pxref{Init | ||
| 2494 | Rebinding}). The string syntax cannot be used, since the | ||
| 2495 | non-@acronym{ASCII} characters will be interpreted as meta keys. For | ||
| 2496 | instance: | ||
| 2497 | |||
| 2498 | @example | ||
| 2499 | (global-set-key [?@var{char}] 'some-function) | ||
| 2500 | @end example | ||
| 2501 | |||
| 2502 | @noindent | ||
| 2503 | Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}. | ||
| 2504 | |||
| 2505 | @strong{Warning:} if you change the keyboard encoding, or change | ||
| 2506 | between multibyte and unibyte mode, or anything that would alter which | ||
| 2507 | code @kbd{C-q} would insert for that character, this keybinding may | ||
| 2508 | stop working. It is therefore advisable to use one and only one | ||
| 2509 | coding system, for your init file as well as the files you edit. For | ||
| 2510 | example, don't mix the @samp{latin-1} and @samp{latin-9} coding | ||
| 2511 | systems. | ||
| 2512 | |||
| 2513 | @ignore | ||
| 2514 | arch-tag: c68abddb-4410-4fb5-925f-63394e971d93 | ||
| 2515 | @end ignore | ||
diff --git a/doc/emacs/dired-xtra.texi b/doc/emacs/dired-xtra.texi new file mode 100644 index 00000000000..e8fdf8ab468 --- /dev/null +++ b/doc/emacs/dired-xtra.texi | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | @c | ||
| 5 | @c This file is included either in emacs-xtra.texi (when producing the | ||
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | ||
| 7 | @node Subdir Switches | ||
| 8 | @section Subdirectory Switches in Dired | ||
| 9 | |||
| 10 | You can insert subdirectories with specified @code{ls} switches in | ||
| 11 | Dired buffers, using @kbd{C-u i}. You can change the @code{ls} | ||
| 12 | switches of an already inserted subdirectory using @kbd{C-u l}. | ||
| 13 | |||
| 14 | In Emacs versions 22.1 and later, Dired remembers the switches, so | ||
| 15 | that reverting the buffer will not change them back to the main | ||
| 16 | directory's switches. Deleting a subdirectory forgets about its | ||
| 17 | switches. | ||
| 18 | |||
| 19 | Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u}) | ||
| 20 | to reinsert or delete subdirectories, that were inserted with explicit | ||
| 21 | switches, can bypass Dired's machinery for remembering (or forgetting) | ||
| 22 | switches. Deleting a subdirectory using @code{dired-undo} does not | ||
| 23 | forget its switches. When later reinserted using @kbd{i}, it will be | ||
| 24 | reinserted using its old switches. Using @code{dired-undo} to | ||
| 25 | reinsert a subdirectory that was deleted using the regular | ||
| 26 | Dired commands (not @code{dired-undo}) will originally insert it with | ||
| 27 | its old switches. However, reverting the buffer will relist it using | ||
| 28 | the buffer's default switches. If any of this yields problems, you | ||
| 29 | can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}. | ||
| 30 | |||
| 31 | Dired does not remember the @code{R} switch. Inserting a subdirectory | ||
| 32 | with switches that include the @code{R} switch is equivalent with | ||
| 33 | inserting each of its subdirectories using all remaining switches. | ||
| 34 | For instance, updating or killing a subdirectory that was inserted | ||
| 35 | with the @code{R} switch will not update or kill its subdirectories. | ||
| 36 | |||
| 37 | The buffer's default switches do not affect subdirectories that were | ||
| 38 | inserted using explicitly specified switches. In particular, | ||
| 39 | commands such as @kbd{s}, that change the buffer's switches do not | ||
| 40 | affect such subdirectories. (They do affect subdirectories without | ||
| 41 | explicitly assigned switches, however.) | ||
| 42 | |||
| 43 | You can make Dired forget about all subdirectory switches and relist | ||
| 44 | all subdirectories with the buffer's default switches using | ||
| 45 | @kbd{M-x dired-reset-subdir-switches}. This also reverts the Dired buffer. | ||
| 46 | |||
| 47 | @ignore | ||
| 48 | arch-tag: e3865701-9179-4ffb-bc34-d321111c688d | ||
| 49 | @end ignore | ||
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi new file mode 100644 index 00000000000..3dda3f588eb --- /dev/null +++ b/doc/emacs/dired.texi | |||
| @@ -0,0 +1,1317 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Dired, Calendar/Diary, Rmail, Top | ||
| 6 | @chapter Dired, the Directory Editor | ||
| 7 | @cindex Dired | ||
| 8 | @cindex file management | ||
| 9 | |||
| 10 | Dired makes an Emacs buffer containing a listing of a directory, and | ||
| 11 | optionally some of its subdirectories as well. You can use the normal | ||
| 12 | Emacs commands to move around in this buffer, and special Dired commands | ||
| 13 | to operate on the files listed. | ||
| 14 | |||
| 15 | The Dired buffer is ``read-only,'' and inserting text in it is not | ||
| 16 | useful, so ordinary printing characters such as @kbd{d} and @kbd{x} | ||
| 17 | are redefined for special Dired commands. Some Dired commands | ||
| 18 | @dfn{mark} or @dfn{flag} the @dfn{current file} (that is, the file on | ||
| 19 | the current line); other commands operate on the marked files or on | ||
| 20 | the flagged files. You first mark certain files in order to operate | ||
| 21 | on all of them with on command. | ||
| 22 | |||
| 23 | The Dired-X package provides various extra features for Dired mode. | ||
| 24 | @xref{Top, Dired-X,,dired-x, Dired Extra Version 2 User's Manual}. | ||
| 25 | |||
| 26 | @menu | ||
| 27 | * Enter: Dired Enter. How to invoke Dired. | ||
| 28 | * Navigation: Dired Navigation. Special motion commands in the Dired buffer. | ||
| 29 | * Deletion: Dired Deletion. Deleting files with Dired. | ||
| 30 | * Flagging Many Files:: Flagging files based on their names. | ||
| 31 | * Visit: Dired Visiting. Other file operations through Dired. | ||
| 32 | * Marks vs Flags:: Flagging for deletion vs marking. | ||
| 33 | * Operating on Files:: How to copy, rename, print, compress, etc. | ||
| 34 | either one file or several files. | ||
| 35 | * Shell Commands in Dired:: Running a shell command on the marked files. | ||
| 36 | * Transforming File Names:: Using patterns to rename multiple files. | ||
| 37 | * Comparison in Dired:: Running `diff' by way of Dired. | ||
| 38 | * Subdirectories in Dired:: Adding subdirectories to the Dired buffer. | ||
| 39 | @ifnottex | ||
| 40 | * Subdir Switches:: Subdirectory switches in Dired. | ||
| 41 | @end ifnottex | ||
| 42 | * Subdirectory Motion:: Moving across subdirectories, and up and down. | ||
| 43 | * Hiding Subdirectories:: Making subdirectories visible or invisible. | ||
| 44 | * Updating: Dired Updating. Discarding lines for files of no interest. | ||
| 45 | * Find: Dired and Find. Using `find' to choose the files for Dired. | ||
| 46 | * Wdired:: Operating on files by editing the Dired buffer. | ||
| 47 | * Image-Dired:: Viewing image thumbnails in Dired | ||
| 48 | * Misc: Misc Dired Features. Various other features. | ||
| 49 | @end menu | ||
| 50 | |||
| 51 | @node Dired Enter | ||
| 52 | @section Entering Dired | ||
| 53 | |||
| 54 | @findex dired | ||
| 55 | @kindex C-x d | ||
| 56 | @vindex dired-listing-switches | ||
| 57 | To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}. The command | ||
| 58 | reads a directory name or wildcard file name pattern as a minibuffer | ||
| 59 | argument to specify the files to list. @kbd{C-x C-f} given a | ||
| 60 | directory name also invokes Dired. Where @code{dired} differs from | ||
| 61 | @code{list-directory} is that it puts the buffer into Dired mode, so | ||
| 62 | that the special commands of Dired are available. | ||
| 63 | |||
| 64 | The variable @code{dired-listing-switches} specifies the options to | ||
| 65 | give to @code{ls} for listing the directory; this string @emph{must} | ||
| 66 | contain @samp{-l}. If you use a numeric prefix argument with the | ||
| 67 | @code{dired} command, you can specify the @code{ls} switches with the | ||
| 68 | minibuffer before you enter the directory specification. No matter | ||
| 69 | how they are specified, the @code{ls} switches can include short | ||
| 70 | options (that is, single characters) requiring no arguments, and long | ||
| 71 | options (starting with @samp{--}) whose arguments are specified with | ||
| 72 | @samp{=}. | ||
| 73 | |||
| 74 | On MS-Windows and MS-DOS systems, Emacs @emph{emulates} @code{ls}; | ||
| 75 | see @ref{ls in Lisp}, for options and peculiarities of that emulation. | ||
| 76 | |||
| 77 | |||
| 78 | @findex dired-other-window | ||
| 79 | @kindex C-x 4 d | ||
| 80 | @findex dired-other-frame | ||
| 81 | @kindex C-x 5 d | ||
| 82 | To display the Dired buffer in another window rather than in the | ||
| 83 | selected window, use @kbd{C-x 4 d} (@code{dired-other-window}) instead | ||
| 84 | of @kbd{C-x d}. @kbd{C-x 5 d} (@code{dired-other-frame}) uses a | ||
| 85 | separate frame to display the Dired buffer. | ||
| 86 | |||
| 87 | @node Dired Navigation | ||
| 88 | @section Navigation in the Dired Buffer | ||
| 89 | |||
| 90 | @kindex C-n @r{(Dired)} | ||
| 91 | @kindex C-p @r{(Dired)} | ||
| 92 | All the usual Emacs cursor motion commands are available in Dired | ||
| 93 | buffers. The keys @kbd{C-n} and @kbd{C-p} are redefined to put the | ||
| 94 | cursor at the beginning of the file name on the line, rather than at | ||
| 95 | the beginning of the line. | ||
| 96 | |||
| 97 | @kindex SPC @r{(Dired)} | ||
| 98 | For extra convenience, @key{SPC} and @kbd{n} in Dired are equivalent | ||
| 99 | to @kbd{C-n}. @kbd{p} is equivalent to @kbd{C-p}. (Moving by lines is | ||
| 100 | so common in Dired that it deserves to be easy to type.) @key{DEL} | ||
| 101 | (move up and unflag) is often useful simply for moving up. | ||
| 102 | |||
| 103 | @findex dired-goto-file | ||
| 104 | @kindex j @r{(Dired)} | ||
| 105 | @kbd{j} (@code{dired-goto-file}) moves point to the line that | ||
| 106 | describes a specified file or directory. | ||
| 107 | |||
| 108 | Some additional navigation commands are available when the Dired | ||
| 109 | buffer includes several directories. @xref{Subdirectory Motion}. | ||
| 110 | |||
| 111 | @node Dired Deletion | ||
| 112 | @section Deleting Files with Dired | ||
| 113 | @cindex flagging files (in Dired) | ||
| 114 | @cindex deleting files (in Dired) | ||
| 115 | |||
| 116 | One of the most frequent uses of Dired is to first @dfn{flag} files for | ||
| 117 | deletion, then delete the files that were flagged. | ||
| 118 | |||
| 119 | @table @kbd | ||
| 120 | @item d | ||
| 121 | Flag this file for deletion. | ||
| 122 | @item u | ||
| 123 | Remove deletion flag on this line. | ||
| 124 | @item @key{DEL} | ||
| 125 | Move point to previous line and remove the deletion flag on that line. | ||
| 126 | @item x | ||
| 127 | Delete the files that are flagged for deletion. | ||
| 128 | @end table | ||
| 129 | |||
| 130 | @kindex d @r{(Dired)} | ||
| 131 | @findex dired-flag-file-deletion | ||
| 132 | You can flag a file for deletion by moving to the line describing | ||
| 133 | the file and typing @kbd{d} (@code{dired-flag-file-deletion}). The | ||
| 134 | deletion flag is visible as a @samp{D} at the beginning of the line. | ||
| 135 | This command moves point to the next line, so that repeated @kbd{d} | ||
| 136 | commands flag successive files. A numeric argument serves as a repeat | ||
| 137 | count. | ||
| 138 | |||
| 139 | @kindex u @r{(Dired deletion)} | ||
| 140 | @kindex DEL @r{(Dired)} | ||
| 141 | The reason for flagging files for deletion, rather than deleting | ||
| 142 | files immediately, is to reduce the danger of deleting a file | ||
| 143 | accidentally. Until you direct Dired to delete the flagged files, you | ||
| 144 | can remove deletion flags using the commands @kbd{u} and @key{DEL}. | ||
| 145 | @kbd{u} (@code{dired-unmark}) works just like @kbd{d}, but removes | ||
| 146 | flags rather than making flags. @key{DEL} | ||
| 147 | (@code{dired-unmark-backward}) moves upward, removing flags; it is | ||
| 148 | like @kbd{u} with argument @minus{}1. | ||
| 149 | |||
| 150 | @kindex x @r{(Dired)} | ||
| 151 | @findex dired-do-flagged-delete | ||
| 152 | @cindex expunging (Dired) | ||
| 153 | To delete the flagged files, type @kbd{x} | ||
| 154 | (@code{dired-do-flagged-delete}). (This is also known as | ||
| 155 | @dfn{expunging}.) This command first displays a list of all the file | ||
| 156 | names flagged for deletion, and requests confirmation with @kbd{yes}. | ||
| 157 | If you confirm, Dired deletes the flagged files, then deletes their | ||
| 158 | lines from the text of the Dired buffer. The Dired buffer, with | ||
| 159 | somewhat fewer lines, remains selected. | ||
| 160 | |||
| 161 | If you answer @kbd{no} or quit with @kbd{C-g} when asked to confirm, you | ||
| 162 | return immediately to Dired, with the deletion flags still present in | ||
| 163 | the buffer, and no files actually deleted. | ||
| 164 | |||
| 165 | @cindex recursive deletion | ||
| 166 | @vindex dired-recursive-deletes | ||
| 167 | You can delete empty directories just like other files, but normally | ||
| 168 | Dired cannot delete directories that are nonempty. If the variable | ||
| 169 | @code{dired-recursive-deletes} is non-@code{nil}, then Dired can | ||
| 170 | delete nonempty directories including all their contents. That can | ||
| 171 | be somewhat risky. | ||
| 172 | |||
| 173 | @node Flagging Many Files | ||
| 174 | @section Flagging Many Files at Once | ||
| 175 | @cindex flagging many files for deletion (in Dired) | ||
| 176 | |||
| 177 | @table @kbd | ||
| 178 | @item # | ||
| 179 | Flag all auto-save files (files whose names start and end with @samp{#}) | ||
| 180 | for deletion (@pxref{Auto Save}). | ||
| 181 | |||
| 182 | @item ~ | ||
| 183 | Flag all backup files (files whose names end with @samp{~}) for deletion | ||
| 184 | (@pxref{Backup}). | ||
| 185 | |||
| 186 | @item & | ||
| 187 | Flag for deletion all files with certain kinds of names which suggest | ||
| 188 | you could easily create those files again. | ||
| 189 | |||
| 190 | @item .@: @r{(Period)} | ||
| 191 | Flag excess numeric backup files for deletion. The oldest and newest | ||
| 192 | few backup files of any one file are exempt; the middle ones are | ||
| 193 | flagged. | ||
| 194 | |||
| 195 | @item % d @var{regexp} @key{RET} | ||
| 196 | Flag for deletion all files whose names match the regular expression | ||
| 197 | @var{regexp}. | ||
| 198 | @end table | ||
| 199 | |||
| 200 | The @kbd{#}, @kbd{~}, @kbd{&}, and @kbd{.} commands flag many files for | ||
| 201 | deletion, based on their file names. These commands are useful | ||
| 202 | precisely because they do not themselves delete any files; you can | ||
| 203 | remove the deletion flags from any flagged files that you really wish to | ||
| 204 | keep.@refill | ||
| 205 | |||
| 206 | @kindex & @r{(Dired)} | ||
| 207 | @findex dired-flag-garbage-files | ||
| 208 | @vindex dired-garbage-files-regexp | ||
| 209 | @cindex deleting some backup files | ||
| 210 | @kbd{&} (@code{dired-flag-garbage-files}) flags files whose names | ||
| 211 | match the regular expression specified by the variable | ||
| 212 | @code{dired-garbage-files-regexp}. By default, this matches certain | ||
| 213 | files produced by @TeX{}, @samp{.bak} files, and the @samp{.orig} and | ||
| 214 | @samp{.rej} files produced by @code{patch}. | ||
| 215 | |||
| 216 | @kindex # @r{(Dired)} | ||
| 217 | @findex dired-flag-auto-save-files | ||
| 218 | @cindex deleting auto-save files | ||
| 219 | @kbd{#} (@code{dired-flag-auto-save-files}) flags for deletion all | ||
| 220 | files whose names look like auto-save files---that is, files whose | ||
| 221 | names begin and end with @samp{#}. @xref{Auto Save}. | ||
| 222 | |||
| 223 | @kindex ~ @r{(Dired)} | ||
| 224 | @findex dired-flag-backup-files | ||
| 225 | @kbd{~} (@code{dired-flag-backup-files}) flags for deletion all | ||
| 226 | files whose names say they are backup files---that is, files whose | ||
| 227 | names end in @samp{~}. @xref{Backup}. | ||
| 228 | |||
| 229 | @kindex . @r{(Dired)} | ||
| 230 | @vindex dired-kept-versions | ||
| 231 | @findex dired-clean-directory | ||
| 232 | @kbd{.} (period, @code{dired-clean-directory}) flags just some of the | ||
| 233 | backup files for deletion: all but the oldest few and newest few backups | ||
| 234 | of any one file. Normally @code{dired-kept-versions} (@strong{not} | ||
| 235 | @code{kept-new-versions}; that applies only when saving) specifies the | ||
| 236 | number of newest versions of each file to keep, and | ||
| 237 | @code{kept-old-versions} specifies the number of oldest versions to | ||
| 238 | keep. | ||
| 239 | |||
| 240 | Period with a positive numeric argument, as in @kbd{C-u 3 .}, | ||
| 241 | specifies the number of newest versions to keep, overriding | ||
| 242 | @code{dired-kept-versions}. A negative numeric argument overrides | ||
| 243 | @code{kept-old-versions}, using minus the value of the argument to | ||
| 244 | specify the number of oldest versions of each file to keep. | ||
| 245 | |||
| 246 | @findex dired-flag-files-regexp | ||
| 247 | @kindex % d @r{(Dired)} | ||
| 248 | The @kbd{% d} command flags all files whose names match a specified | ||
| 249 | regular expression (@code{dired-flag-files-regexp}). Only the | ||
| 250 | non-directory part of the file name is used in matching. You can use | ||
| 251 | @samp{^} and @samp{$} to anchor matches. You can exclude certain | ||
| 252 | subdirectories from marking by hiding them while you use @kbd{% d}. | ||
| 253 | @xref{Hiding Subdirectories}. | ||
| 254 | |||
| 255 | @node Dired Visiting | ||
| 256 | @section Visiting Files in Dired | ||
| 257 | |||
| 258 | There are several Dired commands for visiting or examining the files | ||
| 259 | listed in the Dired buffer. All of them apply to the current line's | ||
| 260 | file; if that file is really a directory, these commands invoke Dired on | ||
| 261 | that subdirectory (making a separate Dired buffer). | ||
| 262 | |||
| 263 | @table @kbd | ||
| 264 | @item f | ||
| 265 | @kindex f @r{(Dired)} | ||
| 266 | @findex dired-find-file | ||
| 267 | Visit the file described on the current line, like typing @kbd{C-x C-f} | ||
| 268 | and supplying that file name (@code{dired-find-file}). @xref{Visiting}. | ||
| 269 | |||
| 270 | @item @key{RET} | ||
| 271 | @itemx e | ||
| 272 | @kindex RET @r{(Dired)} | ||
| 273 | @kindex e @r{(Dired)} | ||
| 274 | Equivalent to @kbd{f}. | ||
| 275 | |||
| 276 | @ignore @c This command seems too risky to document at all. | ||
| 277 | @item a | ||
| 278 | @kindex a @r{(Dired)} | ||
| 279 | @findex dired-find-alternate-file | ||
| 280 | Like @kbd{f}, but replaces the contents of the Dired buffer with | ||
| 281 | that of an alternate file or directory (@code{dired-find-alternate-file}). | ||
| 282 | @end ignore | ||
| 283 | |||
| 284 | @item o | ||
| 285 | @kindex o @r{(Dired)} | ||
| 286 | @findex dired-find-file-other-window | ||
| 287 | Like @kbd{f}, but uses another window to display the file's buffer | ||
| 288 | (@code{dired-find-file-other-window}). The Dired buffer remains visible | ||
| 289 | in the first window. This is like using @kbd{C-x 4 C-f} to visit the | ||
| 290 | file. @xref{Windows}. | ||
| 291 | |||
| 292 | @item C-o | ||
| 293 | @kindex C-o @r{(Dired)} | ||
| 294 | @findex dired-display-file | ||
| 295 | Visit the file described on the current line, and display the buffer in | ||
| 296 | another window, but do not select that window (@code{dired-display-file}). | ||
| 297 | |||
| 298 | @item Mouse-1 | ||
| 299 | @itemx Mouse-2 | ||
| 300 | @findex dired-mouse-find-file-other-window | ||
| 301 | Visit the file named by the line you click on | ||
| 302 | (@code{dired-mouse-find-file-other-window}). This uses another window | ||
| 303 | to display the file, like the @kbd{o} command. | ||
| 304 | |||
| 305 | @item v | ||
| 306 | @kindex v @r{(Dired)} | ||
| 307 | @findex dired-view-file | ||
| 308 | View the file described on the current line, using @kbd{M-x view-file} | ||
| 309 | (@code{dired-view-file}). Viewing a file with @code{view-file} is | ||
| 310 | like visiting it, but is slanted toward moving around in the file | ||
| 311 | conveniently and does not allow changing the file. @xref{Misc File | ||
| 312 | Ops, View File, Miscellaneous File Operations}. | ||
| 313 | |||
| 314 | @item ^ | ||
| 315 | @kindex ^ @r{(Dired)} | ||
| 316 | @findex dired-up-directory | ||
| 317 | Visit the parent directory of the current directory | ||
| 318 | (@code{dired-up-directory}). This is equivalent to moving to the line | ||
| 319 | for @file{..} and typing @kbd{f} there. | ||
| 320 | @end table | ||
| 321 | |||
| 322 | @node Marks vs Flags | ||
| 323 | @section Dired Marks vs. Flags | ||
| 324 | |||
| 325 | @cindex marking many files (in Dired) | ||
| 326 | Instead of flagging a file with @samp{D}, you can @dfn{mark} the | ||
| 327 | file with some other character (usually @samp{*}). Most Dired | ||
| 328 | commands to operate on files use the files marked with @samp{*}. The | ||
| 329 | only command that operates on flagged files is @kbd{x}, which expunges | ||
| 330 | them. | ||
| 331 | |||
| 332 | Here are some commands for marking with @samp{*}, for unmarking, and | ||
| 333 | for operating on marks. (@xref{Dired Deletion}, for commands to flag | ||
| 334 | and unflag files.) | ||
| 335 | |||
| 336 | @table @kbd | ||
| 337 | @item m | ||
| 338 | @itemx * m | ||
| 339 | @kindex m @r{(Dired)} | ||
| 340 | @kindex * m @r{(Dired)} | ||
| 341 | @findex dired-mark | ||
| 342 | Mark the current file with @samp{*} (@code{dired-mark}). With a numeric | ||
| 343 | argument @var{n}, mark the next @var{n} files starting with the current | ||
| 344 | file. (If @var{n} is negative, mark the previous @minus{}@var{n} | ||
| 345 | files.) | ||
| 346 | |||
| 347 | @item * * | ||
| 348 | @kindex * * @r{(Dired)} | ||
| 349 | @findex dired-mark-executables | ||
| 350 | @cindex marking executable files (in Dired) | ||
| 351 | Mark all executable files with @samp{*} | ||
| 352 | (@code{dired-mark-executables}). With a numeric argument, unmark all | ||
| 353 | those files. | ||
| 354 | |||
| 355 | @item * @@ | ||
| 356 | @kindex * @@ @r{(Dired)} | ||
| 357 | @findex dired-mark-symlinks | ||
| 358 | @cindex marking symbolic links (in Dired) | ||
| 359 | Mark all symbolic links with @samp{*} (@code{dired-mark-symlinks}). | ||
| 360 | With a numeric argument, unmark all those files. | ||
| 361 | |||
| 362 | @item * / | ||
| 363 | @kindex * / @r{(Dired)} | ||
| 364 | @findex dired-mark-directories | ||
| 365 | @cindex marking subdirectories (in Dired) | ||
| 366 | Mark with @samp{*} all files which are directories, except for | ||
| 367 | @file{.} and @file{..} (@code{dired-mark-directories}). With a numeric | ||
| 368 | argument, unmark all those files. | ||
| 369 | |||
| 370 | @item * s | ||
| 371 | @kindex * s @r{(Dired)} | ||
| 372 | @findex dired-mark-subdir-files | ||
| 373 | Mark all the files in the current subdirectory, aside from @file{.} | ||
| 374 | and @file{..} (@code{dired-mark-subdir-files}). | ||
| 375 | |||
| 376 | @item u | ||
| 377 | @itemx * u | ||
| 378 | @kindex u @r{(Dired)} | ||
| 379 | @kindex * u @r{(Dired)} | ||
| 380 | @findex dired-unmark | ||
| 381 | Remove any mark on this line (@code{dired-unmark}). | ||
| 382 | |||
| 383 | @item @key{DEL} | ||
| 384 | @itemx * @key{DEL} | ||
| 385 | @kindex * DEL @r{(Dired)} | ||
| 386 | @findex dired-unmark-backward | ||
| 387 | @cindex unmarking files (in Dired) | ||
| 388 | Move point to previous line and remove any mark on that line | ||
| 389 | (@code{dired-unmark-backward}). | ||
| 390 | |||
| 391 | @item * ! | ||
| 392 | @itemx U | ||
| 393 | @kindex * ! @r{(Dired)} | ||
| 394 | @kindex U @r{(Dired)} | ||
| 395 | @findex dired-unmark-all-marks | ||
| 396 | Remove all marks from all the files in this Dired buffer | ||
| 397 | (@code{dired-unmark-all-marks}). | ||
| 398 | |||
| 399 | @item * ? @var{markchar} | ||
| 400 | @itemx M-@key{DEL} | ||
| 401 | @kindex * ? @r{(Dired)} | ||
| 402 | @kindex M-DEL @r{(Dired)} | ||
| 403 | @findex dired-unmark-all-files | ||
| 404 | Remove all marks that use the character @var{markchar} | ||
| 405 | (@code{dired-unmark-all-files}). The argument is a single | ||
| 406 | character---do not use @key{RET} to terminate it. See the description | ||
| 407 | of the @kbd{* c} command below, which lets you replace one mark | ||
| 408 | character with another. | ||
| 409 | |||
| 410 | With a numeric argument, this command queries about each marked file, | ||
| 411 | asking whether to remove its mark. You can answer @kbd{y} meaning yes, | ||
| 412 | @kbd{n} meaning no, or @kbd{!} to remove the marks from the remaining | ||
| 413 | files without asking about them. | ||
| 414 | |||
| 415 | @item * C-n | ||
| 416 | @itemx M-@} | ||
| 417 | @findex dired-next-marked-file | ||
| 418 | @kindex * C-n @r{(Dired)} | ||
| 419 | @kindex M-@} @r{(Dired)} | ||
| 420 | Move down to the next marked file (@code{dired-next-marked-file}) | ||
| 421 | A file is ``marked'' if it has any kind of mark. | ||
| 422 | |||
| 423 | @item * C-p | ||
| 424 | @itemx M-@{ | ||
| 425 | @findex dired-prev-marked-file | ||
| 426 | @kindex * C-p @r{(Dired)} | ||
| 427 | @kindex M-@{ @r{(Dired)} | ||
| 428 | Move up to the previous marked file (@code{dired-prev-marked-file}) | ||
| 429 | |||
| 430 | @item t | ||
| 431 | @itemx * t | ||
| 432 | @kindex t @r{(Dired)} | ||
| 433 | @kindex * t @r{(Dired)} | ||
| 434 | @findex dired-toggle-marks | ||
| 435 | @cindex toggling marks (in Dired) | ||
| 436 | Toggle all marks (@code{dired-toggle-marks}): files marked with @samp{*} | ||
| 437 | become unmarked, and unmarked files are marked with @samp{*}. Files | ||
| 438 | marked in any other way are not affected. | ||
| 439 | |||
| 440 | @item * c @var{old-markchar} @var{new-markchar} | ||
| 441 | @kindex * c @r{(Dired)} | ||
| 442 | @findex dired-change-marks | ||
| 443 | Replace all marks that use the character @var{old-markchar} with marks | ||
| 444 | that use the character @var{new-markchar} (@code{dired-change-marks}). | ||
| 445 | This command is the primary way to create or use marks other than | ||
| 446 | @samp{*} or @samp{D}. The arguments are single characters---do not use | ||
| 447 | @key{RET} to terminate them. | ||
| 448 | |||
| 449 | You can use almost any character as a mark character by means of this | ||
| 450 | command, to distinguish various classes of files. If @var{old-markchar} | ||
| 451 | is a space (@samp{ }), then the command operates on all unmarked files; | ||
| 452 | if @var{new-markchar} is a space, then the command unmarks the files it | ||
| 453 | acts on. | ||
| 454 | |||
| 455 | To illustrate the power of this command, here is how to put @samp{D} | ||
| 456 | flags on all the files that have no marks, while unflagging all those | ||
| 457 | that already have @samp{D} flags: | ||
| 458 | |||
| 459 | @example | ||
| 460 | * c D t * c SPC D * c t SPC | ||
| 461 | @end example | ||
| 462 | |||
| 463 | This assumes that no files were already marked with @samp{t}. | ||
| 464 | |||
| 465 | @item % m @var{regexp} @key{RET} | ||
| 466 | @itemx * % @var{regexp} @key{RET} | ||
| 467 | @findex dired-mark-files-regexp | ||
| 468 | @kindex % m @r{(Dired)} | ||
| 469 | @kindex * % @r{(Dired)} | ||
| 470 | Mark (with @samp{*}) all files whose names match the regular expression | ||
| 471 | @var{regexp} (@code{dired-mark-files-regexp}). This command is like | ||
| 472 | @kbd{% d}, except that it marks files with @samp{*} instead of flagging | ||
| 473 | with @samp{D}. | ||
| 474 | |||
| 475 | Only the non-directory part of the file name is used in matching. Use | ||
| 476 | @samp{^} and @samp{$} to anchor matches. You can exclude | ||
| 477 | subdirectories by temporarily hiding them (@pxref{Hiding | ||
| 478 | Subdirectories}). | ||
| 479 | |||
| 480 | @item % g @var{regexp} @key{RET} | ||
| 481 | @findex dired-mark-files-containing-regexp | ||
| 482 | @kindex % g @r{(Dired)} | ||
| 483 | @cindex finding files containing regexp matches (in Dired) | ||
| 484 | Mark (with @samp{*}) all files whose @emph{contents} contain a match for | ||
| 485 | the regular expression @var{regexp} | ||
| 486 | (@code{dired-mark-files-containing-regexp}). This command is like | ||
| 487 | @kbd{% m}, except that it searches the file contents instead of the file | ||
| 488 | name. | ||
| 489 | |||
| 490 | @item C-x u | ||
| 491 | @itemx C-_ | ||
| 492 | @itemx C-/ | ||
| 493 | @kindex C-_ @r{(Dired)} | ||
| 494 | @findex dired-undo | ||
| 495 | Undo changes in the Dired buffer, such as adding or removing | ||
| 496 | marks (@code{dired-undo}). @emph{This command does not revert the | ||
| 497 | actual file operations, nor recover lost files!} It just undoes | ||
| 498 | changes in the buffer itself. | ||
| 499 | |||
| 500 | In some cases, using this after commands that operate on files can | ||
| 501 | cause trouble. For example, after renaming one or more files, | ||
| 502 | @code{dired-undo} restores the original names in the Dired buffer, | ||
| 503 | which gets the Dired buffer out of sync with the actual contents of | ||
| 504 | the directory. | ||
| 505 | @end table | ||
| 506 | |||
| 507 | @node Operating on Files | ||
| 508 | @section Operating on Files | ||
| 509 | @cindex operating on files in Dired | ||
| 510 | |||
| 511 | This section describes the basic Dired commands to operate on one file | ||
| 512 | or several files. All of these commands are capital letters; all of | ||
| 513 | them use the minibuffer, either to read an argument or to ask for | ||
| 514 | confirmation, before they act. All of them let you specify the | ||
| 515 | files to manipulate in these ways: | ||
| 516 | |||
| 517 | @itemize @bullet | ||
| 518 | @item | ||
| 519 | If you give the command a numeric prefix argument @var{n}, it operates | ||
| 520 | on the next @var{n} files, starting with the current file. (If @var{n} | ||
| 521 | is negative, the command operates on the @minus{}@var{n} files preceding | ||
| 522 | the current line.) | ||
| 523 | |||
| 524 | @item | ||
| 525 | Otherwise, if some files are marked with @samp{*}, the command operates | ||
| 526 | on all those files. | ||
| 527 | |||
| 528 | @item | ||
| 529 | Otherwise, the command operates on the current file only. | ||
| 530 | @end itemize | ||
| 531 | |||
| 532 | @noindent | ||
| 533 | Certain other Dired commands, such as @kbd{!} and the @samp{%} | ||
| 534 | commands, use the same conventions to decide which files to work on. | ||
| 535 | |||
| 536 | @vindex dired-dwim-target | ||
| 537 | @cindex two directories (in Dired) | ||
| 538 | Commands which ask for a destination directory, such as those which | ||
| 539 | copy and rename files or create links for them, try to guess the default | ||
| 540 | target directory for the operation. Normally, they suggest the Dired | ||
| 541 | buffer's default directory, but if the variable @code{dired-dwim-target} | ||
| 542 | is non-@code{nil}, and if there is another Dired buffer displayed in the | ||
| 543 | next window, that other buffer's directory is suggested instead. | ||
| 544 | |||
| 545 | Here are the file-manipulating Dired commands that operate on files. | ||
| 546 | |||
| 547 | @table @kbd | ||
| 548 | @findex dired-do-copy | ||
| 549 | @kindex C @r{(Dired)} | ||
| 550 | @cindex copying files (in Dired) | ||
| 551 | @item C @var{new} @key{RET} | ||
| 552 | Copy the specified files (@code{dired-do-copy}). The argument @var{new} | ||
| 553 | is the directory to copy into, or (if copying a single file) the new | ||
| 554 | name. This is like the shell command @code{cp}. | ||
| 555 | |||
| 556 | @vindex dired-copy-preserve-time | ||
| 557 | If @code{dired-copy-preserve-time} is non-@code{nil}, then copying | ||
| 558 | with this command preserves the modification time of the old file in | ||
| 559 | the copy, like @samp{cp -p}. | ||
| 560 | |||
| 561 | @vindex dired-recursive-copies | ||
| 562 | @cindex recursive copying | ||
| 563 | The variable @code{dired-recursive-copies} controls whether to copy | ||
| 564 | directories recursively (like @samp{cp -r}). The default is | ||
| 565 | @code{nil}, which means that directories cannot be copied. | ||
| 566 | |||
| 567 | @item D | ||
| 568 | @findex dired-do-delete | ||
| 569 | @kindex D @r{(Dired)} | ||
| 570 | Delete the specified files (@code{dired-do-delete}). This is like the | ||
| 571 | shell command @code{rm}. | ||
| 572 | |||
| 573 | Like the other commands in this section, this command operates on the | ||
| 574 | @emph{marked} files, or the next @var{n} files. By contrast, @kbd{x} | ||
| 575 | (@code{dired-do-flagged-delete}) deletes all @dfn{flagged} files. | ||
| 576 | |||
| 577 | @findex dired-do-rename | ||
| 578 | @kindex R @r{(Dired)} | ||
| 579 | @cindex renaming files (in Dired) | ||
| 580 | @cindex moving files (in Dired) | ||
| 581 | @item R @var{new} @key{RET} | ||
| 582 | Rename the specified files (@code{dired-do-rename}). If you rename a | ||
| 583 | single file, the argument @var{new} is the new name of the file. If | ||
| 584 | you rename several files, the argument @var{new} is the directory into | ||
| 585 | which to move the files (this is like the shell command @code{mv}). | ||
| 586 | |||
| 587 | Dired automatically changes the visited file name of buffers associated | ||
| 588 | with renamed files so that they refer to the new names. | ||
| 589 | |||
| 590 | @findex dired-do-hardlink | ||
| 591 | @kindex H @r{(Dired)} | ||
| 592 | @cindex hard links (in Dired) | ||
| 593 | @item H @var{new} @key{RET} | ||
| 594 | Make hard links to the specified files (@code{dired-do-hardlink}). | ||
| 595 | This is like the shell command @code{ln}. The argument @var{new} is | ||
| 596 | the directory to make the links in, or (if making just one link) the | ||
| 597 | name to give the link. | ||
| 598 | |||
| 599 | @findex dired-do-symlink | ||
| 600 | @kindex S @r{(Dired)} | ||
| 601 | @cindex symbolic links (creation in Dired) | ||
| 602 | @item S @var{new} @key{RET} | ||
| 603 | Make symbolic links to the specified files (@code{dired-do-symlink}). | ||
| 604 | This is like @samp{ln -s}. The argument @var{new} is the directory to | ||
| 605 | make the links in, or (if making just one link) the name to give the | ||
| 606 | link. | ||
| 607 | |||
| 608 | @findex dired-do-chmod | ||
| 609 | @kindex M @r{(Dired)} | ||
| 610 | @cindex changing file permissions (in Dired) | ||
| 611 | @item M @var{modespec} @key{RET} | ||
| 612 | Change the mode (also called ``permission bits'') of the specified files | ||
| 613 | (@code{dired-do-chmod}). This uses the @code{chmod} program, so | ||
| 614 | @var{modespec} can be any argument that @code{chmod} can handle. | ||
| 615 | |||
| 616 | @findex dired-do-chgrp | ||
| 617 | @kindex G @r{(Dired)} | ||
| 618 | @cindex changing file group (in Dired) | ||
| 619 | @item G @var{newgroup} @key{RET} | ||
| 620 | Change the group of the specified files to @var{newgroup} | ||
| 621 | (@code{dired-do-chgrp}). | ||
| 622 | |||
| 623 | @findex dired-do-chown | ||
| 624 | @kindex O @r{(Dired)} | ||
| 625 | @cindex changing file owner (in Dired) | ||
| 626 | @item O @var{newowner} @key{RET} | ||
| 627 | Change the owner of the specified files to @var{newowner} | ||
| 628 | (@code{dired-do-chown}). (On most systems, only the superuser can do | ||
| 629 | this.) | ||
| 630 | |||
| 631 | @vindex dired-chown-program | ||
| 632 | The variable @code{dired-chown-program} specifies the name of the | ||
| 633 | program to use to do the work (different systems put @code{chown} in | ||
| 634 | different places). | ||
| 635 | |||
| 636 | @findex dired-do-touch | ||
| 637 | @kindex T @r{(Dired)} | ||
| 638 | @cindex changing file time (in Dired) | ||
| 639 | @item T @var{timestamp} @key{RET} | ||
| 640 | Touch the specified files (@code{dired-do-touch}). This means | ||
| 641 | updating their modification times to the present time. This is like | ||
| 642 | the shell command @code{touch}. | ||
| 643 | |||
| 644 | @findex dired-do-print | ||
| 645 | @kindex P @r{(Dired)} | ||
| 646 | @cindex printing files (in Dired) | ||
| 647 | @item P @var{command} @key{RET} | ||
| 648 | Print the specified files (@code{dired-do-print}). You must specify the | ||
| 649 | command to print them with, but the minibuffer starts out with a | ||
| 650 | suitable guess made using the variables @code{lpr-command} and | ||
| 651 | @code{lpr-switches} (the same variables that @code{lpr-buffer} uses; | ||
| 652 | @pxref{Printing}). | ||
| 653 | |||
| 654 | @findex dired-do-compress | ||
| 655 | @kindex Z @r{(Dired)} | ||
| 656 | @cindex compressing files (in Dired) | ||
| 657 | @item Z | ||
| 658 | Compress the specified files (@code{dired-do-compress}). If the file | ||
| 659 | appears to be a compressed file already, uncompress it instead. | ||
| 660 | |||
| 661 | @findex dired-do-load | ||
| 662 | @kindex L @r{(Dired)} | ||
| 663 | @cindex loading several files (in Dired) | ||
| 664 | @item L | ||
| 665 | Load the specified Emacs Lisp files (@code{dired-do-load}). | ||
| 666 | @xref{Lisp Libraries}. | ||
| 667 | |||
| 668 | @findex dired-do-byte-compile | ||
| 669 | @kindex B @r{(Dired)} | ||
| 670 | @cindex byte-compiling several files (in Dired) | ||
| 671 | @item B | ||
| 672 | Byte compile the specified Emacs Lisp files | ||
| 673 | (@code{dired-do-byte-compile}). @xref{Byte Compilation,, Byte | ||
| 674 | Compilation, elisp, The Emacs Lisp Reference Manual}. | ||
| 675 | |||
| 676 | @kindex A @r{(Dired)} | ||
| 677 | @findex dired-do-search | ||
| 678 | @cindex search multiple files (in Dired) | ||
| 679 | @item A @var{regexp} @key{RET} | ||
| 680 | Search all the specified files for the regular expression @var{regexp} | ||
| 681 | (@code{dired-do-search}). | ||
| 682 | |||
| 683 | This command is a variant of @code{tags-search}. The search stops at | ||
| 684 | the first match it finds; use @kbd{M-,} to resume the search and find | ||
| 685 | the next match. @xref{Tags Search}. | ||
| 686 | |||
| 687 | @kindex Q @r{(Dired)} | ||
| 688 | @findex dired-do-query-replace-regexp | ||
| 689 | @cindex search and replace in multiple files (in Dired) | ||
| 690 | @item Q @var{regexp} @key{RET} @var{to} @key{RET} | ||
| 691 | Perform @code{query-replace-regexp} on each of the specified files, | ||
| 692 | replacing matches for @var{regexp} with the string | ||
| 693 | @var{to} (@code{dired-do-query-replace-regexp}). | ||
| 694 | |||
| 695 | This command is a variant of @code{tags-query-replace}. If you exit the | ||
| 696 | query replace loop, you can use @kbd{M-,} to resume the scan and replace | ||
| 697 | more matches. @xref{Tags Search}. | ||
| 698 | @end table | ||
| 699 | |||
| 700 | @node Shell Commands in Dired | ||
| 701 | @section Shell Commands in Dired | ||
| 702 | @cindex shell commands, Dired | ||
| 703 | |||
| 704 | @findex dired-do-shell-command | ||
| 705 | @kindex ! @r{(Dired)} | ||
| 706 | @kindex X @r{(Dired)} | ||
| 707 | The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a | ||
| 708 | shell command string in the minibuffer and runs that shell command on | ||
| 709 | all the specified files. (@kbd{X} is a synonym for @kbd{!}.) You can | ||
| 710 | specify the files to operate on in the usual ways for Dired commands | ||
| 711 | (@pxref{Operating on Files}). | ||
| 712 | |||
| 713 | The working directory for the shell command is the top-level directory | ||
| 714 | of the Dired buffer. | ||
| 715 | |||
| 716 | There are two ways of applying a shell command to multiple files: | ||
| 717 | |||
| 718 | @itemize @bullet | ||
| 719 | @item | ||
| 720 | If you use @samp{*} surrounded by whitespace in the shell command, | ||
| 721 | then the command runs just once, with the list of file names | ||
| 722 | substituted for the @samp{*}. The order of file names is the order of | ||
| 723 | appearance in the Dired buffer. | ||
| 724 | |||
| 725 | Thus, @kbd{! tar cf foo.tar * @key{RET}} runs @code{tar} on the entire | ||
| 726 | list of file names, putting them into one tar file @file{foo.tar}. | ||
| 727 | |||
| 728 | If you want to use @samp{*} as a shell wildcard with whitespace around | ||
| 729 | it, write @samp{*""}. In the shell, this is equivalent to @samp{*}; | ||
| 730 | but since the @samp{*} is not surrounded by whitespace, Dired does | ||
| 731 | not treat it specially. | ||
| 732 | |||
| 733 | @item | ||
| 734 | If the command string doesn't contain @samp{*} surrounded by | ||
| 735 | whitespace, then it runs once @emph{for each file}. Normally the file | ||
| 736 | name is added at the end. | ||
| 737 | |||
| 738 | For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on each | ||
| 739 | file. | ||
| 740 | |||
| 741 | @item | ||
| 742 | However, if the command string contains @samp{?} surrounded by | ||
| 743 | whitespace, the current file name is substituted for @samp{?} (rather | ||
| 744 | than added at the end). You can use @samp{?} this way more than once | ||
| 745 | in the command, and the same file name replaces each occurrence. | ||
| 746 | @end itemize | ||
| 747 | |||
| 748 | To iterate over the file names in a more complicated fashion, use an | ||
| 749 | explicit shell loop. For example, here is how to uuencode each file, | ||
| 750 | making the output file name by appending @samp{.uu} to the input file | ||
| 751 | name: | ||
| 752 | |||
| 753 | @example | ||
| 754 | for file in * ; do uuencode "$file" "$file" >"$file".uu; done | ||
| 755 | @end example | ||
| 756 | |||
| 757 | The @kbd{!} command does not attempt to update the Dired buffer to | ||
| 758 | show new or modified files, because it doesn't understand shell | ||
| 759 | commands, and does not know what files the shell command changed. Use | ||
| 760 | the @kbd{g} command to update the Dired buffer (@pxref{Dired | ||
| 761 | Updating}). | ||
| 762 | |||
| 763 | @node Transforming File Names | ||
| 764 | @section Transforming File Names in Dired | ||
| 765 | |||
| 766 | This section describes Dired commands which alter file names in a | ||
| 767 | systematic way. Each command operates on some or all of the marked | ||
| 768 | files, using a new name made by transforming the existing name. | ||
| 769 | |||
| 770 | Like the basic Dired file-manipulation commands (@pxref{Operating on | ||
| 771 | Files}), the commands described here operate either on the next | ||
| 772 | @var{n} files, or on all files marked with @samp{*}, or on the current | ||
| 773 | file. (To mark files, use the commands described in @ref{Marks vs | ||
| 774 | Flags}.) | ||
| 775 | |||
| 776 | All of the commands described in this section work | ||
| 777 | @emph{interactively}: they ask you to confirm the operation for each | ||
| 778 | candidate file. Thus, you can select more files than you actually | ||
| 779 | need to operate on (e.g., with a regexp that matches many files), and | ||
| 780 | then filter the selected names by typing @kbd{y} or @kbd{n} when the | ||
| 781 | command prompts for confirmation. | ||
| 782 | |||
| 783 | @table @kbd | ||
| 784 | @findex dired-upcase | ||
| 785 | @kindex % u @r{(Dired)} | ||
| 786 | @cindex upcase file names | ||
| 787 | @item % u | ||
| 788 | Rename each of the selected files to an upper-case name | ||
| 789 | (@code{dired-upcase}). If the old file names are @file{Foo} | ||
| 790 | and @file{bar}, the new names are @file{FOO} and @file{BAR}. | ||
| 791 | |||
| 792 | @item % l | ||
| 793 | @findex dired-downcase | ||
| 794 | @kindex % l @r{(Dired)} | ||
| 795 | @cindex downcase file names | ||
| 796 | Rename each of the selected files to a lower-case name | ||
| 797 | (@code{dired-downcase}). If the old file names are @file{Foo} and | ||
| 798 | @file{bar}, the new names are @file{foo} and @file{bar}. | ||
| 799 | |||
| 800 | @item % R @var{from} @key{RET} @var{to} @key{RET} | ||
| 801 | @kindex % R @r{(Dired)} | ||
| 802 | @findex dired-do-rename-regexp | ||
| 803 | @itemx % C @var{from} @key{RET} @var{to} @key{RET} | ||
| 804 | @kindex % C @r{(Dired)} | ||
| 805 | @findex dired-do-copy-regexp | ||
| 806 | @itemx % H @var{from} @key{RET} @var{to} @key{RET} | ||
| 807 | @kindex % H @r{(Dired)} | ||
| 808 | @findex dired-do-hardlink-regexp | ||
| 809 | @itemx % S @var{from} @key{RET} @var{to} @key{RET} | ||
| 810 | @kindex % S @r{(Dired)} | ||
| 811 | @findex dired-do-symlink-regexp | ||
| 812 | These four commands rename, copy, make hard links and make soft links, | ||
| 813 | in each case computing the new name by regular-expression substitution | ||
| 814 | from the name of the old file. | ||
| 815 | @end table | ||
| 816 | |||
| 817 | The four regular-expression substitution commands effectively | ||
| 818 | perform a search-and-replace on the selected file names. They read | ||
| 819 | two arguments: a regular expression @var{from}, and a substitution | ||
| 820 | pattern @var{to}; they match each ``old'' file name against | ||
| 821 | @var{from}, and then replace the matching part with @var{to}. You can | ||
| 822 | use @samp{\&} and @samp{\@var{digit}} in @var{to} to refer to all or | ||
| 823 | part of what the pattern matched in the old file name, as in | ||
| 824 | @code{replace-regexp} (@pxref{Regexp Replace}). If the regular | ||
| 825 | expression matches more than once in a file name, only the first match | ||
| 826 | is replaced. | ||
| 827 | |||
| 828 | For example, @kbd{% R ^.*$ @key{RET} x-\& @key{RET}} renames each | ||
| 829 | selected file by prepending @samp{x-} to its name. The inverse of this, | ||
| 830 | removing @samp{x-} from the front of each file name, is also possible: | ||
| 831 | one method is @kbd{% R ^x-\(.*\)$ @key{RET} \1 @key{RET}}; another is | ||
| 832 | @kbd{% R ^x- @key{RET} @key{RET}}. (Use @samp{^} and @samp{$} to anchor | ||
| 833 | matches that should span the whole file name.) | ||
| 834 | |||
| 835 | Normally, the replacement process does not consider the files' | ||
| 836 | directory names; it operates on the file name within the directory. If | ||
| 837 | you specify a numeric argument of zero, then replacement affects the | ||
| 838 | entire absolute file name including directory name. (A non-zero | ||
| 839 | argument specifies the number of files to operate on.) | ||
| 840 | |||
| 841 | You may want to select the set of files to operate on using the same | ||
| 842 | regexp @var{from} that you will use to operate on them. To do this, | ||
| 843 | mark those files with @kbd{% m @var{from} @key{RET}}, then use the | ||
| 844 | same regular expression in the command to operate on the files. To | ||
| 845 | make this more convenient, the @kbd{%} commands to operate on files | ||
| 846 | use the last regular expression specified in any @kbd{%} command as a | ||
| 847 | default. | ||
| 848 | |||
| 849 | @node Comparison in Dired | ||
| 850 | @section File Comparison with Dired | ||
| 851 | @cindex file comparison (in Dired) | ||
| 852 | @cindex compare files (in Dired) | ||
| 853 | |||
| 854 | Here are two Dired commands that compare specified files using | ||
| 855 | @code{diff}. They show the output in a buffer using Diff mode | ||
| 856 | (@pxref{Comparing Files}). | ||
| 857 | |||
| 858 | @table @kbd | ||
| 859 | @item = | ||
| 860 | @findex dired-diff | ||
| 861 | @kindex = @r{(Dired)} | ||
| 862 | Compare the current file (the file at point) with another file (the | ||
| 863 | file at the mark) using the @code{diff} program (@code{dired-diff}). | ||
| 864 | The file at the mark is the first argument of @code{diff}, and the | ||
| 865 | file at point is the second argument. This refers to the ordinary | ||
| 866 | Emacs mark, not Dired marks; use @kbd{C-@key{SPC}} | ||
| 867 | (@code{set-mark-command}) to set the mark at the first file's line | ||
| 868 | (@pxref{Setting Mark}). | ||
| 869 | |||
| 870 | @findex dired-backup-diff | ||
| 871 | @kindex M-= @r{(Dired)} | ||
| 872 | @item M-= | ||
| 873 | Compare the current file with its latest backup file | ||
| 874 | (@code{dired-backup-diff}). If the current file is itself a backup, | ||
| 875 | compare it with the file it is a backup of; this way, you can compare | ||
| 876 | a file with any one of its backups. | ||
| 877 | |||
| 878 | The backup file is the first file given to @code{diff}. | ||
| 879 | @end table | ||
| 880 | |||
| 881 | @node Subdirectories in Dired | ||
| 882 | @section Subdirectories in Dired | ||
| 883 | @cindex subdirectories in Dired | ||
| 884 | @cindex expanding subdirectories in Dired | ||
| 885 | |||
| 886 | A Dired buffer displays just one directory in the normal case; | ||
| 887 | but you can optionally include its subdirectories as well. | ||
| 888 | |||
| 889 | The simplest way to include multiple directories in one Dired buffer is | ||
| 890 | to specify the options @samp{-lR} for running @code{ls}. (If you give a | ||
| 891 | numeric argument when you run Dired, then you can specify these options | ||
| 892 | in the minibuffer.) That produces a recursive directory listing showing | ||
| 893 | all subdirectories at all levels. | ||
| 894 | |||
| 895 | More often, you will want to show only specific subdirectories. You | ||
| 896 | can do this with the @kbd{i} command: | ||
| 897 | |||
| 898 | @table @kbd | ||
| 899 | @findex dired-maybe-insert-subdir | ||
| 900 | @kindex i @r{(Dired)} | ||
| 901 | @item i | ||
| 902 | @cindex inserted subdirectory (Dired) | ||
| 903 | @cindex in-situ subdirectory (Dired) | ||
| 904 | Insert the contents of a subdirectory later in the buffer. | ||
| 905 | @end table | ||
| 906 | |||
| 907 | Use the @kbd{i} (@code{dired-maybe-insert-subdir}) command on a line | ||
| 908 | that describes a file which is a directory. It inserts the contents of | ||
| 909 | that directory into the same Dired buffer, and moves there. Inserted | ||
| 910 | subdirectory contents follow the top-level directory of the Dired | ||
| 911 | buffer, just as they do in @samp{ls -lR} output. | ||
| 912 | |||
| 913 | If the subdirectory's contents are already present in the buffer, the | ||
| 914 | @kbd{i} command just moves to it. | ||
| 915 | |||
| 916 | In either case, @kbd{i} sets the Emacs mark before moving, so @kbd{C-u | ||
| 917 | C-@key{SPC}} takes you back to the old position in the buffer (the line | ||
| 918 | describing that subdirectory). | ||
| 919 | |||
| 920 | Use the @kbd{l} command (@code{dired-do-redisplay}) to update the | ||
| 921 | subdirectory's contents. Use @kbd{C-u k} on the subdirectory header | ||
| 922 | line to delete the subdirectory. @xref{Dired Updating}. | ||
| 923 | |||
| 924 | |||
| 925 | |||
| 926 | |||
| 927 | @ifnottex | ||
| 928 | @include dired-xtra.texi | ||
| 929 | @end ifnottex | ||
| 930 | |||
| 931 | @node Subdirectory Motion | ||
| 932 | @section Moving Over Subdirectories | ||
| 933 | |||
| 934 | When a Dired buffer lists subdirectories, you can use the page motion | ||
| 935 | commands @kbd{C-x [} and @kbd{C-x ]} to move by entire directories | ||
| 936 | (@pxref{Pages}). | ||
| 937 | |||
| 938 | @cindex header line (Dired) | ||
| 939 | @cindex directory header lines | ||
| 940 | The following commands move across, up and down in the tree of | ||
| 941 | directories within one Dired buffer. They move to @dfn{directory header | ||
| 942 | lines}, which are the lines that give a directory's name, at the | ||
| 943 | beginning of the directory's contents. | ||
| 944 | |||
| 945 | @table @kbd | ||
| 946 | @findex dired-next-subdir | ||
| 947 | @kindex C-M-n @r{(Dired)} | ||
| 948 | @item C-M-n | ||
| 949 | Go to next subdirectory header line, regardless of level | ||
| 950 | (@code{dired-next-subdir}). | ||
| 951 | |||
| 952 | @findex dired-prev-subdir | ||
| 953 | @kindex C-M-p @r{(Dired)} | ||
| 954 | @item C-M-p | ||
| 955 | Go to previous subdirectory header line, regardless of level | ||
| 956 | (@code{dired-prev-subdir}). | ||
| 957 | |||
| 958 | @findex dired-tree-up | ||
| 959 | @kindex C-M-u @r{(Dired)} | ||
| 960 | @item C-M-u | ||
| 961 | Go up to the parent directory's header line (@code{dired-tree-up}). | ||
| 962 | |||
| 963 | @findex dired-tree-down | ||
| 964 | @kindex C-M-d @r{(Dired)} | ||
| 965 | @item C-M-d | ||
| 966 | Go down in the directory tree, to the first subdirectory's header line | ||
| 967 | (@code{dired-tree-down}). | ||
| 968 | |||
| 969 | @findex dired-prev-dirline | ||
| 970 | @kindex < @r{(Dired)} | ||
| 971 | @item < | ||
| 972 | Move up to the previous directory-file line (@code{dired-prev-dirline}). | ||
| 973 | These lines are the ones that describe a directory as a file in its | ||
| 974 | parent directory. | ||
| 975 | |||
| 976 | @findex dired-next-dirline | ||
| 977 | @kindex > @r{(Dired)} | ||
| 978 | @item > | ||
| 979 | Move down to the next directory-file line (@code{dired-prev-dirline}). | ||
| 980 | @end table | ||
| 981 | |||
| 982 | @node Hiding Subdirectories | ||
| 983 | @section Hiding Subdirectories | ||
| 984 | |||
| 985 | @cindex hiding in Dired (Dired) | ||
| 986 | @dfn{Hiding} a subdirectory means to make it invisible, except for its | ||
| 987 | header line. | ||
| 988 | |||
| 989 | @table @kbd | ||
| 990 | @item $ | ||
| 991 | @findex dired-hide-subdir | ||
| 992 | @kindex $ @r{(Dired)} | ||
| 993 | Hide or reveal the subdirectory that point is in, and move point to the | ||
| 994 | next subdirectory (@code{dired-hide-subdir}). A numeric argument serves | ||
| 995 | as a repeat count. | ||
| 996 | |||
| 997 | @item M-$ | ||
| 998 | @findex dired-hide-all | ||
| 999 | @kindex M-$ @r{(Dired)} | ||
| 1000 | Hide all subdirectories in this Dired buffer, leaving only their header | ||
| 1001 | lines (@code{dired-hide-all}). Or, if any subdirectory is currently | ||
| 1002 | hidden, make all subdirectories visible again. You can use this command | ||
| 1003 | to get an overview in very deep directory trees or to move quickly to | ||
| 1004 | subdirectories far away. | ||
| 1005 | @end table | ||
| 1006 | |||
| 1007 | Ordinary Dired commands never consider files inside a hidden | ||
| 1008 | subdirectory. For example, the commands to operate on marked files | ||
| 1009 | ignore files in hidden directories even if they are marked. Thus you | ||
| 1010 | can use hiding to temporarily exclude subdirectories from operations | ||
| 1011 | without having to remove the Dired marks on files in those | ||
| 1012 | subdirectories. | ||
| 1013 | |||
| 1014 | @node Dired Updating | ||
| 1015 | @section Updating the Dired Buffer | ||
| 1016 | @cindex updating Dired buffer | ||
| 1017 | @cindex refreshing displayed files | ||
| 1018 | |||
| 1019 | This section describes commands to update the Dired buffer to reflect | ||
| 1020 | outside (non-Dired) changes in the directories and files, and to delete | ||
| 1021 | part of the Dired buffer. | ||
| 1022 | |||
| 1023 | @table @kbd | ||
| 1024 | @item g | ||
| 1025 | Update the entire contents of the Dired buffer (@code{revert-buffer}). | ||
| 1026 | |||
| 1027 | @item l | ||
| 1028 | Update the specified files (@code{dired-do-redisplay}). You specify the | ||
| 1029 | files for @kbd{l} in the same way as for file operations. | ||
| 1030 | |||
| 1031 | @item k | ||
| 1032 | Delete the specified @emph{file lines}---not the files, just the lines | ||
| 1033 | (@code{dired-do-kill-lines}). | ||
| 1034 | |||
| 1035 | @item s | ||
| 1036 | Toggle between alphabetical order and date/time order | ||
| 1037 | (@code{dired-sort-toggle-or-edit}). | ||
| 1038 | |||
| 1039 | @item C-u s @var{switches} @key{RET} | ||
| 1040 | Refresh the Dired buffer using @var{switches} as | ||
| 1041 | @code{dired-listing-switches}. | ||
| 1042 | @end table | ||
| 1043 | |||
| 1044 | @kindex g @r{(Dired)} | ||
| 1045 | @findex revert-buffer @r{(Dired)} | ||
| 1046 | Type @kbd{g} (@code{revert-buffer}) to update the contents of the | ||
| 1047 | Dired buffer, based on changes in the files and directories listed. | ||
| 1048 | This preserves all marks except for those on files that have vanished. | ||
| 1049 | Hidden subdirectories are updated but remain hidden. | ||
| 1050 | |||
| 1051 | @kindex l @r{(Dired)} | ||
| 1052 | @findex dired-do-redisplay | ||
| 1053 | To update only some of the files, type @kbd{l} | ||
| 1054 | (@code{dired-do-redisplay}). Like the Dired file-operating commands, | ||
| 1055 | this command operates on the next @var{n} files (or previous | ||
| 1056 | @minus{}@var{n} files), or on the marked files if any, or on the | ||
| 1057 | current file. Updating the files means reading their current status, | ||
| 1058 | then updating their lines in the buffer to indicate that status. | ||
| 1059 | |||
| 1060 | If you use @kbd{l} on a subdirectory header line, it updates the | ||
| 1061 | contents of the corresponding subdirectory. | ||
| 1062 | |||
| 1063 | @kindex k @r{(Dired)} | ||
| 1064 | @findex dired-do-kill-lines | ||
| 1065 | To delete the specified @emph{file lines} from the buffer---not | ||
| 1066 | delete the files---type @kbd{k} (@code{dired-do-kill-lines}). Like | ||
| 1067 | the file-operating commands, this command operates on the next @var{n} | ||
| 1068 | files, or on the marked files if any; but it does not operate on the | ||
| 1069 | current file as a last resort. | ||
| 1070 | |||
| 1071 | If you use @kbd{k} with a numeric prefix argument to kill the line | ||
| 1072 | for a file that is a directory, which you have inserted in the Dired | ||
| 1073 | buffer as a subdirectory, it deletes that subdirectory from the buffer | ||
| 1074 | as well. Typing @kbd{C-u k} on the header line for a subdirectory | ||
| 1075 | also deletes the subdirectory from the Dired buffer. | ||
| 1076 | |||
| 1077 | The @kbd{g} command brings back any individual lines that you have | ||
| 1078 | killed in this way, but not subdirectories---you must use @kbd{i} to | ||
| 1079 | reinsert a subdirectory. | ||
| 1080 | |||
| 1081 | @cindex Dired sorting | ||
| 1082 | @cindex sorting Dired buffer | ||
| 1083 | @kindex s @r{(Dired)} | ||
| 1084 | @findex dired-sort-toggle-or-edit | ||
| 1085 | The files in a Dired buffers are normally listed in alphabetical order | ||
| 1086 | by file names. Alternatively Dired can sort them by date/time. The | ||
| 1087 | Dired command @kbd{s} (@code{dired-sort-toggle-or-edit}) switches | ||
| 1088 | between these two sorting modes. The mode line in a Dired buffer | ||
| 1089 | indicates which way it is currently sorted---by name, or by date. | ||
| 1090 | |||
| 1091 | @kbd{C-u s @var{switches} @key{RET}} lets you specify a new value for | ||
| 1092 | @code{dired-listing-switches}. | ||
| 1093 | |||
| 1094 | @node Dired and Find | ||
| 1095 | @section Dired and @code{find} | ||
| 1096 | @cindex @code{find} and Dired | ||
| 1097 | |||
| 1098 | You can select a set of files for display in a Dired buffer more | ||
| 1099 | flexibly by using the @code{find} utility to choose the files. | ||
| 1100 | |||
| 1101 | @findex find-name-dired | ||
| 1102 | To search for files with names matching a wildcard pattern use | ||
| 1103 | @kbd{M-x find-name-dired}. It reads arguments @var{directory} and | ||
| 1104 | @var{pattern}, and chooses all the files in @var{directory} or its | ||
| 1105 | subdirectories whose individual names match @var{pattern}. | ||
| 1106 | |||
| 1107 | The files thus chosen are displayed in a Dired buffer, in which the | ||
| 1108 | ordinary Dired commands are available. | ||
| 1109 | |||
| 1110 | @findex find-grep-dired | ||
| 1111 | If you want to test the contents of files, rather than their names, | ||
| 1112 | use @kbd{M-x find-grep-dired}. This command reads two minibuffer | ||
| 1113 | arguments, @var{directory} and @var{regexp}; it chooses all the files in | ||
| 1114 | @var{directory} or its subdirectories that contain a match for | ||
| 1115 | @var{regexp}. It works by running the programs @code{find} and | ||
| 1116 | @code{grep}. See also @kbd{M-x grep-find}, in @ref{Grep Searching}. | ||
| 1117 | Remember to write the regular expression for @code{grep}, not for Emacs. | ||
| 1118 | (An alternative method of showing files whose contents match a given | ||
| 1119 | regexp is the @kbd{% g @var{regexp}} command, see @ref{Marks vs Flags}.) | ||
| 1120 | |||
| 1121 | @findex find-dired | ||
| 1122 | The most general command in this series is @kbd{M-x find-dired}, which | ||
| 1123 | lets you specify any condition that @code{find} can test. It takes two | ||
| 1124 | minibuffer arguments, @var{directory} and @var{find-args}; it runs | ||
| 1125 | @code{find} in @var{directory}, passing @var{find-args} to tell | ||
| 1126 | @code{find} what condition to test. To use this command, you need to | ||
| 1127 | know how to use @code{find}. | ||
| 1128 | |||
| 1129 | @vindex find-ls-option | ||
| 1130 | The format of listing produced by these commands is controlled by the | ||
| 1131 | variable @code{find-ls-option}, whose default value specifies using | ||
| 1132 | options @samp{-ld} for @code{ls}. If your listings are corrupted, you | ||
| 1133 | may need to change the value of this variable. | ||
| 1134 | |||
| 1135 | @findex locate | ||
| 1136 | @findex locate-with-filter | ||
| 1137 | @cindex file database (locate) | ||
| 1138 | @vindex locate-command | ||
| 1139 | The command @kbd{M-x locate} provides a similar interface to the | ||
| 1140 | @code{locate} program. @kbd{M-x locate-with-filter} is similar, but | ||
| 1141 | keeps only files whose names match a given regular expression. | ||
| 1142 | |||
| 1143 | These buffers don't work entirely like ordinary Dired buffers: file | ||
| 1144 | operations work, but do not always automatically update the buffer. | ||
| 1145 | Reverting the buffer with @kbd{g} deletes all inserted subdirectories, | ||
| 1146 | and erases all flags and marks. | ||
| 1147 | |||
| 1148 | @node Wdired | ||
| 1149 | @section Editing the Dired Buffer | ||
| 1150 | |||
| 1151 | @cindex wdired mode | ||
| 1152 | @findex wdired-change-to-wdired-mode | ||
| 1153 | Wdired is a special mode that allows you to perform file operations | ||
| 1154 | by editing the Dired buffer directly (the ``W'' in ``Wdired'' stands | ||
| 1155 | for ``writable.'') To enter Wdired mode, type @kbd{C-x C-q} or @kbd{M-x | ||
| 1156 | wdired-change-to-wdired-mode} while in a Dired buffer. Alternatively, | ||
| 1157 | use @samp{Edit File Names} in the @samp{Immediate} menu bar menu. | ||
| 1158 | |||
| 1159 | @findex wdired-finish-edit | ||
| 1160 | While in Wdired mode, you can rename files by editing the file names | ||
| 1161 | displayed in the Dired buffer. All the ordinary Emacs editing | ||
| 1162 | commands, including rectangle operations and @code{query-replace}, are | ||
| 1163 | available for this. Once you are done editing, type @kbd{C-c C-c} | ||
| 1164 | (@code{wdired-finish-edit}). This applies your changes and switches | ||
| 1165 | back to ordinary Dired mode. | ||
| 1166 | |||
| 1167 | Apart from simply renaming files, you can move a file to another | ||
| 1168 | directory by typing in the new file name (either absolute or | ||
| 1169 | relative). To mark a file for deletion, delete the entire file name. | ||
| 1170 | To change the target of a symbolic link, edit the link target name | ||
| 1171 | which appears next to the link name. | ||
| 1172 | |||
| 1173 | The rest of the text in the buffer, such as the file sizes and | ||
| 1174 | modification dates, is marked read-only, so you can't edit it. | ||
| 1175 | However, if you set @code{wdired-allow-to-change-permissions} to | ||
| 1176 | @code{t}, you can edit the file permissions. For example, you can | ||
| 1177 | change @samp{-rw-r--r--} to @samp{-rw-rw-rw-} to make a file | ||
| 1178 | world-writable. These changes also take effect when you type @kbd{C-c | ||
| 1179 | C-c}. | ||
| 1180 | |||
| 1181 | @node Image-Dired | ||
| 1182 | @section Viewing Image Thumbnails in Dired | ||
| 1183 | @cindex image-dired mode | ||
| 1184 | @cindex image-dired | ||
| 1185 | |||
| 1186 | Image-Dired is a facility for browsing image files. It provides viewing | ||
| 1187 | the images either as thumbnails or in full size, either inside Emacs | ||
| 1188 | or through an external viewer. | ||
| 1189 | |||
| 1190 | @kindex C-t d @r{(Image-Dired)} | ||
| 1191 | @findex image-dired-display-thumbs | ||
| 1192 | To enter Image-Dired, mark the image files you want to look at in | ||
| 1193 | the Dired buffer, using @kbd{m} as usual. Then type @kbd{C-t d} | ||
| 1194 | (@code{image-dired-display-thumbs}). This creates and switches to a | ||
| 1195 | buffer containing image-dired, corresponding to the marked files. | ||
| 1196 | |||
| 1197 | You can also enter Image-Dired directly by typing @kbd{M-x | ||
| 1198 | image-dired}. This prompts for a directory; specify one that has | ||
| 1199 | image files. This creates thumbnails for all the images in that | ||
| 1200 | directory, and displays them all in the ``thumbnail buffer.'' This | ||
| 1201 | takes a long time if the directory contains many image files, and it | ||
| 1202 | asks for confirmation if the number of image files exceeds | ||
| 1203 | @code{image-dired-show-all-from-dir-max-files}. | ||
| 1204 | |||
| 1205 | With point in the thumbnail buffer, you can type @kbd{RET} | ||
| 1206 | (@code{image-dired-display-thumbnail-original-image}) to display a | ||
| 1207 | sized version of it in another window. This sizes the image to fit | ||
| 1208 | the window. Use the arrow keys to move around in the buffer. For | ||
| 1209 | easy browsing, use @kbd{SPC} | ||
| 1210 | (@code{image-dired-display-next-thumbnail-original}) to advance and | ||
| 1211 | display the next image. Typing @kbd{DEL} | ||
| 1212 | (@code{image-dired-display-previous-thumbnail-original}) backs up to | ||
| 1213 | the previous thumbnail and displays that instead. | ||
| 1214 | |||
| 1215 | @vindex image-dired-external-viewer | ||
| 1216 | To view and the image in its original size, either provide a prefix | ||
| 1217 | argument (@kbd{C-u}) before pressing @kbd{RET}, or type | ||
| 1218 | @kbd{C-@key{RET}} (@code{image-dired-thumbnail-display-external}) to | ||
| 1219 | display the image in an external viewer. You must first configure | ||
| 1220 | @code{image-dired-external-viewer}. | ||
| 1221 | |||
| 1222 | You can delete images through Image-Dired also. Type @kbd{d} | ||
| 1223 | (@code{image-dired-flag-thumb-original-file}) to flag the image file | ||
| 1224 | for deletion in the Dired buffer. You can also delete the thumbnail | ||
| 1225 | image from the thumbnail buffer with @kbd{C-d} | ||
| 1226 | (@code{image-dired-delete-char}). | ||
| 1227 | |||
| 1228 | More advanced features include @dfn{image tags}, which are metadata | ||
| 1229 | used to categorize image files. The tags are stored in a plain text | ||
| 1230 | file configured by @code{image-dired-db-file}. | ||
| 1231 | |||
| 1232 | To tag image files, mark them in the dired buffer (you can also mark | ||
| 1233 | files in Dired from the thumbnail buffer by typing @kbd{m}) and type | ||
| 1234 | @kbd{C-t t} (@code{image-dired-tag-files}). You will be prompted for | ||
| 1235 | a tag. To mark files having a certain tag, type @kbd{C-t f} | ||
| 1236 | (@code{image-dired-mark-tagged-files}). After marking image files | ||
| 1237 | with a certain tag, you can use @kbd{C-t d} to view them. | ||
| 1238 | |||
| 1239 | You can also tag a file directly from the thumbnail buffer by typing | ||
| 1240 | @kbd{t t} and you can remove a tag by typing @kbd{t r}. There is also | ||
| 1241 | a special ``tag'' called ``comment'' for each file (it is not a tag in | ||
| 1242 | the exact same sense as the other tags, it is handled slightly | ||
| 1243 | different). That is used to enter a comment or description about the | ||
| 1244 | image. You comment a file from the thumbnail buffer by typing | ||
| 1245 | @kbd{c}. You will be prompted for a comment. Type @kbd{C-t c} to add | ||
| 1246 | a comment from Dired (@code{image-dired-dired-comment-files}). | ||
| 1247 | |||
| 1248 | Image-Dired also provides simple image manipulation. In the | ||
| 1249 | thumbnail buffer, type @kbd{L} to rotate the original image 90 degrees | ||
| 1250 | anti clockwise, and @kbd{R} to rotate it 90 degrees clockwise. This | ||
| 1251 | rotation is lossless, and uses an external utility called JpegTRAN. | ||
| 1252 | |||
| 1253 | @node Misc Dired Features | ||
| 1254 | @section Other Dired Features | ||
| 1255 | |||
| 1256 | @kindex + @r{(Dired)} | ||
| 1257 | @findex dired-create-directory | ||
| 1258 | An unusual Dired file-operation command is @kbd{+} | ||
| 1259 | (@code{dired-create-directory}). This command reads a directory name, | ||
| 1260 | and creates the directory if it does not already exist. | ||
| 1261 | |||
| 1262 | @cindex Adding to the kill ring in Dired. | ||
| 1263 | @kindex w @r{(Dired)} | ||
| 1264 | @findex dired-copy-filename-as-kill | ||
| 1265 | The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the | ||
| 1266 | names of the marked (or next @var{n}) files into the kill ring, as if | ||
| 1267 | you had killed them with @kbd{C-w}. The names are separated by a space. | ||
| 1268 | |||
| 1269 | With a zero prefix argument, this uses the absolute file name of | ||
| 1270 | each marked file. With just @kbd{C-u} as the prefix argument, it uses | ||
| 1271 | file names relative to the Dired buffer's default directory. (This | ||
| 1272 | can still contain slashes if in a subdirectory.) As a special case, | ||
| 1273 | if point is on a directory headerline, @kbd{w} gives you the absolute | ||
| 1274 | name of that directory. Any prefix argument or marked files are | ||
| 1275 | ignored in this case. | ||
| 1276 | |||
| 1277 | The main purpose of this command is so that you can yank the file | ||
| 1278 | names into arguments for other Emacs commands. It also displays what | ||
| 1279 | it added to the kill ring, so you can use it to display the list of | ||
| 1280 | currently marked files in the echo area. | ||
| 1281 | |||
| 1282 | @findex dired-compare-directories | ||
| 1283 | The command @kbd{M-x dired-compare-directories} is used to compare | ||
| 1284 | the current Dired buffer with another directory. It marks all the files | ||
| 1285 | that are ``different'' between the two directories. It puts these marks | ||
| 1286 | in all Dired buffers where these files are listed, which of course includes | ||
| 1287 | the current buffer. | ||
| 1288 | |||
| 1289 | The default comparison method (used if you type @key{RET} at the | ||
| 1290 | prompt) is to compare just the file names---each file name that does | ||
| 1291 | not appear in the other directory is ``different.'' You can specify | ||
| 1292 | more stringent comparisons by entering a Lisp expression, which can | ||
| 1293 | refer to the variables @code{size1} and @code{size2}, the respective | ||
| 1294 | file sizes; @code{mtime1} and @code{mtime2}, the last modification | ||
| 1295 | times in seconds, as floating point numbers; and @code{fa1} and | ||
| 1296 | @code{fa2}, the respective file attribute lists (as returned by the | ||
| 1297 | function @code{file-attributes}). This expression is evaluated for | ||
| 1298 | each pair of like-named files, and if the expression's value is | ||
| 1299 | non-@code{nil}, those files are considered ``different.'' | ||
| 1300 | |||
| 1301 | For instance, the sequence @code{M-x dired-compare-directories | ||
| 1302 | @key{RET} (> mtime1 mtime2) @key{RET}} marks files newer in this | ||
| 1303 | directory than in the other, and marks files older in the other | ||
| 1304 | directory than in this one. It also marks files with no counterpart, | ||
| 1305 | in both directories, as always. | ||
| 1306 | |||
| 1307 | @cindex drag and drop, Dired | ||
| 1308 | On the X window system, Emacs supports the ``drag and drop'' | ||
| 1309 | protocol. You can drag a file object from another program, and drop | ||
| 1310 | it onto a Dired buffer; this either moves, copies, or creates a link | ||
| 1311 | to the file in that directory. Precisely which action is taken is | ||
| 1312 | determined by the originating program. Dragging files out of a Dired | ||
| 1313 | buffer is currently not supported. | ||
| 1314 | |||
| 1315 | @ignore | ||
| 1316 | arch-tag: d105f9b9-fc1b-4c5f-a949-9b2cf3ca2fc1 | ||
| 1317 | @end ignore | ||
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi new file mode 100644 index 00000000000..21a65999ec3 --- /dev/null +++ b/doc/emacs/display.texi | |||
| @@ -0,0 +1,1259 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Display, Search, Registers, Top | ||
| 6 | @chapter Controlling the Display | ||
| 7 | |||
| 8 | Since only part of a large buffer fits in the window, Emacs tries to | ||
| 9 | show a part that is likely to be interesting. Display-control | ||
| 10 | commands allow you to specify which part of the text you want to see, | ||
| 11 | and how to display it. Many variables also affect the details of | ||
| 12 | redisplay. Unless otherwise stated, the variables described in this | ||
| 13 | chapter have their effect by customizing redisplay itself; therefore, | ||
| 14 | their values only make a difference at the time of redisplay. | ||
| 15 | |||
| 16 | @menu | ||
| 17 | * Scrolling:: Commands to move text up and down in a window. | ||
| 18 | * Auto Scrolling:: Redisplay scrolls text automatically when needed. | ||
| 19 | * Horizontal Scrolling:: Moving text left and right in a window. | ||
| 20 | * Follow Mode:: Follow mode lets two windows scroll as one. | ||
| 21 | * Faces:: How to change the display style using faces. | ||
| 22 | * Standard Faces:: Emacs' predefined faces. | ||
| 23 | * Font Lock:: Minor mode for syntactic highlighting using faces. | ||
| 24 | * Highlight Interactively:: Tell Emacs what text to highlight. | ||
| 25 | * Fringes:: Enabling or disabling window fringes. | ||
| 26 | * Displaying Boundaries:: Displaying top and bottom of the buffer. | ||
| 27 | * Useless Whitespace:: Showing possibly-spurious trailing whitespace. | ||
| 28 | * Selective Display:: Hiding lines with lots of indentation. | ||
| 29 | * Optional Mode Line:: Optional mode line display features. | ||
| 30 | * Text Display:: How text characters are normally displayed. | ||
| 31 | * Cursor Display:: Features for displaying the cursor. | ||
| 32 | * Line Truncation:: Truncating lines to fit the screen width instead | ||
| 33 | of continuing them to multiple screen lines. | ||
| 34 | * Display Custom:: Information on variables for customizing display. | ||
| 35 | @end menu | ||
| 36 | |||
| 37 | @node Scrolling | ||
| 38 | @section Scrolling | ||
| 39 | |||
| 40 | If a buffer contains text that is too large to fit entirely within a | ||
| 41 | window that is displaying the buffer, Emacs shows a contiguous portion of | ||
| 42 | the text. The portion shown always contains point. | ||
| 43 | |||
| 44 | @cindex scrolling | ||
| 45 | @dfn{Scrolling} means moving text up or down in the window so that | ||
| 46 | different parts of the text are visible. Scrolling ``forward'' or | ||
| 47 | ``up'' means that text moves up, and new text appears at the bottom. | ||
| 48 | Scrolling ``backward'' or ``down'' moves text down, and new text | ||
| 49 | appears at the top. | ||
| 50 | |||
| 51 | Scrolling happens automatically if you move point past the bottom or | ||
| 52 | top of the window. You can also scroll explicitly with the commands | ||
| 53 | in this section. | ||
| 54 | |||
| 55 | @table @kbd | ||
| 56 | @item C-l | ||
| 57 | Clear screen and redisplay, scrolling the selected window to center | ||
| 58 | point vertically within it (@code{recenter}). | ||
| 59 | @item C-v | ||
| 60 | Scroll forward (a windowful or a specified number of lines) (@code{scroll-up}). | ||
| 61 | @item @key{NEXT} | ||
| 62 | @itemx @key{PAGEDOWN} | ||
| 63 | Likewise, scroll forward. | ||
| 64 | @item M-v | ||
| 65 | Scroll backward (@code{scroll-down}). | ||
| 66 | @item @key{PRIOR} | ||
| 67 | @itemx @key{PAGEUP} | ||
| 68 | Likewise, scroll backward. | ||
| 69 | @item @var{arg} C-l | ||
| 70 | Scroll so point is on line @var{arg} (@code{recenter}). | ||
| 71 | @item C-M-l | ||
| 72 | Scroll heuristically to bring useful information onto the screen | ||
| 73 | (@code{reposition-window}). | ||
| 74 | @end table | ||
| 75 | |||
| 76 | @kindex C-l | ||
| 77 | @findex recenter | ||
| 78 | The most basic scrolling command is @kbd{C-l} (@code{recenter}) with | ||
| 79 | no argument. It scrolls the selected window so that point is halfway | ||
| 80 | down from the top of the window. On a text terminal, it also clears | ||
| 81 | the screen and redisplays all windows. That is useful in case the | ||
| 82 | screen is garbled (@pxref{Screen Garbled}). | ||
| 83 | |||
| 84 | @kindex C-v | ||
| 85 | @kindex M-v | ||
| 86 | @kindex NEXT | ||
| 87 | @kindex PRIOR | ||
| 88 | @kindex PAGEDOWN | ||
| 89 | @kindex PAGEUP | ||
| 90 | @findex scroll-up | ||
| 91 | @findex scroll-down | ||
| 92 | To read the buffer a windowful at a time, use @kbd{C-v} | ||
| 93 | (@code{scroll-up}) with no argument. This scrolls forward by nearly | ||
| 94 | the whole window height. The effect is to take the two lines at the | ||
| 95 | bottom of the window and put them at the top, followed by nearly a | ||
| 96 | whole windowful of lines that were not previously visible. If point | ||
| 97 | was in the text that scrolled off the top, it ends up at the new top | ||
| 98 | of the window. | ||
| 99 | |||
| 100 | @vindex next-screen-context-lines | ||
| 101 | @kbd{M-v} (@code{scroll-down}) with no argument scrolls backward in | ||
| 102 | a similar way, also with overlap. The number of lines of overlap that | ||
| 103 | the @kbd{C-v} or @kbd{M-v} commands leave is controlled by the | ||
| 104 | variable @code{next-screen-context-lines}; by default, it is 2. The | ||
| 105 | function keys @key{NEXT} and @key{PRIOR}, or @key{PAGEDOWN} and | ||
| 106 | @key{PAGEUP}, are equivalent to @kbd{C-v} and @kbd{M-v}. | ||
| 107 | |||
| 108 | The commands @kbd{C-v} and @kbd{M-v} with a numeric argument scroll | ||
| 109 | the text in the selected window up or down a few lines. @kbd{C-v} | ||
| 110 | with an argument moves the text and point up, together, that many | ||
| 111 | lines; it brings the same number of new lines into view at the bottom | ||
| 112 | of the window. @kbd{M-v} with numeric argument scrolls the text | ||
| 113 | downward, bringing that many new lines into view at the top of the | ||
| 114 | window. @kbd{C-v} with a negative argument is like @kbd{M-v} and vice | ||
| 115 | versa. | ||
| 116 | |||
| 117 | The names of scroll commands are based on the direction that the | ||
| 118 | text moves in the window. Thus, the command to scroll forward is | ||
| 119 | called @code{scroll-up} because it moves the text upward on the | ||
| 120 | screen. The keys @key{PAGEDOWN} and @key{PAGEUP} derive their names | ||
| 121 | and customary meanings from a different convention that developed | ||
| 122 | elsewhere; hence the strange result that @key{PAGEDOWN} runs | ||
| 123 | @code{scroll-up}. | ||
| 124 | |||
| 125 | @vindex scroll-preserve-screen-position | ||
| 126 | Some users like the full-screen scroll commands to keep point at the | ||
| 127 | same screen line. To enable this behavior, set the variable | ||
| 128 | @code{scroll-preserve-screen-position} to a non-@code{nil} value. In | ||
| 129 | this mode, when these commands would scroll the text around point off | ||
| 130 | the screen, or within @code{scroll-margin} lines of the edge, they | ||
| 131 | move point to keep the same vertical position within the window. | ||
| 132 | This mode is convenient for browsing through a file by scrolling by | ||
| 133 | screenfuls; if you come back to the screen where you started, point | ||
| 134 | goes back to the line where it started. However, this mode is | ||
| 135 | inconvenient when you move to the next screen in order to move point | ||
| 136 | to the text there. | ||
| 137 | |||
| 138 | Another way to do scrolling is with @kbd{C-l} with a numeric argument. | ||
| 139 | @kbd{C-l} does not clear the screen when given an argument; it only scrolls | ||
| 140 | the selected window. With a positive argument @var{n}, it repositions text | ||
| 141 | to put point @var{n} lines down from the top. An argument of zero puts | ||
| 142 | point on the very top line. Point does not move with respect to the text; | ||
| 143 | rather, the text and point move rigidly on the screen. @kbd{C-l} with a | ||
| 144 | negative argument puts point that many lines from the bottom of the window. | ||
| 145 | For example, @kbd{C-u - 1 C-l} puts point on the bottom line, and @kbd{C-u | ||
| 146 | - 5 C-l} puts it five lines from the bottom. @kbd{C-u C-l} scrolls to put | ||
| 147 | point at the center (vertically) of the selected window. | ||
| 148 | |||
| 149 | @kindex C-M-l | ||
| 150 | @findex reposition-window | ||
| 151 | The @kbd{C-M-l} command (@code{reposition-window}) scrolls the current | ||
| 152 | window heuristically in a way designed to get useful information onto | ||
| 153 | the screen. For example, in a Lisp file, this command tries to get the | ||
| 154 | entire current defun onto the screen if possible. | ||
| 155 | |||
| 156 | @node Auto Scrolling | ||
| 157 | @section Automatic Scrolling | ||
| 158 | |||
| 159 | @vindex scroll-conservatively | ||
| 160 | Redisplay scrolls the buffer automatically when point moves out of | ||
| 161 | the visible portion of the text. The purpose of automatic scrolling | ||
| 162 | is to make point visible, but you can customize many aspects of how | ||
| 163 | this is done. | ||
| 164 | |||
| 165 | Normally, automatic scrolling centers point vertically within the | ||
| 166 | window. However, if you set @code{scroll-conservatively} to a small | ||
| 167 | number @var{n}, then if you move point just a little off the | ||
| 168 | screen---less than @var{n} lines---then Emacs scrolls the text just | ||
| 169 | far enough to bring point back on screen. By default, | ||
| 170 | @code{scroll-conservatively} is@tie{}0. | ||
| 171 | |||
| 172 | @cindex aggressive scrolling | ||
| 173 | @vindex scroll-up-aggressively | ||
| 174 | @vindex scroll-down-aggressively | ||
| 175 | When the window does scroll by a longer distance, you can control | ||
| 176 | how aggressively it scrolls, by setting the variables | ||
| 177 | @code{scroll-up-aggressively} and @code{scroll-down-aggressively}. | ||
| 178 | The value of @code{scroll-up-aggressively} should be either | ||
| 179 | @code{nil}, or a fraction @var{f} between 0 and 1. A fraction | ||
| 180 | specifies where on the screen to put point when scrolling upward. | ||
| 181 | More precisely, when a window scrolls up because point is above the | ||
| 182 | window start, the new start position is chosen to put point @var{f} | ||
| 183 | part of the window height from the top. The larger @var{f}, the more | ||
| 184 | aggressive the scrolling. | ||
| 185 | |||
| 186 | @code{nil}, which is the default, scrolls to put point at the center. | ||
| 187 | So it is equivalent to .5. | ||
| 188 | |||
| 189 | Likewise, @code{scroll-down-aggressively} is used for scrolling | ||
| 190 | down. The value, @var{f}, specifies how far point should be placed | ||
| 191 | from the bottom of the window; thus, as with | ||
| 192 | @code{scroll-up-aggressively}, a larger value is more aggressive. | ||
| 193 | |||
| 194 | @vindex scroll-margin | ||
| 195 | The variable @code{scroll-margin} restricts how close point can come | ||
| 196 | to the top or bottom of a window. Its value is a number of screen | ||
| 197 | lines; if point comes within that many lines of the top or bottom of the | ||
| 198 | window, Emacs recenters the window. By default, @code{scroll-margin} is | ||
| 199 | 0. | ||
| 200 | |||
| 201 | @node Horizontal Scrolling | ||
| 202 | @section Horizontal Scrolling | ||
| 203 | @cindex horizontal scrolling | ||
| 204 | |||
| 205 | @dfn{Horizontal scrolling} means shifting all the lines sideways | ||
| 206 | within a window---so that some of the text near the left margin is not | ||
| 207 | displayed at all. When the text in a window is scrolled horizontally, | ||
| 208 | text lines are truncated rather than continued (@pxref{Line | ||
| 209 | Truncation}). Whenever a window shows truncated lines, Emacs | ||
| 210 | automatically updates its horizontal scrolling whenever point moves | ||
| 211 | off the left or right edge of the screen. You can also use these | ||
| 212 | commands to do explicit horizontal scrolling. | ||
| 213 | |||
| 214 | @table @kbd | ||
| 215 | @item C-x < | ||
| 216 | Scroll text in current window to the left (@code{scroll-left}). | ||
| 217 | @item C-x > | ||
| 218 | Scroll to the right (@code{scroll-right}). | ||
| 219 | @end table | ||
| 220 | |||
| 221 | @kindex C-x < | ||
| 222 | @kindex C-x > | ||
| 223 | @findex scroll-left | ||
| 224 | @findex scroll-right | ||
| 225 | The command @kbd{C-x <} (@code{scroll-left}) scrolls the selected | ||
| 226 | window to the left by @var{n} columns with argument @var{n}. This moves | ||
| 227 | part of the beginning of each line off the left edge of the window. | ||
| 228 | With no argument, it scrolls by almost the full width of the window (two | ||
| 229 | columns less, to be precise). | ||
| 230 | |||
| 231 | @kbd{C-x >} (@code{scroll-right}) scrolls similarly to the right. The | ||
| 232 | window cannot be scrolled any farther to the right once it is displayed | ||
| 233 | normally (with each line starting at the window's left margin); | ||
| 234 | attempting to do so has no effect. This means that you don't have to | ||
| 235 | calculate the argument precisely for @w{@kbd{C-x >}}; any sufficiently large | ||
| 236 | argument will restore the normal display. | ||
| 237 | |||
| 238 | If you use those commands to scroll a window horizontally, that sets | ||
| 239 | a lower bound for automatic horizontal scrolling. Automatic scrolling | ||
| 240 | will continue to scroll the window, but never farther to the right | ||
| 241 | than the amount you previously set by @code{scroll-left}. | ||
| 242 | |||
| 243 | @vindex hscroll-margin | ||
| 244 | The value of the variable @code{hscroll-margin} controls how close | ||
| 245 | to the window's edges point is allowed to get before the window will | ||
| 246 | be automatically scrolled. It is measured in columns. If the value | ||
| 247 | is 5, then moving point within 5 columns of the edge causes horizontal | ||
| 248 | scrolling away from that edge. | ||
| 249 | |||
| 250 | @vindex hscroll-step | ||
| 251 | The variable @code{hscroll-step} determines how many columns to | ||
| 252 | scroll the window when point gets too close to the edge. If it's | ||
| 253 | zero, horizontal scrolling centers point horizontally within the | ||
| 254 | window. If it's a positive integer, it specifies the number of | ||
| 255 | columns to scroll by. If it's a floating-point number, it specifies | ||
| 256 | the fraction of the window's width to scroll by. The default is zero. | ||
| 257 | |||
| 258 | @vindex auto-hscroll-mode | ||
| 259 | To disable automatic horizontal scrolling, set the variable | ||
| 260 | @code{auto-hscroll-mode} to @code{nil}. | ||
| 261 | |||
| 262 | @node Follow Mode | ||
| 263 | @section Follow Mode | ||
| 264 | @cindex Follow mode | ||
| 265 | @cindex mode, Follow | ||
| 266 | @findex follow-mode | ||
| 267 | @cindex windows, synchronizing | ||
| 268 | @cindex synchronizing windows | ||
| 269 | |||
| 270 | @dfn{Follow mode} is a minor mode that makes two windows, both | ||
| 271 | showing the same buffer, scroll as a single tall ``virtual window.'' | ||
| 272 | To use Follow mode, go to a frame with just one window, split it into | ||
| 273 | two side-by-side windows using @kbd{C-x 3}, and then type @kbd{M-x | ||
| 274 | follow-mode}. From then on, you can edit the buffer in either of the | ||
| 275 | two windows, or scroll either one; the other window follows it. | ||
| 276 | |||
| 277 | In Follow mode, if you move point outside the portion visible in one | ||
| 278 | window and into the portion visible in the other window, that selects | ||
| 279 | the other window---again, treating the two as if they were parts of | ||
| 280 | one large window. | ||
| 281 | |||
| 282 | To turn off Follow mode, type @kbd{M-x follow-mode} a second time. | ||
| 283 | |||
| 284 | @node Faces | ||
| 285 | @section Using Multiple Typefaces | ||
| 286 | @cindex faces | ||
| 287 | |||
| 288 | You can specify various styles for displaying text using | ||
| 289 | @dfn{faces}. Each face can specify various @dfn{face attributes}, | ||
| 290 | such as the font family, the height, weight and slant of the | ||
| 291 | characters, the foreground and background color, and underlining or | ||
| 292 | overlining. A face does not have to specify all of these attributes; | ||
| 293 | often it inherits most of them from another face. | ||
| 294 | |||
| 295 | On graphical display, all the Emacs face attributes are meaningful. | ||
| 296 | On a text-only terminal, only some of them work. Some text-only | ||
| 297 | terminals support inverse video, bold, and underline attributes; some | ||
| 298 | support colors. Text-only terminals generally do not support changing | ||
| 299 | the height and width or the font family. | ||
| 300 | |||
| 301 | Emacs uses faces automatically for highlighting, through the work of | ||
| 302 | Font Lock mode. @xref{Font Lock}, for more information about Font | ||
| 303 | Lock mode and syntactic highlighting. You can print out the buffer | ||
| 304 | with the highlighting that appears on your screen using the command | ||
| 305 | @code{ps-print-buffer-with-faces}. @xref{PostScript}. | ||
| 306 | |||
| 307 | You control the appearance of a part of the text in the buffer by | ||
| 308 | specifying the face or faces to use for it. The style of display used | ||
| 309 | for any given character is determined by combining the attributes of | ||
| 310 | all the applicable faces specified for that character. Any attribute | ||
| 311 | that isn't specified by these faces is taken from the @code{default} face, | ||
| 312 | whose attributes reflect the default settings of the frame itself. | ||
| 313 | |||
| 314 | Enriched mode, the mode for editing formatted text, includes several | ||
| 315 | commands and menus for specifying faces for text in the buffer. | ||
| 316 | @xref{Format Faces}, for how to specify the font for text in the | ||
| 317 | buffer. @xref{Format Colors}, for how to specify the foreground and | ||
| 318 | background color. | ||
| 319 | |||
| 320 | @cindex face colors, setting | ||
| 321 | @findex set-face-foreground | ||
| 322 | @findex set-face-background | ||
| 323 | To alter the appearance of a face, use the customization buffer. | ||
| 324 | @xref{Face Customization}. You can also use X resources to specify | ||
| 325 | attributes of particular faces (@pxref{Resources}). Alternatively, | ||
| 326 | you can change the foreground and background colors of a specific face | ||
| 327 | with @kbd{M-x set-face-foreground} and @kbd{M-x set-face-background}. | ||
| 328 | These commands prompt in the minibuffer for a face name and a color | ||
| 329 | name, with completion, and then set that face to use the specified | ||
| 330 | color. Changing the colors of the @code{default} face also changes | ||
| 331 | the foreground and background colors on all frames, both existing and | ||
| 332 | those to be created in the future. (You can also set foreground and | ||
| 333 | background colors for the current frame only; see @ref{Frame | ||
| 334 | Parameters}.) | ||
| 335 | |||
| 336 | If you want to alter the appearance of all Emacs frames, you need to | ||
| 337 | customize the frame parameters in the variable | ||
| 338 | @code{default-frame-alist}; see @ref{Creating Frames, | ||
| 339 | default-frame-alist}. | ||
| 340 | |||
| 341 | Emacs can correctly display variable-width fonts, but Emacs commands | ||
| 342 | that calculate width and indentation do not know how to calculate | ||
| 343 | variable widths. This can sometimes lead to incorrect results when | ||
| 344 | you use variable-width fonts. In particular, indentation commands can | ||
| 345 | give inconsistent results, so we recommend you avoid variable-width | ||
| 346 | fonts for editing program source code. Filling will sometimes make | ||
| 347 | lines too long or too short. We plan to address these issues in | ||
| 348 | future Emacs versions. | ||
| 349 | |||
| 350 | @node Standard Faces | ||
| 351 | @section Standard Faces | ||
| 352 | |||
| 353 | @findex list-faces-display | ||
| 354 | To see what faces are currently defined, and what they look like, | ||
| 355 | type @kbd{M-x list-faces-display}. It's possible for a given face to | ||
| 356 | look different in different frames; this command shows the appearance | ||
| 357 | in the frame in which you type it. With a prefix argument, this | ||
| 358 | prompts for a regular expression, and displays only faces with names | ||
| 359 | matching that regular expression. | ||
| 360 | |||
| 361 | Here are the standard faces for specifying text appearance. You can | ||
| 362 | apply them to specific text when you want the effects they produce. | ||
| 363 | |||
| 364 | @table @code | ||
| 365 | @item default | ||
| 366 | This face is used for ordinary text that doesn't specify any face. | ||
| 367 | @item bold | ||
| 368 | This face uses a bold variant of the default font, if it has one. | ||
| 369 | It's up to you to choose a default font that has a bold variant, | ||
| 370 | if you want to use one. | ||
| 371 | @item italic | ||
| 372 | This face uses an italic variant of the default font, if it has one. | ||
| 373 | @item bold-italic | ||
| 374 | This face uses a bold italic variant of the default font, if it has one. | ||
| 375 | @item underline | ||
| 376 | This face underlines text. | ||
| 377 | @item fixed-pitch | ||
| 378 | This face forces use of a particular fixed-width font. | ||
| 379 | @item variable-pitch | ||
| 380 | This face forces use of a particular variable-width font. It's | ||
| 381 | reasonable to customize this face to use a different variable-width font, | ||
| 382 | if you like, but you should not make it a fixed-width font. | ||
| 383 | @item shadow | ||
| 384 | This face is used for making the text less noticeable than the surrounding | ||
| 385 | ordinary text. Usually this can be achieved by using shades of gray in | ||
| 386 | contrast with either black or white default foreground color. | ||
| 387 | @end table | ||
| 388 | |||
| 389 | Here's an incomplete list of faces used to highlight parts of the | ||
| 390 | text temporarily for specific purposes. (Many other modes define | ||
| 391 | their own faces for this purpose.) | ||
| 392 | |||
| 393 | @table @code | ||
| 394 | @item highlight | ||
| 395 | This face is used for highlighting portions of text, in various modes. | ||
| 396 | For example, mouse-sensitive text is highlighted using this face. | ||
| 397 | @item isearch | ||
| 398 | This face is used for highlighting the current Isearch match. | ||
| 399 | @item query-replace | ||
| 400 | This face is used for highlighting the current Query Replace match. | ||
| 401 | @item lazy-highlight | ||
| 402 | This face is used for lazy highlighting of Isearch and Query Replace | ||
| 403 | matches other than the current one. | ||
| 404 | @item region | ||
| 405 | This face is used for displaying a selected region (when Transient Mark | ||
| 406 | mode is enabled---see below). | ||
| 407 | @item secondary-selection | ||
| 408 | This face is used for displaying a secondary X selection (@pxref{Secondary | ||
| 409 | Selection}). | ||
| 410 | @item trailing-whitespace | ||
| 411 | The face for highlighting excess spaces and tabs at the end of a line | ||
| 412 | when @code{show-trailing-whitespace} is non-@code{nil}; see | ||
| 413 | @ref{Useless Whitespace}. | ||
| 414 | @item nobreak-space | ||
| 415 | The face for displaying the character ``nobreak space.'' | ||
| 416 | @item escape-glyph | ||
| 417 | The face for highlighting the @samp{\} or @samp{^} that indicates | ||
| 418 | a control character. It's also used when @samp{\} indicates a | ||
| 419 | nobreak space or nobreak (soft) hyphen. | ||
| 420 | @end table | ||
| 421 | |||
| 422 | @cindex @code{region} face | ||
| 423 | When Transient Mark mode is enabled, the text of the region is | ||
| 424 | highlighted when the mark is active. This uses the face named | ||
| 425 | @code{region}; you can control the style of highlighting by changing the | ||
| 426 | style of this face (@pxref{Face Customization}). @xref{Transient Mark}, | ||
| 427 | for more information about Transient Mark mode and activation and | ||
| 428 | deactivation of the mark. | ||
| 429 | |||
| 430 | These faces control the appearance of parts of the Emacs frame. | ||
| 431 | They exist as faces to provide a consistent way to customize the | ||
| 432 | appearance of these parts of the frame. | ||
| 433 | |||
| 434 | @table @code | ||
| 435 | @item mode-line | ||
| 436 | @itemx modeline | ||
| 437 | This face is used for the mode line of the currently selected window, | ||
| 438 | and for menu bars when toolkit menus are not used. By default, it's | ||
| 439 | drawn with shadows for a ``raised'' effect on graphical displays, and | ||
| 440 | drawn as the inverse of the default face on non-windowed terminals. | ||
| 441 | @code{modeline} is an alias for the @code{mode-line} face, for | ||
| 442 | compatibility with old Emacs versions. | ||
| 443 | @item mode-line-inactive | ||
| 444 | Like @code{mode-line}, but used for mode lines of the windows other | ||
| 445 | than the selected one (if @code{mode-line-in-non-selected-windows} is | ||
| 446 | non-@code{nil}). This face inherits from @code{mode-line}, so changes | ||
| 447 | in that face affect mode lines in all windows. | ||
| 448 | @item mode-line-highlight | ||
| 449 | Like @code{highlight}, but used for portions of text on mode lines. | ||
| 450 | @item mode-line-buffer-id | ||
| 451 | This face is used for buffer identification parts in the mode line. | ||
| 452 | @item header-line | ||
| 453 | Similar to @code{mode-line} for a window's header line, which appears | ||
| 454 | at the top of a window just as the mode line appears at the bottom. | ||
| 455 | Most windows do not have a header line---only some special modes, such | ||
| 456 | Info mode, create one. | ||
| 457 | @item vertical-border | ||
| 458 | This face is used for the vertical divider between windows. | ||
| 459 | By default this face inherits from the @code{mode-line-inactive} face | ||
| 460 | on character terminals. On graphical displays the foreground color of | ||
| 461 | this face is used for the vertical line between windows without | ||
| 462 | scrollbars. | ||
| 463 | @item minibuffer-prompt | ||
| 464 | @cindex @code{minibuffer-prompt} face | ||
| 465 | @vindex minibuffer-prompt-properties | ||
| 466 | This face is used for the prompt strings displayed in the minibuffer. | ||
| 467 | By default, Emacs automatically adds this face to the value of | ||
| 468 | @code{minibuffer-prompt-properties}, which is a list of text | ||
| 469 | properties used to display the prompt text. (This variable takes | ||
| 470 | effect when you enter the minibuffer.) | ||
| 471 | @item fringe | ||
| 472 | @cindex @code{fringe} face | ||
| 473 | The face for the fringes to the left and right of windows on graphic | ||
| 474 | displays. (The fringes are the narrow portions of the Emacs frame | ||
| 475 | between the text area and the window's right and left borders.) | ||
| 476 | @xref{Fringes}. | ||
| 477 | @item scroll-bar | ||
| 478 | This face determines the visual appearance of the scroll bar. | ||
| 479 | @xref{Scroll Bars}. | ||
| 480 | @item border | ||
| 481 | This face determines the color of the frame border. | ||
| 482 | @item cursor | ||
| 483 | This face determines the color of the cursor. | ||
| 484 | @item mouse | ||
| 485 | This face determines the color of the mouse pointer. | ||
| 486 | @item tool-bar | ||
| 487 | This face determines the color of tool bar icons. @xref{Tool Bars}. | ||
| 488 | @item tooltip | ||
| 489 | This face is used for tooltips. @xref{Tooltips}. | ||
| 490 | @item menu | ||
| 491 | @cindex menu bar appearance | ||
| 492 | @cindex @code{menu} face, no effect if customized | ||
| 493 | @cindex customization of @code{menu} face | ||
| 494 | This face determines the colors and font of Emacs's menus. @xref{Menu | ||
| 495 | Bars}. Setting the font of LessTif/Motif menus is currently not | ||
| 496 | supported; attempts to set the font are ignored in this case. | ||
| 497 | Likewise, attempts to customize this face in Emacs built with GTK and | ||
| 498 | in the MS-Windows/Mac ports are ignored by the respective GUI toolkits; | ||
| 499 | you need to use system-wide styles and options to change the | ||
| 500 | appearance of the menus. | ||
| 501 | @end table | ||
| 502 | |||
| 503 | @node Font Lock | ||
| 504 | @section Font Lock mode | ||
| 505 | @cindex Font Lock mode | ||
| 506 | @cindex mode, Font Lock | ||
| 507 | @cindex syntax highlighting and coloring | ||
| 508 | |||
| 509 | Font Lock mode is a minor mode, always local to a particular buffer, | ||
| 510 | which highlights (or ``fontifies'') the buffer contents according to | ||
| 511 | the syntax of the text you are editing. It can recognize comments and | ||
| 512 | strings in most languages; in several languages, it can also recognize | ||
| 513 | and properly highlight various other important constructs---for | ||
| 514 | example, names of functions being defined or reserved keywords. | ||
| 515 | Some special modes, such as Occur mode and Info mode, have completely | ||
| 516 | specialized ways of assigning fonts for Font Lock mode. | ||
| 517 | |||
| 518 | @findex font-lock-mode | ||
| 519 | Font Lock mode is turned on by default in all modes which support it. | ||
| 520 | You can toggle font-lock for each buffer with the command @kbd{M-x | ||
| 521 | font-lock-mode}. Using a positive argument unconditionally turns Font | ||
| 522 | Lock mode on, and a negative or zero argument turns it off. | ||
| 523 | |||
| 524 | @findex global-font-lock-mode | ||
| 525 | @vindex global-font-lock-mode | ||
| 526 | If you do not wish Font Lock mode to be turned on by default, | ||
| 527 | customize the variable @code{global-font-lock-mode} using the Customize | ||
| 528 | interface (@pxref{Easy Customization}), or use the function | ||
| 529 | @code{global-font-lock-mode} in your @file{.emacs} file, like this: | ||
| 530 | |||
| 531 | @example | ||
| 532 | (global-font-lock-mode 0) | ||
| 533 | @end example | ||
| 534 | |||
| 535 | @noindent | ||
| 536 | This variable, like all the variables that control Font Lock mode, | ||
| 537 | take effect whenever fontification is done; that is, potentially at | ||
| 538 | any time. | ||
| 539 | |||
| 540 | @findex turn-on-font-lock | ||
| 541 | If you have disabled Global Font Lock mode, you can still enable Font | ||
| 542 | Lock for specific major modes by adding the function | ||
| 543 | @code{turn-on-font-lock} to the mode hooks (@pxref{Hooks}). For | ||
| 544 | example, to enable Font Lock mode for editing C files, you can do this: | ||
| 545 | |||
| 546 | @example | ||
| 547 | (add-hook 'c-mode-hook 'turn-on-font-lock) | ||
| 548 | @end example | ||
| 549 | |||
| 550 | Font Lock mode uses several specifically named faces to do its job, | ||
| 551 | including @code{font-lock-string-face}, @code{font-lock-comment-face}, | ||
| 552 | and others. The easiest way to find them all is to use @kbd{M-x | ||
| 553 | customize-group @key{RET} font-lock-faces @key{RET}}. You can then | ||
| 554 | use that customization buffer to customize the appearance of these | ||
| 555 | faces. @xref{Face Customization}. | ||
| 556 | |||
| 557 | You can also customize these faces using @kbd{M-x | ||
| 558 | set-face-foreground} or @kbd{M-x set-face-background}. @xref{Faces}. | ||
| 559 | |||
| 560 | @vindex font-lock-maximum-decoration | ||
| 561 | The variable @code{font-lock-maximum-decoration} specifies the | ||
| 562 | preferred level of fontification, for modes that provide multiple | ||
| 563 | levels. Level 1 is the least amount of fontification; some modes | ||
| 564 | support levels as high as 3. The normal default is ``as high as | ||
| 565 | possible.'' You can specify an integer, which applies to all modes, or | ||
| 566 | you can specify different numbers for particular major modes; for | ||
| 567 | example, to use level 1 for C/C++ modes, and the default level | ||
| 568 | otherwise, use this: | ||
| 569 | |||
| 570 | @example | ||
| 571 | (setq font-lock-maximum-decoration | ||
| 572 | '((c-mode . 1) (c++-mode . 1))) | ||
| 573 | @end example | ||
| 574 | |||
| 575 | @vindex font-lock-maximum-size | ||
| 576 | Fontification can be too slow for large buffers, so you can suppress | ||
| 577 | it for buffers above a certain size. The variable | ||
| 578 | @code{font-lock-maximum-size} specifies a buffer size, beyond which | ||
| 579 | buffer fontification is suppressed. | ||
| 580 | |||
| 581 | @c @w is used below to prevent a bad page-break. | ||
| 582 | @vindex font-lock-beginning-of-syntax-function | ||
| 583 | @cindex incorrect fontification | ||
| 584 | @cindex parenthesis in column zero and fontification | ||
| 585 | @cindex brace in column zero and fontification | ||
| 586 | Comment and string fontification (or ``syntactic'' fontification) | ||
| 587 | relies on analysis of the syntactic structure of the buffer text. For | ||
| 588 | the sake of speed, some modes, including Lisp mode, rely on a special | ||
| 589 | convention: an open-parenthesis or open-brace in the leftmost column | ||
| 590 | always defines the @w{beginning} of a defun, and is thus always | ||
| 591 | outside any string or comment. (@xref{Left Margin Paren}.) If you | ||
| 592 | don't follow this convention, Font Lock mode can misfontify the text | ||
| 593 | that follows an open-parenthesis or open-brace in the leftmost column | ||
| 594 | that is inside a string or comment. | ||
| 595 | |||
| 596 | @cindex slow display during scrolling | ||
| 597 | The variable @code{font-lock-beginning-of-syntax-function} (always | ||
| 598 | buffer-local) specifies how Font Lock mode can find a position | ||
| 599 | guaranteed to be outside any comment or string. In modes which use the | ||
| 600 | leftmost column parenthesis convention, the default value of the variable | ||
| 601 | is @code{beginning-of-defun}---that tells Font Lock mode to use the | ||
| 602 | convention. If you set this variable to @code{nil}, Font Lock no longer | ||
| 603 | relies on the convention. This avoids incorrect results, but the price | ||
| 604 | is that, in some cases, fontification for a changed text must rescan | ||
| 605 | buffer text from the beginning of the buffer. This can considerably | ||
| 606 | slow down redisplay while scrolling, particularly if you are close to | ||
| 607 | the end of a large buffer. | ||
| 608 | |||
| 609 | @findex font-lock-add-keywords | ||
| 610 | Font Lock highlighting patterns already exist for many modes, but you | ||
| 611 | may want to fontify additional patterns. You can use the function | ||
| 612 | @code{font-lock-add-keywords}, to add your own highlighting patterns for | ||
| 613 | a particular mode. For example, to highlight @samp{FIXME:} words in C | ||
| 614 | comments, use this: | ||
| 615 | |||
| 616 | @example | ||
| 617 | (font-lock-add-keywords | ||
| 618 | 'c-mode | ||
| 619 | '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t))) | ||
| 620 | @end example | ||
| 621 | |||
| 622 | @findex font-lock-remove-keywords | ||
| 623 | To remove keywords from the font-lock highlighting patterns, use the | ||
| 624 | function @code{font-lock-remove-keywords}. @xref{Search-based | ||
| 625 | Fontification,,, elisp, The Emacs Lisp Reference Manual}, for | ||
| 626 | documentation of the format of this list. | ||
| 627 | |||
| 628 | @cindex just-in-time (JIT) font-lock | ||
| 629 | @cindex background syntax highlighting | ||
| 630 | Fontifying large buffers can take a long time. To avoid large | ||
| 631 | delays when a file is visited, Emacs fontifies only the visible | ||
| 632 | portion of a buffer. As you scroll through the buffer, each portion | ||
| 633 | that becomes visible is fontified as soon as it is displayed. The | ||
| 634 | parts of the buffer that are not displayed are fontified | ||
| 635 | ``stealthily,'' in the background, i.e.@: when Emacs is idle. You can | ||
| 636 | control this background fontification, also called @dfn{Just-In-Time} | ||
| 637 | (or @dfn{JIT}) Lock, by customizing variables in the customization | ||
| 638 | group @samp{jit-lock}. @xref{Specific Customization}. | ||
| 639 | |||
| 640 | @node Highlight Interactively | ||
| 641 | @section Interactive Highlighting | ||
| 642 | @cindex highlighting by matching | ||
| 643 | @cindex interactive highlighting | ||
| 644 | @cindex Highlight Changes mode | ||
| 645 | |||
| 646 | @findex highlight-changes-mode | ||
| 647 | Use @kbd{M-x highlight-changes-mode} to enable (or disable) | ||
| 648 | Highlight Changes mode, a minor mode that uses faces (colors, | ||
| 649 | typically) to indicate which parts of the buffer were changed most | ||
| 650 | recently. | ||
| 651 | |||
| 652 | @cindex Hi Lock mode | ||
| 653 | @findex hi-lock-mode | ||
| 654 | Hi Lock mode highlights text that matches regular expressions you | ||
| 655 | specify. For example, you might wish to see all the references to a | ||
| 656 | certain variable in a program source file, highlight certain parts in | ||
| 657 | a voluminous output of some program, or make certain names stand out | ||
| 658 | in an article. Use the @kbd{M-x hi-lock-mode} command to enable (or | ||
| 659 | disable) Hi Lock mode. To enable Hi Lock mode for all buffers, use | ||
| 660 | @kbd{M-x global-hi-lock-mode} or place @code{(global-hi-lock-mode 1)} | ||
| 661 | in your @file{.emacs} file. | ||
| 662 | |||
| 663 | Hi Lock mode works like Font Lock mode (@pxref{Font Lock}), except | ||
| 664 | that you specify explicitly the regular expressions to highlight. You | ||
| 665 | control them with these commands: | ||
| 666 | |||
| 667 | @table @kbd | ||
| 668 | @item C-x w h @var{regexp} @key{RET} @var{face} @key{RET} | ||
| 669 | @kindex C-x w h | ||
| 670 | @findex highlight-regexp | ||
| 671 | Highlight text that matches @var{regexp} using face @var{face} | ||
| 672 | (@code{highlight-regexp}). The highlighting will remain as long as | ||
| 673 | the buffer is loaded. For example, to highlight all occurrences of | ||
| 674 | the word ``whim'' using the default face (a yellow background) | ||
| 675 | @kbd{C-x w h whim @key{RET} @key{RET}}. Any face can be used for | ||
| 676 | highlighting, Hi Lock provides several of its own and these are | ||
| 677 | pre-loaded into a history list. While being prompted for a face use | ||
| 678 | @kbd{M-p} and @kbd{M-n} to cycle through them. | ||
| 679 | |||
| 680 | You can use this command multiple times, specifying various regular | ||
| 681 | expressions to highlight in different ways. | ||
| 682 | |||
| 683 | @item C-x w r @var{regexp} @key{RET} | ||
| 684 | @kindex C-x w r | ||
| 685 | @findex unhighlight-regexp | ||
| 686 | Unhighlight @var{regexp} (@code{unhighlight-regexp}). | ||
| 687 | |||
| 688 | If you invoke this from the menu, you select the expression to | ||
| 689 | unhighlight from a list. If you invoke this from the keyboard, you | ||
| 690 | use the minibuffer. It will show the most recently added regular | ||
| 691 | expression; use @kbd{M-p} to show the next older expression and | ||
| 692 | @kbd{M-n} to select the next newer expression. (You can also type the | ||
| 693 | expression by hand, with completion.) When the expression you want to | ||
| 694 | unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit | ||
| 695 | the minibuffer and unhighlight it. | ||
| 696 | |||
| 697 | @item C-x w l @var{regexp} @key{RET} @var{face} @key{RET} | ||
| 698 | @kindex C-x w l | ||
| 699 | @findex highlight-lines-matching-regexp | ||
| 700 | @cindex lines, highlighting | ||
| 701 | @cindex highlighting lines of text | ||
| 702 | Highlight entire lines containing a match for @var{regexp}, using face | ||
| 703 | @var{face} (@code{highlight-lines-matching-regexp}). | ||
| 704 | |||
| 705 | @item C-x w b | ||
| 706 | @kindex C-x w b | ||
| 707 | @findex hi-lock-write-interactive-patterns | ||
| 708 | Insert all the current highlighting regexp/face pairs into the buffer | ||
| 709 | at point, with comment delimiters to prevent them from changing your | ||
| 710 | program. (This key binding runs the | ||
| 711 | @code{hi-lock-write-interactive-patterns} command.) | ||
| 712 | |||
| 713 | These patterns are extracted from the comments, if appropriate, if you | ||
| 714 | invoke @kbd{M-x hi-lock-find-patterns}, or if you visit the file while | ||
| 715 | Hi Lock mode is enabled (since that runs @code{hi-lock-find-patterns}). | ||
| 716 | |||
| 717 | @item C-x w i | ||
| 718 | @kindex C-x w i | ||
| 719 | @findex hi-lock-find-patterns | ||
| 720 | Extract regexp/face pairs from comments in the current buffer | ||
| 721 | (@code{hi-lock-find-patterns}). Thus, you can enter patterns | ||
| 722 | interactively with @code{highlight-regexp}, store them into the file | ||
| 723 | with @code{hi-lock-write-interactive-patterns}, edit them (perhaps | ||
| 724 | including different faces for different parenthesized parts of the | ||
| 725 | match), and finally use this command (@code{hi-lock-find-patterns}) to | ||
| 726 | have Hi Lock highlight the edited patterns. | ||
| 727 | |||
| 728 | @vindex hi-lock-file-patterns-policy | ||
| 729 | The variable @code{hi-lock-file-patterns-policy} controls whether Hi | ||
| 730 | Lock mode should automatically extract and highlight patterns found in | ||
| 731 | a file when it is visited. Its value can be @code{nil} (never | ||
| 732 | highlight), @code{t} (highlight the patterns), @code{ask} (query the | ||
| 733 | user), or a function. If it is a function, | ||
| 734 | @code{hi-lock-find-patterns} calls it with the patterns as argument; | ||
| 735 | if the function returns non-@code{nil}, the patterns are used. The | ||
| 736 | default is @code{nil}. Note that patterns are always highlighted if | ||
| 737 | you call @code{hi-lock-find-patterns} directly, regardless of the | ||
| 738 | value of this variable. | ||
| 739 | |||
| 740 | @vindex hi-lock-exclude-modes | ||
| 741 | Also, @code{hi-lock-find-patterns} does nothing if the current major | ||
| 742 | mode's symbol is a member of the list @code{hi-lock-exclude-modes}. | ||
| 743 | @end table | ||
| 744 | |||
| 745 | @node Fringes | ||
| 746 | @section Window Fringes | ||
| 747 | @cindex fringes | ||
| 748 | |||
| 749 | On a graphical display, each Emacs window normally has narrow | ||
| 750 | @dfn{fringes} on the left and right edges. The fringes display | ||
| 751 | indications about the text in the window. | ||
| 752 | |||
| 753 | The most common use of the fringes is to indicate a continuation | ||
| 754 | line, when one line of text is split into multiple lines on the | ||
| 755 | screen. The left fringe shows a curving arrow for each screen line | ||
| 756 | except the first, indicating that ``this is not the real beginning.'' | ||
| 757 | The right fringe shows a curving arrow for each screen line except the | ||
| 758 | last, indicating that ``this is not the real end.'' | ||
| 759 | |||
| 760 | The fringes indicate line truncation with short horizontal arrows | ||
| 761 | meaning ``there's more text on this line which is scrolled | ||
| 762 | horizontally out of view;'' clicking the mouse on one of the arrows | ||
| 763 | scrolls the display horizontally in the direction of the arrow. The | ||
| 764 | fringes can also indicate other things, such as empty lines, or where a | ||
| 765 | program you are debugging is executing (@pxref{Debuggers}). | ||
| 766 | |||
| 767 | @findex set-fringe-style | ||
| 768 | @findex fringe-mode | ||
| 769 | You can enable and disable the fringes for all frames using | ||
| 770 | @kbd{M-x fringe-mode}. To enable and disable the fringes | ||
| 771 | for the selected frame, use @kbd{M-x set-fringe-style}. | ||
| 772 | |||
| 773 | @node Displaying Boundaries | ||
| 774 | @section Displaying Boundaries | ||
| 775 | |||
| 776 | @vindex indicate-buffer-boundaries | ||
| 777 | On a graphical display, Emacs can indicate the buffer boundaries in | ||
| 778 | the fringes. It indicates the first line and the last line with | ||
| 779 | angle images in the fringes. This can be combined with up and down | ||
| 780 | arrow images which say whether it is possible to scroll the window up | ||
| 781 | and down. | ||
| 782 | |||
| 783 | The buffer-local variable @code{indicate-buffer-boundaries} controls | ||
| 784 | how the buffer boundaries and window scrolling is indicated in the | ||
| 785 | fringes. If the value is @code{left} or @code{right}, both angle and | ||
| 786 | arrow bitmaps are displayed in the left or right fringe, respectively. | ||
| 787 | |||
| 788 | If value is an alist, each element @code{(@var{indicator} . | ||
| 789 | @var{position})} specifies the position of one of the indicators. | ||
| 790 | The @var{indicator} must be one of @code{top}, @code{bottom}, | ||
| 791 | @code{up}, @code{down}, or @code{t} which specifies the default | ||
| 792 | position for the indicators not present in the alist. | ||
| 793 | The @var{position} is one of @code{left}, @code{right}, or @code{nil} | ||
| 794 | which specifies not to show this indicator. | ||
| 795 | |||
| 796 | For example, @code{((top . left) (t . right))} places the top angle | ||
| 797 | bitmap in left fringe, the bottom angle bitmap in right fringe, and | ||
| 798 | both arrow bitmaps in right fringe. To show just the angle bitmaps in | ||
| 799 | the left fringe, but no arrow bitmaps, use @code{((top . left) | ||
| 800 | (bottom . left))}. | ||
| 801 | |||
| 802 | @vindex default-indicate-buffer-boundaries | ||
| 803 | The value of the variable @code{default-indicate-buffer-boundaries} | ||
| 804 | is the default value for @code{indicate-buffer-boundaries} in buffers | ||
| 805 | that do not override it. | ||
| 806 | |||
| 807 | @node Useless Whitespace | ||
| 808 | @section Useless Whitespace | ||
| 809 | |||
| 810 | @cindex trailing whitespace | ||
| 811 | @cindex whitespace, trailing | ||
| 812 | @vindex show-trailing-whitespace | ||
| 813 | It is easy to leave unnecessary spaces at the end of a line, or | ||
| 814 | empty lines at the end of a file, without realizing it. In most | ||
| 815 | cases, this @dfn{trailing whitespace} has no effect, but there are | ||
| 816 | special circumstances where it matters. It can also be a nuisance | ||
| 817 | that the line has ``changed,'' when the change is just spaces added or | ||
| 818 | removed at the end. | ||
| 819 | |||
| 820 | You can make trailing whitespace at the end of a line visible on the | ||
| 821 | screen by setting the buffer-local variable | ||
| 822 | @code{show-trailing-whitespace} to @code{t}. Then Emacs displays | ||
| 823 | trailing whitespace in the face @code{trailing-whitespace}. | ||
| 824 | |||
| 825 | This feature does not apply when point is at the end of the line | ||
| 826 | containing the whitespace. Strictly speaking, that is ``trailing | ||
| 827 | whitespace'' nonetheless, but displaying it specially in that case | ||
| 828 | looks ugly while you are typing in new text. In this special case, | ||
| 829 | the location of point is enough to show you that the spaces are | ||
| 830 | present. | ||
| 831 | |||
| 832 | @findex delete-trailing-whitespace | ||
| 833 | To delete all trailing whitespace within the current buffer's | ||
| 834 | accessible portion (@pxref{Narrowing}), type @kbd{M-x | ||
| 835 | delete-trailing-whitespace @key{RET}}. (This command does not remove | ||
| 836 | the form-feed characters.) | ||
| 837 | |||
| 838 | @vindex indicate-empty-lines | ||
| 839 | @vindex default-indicate-empty-lines | ||
| 840 | @cindex unused lines | ||
| 841 | @cindex fringes, and unused line indication | ||
| 842 | Emacs can indicate unused lines at the end of the window with a | ||
| 843 | small image in the left fringe (@pxref{Fringes}). The image appears | ||
| 844 | for window lines that do not correspond to any buffer text. Blank | ||
| 845 | lines at the end of the buffer then stand out because they do not have | ||
| 846 | this image in the fringe. | ||
| 847 | |||
| 848 | To enable this feature, set the buffer-local variable | ||
| 849 | @code{indicate-empty-lines} to a non-@code{nil} value. The default | ||
| 850 | value of this variable is controlled by the variable | ||
| 851 | @code{default-indicate-empty-lines}; by setting that variable, you | ||
| 852 | can enable or disable this feature for all new buffers. (This feature | ||
| 853 | currently doesn't work on text-only terminals.) | ||
| 854 | |||
| 855 | @node Selective Display | ||
| 856 | @section Selective Display | ||
| 857 | @cindex selective display | ||
| 858 | @findex set-selective-display | ||
| 859 | @kindex C-x $ | ||
| 860 | |||
| 861 | Emacs has the ability to hide lines indented more than a certain number | ||
| 862 | of columns (you specify how many columns). You can use this to get an | ||
| 863 | overview of a part of a program. | ||
| 864 | |||
| 865 | To hide lines in the current buffer, type @kbd{C-x $} | ||
| 866 | (@code{set-selective-display}) with a numeric argument @var{n}. Then | ||
| 867 | lines with at least @var{n} columns of indentation disappear from the | ||
| 868 | screen. The only indication of their presence is that three dots | ||
| 869 | (@samp{@dots{}}) appear at the end of each visible line that is | ||
| 870 | followed by one or more hidden ones. | ||
| 871 | |||
| 872 | The commands @kbd{C-n} and @kbd{C-p} move across the hidden lines as | ||
| 873 | if they were not there. | ||
| 874 | |||
| 875 | The hidden lines are still present in the buffer, and most editing | ||
| 876 | commands see them as usual, so you may find point in the middle of the | ||
| 877 | hidden text. When this happens, the cursor appears at the end of the | ||
| 878 | previous line, after the three dots. If point is at the end of the | ||
| 879 | visible line, before the newline that ends it, the cursor appears before | ||
| 880 | the three dots. | ||
| 881 | |||
| 882 | To make all lines visible again, type @kbd{C-x $} with no argument. | ||
| 883 | |||
| 884 | @vindex selective-display-ellipses | ||
| 885 | If you set the variable @code{selective-display-ellipses} to | ||
| 886 | @code{nil}, the three dots do not appear at the end of a line that | ||
| 887 | precedes hidden lines. Then there is no visible indication of the | ||
| 888 | hidden lines. This variable becomes local automatically when set. | ||
| 889 | |||
| 890 | See also @ref{Outline Mode} for another way to hide part of | ||
| 891 | the text in a buffer. | ||
| 892 | |||
| 893 | @node Optional Mode Line | ||
| 894 | @section Optional Mode Line Features | ||
| 895 | |||
| 896 | @cindex buffer size display | ||
| 897 | @cindex display of buffer size | ||
| 898 | @findex size-indication-mode | ||
| 899 | The buffer percentage @var{pos} indicates the percentage of the | ||
| 900 | buffer above the top of the window. You can additionally display the | ||
| 901 | size of the buffer by typing @kbd{M-x size-indication-mode} to turn on | ||
| 902 | Size Indication mode. The size will be displayed immediately | ||
| 903 | following the buffer percentage like this: | ||
| 904 | |||
| 905 | @example | ||
| 906 | @var{POS} of @var{SIZE} | ||
| 907 | @end example | ||
| 908 | |||
| 909 | @noindent | ||
| 910 | Here @var{SIZE} is the human readable representation of the number of | ||
| 911 | characters in the buffer, which means that @samp{k} for 10^3, @samp{M} | ||
| 912 | for 10^6, @samp{G} for 10^9, etc., are used to abbreviate. | ||
| 913 | |||
| 914 | @cindex narrowing, and buffer size display | ||
| 915 | If you have narrowed the buffer (@pxref{Narrowing}), the size of the | ||
| 916 | accessible part of the buffer is shown. | ||
| 917 | |||
| 918 | @cindex line number display | ||
| 919 | @cindex display of line number | ||
| 920 | @findex line-number-mode | ||
| 921 | The current line number of point appears in the mode line when Line | ||
| 922 | Number mode is enabled. Use the command @kbd{M-x line-number-mode} to | ||
| 923 | turn this mode on and off; normally it is on. The line number appears | ||
| 924 | after the buffer percentage @var{pos}, with the letter @samp{L} to | ||
| 925 | indicate what it is. | ||
| 926 | |||
| 927 | @cindex Column Number mode | ||
| 928 | @cindex mode, Column Number | ||
| 929 | @findex column-number-mode | ||
| 930 | Similarly, you can display the current column number by turning on | ||
| 931 | Column number mode with @kbd{M-x column-number-mode}. The column | ||
| 932 | number is indicated by the letter @samp{C}. However, when both of | ||
| 933 | these modes are enabled, the line and column numbers are displayed in | ||
| 934 | parentheses, the line number first, rather than with @samp{L} and | ||
| 935 | @samp{C}. For example: @samp{(561,2)}. @xref{Minor Modes}, for more | ||
| 936 | information about minor modes and about how to use these commands. | ||
| 937 | |||
| 938 | @cindex narrowing, and line number display | ||
| 939 | If you have narrowed the buffer (@pxref{Narrowing}), the displayed | ||
| 940 | line number is relative to the accessible portion of the buffer. | ||
| 941 | Thus, it isn't suitable as an argument to @code{goto-line}. (Use | ||
| 942 | @code{what-line} command to see the line number relative to the whole | ||
| 943 | file.) | ||
| 944 | |||
| 945 | @vindex line-number-display-limit | ||
| 946 | If the buffer is very large (larger than the value of | ||
| 947 | @code{line-number-display-limit}), then the line number doesn't appear. | ||
| 948 | Emacs doesn't compute the line number when the buffer is large, because | ||
| 949 | that would be too slow. Set it to @code{nil} to remove the limit. | ||
| 950 | |||
| 951 | @vindex line-number-display-limit-width | ||
| 952 | Line-number computation can also be slow if the lines in the buffer | ||
| 953 | are too long. For this reason, Emacs normally doesn't display line | ||
| 954 | numbers if the average width, in characters, of lines near point is | ||
| 955 | larger than the value of the variable | ||
| 956 | @code{line-number-display-limit-width}. The default value is 200 | ||
| 957 | characters. | ||
| 958 | |||
| 959 | @findex display-time | ||
| 960 | @cindex time (on mode line) | ||
| 961 | Emacs can optionally display the time and system load in all mode | ||
| 962 | lines. To enable this feature, type @kbd{M-x display-time} or customize | ||
| 963 | the option @code{display-time-mode}. The information added to the mode | ||
| 964 | line usually appears after the buffer name, before the mode names and | ||
| 965 | their parentheses. It looks like this: | ||
| 966 | |||
| 967 | @example | ||
| 968 | @var{hh}:@var{mm}pm @var{l.ll} | ||
| 969 | @end example | ||
| 970 | |||
| 971 | @noindent | ||
| 972 | @vindex display-time-24hr-format | ||
| 973 | Here @var{hh} and @var{mm} are the hour and minute, followed always by | ||
| 974 | @samp{am} or @samp{pm}. @var{l.ll} is the average number of running | ||
| 975 | processes in the whole system recently. (Some fields may be missing if | ||
| 976 | your operating system cannot support them.) If you prefer time display | ||
| 977 | in 24-hour format, set the variable @code{display-time-24hr-format} | ||
| 978 | to @code{t}. | ||
| 979 | |||
| 980 | @cindex mail (on mode line) | ||
| 981 | @vindex display-time-use-mail-icon | ||
| 982 | @vindex display-time-mail-face | ||
| 983 | @vindex display-time-mail-file | ||
| 984 | @vindex display-time-mail-directory | ||
| 985 | The word @samp{Mail} appears after the load level if there is mail | ||
| 986 | for you that you have not read yet. On a graphical display you can use | ||
| 987 | an icon instead of @samp{Mail} by customizing | ||
| 988 | @code{display-time-use-mail-icon}; this may save some space on the mode | ||
| 989 | line. You can customize @code{display-time-mail-face} to make the mail | ||
| 990 | indicator prominent. Use @code{display-time-mail-file} to specify | ||
| 991 | the mail file to check, or set @code{display-time-mail-directory} | ||
| 992 | to specify the directory to check for incoming mail (any nonempty regular | ||
| 993 | file in the directory is considered as ``newly arrived mail''). | ||
| 994 | |||
| 995 | @cindex mode line, 3D appearance | ||
| 996 | @cindex attributes of mode line, changing | ||
| 997 | @cindex non-integral number of lines in a window | ||
| 998 | By default, the mode line is drawn on graphics displays with | ||
| 999 | 3D-style highlighting, like that of a button when it is not being | ||
| 1000 | pressed. If you don't like this effect, you can disable the 3D | ||
| 1001 | highlighting of the mode line, by customizing the attributes of the | ||
| 1002 | @code{mode-line} face. @xref{Face Customization}. | ||
| 1003 | |||
| 1004 | @cindex non-selected windows, mode line appearance | ||
| 1005 | By default, the mode line of nonselected windows is displayed in a | ||
| 1006 | different face, called @code{mode-line-inactive}. Only the selected | ||
| 1007 | window is displayed in the @code{mode-line} face. This helps show | ||
| 1008 | which window is selected. When the minibuffer is selected, since | ||
| 1009 | it has no mode line, the window from which you activated the minibuffer | ||
| 1010 | has its mode line displayed using @code{mode-line}; as a result, | ||
| 1011 | ordinary entry to the minibuffer does not change any mode lines. | ||
| 1012 | |||
| 1013 | @vindex mode-line-in-non-selected-windows | ||
| 1014 | You can disable use of @code{mode-line-inactive} by setting variable | ||
| 1015 | @code{mode-line-in-non-selected-windows} to @code{nil}; then all mode | ||
| 1016 | lines are displayed in the @code{mode-line} face. | ||
| 1017 | |||
| 1018 | @vindex eol-mnemonic-unix | ||
| 1019 | @vindex eol-mnemonic-dos | ||
| 1020 | @vindex eol-mnemonic-mac | ||
| 1021 | @vindex eol-mnemonic-undecided | ||
| 1022 | You can customize the mode line display for each of the end-of-line | ||
| 1023 | formats by setting each of the variables @code{eol-mnemonic-unix}, | ||
| 1024 | @code{eol-mnemonic-dos}, @code{eol-mnemonic-mac}, and | ||
| 1025 | @code{eol-mnemonic-undecided} to the strings you prefer. | ||
| 1026 | |||
| 1027 | @node Text Display | ||
| 1028 | @section How Text Is Displayed | ||
| 1029 | @cindex characters (in text) | ||
| 1030 | |||
| 1031 | @acronym{ASCII} printing characters (octal codes 040 through 0176) in Emacs | ||
| 1032 | buffers are displayed with their graphics, as are non-ASCII multibyte | ||
| 1033 | printing characters (octal codes above 0400). | ||
| 1034 | |||
| 1035 | Some @acronym{ASCII} control characters are displayed in special ways. The | ||
| 1036 | newline character (octal code 012) is displayed by starting a new line. | ||
| 1037 | The tab character (octal code 011) is displayed by moving to the next | ||
| 1038 | tab stop column (normally every 8 columns). | ||
| 1039 | |||
| 1040 | Other @acronym{ASCII} control characters are normally displayed as a caret | ||
| 1041 | (@samp{^}) followed by the non-control version of the character; thus, | ||
| 1042 | control-A is displayed as @samp{^A}. The caret appears in face | ||
| 1043 | @code{escape-glyph}. | ||
| 1044 | |||
| 1045 | Non-@acronym{ASCII} characters 0200 through 0237 (octal) are | ||
| 1046 | displayed with octal escape sequences; thus, character code 0230 | ||
| 1047 | (octal) is displayed as @samp{\230}. The backslash appears in face | ||
| 1048 | @code{escape-glyph}. | ||
| 1049 | |||
| 1050 | @vindex ctl-arrow | ||
| 1051 | If the variable @code{ctl-arrow} is @code{nil}, control characters in | ||
| 1052 | the buffer are displayed with octal escape sequences, except for newline | ||
| 1053 | and tab. Altering the value of @code{ctl-arrow} makes it local to the | ||
| 1054 | current buffer; until that time, the default value is in effect. The | ||
| 1055 | default is initially @code{t}. | ||
| 1056 | |||
| 1057 | The display of character codes 0240 through 0377 (octal) may be | ||
| 1058 | either as escape sequences or as graphics. They do not normally occur | ||
| 1059 | in multibyte buffers, but if they do, they are displayed as Latin-1 | ||
| 1060 | graphics. In unibyte mode, if you enable European display they are | ||
| 1061 | displayed using their graphics (assuming your terminal supports them), | ||
| 1062 | otherwise as escape sequences. @xref{Unibyte Mode}. | ||
| 1063 | |||
| 1064 | @vindex nobreak-char-display | ||
| 1065 | @cindex no-break space, display | ||
| 1066 | @cindex no-break hyphen, display | ||
| 1067 | @cindex soft hyphen, display | ||
| 1068 | Some character sets define ``no-break'' versions of the space and | ||
| 1069 | hyphen characters, which are used where a line should not be broken. | ||
| 1070 | Emacs normally displays these characters with special faces | ||
| 1071 | (respectively, @code{nobreak-space} and @code{escape-glyph}) to | ||
| 1072 | distinguish them from ordinary spaces and hyphens. You can turn off | ||
| 1073 | this feature by setting the variable @code{nobreak-char-display} to | ||
| 1074 | @code{nil}. If you set the variable to any other value, that means to | ||
| 1075 | prefix these characters with an escape character. | ||
| 1076 | |||
| 1077 | @vindex tab-width | ||
| 1078 | @vindex default-tab-width | ||
| 1079 | Normally, a tab character in the buffer is displayed as whitespace which | ||
| 1080 | extends to the next display tab stop position, and display tab stops come | ||
| 1081 | at intervals equal to eight spaces. The number of spaces per tab is | ||
| 1082 | controlled by the variable @code{tab-width}, which is made local by | ||
| 1083 | changing it. Note that how the tab character | ||
| 1084 | in the buffer is displayed has nothing to do with the definition of | ||
| 1085 | @key{TAB} as a command. The variable @code{tab-width} must have an | ||
| 1086 | integer value between 1 and 1000, inclusive. The variable | ||
| 1087 | @code{default-tab-width} controls the default value of this variable | ||
| 1088 | for buffers where you have not set it locally. | ||
| 1089 | |||
| 1090 | You can customize the way any particular character code is displayed | ||
| 1091 | by means of a display table. @xref{Display Tables,, Display Tables, | ||
| 1092 | elisp, The Emacs Lisp Reference Manual}. | ||
| 1093 | |||
| 1094 | @node Cursor Display | ||
| 1095 | @section Displaying the Cursor | ||
| 1096 | |||
| 1097 | @findex blink-cursor-mode | ||
| 1098 | @vindex blink-cursor-alist | ||
| 1099 | @cindex cursor, locating visually | ||
| 1100 | @cindex cursor, blinking | ||
| 1101 | You can customize the cursor's color, and whether it blinks, using | ||
| 1102 | the @code{cursor} Custom group (@pxref{Easy Customization}). On | ||
| 1103 | a graphical display, the command @kbd{M-x blink-cursor-mode} enables | ||
| 1104 | or disables the blinking of the cursor. (On text terminals, the | ||
| 1105 | terminal itself blinks the cursor, and Emacs has no control over it.) | ||
| 1106 | You can control how the cursor appears when it blinks off by setting | ||
| 1107 | the variable @code{blink-cursor-alist}. | ||
| 1108 | |||
| 1109 | @vindex visible-cursor | ||
| 1110 | Some text terminals offer two different cursors: the normal cursor | ||
| 1111 | and the very visible cursor, where the latter may be e.g. bigger or | ||
| 1112 | blinking. By default Emacs uses the very visible cursor, and switches | ||
| 1113 | to it when you start or resume Emacs. If the variable | ||
| 1114 | @code{visible-cursor} is @code{nil} when Emacs starts or resumes, it | ||
| 1115 | doesn't switch, so it uses the normal cursor. | ||
| 1116 | |||
| 1117 | @cindex cursor in non-selected windows | ||
| 1118 | @vindex cursor-in-non-selected-windows | ||
| 1119 | Normally, the cursor appears in non-selected windows in the ``off'' | ||
| 1120 | state, with the same appearance as when the blinking cursor blinks | ||
| 1121 | ``off.'' For a box cursor, this is a hollow box; for a bar cursor, | ||
| 1122 | this is a thinner bar. To turn off cursors in non-selected windows, | ||
| 1123 | customize the variable @code{cursor-in-non-selected-windows} and assign | ||
| 1124 | it a @code{nil} value. | ||
| 1125 | |||
| 1126 | @vindex x-stretch-cursor | ||
| 1127 | @cindex wide block cursor | ||
| 1128 | On graphical displays, Emacs can optionally draw the block cursor | ||
| 1129 | as wide as the character under the cursor---for example, if the cursor | ||
| 1130 | is on a tab character, it would cover the full width occupied by that | ||
| 1131 | tab character. To enable this feature, set the variable | ||
| 1132 | @code{x-stretch-cursor} to a non-@code{nil} value. | ||
| 1133 | |||
| 1134 | @findex hl-line-mode | ||
| 1135 | @findex global-hl-line-mode | ||
| 1136 | @cindex highlight current line | ||
| 1137 | To make the cursor even more visible, you can use HL Line mode, a | ||
| 1138 | minor mode that highlights the line containing point. Use @kbd{M-x | ||
| 1139 | hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x | ||
| 1140 | global-hl-line-mode} enables or disables the same mode globally. | ||
| 1141 | |||
| 1142 | @node Line Truncation | ||
| 1143 | @section Truncation of Lines | ||
| 1144 | |||
| 1145 | @cindex truncation | ||
| 1146 | @cindex line truncation, and fringes | ||
| 1147 | As an alternative to continuation, Emacs can display long lines by | ||
| 1148 | @dfn{truncation}. This means that all the characters that do not fit | ||
| 1149 | in the width of the screen or window do not appear at all. On | ||
| 1150 | graphical displays, a small straight arrow in the fringe indicates | ||
| 1151 | truncation at either end of the line. On text-only terminals, @samp{$} | ||
| 1152 | appears in the first column when there is text truncated to the left, | ||
| 1153 | and in the last column when there is text truncated to the right. | ||
| 1154 | |||
| 1155 | @vindex truncate-lines | ||
| 1156 | @findex toggle-truncate-lines | ||
| 1157 | Horizontal scrolling automatically causes line truncation | ||
| 1158 | (@pxref{Horizontal Scrolling}). You can explicitly enable line | ||
| 1159 | truncation for a particular buffer with the command @kbd{M-x | ||
| 1160 | toggle-truncate-lines}. This works by locally changing the variable | ||
| 1161 | @code{truncate-lines}. If that variable is non-@code{nil}, long lines | ||
| 1162 | are truncated; if it is @code{nil}, they are continued onto multiple | ||
| 1163 | screen lines. Setting the variable @code{truncate-lines} in any way | ||
| 1164 | makes it local to the current buffer; until that time, the default | ||
| 1165 | value is in effect. The default value is normally @code{nil}. | ||
| 1166 | |||
| 1167 | @c @vindex truncate-partial-width-windows @c Idx entry is in Split Windows. | ||
| 1168 | If the variable @code{truncate-partial-width-windows} is | ||
| 1169 | non-@code{nil}, it forces truncation rather than continuation in any | ||
| 1170 | window less than the full width of the screen or frame, regardless of | ||
| 1171 | the value of @code{truncate-lines}. For information about side-by-side | ||
| 1172 | windows, see @ref{Split Window}. See also @ref{Display,, Display, | ||
| 1173 | elisp, The Emacs Lisp Reference Manual}. | ||
| 1174 | |||
| 1175 | @vindex overflow-newline-into-fringe | ||
| 1176 | If the variable @code{overflow-newline-into-fringe} is | ||
| 1177 | non-@code{nil} on a graphical display, then Emacs does not continue or | ||
| 1178 | truncate a line which is exactly as wide as the window. Instead, the | ||
| 1179 | newline overflows into the right fringe, and the cursor appears in the | ||
| 1180 | fringe when positioned on that newline. | ||
| 1181 | |||
| 1182 | @node Display Custom | ||
| 1183 | @section Customization of Display | ||
| 1184 | |||
| 1185 | This section describes variables (@pxref{Variables}) that you can | ||
| 1186 | change to customize how Emacs displays. Beginning users can skip | ||
| 1187 | it. | ||
| 1188 | @c the reason for that pxref is because an xref early in the | ||
| 1189 | @c ``echo area'' section leads here. | ||
| 1190 | |||
| 1191 | @vindex inverse-video | ||
| 1192 | If the variable @code{inverse-video} is non-@code{nil}, Emacs attempts | ||
| 1193 | to invert all the lines of the display from what they normally are. | ||
| 1194 | |||
| 1195 | @vindex visible-bell | ||
| 1196 | If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts | ||
| 1197 | to make the whole screen blink when it would normally make an audible bell | ||
| 1198 | sound. This variable has no effect if your terminal does not have a way | ||
| 1199 | to make the screen blink. | ||
| 1200 | |||
| 1201 | @vindex echo-keystrokes | ||
| 1202 | The variable @code{echo-keystrokes} controls the echoing of multi-character | ||
| 1203 | keys; its value is the number of seconds of pause required to cause echoing | ||
| 1204 | to start, or zero, meaning don't echo at all. The value takes effect when | ||
| 1205 | there is someting to echo. @xref{Echo Area}. | ||
| 1206 | |||
| 1207 | @vindex baud-rate | ||
| 1208 | The variable @anchor{baud-rate}@code{baud-rate} holds the output | ||
| 1209 | speed of the terminal, as far as Emacs knows. Setting this variable | ||
| 1210 | does not change the speed of actual data transmission, but the value | ||
| 1211 | is used for calculations. On text-only terminals, it affects padding, | ||
| 1212 | and decisions about whether to scroll part of the screen or redraw it | ||
| 1213 | instead. It also affects the behavior of incremental search. | ||
| 1214 | |||
| 1215 | On graphical displays, @code{baud-rate} is only used to determine | ||
| 1216 | how frequently to look for pending input during display updating. A | ||
| 1217 | higher value of @code{baud-rate} means that check for pending input | ||
| 1218 | will be done less frequently. | ||
| 1219 | |||
| 1220 | @cindex hourglass pointer display | ||
| 1221 | @vindex hourglass-delay | ||
| 1222 | On graphical display, Emacs can optionally display the mouse pointer | ||
| 1223 | in a special shape to say that Emacs is busy. To turn this feature on | ||
| 1224 | or off, customize the group @code{cursor}. You can also control the | ||
| 1225 | amount of time Emacs must remain busy before the busy indicator is | ||
| 1226 | displayed, by setting the variable @code{hourglass-delay}. | ||
| 1227 | |||
| 1228 | @vindex overline-margin | ||
| 1229 | On graphical display, this variables specifies the vertical position | ||
| 1230 | of an overline above the text, including the height of the overline | ||
| 1231 | itself (1 pixel). The default value is 2 pixels. | ||
| 1232 | |||
| 1233 | @vindex x-underline-at-descent-line | ||
| 1234 | On graphical display, Emacs normally draws an underline at the | ||
| 1235 | baseline level of the font. If @code{x-underline-at-descent-line} is | ||
| 1236 | non-@code{nil}, Emacs draws the underline at the same height as the | ||
| 1237 | font's descent line. | ||
| 1238 | |||
| 1239 | @findex tty-suppress-bold-inverse-default-colors | ||
| 1240 | On some text-only terminals, bold face and inverse video together | ||
| 1241 | result in text that is hard to read. Call the function | ||
| 1242 | @code{tty-suppress-bold-inverse-default-colors} with a non-@code{nil} | ||
| 1243 | argument to suppress the effect of bold-face in this case. | ||
| 1244 | |||
| 1245 | @vindex no-redraw-on-reenter | ||
| 1246 | On a text-only terminal, when you reenter Emacs after suspending, Emacs | ||
| 1247 | normally clears the screen and redraws the entire display. On some | ||
| 1248 | terminals with more than one page of memory, it is possible to arrange | ||
| 1249 | the termcap entry so that the @samp{ti} and @samp{te} strings (output | ||
| 1250 | to the terminal when Emacs is entered and exited, respectively) switch | ||
| 1251 | between pages of memory so as to use one page for Emacs and another | ||
| 1252 | page for other output. On such terminals, you might want to set the variable | ||
| 1253 | @code{no-redraw-on-reenter} non-@code{nil}; this tells Emacs to | ||
| 1254 | assume, when resumed, that the screen page it is using still contains | ||
| 1255 | what Emacs last wrote there. | ||
| 1256 | |||
| 1257 | @ignore | ||
| 1258 | arch-tag: 2219f910-2ff0-4521-b059-1bd231a536c4 | ||
| 1259 | @end ignore | ||
diff --git a/doc/emacs/doclicense.texi b/doc/emacs/doclicense.texi new file mode 100644 index 00000000000..83e9d6b5579 --- /dev/null +++ b/doc/emacs/doclicense.texi | |||
| @@ -0,0 +1,416 @@ | |||
| 1 | @c -*-texinfo-*- | ||
| 2 | @center Version 1.2, November 2002 | ||
| 3 | |||
| 4 | @display | ||
| 5 | Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. | ||
| 6 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 7 | |||
| 8 | Everyone is permitted to copy and distribute verbatim copies | ||
| 9 | of this license document, but changing it is not allowed. | ||
| 10 | @end display | ||
| 11 | @sp 1 | ||
| 12 | @enumerate 0 | ||
| 13 | @item | ||
| 14 | PREAMBLE | ||
| 15 | |||
| 16 | The purpose of this License is to make a manual, textbook, or other | ||
| 17 | functional and useful document ``free'' in the sense of freedom: to | ||
| 18 | assure everyone the effective freedom to copy and redistribute it, | ||
| 19 | with or without modifying it, either commercially or noncommercially. | ||
| 20 | Secondarily, this License preserves for the author and publisher a way | ||
| 21 | to get credit for their work, while not being considered responsible | ||
| 22 | for modifications made by others. | ||
| 23 | |||
| 24 | This License is a kind of ``copyleft,'' which means that derivative | ||
| 25 | works of the document must themselves be free in the same sense. It | ||
| 26 | complements the GNU General Public License, which is a copyleft | ||
| 27 | license designed for free software. | ||
| 28 | |||
| 29 | We have designed this License in order to use it for manuals for free | ||
| 30 | software, because free software needs free documentation: a free | ||
| 31 | program should come with manuals providing the same freedoms that the | ||
| 32 | software does. But this License is not limited to software manuals; | ||
| 33 | it can be used for any textual work, regardless of subject matter or | ||
| 34 | whether it is published as a printed book. We recommend this License | ||
| 35 | principally for works whose purpose is instruction or reference. | ||
| 36 | |||
| 37 | @sp 1 | ||
| 38 | @item | ||
| 39 | APPLICABILITY AND DEFINITIONS | ||
| 40 | |||
| 41 | This License applies to any manual or other work, in any medium, that | ||
| 42 | contains a notice placed by the copyright holder saying it can be | ||
| 43 | distributed under the terms of this License. Such a notice grants a | ||
| 44 | world-wide, royalty-free license, unlimited in duration, to use that | ||
| 45 | work under the conditions stated herein. The ``Document,'' below, | ||
| 46 | refers to any such manual or work. Any member of the public is a | ||
| 47 | licensee, and is addressed as ``you.'' You accept the license if you | ||
| 48 | copy, modify or distribute the work in a way requiring permission | ||
| 49 | under copyright law. | ||
| 50 | |||
| 51 | A ``Modified Version'' of the Document means any work containing the | ||
| 52 | Document or a portion of it, either copied verbatim, or with | ||
| 53 | modifications and/or translated into another language. | ||
| 54 | |||
| 55 | A ``Secondary Section'' is a named appendix or a front-matter section of | ||
| 56 | the Document that deals exclusively with the relationship of the | ||
| 57 | publishers or authors of the Document to the Document's overall subject | ||
| 58 | (or to related matters) and contains nothing that could fall directly | ||
| 59 | within that overall subject. (Thus, if the Document is in part a | ||
| 60 | textbook of mathematics, a Secondary Section may not explain any | ||
| 61 | mathematics.) The relationship could be a matter of historical | ||
| 62 | connection with the subject or with related matters, or of legal, | ||
| 63 | commercial, philosophical, ethical or political position regarding | ||
| 64 | them. | ||
| 65 | |||
| 66 | The ``Invariant Sections'' are certain Secondary Sections whose titles | ||
| 67 | are designated, as being those of Invariant Sections, in the notice | ||
| 68 | that says that the Document is released under this License. If a | ||
| 69 | section does not fit the above definition of Secondary then it is not | ||
| 70 | allowed to be designated as Invariant. The Document may contain zero | ||
| 71 | Invariant Sections. If the Document does not identify any Invariant | ||
| 72 | Sections then there are none. | ||
| 73 | |||
| 74 | The ``Cover Texts'' are certain short passages of text that are listed, | ||
| 75 | as Front-Cover Texts or Back-Cover Texts, in the notice that says that | ||
| 76 | the Document is released under this License. A Front-Cover Text may | ||
| 77 | be at most 5 words, and a Back-Cover Text may be at most 25 words. | ||
| 78 | |||
| 79 | A ``Transparent'' copy of the Document means a machine-readable copy, | ||
| 80 | represented in a format whose specification is available to the | ||
| 81 | general public, that is suitable for revising the document | ||
| 82 | straightforwardly with generic text editors or (for images composed of | ||
| 83 | pixels) generic paint programs or (for drawings) some widely available | ||
| 84 | drawing editor, and that is suitable for input to text formatters or | ||
| 85 | for automatic translation to a variety of formats suitable for input | ||
| 86 | to text formatters. A copy made in an otherwise Transparent file | ||
| 87 | format whose markup, or absence of markup, has been arranged to thwart | ||
| 88 | or discourage subsequent modification by readers is not Transparent. | ||
| 89 | An image format is not Transparent if used for any substantial amount | ||
| 90 | of text. A copy that is not ``Transparent'' is called ``Opaque.'' | ||
| 91 | |||
| 92 | |||
| 93 | Examples of suitable formats for Transparent copies include plain | ||
| 94 | ASCII without markup, Texinfo input format, LaTeX input format, SGML | ||
| 95 | or XML using a publicly available DTD, and standard-conforming simple | ||
| 96 | HTML, PostScript or PDF designed for human modification. Examples of | ||
| 97 | transparent image formats include PNG, XCF and JPG. Opaque formats | ||
| 98 | include proprietary formats that can be read and edited only by | ||
| 99 | proprietary word processors, SGML or XML for which the DTD and/or | ||
| 100 | processing tools are not generally available, and the | ||
| 101 | machine-generated HTML, PostScript or PDF produced by some word | ||
| 102 | processors for output purposes only. | ||
| 103 | |||
| 104 | The ``Title Page'' means, for a printed book, the title page itself, | ||
| 105 | plus such following pages as are needed to hold, legibly, the material | ||
| 106 | this License requires to appear in the title page. For works in | ||
| 107 | formats which do not have any title page as such, ``Title Page'' means | ||
| 108 | the text near the most prominent appearance of the work's title, | ||
| 109 | preceding the beginning of the body of the text. | ||
| 110 | |||
| 111 | A section ``Entitled XYZ'' means a named subunit of the Document whose | ||
| 112 | title either is precisely XYZ or contains XYZ in parentheses following | ||
| 113 | text that translates XYZ in another language. (Here XYZ stands for a | ||
| 114 | specific section name mentioned below, such as ``Acknowledgements,'' | ||
| 115 | ``Dedications,'' ``Endorsements,'' or ``History.'') To ``Preserve the Title'' | ||
| 116 | of such a section when you modify the Document means that it remains a | ||
| 117 | section ``Entitled XYZ'' according to this definition. | ||
| 118 | |||
| 119 | The Document may include Warranty Disclaimers next to the notice which | ||
| 120 | states that this License applies to the Document. These Warranty | ||
| 121 | Disclaimers are considered to be included by reference in this | ||
| 122 | License, but only as regards disclaiming warranties: any other | ||
| 123 | implication that these Warranty Disclaimers may have is void and has | ||
| 124 | no effect on the meaning of this License. | ||
| 125 | @sp 1 | ||
| 126 | @item | ||
| 127 | VERBATIM COPYING | ||
| 128 | |||
| 129 | You may copy and distribute the Document in any medium, either | ||
| 130 | commercially or noncommercially, provided that this License, the | ||
| 131 | copyright notices, and the license notice saying this License applies | ||
| 132 | to the Document are reproduced in all copies, and that you add no other | ||
| 133 | conditions whatsoever to those of this License. You may not use | ||
| 134 | technical measures to obstruct or control the reading or further | ||
| 135 | copying of the copies you make or distribute. However, you may accept | ||
| 136 | compensation in exchange for copies. If you distribute a large enough | ||
| 137 | number of copies you must also follow the conditions in section 3. | ||
| 138 | |||
| 139 | You may also lend copies, under the same conditions stated above, and | ||
| 140 | you may publicly display copies. | ||
| 141 | @sp 1 | ||
| 142 | @item | ||
| 143 | COPYING IN QUANTITY | ||
| 144 | |||
| 145 | If you publish printed copies (or copies in media that commonly have | ||
| 146 | printed covers) of the Document, numbering more than 100, and the | ||
| 147 | Document's license notice requires Cover Texts, you must enclose the | ||
| 148 | copies in covers that carry, clearly and legibly, all these Cover | ||
| 149 | Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on | ||
| 150 | the back cover. Both covers must also clearly and legibly identify | ||
| 151 | you as the publisher of these copies. The front cover must present | ||
| 152 | the full title with all words of the title equally prominent and | ||
| 153 | visible. You may add other material on the covers in addition. | ||
| 154 | Copying with changes limited to the covers, as long as they preserve | ||
| 155 | the title of the Document and satisfy these conditions, can be treated | ||
| 156 | as verbatim copying in other respects. | ||
| 157 | |||
| 158 | If the required texts for either cover are too voluminous to fit | ||
| 159 | legibly, you should put the first ones listed (as many as fit | ||
| 160 | reasonably) on the actual cover, and continue the rest onto adjacent | ||
| 161 | pages. | ||
| 162 | |||
| 163 | If you publish or distribute Opaque copies of the Document numbering | ||
| 164 | more than 100, you must either include a machine-readable Transparent | ||
| 165 | copy along with each Opaque copy, or state in or with each Opaque copy | ||
| 166 | a computer-network location from which the general network-using | ||
| 167 | public has access to download using public-standard network protocols | ||
| 168 | a complete Transparent copy of the Document, free of added material. | ||
| 169 | If you use the latter option, you must take reasonably prudent steps, | ||
| 170 | when you begin distribution of Opaque copies in quantity, to ensure | ||
| 171 | that this Transparent copy will remain thus accessible at the stated | ||
| 172 | location until at least one year after the last time you distribute an | ||
| 173 | Opaque copy (directly or through your agents or retailers) of that | ||
| 174 | edition to the public. | ||
| 175 | |||
| 176 | It is requested, but not required, that you contact the authors of the | ||
| 177 | Document well before redistributing any large number of copies, to give | ||
| 178 | them a chance to provide you with an updated version of the Document. | ||
| 179 | @sp 1 | ||
| 180 | @item | ||
| 181 | MODIFICATIONS | ||
| 182 | |||
| 183 | You may copy and distribute a Modified Version of the Document under | ||
| 184 | the conditions of sections 2 and 3 above, provided that you release | ||
| 185 | the Modified Version under precisely this License, with the Modified | ||
| 186 | Version filling the role of the Document, thus licensing distribution | ||
| 187 | and modification of the Modified Version to whoever possesses a copy | ||
| 188 | of it. In addition, you must do these things in the Modified Version: | ||
| 189 | |||
| 190 | A. Use in the Title Page (and on the covers, if any) a title distinct | ||
| 191 | from that of the Document, and from those of previous versions | ||
| 192 | (which should, if there were any, be listed in the History section | ||
| 193 | of the Document). You may use the same title as a previous version | ||
| 194 | if the original publisher of that version gives permission.@* | ||
| 195 | B. List on the Title Page, as authors, one or more persons or entities | ||
| 196 | responsible for authorship of the modifications in the Modified | ||
| 197 | Version, together with at least five of the principal authors of the | ||
| 198 | Document (all of its principal authors, if it has fewer than five), | ||
| 199 | unless they release you from this requirement.@* | ||
| 200 | C. State on the Title page the name of the publisher of the | ||
| 201 | Modified Version, as the publisher.@* | ||
| 202 | D. Preserve all the copyright notices of the Document.@* | ||
| 203 | E. Add an appropriate copyright notice for your modifications | ||
| 204 | adjacent to the other copyright notices.@* | ||
| 205 | F. Include, immediately after the copyright notices, a license notice | ||
| 206 | giving the public permission to use the Modified Version under the | ||
| 207 | terms of this License, in the form shown in the Addendum below.@* | ||
| 208 | G. Preserve in that license notice the full lists of Invariant Sections | ||
| 209 | and required Cover Texts given in the Document's license notice.@* | ||
| 210 | H. Include an unaltered copy of this License.@* | ||
| 211 | I. Preserve the section Entitled ``History,'' Preserve its Title, and add | ||
| 212 | to it an item stating at least the title, year, new authors, and | ||
| 213 | publisher of the Modified Version as given on the Title Page. If | ||
| 214 | there is no section Entitled ``History'' in the Document, create one | ||
| 215 | stating the title, year, authors, and publisher of the Document as | ||
| 216 | given on its Title Page, then add an item describing the Modified | ||
| 217 | Version as stated in the previous sentence.@* | ||
| 218 | J. Preserve the network location, if any, given in the Document for | ||
| 219 | public access to a Transparent copy of the Document, and likewise | ||
| 220 | the network locations given in the Document for previous versions | ||
| 221 | it was based on. These may be placed in the ``History'' section. | ||
| 222 | You may omit a network location for a work that was published at | ||
| 223 | least four years before the Document itself, or if the original | ||
| 224 | publisher of the version it refers to gives permission.@* | ||
| 225 | K. For any section Entitled ``Acknowledgements'' or ``Dedications,'' | ||
| 226 | Preserve the Title of the section, and preserve in the section all | ||
| 227 | the substance and tone of each of the contributor acknowledgements | ||
| 228 | and/or dedications given therein.@* | ||
| 229 | L. Preserve all the Invariant Sections of the Document, | ||
| 230 | unaltered in their text and in their titles. Section numbers | ||
| 231 | or the equivalent are not considered part of the section titles.@* | ||
| 232 | M. Delete any section Entitled ``Endorsements.'' Such a section | ||
| 233 | may not be included in the Modified Version.@* | ||
| 234 | N. Do not retitle any existing section to be Entitled ``Endorsements'' | ||
| 235 | or to conflict in title with any Invariant Section.@* | ||
| 236 | O. Preserve any Warranty Disclaimers.@* | ||
| 237 | @sp 1 | ||
| 238 | If the Modified Version includes new front-matter sections or | ||
| 239 | appendices that qualify as Secondary Sections and contain no material | ||
| 240 | copied from the Document, you may at your option designate some or all | ||
| 241 | of these sections as invariant. To do this, add their titles to the | ||
| 242 | list of Invariant Sections in the Modified Version's license notice. | ||
| 243 | These titles must be distinct from any other section titles. | ||
| 244 | |||
| 245 | You may add a section Entitled ``Endorsements,'' provided it contains | ||
| 246 | nothing but endorsements of your Modified Version by various | ||
| 247 | parties--for example, statements of peer review or that the text has | ||
| 248 | been approved by an organization as the authoritative definition of a | ||
| 249 | standard. | ||
| 250 | |||
| 251 | You may add a passage of up to five words as a Front-Cover Text, and a | ||
| 252 | passage of up to 25 words as a Back-Cover Text, to the end of the list | ||
| 253 | of Cover Texts in the Modified Version. Only one passage of | ||
| 254 | Front-Cover Text and one of Back-Cover Text may be added by (or | ||
| 255 | through arrangements made by) any one entity. If the Document already | ||
| 256 | includes a cover text for the same cover, previously added by you or | ||
| 257 | by arrangement made by the same entity you are acting on behalf of, | ||
| 258 | you may not add another; but you may replace the old one, on explicit | ||
| 259 | permission from the previous publisher that added the old one. | ||
| 260 | |||
| 261 | The author(s) and publisher(s) of the Document do not by this License | ||
| 262 | give permission to use their names for publicity for or to assert or | ||
| 263 | imply endorsement of any Modified Version. | ||
| 264 | @sp 1 | ||
| 265 | @item | ||
| 266 | COMBINING DOCUMENTS | ||
| 267 | |||
| 268 | You may combine the Document with other documents released under this | ||
| 269 | License, under the terms defined in section 4 above for modified | ||
| 270 | versions, provided that you include in the combination all of the | ||
| 271 | Invariant Sections of all of the original documents, unmodified, and | ||
| 272 | list them all as Invariant Sections of your combined work in its | ||
| 273 | license notice, and that you preserve all their Warranty Disclaimers. | ||
| 274 | |||
| 275 | The combined work need only contain one copy of this License, and | ||
| 276 | multiple identical Invariant Sections may be replaced with a single | ||
| 277 | copy. If there are multiple Invariant Sections with the same name but | ||
| 278 | different contents, make the title of each such section unique by | ||
| 279 | adding at the end of it, in parentheses, the name of the original | ||
| 280 | author or publisher of that section if known, or else a unique number. | ||
| 281 | Make the same adjustment to the section titles in the list of | ||
| 282 | Invariant Sections in the license notice of the combined work. | ||
| 283 | |||
| 284 | In the combination, you must combine any sections Entitled ``History'' | ||
| 285 | in the various original documents, forming one section Entitled | ||
| 286 | ``History''; likewise combine any sections Entitled ``Acknowledgements,'' | ||
| 287 | and any sections Entitled ``Dedications.'' You must delete all sections | ||
| 288 | Entitled ``Endorsements.'' | ||
| 289 | @sp 1 | ||
| 290 | @item | ||
| 291 | COLLECTIONS OF DOCUMENTS | ||
| 292 | |||
| 293 | You may make a collection consisting of the Document and other documents | ||
| 294 | released under this License, and replace the individual copies of this | ||
| 295 | License in the various documents with a single copy that is included in | ||
| 296 | the collection, provided that you follow the rules of this License for | ||
| 297 | verbatim copying of each of the documents in all other respects. | ||
| 298 | |||
| 299 | You may extract a single document from such a collection, and distribute | ||
| 300 | it individually under this License, provided you insert a copy of this | ||
| 301 | License into the extracted document, and follow this License in all | ||
| 302 | other respects regarding verbatim copying of that document. | ||
| 303 | @sp 1 | ||
| 304 | @item | ||
| 305 | AGGREGATION WITH INDEPENDENT WORKS | ||
| 306 | |||
| 307 | A compilation of the Document or its derivatives with other separate | ||
| 308 | and independent documents or works, in or on a volume of a storage or | ||
| 309 | distribution medium, is called an ``aggregate'' if the copyright | ||
| 310 | resulting from the compilation is not used to limit the legal rights | ||
| 311 | of the compilation's users beyond what the individual works permit. | ||
| 312 | When the Document is included in an aggregate, this License does not | ||
| 313 | apply to the other works in the aggregate which are not themselves | ||
| 314 | derivative works of the Document. | ||
| 315 | |||
| 316 | If the Cover Text requirement of section 3 is applicable to these | ||
| 317 | copies of the Document, then if the Document is less than one half of | ||
| 318 | the entire aggregate, the Document's Cover Texts may be placed on | ||
| 319 | covers that bracket the Document within the aggregate, or the | ||
| 320 | electronic equivalent of covers if the Document is in electronic form. | ||
| 321 | Otherwise they must appear on printed covers that bracket the whole | ||
| 322 | aggregate. | ||
| 323 | @sp 1 | ||
| 324 | @item | ||
| 325 | TRANSLATION | ||
| 326 | |||
| 327 | Translation is considered a kind of modification, so you may | ||
| 328 | distribute translations of the Document under the terms of section 4. | ||
| 329 | Replacing Invariant Sections with translations requires special | ||
| 330 | permission from their copyright holders, but you may include | ||
| 331 | translations of some or all Invariant Sections in addition to the | ||
| 332 | original versions of these Invariant Sections. You may include a | ||
| 333 | translation of this License, and all the license notices in the | ||
| 334 | Document, and any Warranty Disclaimers, provided that you also include | ||
| 335 | the original English version of this License and the original versions | ||
| 336 | of those notices and disclaimers. In case of a disagreement between | ||
| 337 | the translation and the original version of this License or a notice | ||
| 338 | or disclaimer, the original version will prevail. | ||
| 339 | |||
| 340 | If a section in the Document is Entitled ``Acknowledgements,'' | ||
| 341 | ``Dedications,'' or ``History,'' the requirement (section 4) to Preserve | ||
| 342 | its Title (section 1) will typically require changing the actual | ||
| 343 | title. | ||
| 344 | @sp 1 | ||
| 345 | @item | ||
| 346 | TERMINATION | ||
| 347 | |||
| 348 | You may not copy, modify, sublicense, or distribute the Document except | ||
| 349 | as expressly provided for under this License. Any other attempt to | ||
| 350 | copy, modify, sublicense or distribute the Document is void, and will | ||
| 351 | automatically terminate your rights under this License. However, | ||
| 352 | parties who have received copies, or rights, from you under this | ||
| 353 | License will not have their licenses terminated so long as such | ||
| 354 | parties remain in full compliance. | ||
| 355 | @sp 1 | ||
| 356 | @item | ||
| 357 | FUTURE REVISIONS OF THIS LICENSE | ||
| 358 | |||
| 359 | The Free Software Foundation may publish new, revised versions | ||
| 360 | of the GNU Free Documentation License from time to time. Such new | ||
| 361 | versions will be similar in spirit to the present version, but may | ||
| 362 | differ in detail to address new problems or concerns. See | ||
| 363 | http://www.gnu.org/copyleft/. | ||
| 364 | |||
| 365 | Each version of the License is given a distinguishing version number. | ||
| 366 | If the Document specifies that a particular numbered version of this | ||
| 367 | License ``or any later version'' applies to it, you have the option of | ||
| 368 | following the terms and conditions either of that specified version or | ||
| 369 | of any later version that has been published (not as a draft) by the | ||
| 370 | Free Software Foundation. If the Document does not specify a version | ||
| 371 | number of this License, you may choose any version ever published (not | ||
| 372 | as a draft) by the Free Software Foundation. | ||
| 373 | |||
| 374 | @end enumerate | ||
| 375 | |||
| 376 | @unnumberedsec ADDENDUM: How to use this License for your documents | ||
| 377 | |||
| 378 | To use this License in a document you have written, include a copy of | ||
| 379 | the License in the document and put the following copyright and | ||
| 380 | license notices just after the title page: | ||
| 381 | |||
| 382 | @smallexample | ||
| 383 | @group | ||
| 384 | Copyright (C) @var{year} @var{your name}. | ||
| 385 | Permission is granted to copy, distribute and/or modify this document | ||
| 386 | under the terms of the GNU Free Documentation License, Version 1.2 | ||
| 387 | or any later version published by the Free Software Foundation; | ||
| 388 | with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. | ||
| 389 | A copy of the license is included in the section entitled ``GNU | ||
| 390 | Free Documentation License.'' | ||
| 391 | @end group | ||
| 392 | @end smallexample | ||
| 393 | |||
| 394 | If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, | ||
| 395 | replace the ``with...Texts.'' line with this: | ||
| 396 | |||
| 397 | @smallexample | ||
| 398 | @group | ||
| 399 | with the Invariant Sections being @var{list their titles}, with the | ||
| 400 | Front-Cover Texts being @var{list}, and with the Back-Cover Texts being | ||
| 401 | @var{list}. | ||
| 402 | @end group | ||
| 403 | @end smallexample | ||
| 404 | |||
| 405 | If you have Invariant Sections without Cover Texts, or some other | ||
| 406 | combination of the three, merge those two alternatives to suit the | ||
| 407 | situation. | ||
| 408 | |||
| 409 | If your document contains nontrivial examples of program code, we | ||
| 410 | recommend releasing these examples in parallel under your choice of | ||
| 411 | free software license, such as the GNU General Public License, | ||
| 412 | to permit their use in free software. | ||
| 413 | |||
| 414 | @ignore | ||
| 415 | arch-tag: c1679162-1d8a-4f02-bc52-2e71765f0165 | ||
| 416 | @end ignore | ||
diff --git a/doc/emacs/emacs-xtra.texi b/doc/emacs/emacs-xtra.texi new file mode 100644 index 00000000000..841c62a527f --- /dev/null +++ b/doc/emacs/emacs-xtra.texi | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | \input texinfo @c -*-texinfo-*- | ||
| 2 | @comment %**start of header | ||
| 3 | @setfilename ../info/emacs-xtra | ||
| 4 | @settitle Specialized Emacs Features | ||
| 5 | @syncodeindex fn cp | ||
| 6 | @syncodeindex vr cp | ||
| 7 | @syncodeindex ky cp | ||
| 8 | @comment %**end of header | ||
| 9 | |||
| 10 | @copying | ||
| 11 | This manual describes specialized features of Emacs. | ||
| 12 | |||
| 13 | Copyright @copyright{} 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 14 | |||
| 15 | @quotation | ||
| 16 | Permission is granted to copy, distribute and/or modify this document | ||
| 17 | under the terms of the GNU Free Documentation License, Version 1.2 or | ||
| 18 | any later version published by the Free Software Foundation; with no | ||
| 19 | Invariant Sections, with the Front-Cover texts being ``A GNU | ||
| 20 | Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the | ||
| 21 | license is included in the section entitled ``GNU Free Documentation | ||
| 22 | License'' in the Emacs manual. | ||
| 23 | |||
| 24 | (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify | ||
| 25 | this GNU Manual, like GNU software. Copies published by the Free | ||
| 26 | Software Foundation raise funds for GNU development.'' | ||
| 27 | |||
| 28 | This document is part of a collection distributed under the GNU Free | ||
| 29 | Documentation License. If you want to distribute this document | ||
| 30 | separately from the collection, you can do so by adding a copy of the | ||
| 31 | license to the document, as described in section 6 of the license. | ||
| 32 | @end quotation | ||
| 33 | @end copying | ||
| 34 | |||
| 35 | @dircategory Emacs | ||
| 36 | @direntry | ||
| 37 | * Emacs-Xtra: (emacs-xtra). Specialized Emacs features. | ||
| 38 | @end direntry | ||
| 39 | |||
| 40 | @titlepage | ||
| 41 | @title Specialized Emacs Features | ||
| 42 | @page | ||
| 43 | @vskip 0pt plus 1filll | ||
| 44 | @insertcopying | ||
| 45 | @end titlepage | ||
| 46 | |||
| 47 | @contents | ||
| 48 | |||
| 49 | @ifnottex | ||
| 50 | @node Top | ||
| 51 | @top Specialized Emacs Features | ||
| 52 | |||
| 53 | @insertcopying | ||
| 54 | |||
| 55 | @end ifnottex | ||
| 56 | |||
| 57 | @menu | ||
| 58 | * Introduction:: What documentation belongs here? | ||
| 59 | @iftex | ||
| 60 | * Picture Mode:: Editing pictures made up of characters using | ||
| 61 | the quarter-plane screen model. | ||
| 62 | |||
| 63 | * Autorevert:: Auto Reverting non-file buffers. | ||
| 64 | * Subdir Switches:: Subdirectory switches in Dired. | ||
| 65 | * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. | ||
| 66 | * Emerge:: A convenient way of merging two versions of a program. | ||
| 67 | * Advanced VC Usage:: Advanced VC (version control) features. | ||
| 68 | * Fortran:: Fortran mode and its special features. | ||
| 69 | * MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}). | ||
| 70 | @end iftex | ||
| 71 | * Index:: | ||
| 72 | @end menu | ||
| 73 | |||
| 74 | @node Introduction | ||
| 75 | @unnumbered Introduction | ||
| 76 | |||
| 77 | This manual contains detailed information about various features that | ||
| 78 | are too specialized to be included in the printed Emacs manual. It is | ||
| 79 | intended to be readable by anyone having a basic knowledge of Emacs. | ||
| 80 | However, certain sections may be intended for a more specialized | ||
| 81 | audience, such as Elisp authors. This should be clearly pointed out | ||
| 82 | at the beginning of these sections. | ||
| 83 | |||
| 84 | Certain packages, or collections of related features, have their own | ||
| 85 | manuals, separate from the main Emacs User's manual. This manual is | ||
| 86 | intended as a complement, rather than an alternative, to reading those | ||
| 87 | additional manuals; in a nutshell, it is a collection of smaller | ||
| 88 | specialized features, too small or too obscure to justify their own | ||
| 89 | manual. | ||
| 90 | |||
| 91 | Sections intended specifically for Elisp programmers can follow the | ||
| 92 | style of the Elisp manual. Other sections should follow the style of | ||
| 93 | the Emacs manual. | ||
| 94 | |||
| 95 | @iftex | ||
| 96 | @c ``Picture Mode'' is a chapter, not a section, so it's outside @raisesections. | ||
| 97 | @include picture-xtra.texi | ||
| 98 | |||
| 99 | @raisesections | ||
| 100 | @include arevert-xtra.texi | ||
| 101 | |||
| 102 | @include dired-xtra.texi | ||
| 103 | |||
| 104 | @include cal-xtra.texi | ||
| 105 | |||
| 106 | @include emerge-xtra.texi | ||
| 107 | |||
| 108 | @include vc-xtra.texi | ||
| 109 | |||
| 110 | @include fortran-xtra.texi | ||
| 111 | |||
| 112 | @include msdog-xtra.texi | ||
| 113 | |||
| 114 | @lowersections | ||
| 115 | @end iftex | ||
| 116 | |||
| 117 | @node Index | ||
| 118 | @unnumbered Index | ||
| 119 | |||
| 120 | @printindex cp | ||
| 121 | |||
| 122 | @bye | ||
| 123 | |||
| 124 | @ignore | ||
| 125 | arch-tag: 75c33f13-32c6-41b6-9537-847a312e2e49 | ||
| 126 | @end ignore | ||
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi new file mode 100644 index 00000000000..1e6fd8461c3 --- /dev/null +++ b/doc/emacs/emacs.texi | |||
| @@ -0,0 +1,1365 @@ | |||
| 1 | \input texinfo | ||
| 2 | |||
| 3 | @setfilename ../info/emacs | ||
| 4 | @settitle GNU Emacs Manual | ||
| 5 | |||
| 6 | @c The edition number appears in several places in this file | ||
| 7 | @set EDITION Sixteenth | ||
| 8 | @set EMACSVER 23.0.50 | ||
| 9 | |||
| 10 | @copying | ||
| 11 | This is the @value{EDITION} edition of the @cite{GNU Emacs Manual},@* | ||
| 12 | updated for Emacs version @value{EMACSVER}. | ||
| 13 | |||
| 14 | Copyright @copyright{} 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, | ||
| 15 | 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software | ||
| 16 | Foundation, Inc. | ||
| 17 | |||
| 18 | @quotation | ||
| 19 | Permission is granted to copy, distribute and/or modify this document | ||
| 20 | under the terms of the GNU Free Documentation License, Version 1.2 or | ||
| 21 | any later version published by the Free Software Foundation; with the | ||
| 22 | Invariant Sections being ``The GNU Manifesto,'' ``Distribution'' and | ||
| 23 | ``GNU GENERAL PUBLIC LICENSE,'' with the Front-Cover texts being ``A GNU | ||
| 24 | Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the | ||
| 25 | license is included in the section entitled ``GNU Free Documentation | ||
| 26 | License.'' | ||
| 27 | |||
| 28 | (a) The FSF's Back-Cover Text is: ``You are free to copy and modify | ||
| 29 | this GNU Manual. Buying copies from GNU Press supports the FSF in | ||
| 30 | developing GNU and promoting software freedom.'' | ||
| 31 | @end quotation | ||
| 32 | @end copying | ||
| 33 | |||
| 34 | @dircategory Emacs | ||
| 35 | @direntry | ||
| 36 | * Emacs: (emacs). The extensible self-documenting text editor. | ||
| 37 | @end direntry | ||
| 38 | |||
| 39 | @c in general, keep the following line commented out, unless doing a | ||
| 40 | @c copy of this manual that will be published. The manual should go | ||
| 41 | @c onto the distribution in the full, 8.5 x 11" size. | ||
| 42 | @c set smallbook | ||
| 43 | |||
| 44 | @ifset smallbook | ||
| 45 | @smallbook | ||
| 46 | @end ifset | ||
| 47 | |||
| 48 | @c per rms and peterb, use 10pt fonts for the main text, mostly to | ||
| 49 | @c save on paper cost. | ||
| 50 | @c Do this inside @tex for now, so current makeinfo does not complain. | ||
| 51 | @tex | ||
| 52 | @ifset smallbook | ||
| 53 | @fonttextsize 10 | ||
| 54 | @set EMACSVER 22 | ||
| 55 | \global\let\urlcolor=\Black % don't print links in grayscale | ||
| 56 | \global\let\linkcolor=\Black | ||
| 57 | @end ifset | ||
| 58 | \global\hbadness=6666 % don't worry about not-too-underfull boxes | ||
| 59 | @end tex | ||
| 60 | |||
| 61 | @defcodeindex op | ||
| 62 | @synindex pg cp | ||
| 63 | |||
| 64 | @iftex | ||
| 65 | @kbdinputstyle code | ||
| 66 | |||
| 67 | @shorttitlepage GNU Emacs Manual | ||
| 68 | @end iftex | ||
| 69 | |||
| 70 | @titlepage | ||
| 71 | @sp 6 | ||
| 72 | @center @titlefont{GNU Emacs Manual} | ||
| 73 | @sp 4 | ||
| 74 | @center @value{EDITION} Edition, Updated for Emacs Version @value{EMACSVER}. | ||
| 75 | @sp 5 | ||
| 76 | @center Richard Stallman | ||
| 77 | @page | ||
| 78 | @vskip 0pt plus 1filll | ||
| 79 | @insertcopying | ||
| 80 | |||
| 81 | @sp 2 | ||
| 82 | Published by the Free Software Foundation @* | ||
| 83 | 51 Franklin Street, Fifth Floor @* | ||
| 84 | Boston, MA 02110-1301 USA @* | ||
| 85 | ISBN 1-882114-86-8 | ||
| 86 | |||
| 87 | @sp 2 | ||
| 88 | Cover art by Etienne Suvasa. | ||
| 89 | |||
| 90 | @end titlepage | ||
| 91 | |||
| 92 | |||
| 93 | @summarycontents | ||
| 94 | @contents | ||
| 95 | |||
| 96 | |||
| 97 | @ifnottex | ||
| 98 | @node Top, Distrib, (dir), (dir) | ||
| 99 | @top The Emacs Editor | ||
| 100 | |||
| 101 | Emacs is the extensible, customizable, self-documenting real-time | ||
| 102 | display editor. This Info file describes how to edit with Emacs and | ||
| 103 | some of how to customize it; it corresponds to GNU Emacs version | ||
| 104 | @value{EMACSVER}. | ||
| 105 | |||
| 106 | @ifinfo | ||
| 107 | To learn more about the Info documentation system, type @kbd{h}, and | ||
| 108 | Emacs will take you to a programmed instruction sequence for the Info | ||
| 109 | commands. | ||
| 110 | @end ifinfo | ||
| 111 | |||
| 112 | For information on extending Emacs, see @ref{Top, Emacs Lisp,, elisp, The | ||
| 113 | Emacs Lisp Reference Manual}. | ||
| 114 | @end ifnottex | ||
| 115 | |||
| 116 | @ignore | ||
| 117 | These subcategories have been deleted for simplicity | ||
| 118 | and to avoid conflicts. | ||
| 119 | Completion | ||
| 120 | Backup Files | ||
| 121 | Auto-Saving: Protection Against Disasters | ||
| 122 | Snapshots | ||
| 123 | Text Mode | ||
| 124 | Outline Mode | ||
| 125 | @TeX{} Mode | ||
| 126 | Formatted Text | ||
| 127 | Shell Command History | ||
| 128 | |||
| 129 | The ones for Dired and Rmail have had the items turned into :: items | ||
| 130 | to avoid conflicts. | ||
| 131 | Also Running Shell Commands from Emacs | ||
| 132 | and Sending Mail and Registers and Minibuffer. | ||
| 133 | @end ignore | ||
| 134 | |||
| 135 | @menu | ||
| 136 | * Distrib:: How to get the latest Emacs distribution. | ||
| 137 | * Copying:: The GNU General Public License gives you permission | ||
| 138 | to redistribute GNU Emacs on certain terms; | ||
| 139 | it also explains that there is no warranty. | ||
| 140 | * GNU Free Documentation License:: The license for this documentation. | ||
| 141 | * Intro:: An introduction to Emacs concepts. | ||
| 142 | * Glossary:: The glossary. | ||
| 143 | * Antinews:: Information about Emacs version 21. | ||
| 144 | * Mac OS:: Using Emacs in the Mac. | ||
| 145 | * Microsoft Windows:: Using Emacs on Microsoft Windows and MS-DOS. | ||
| 146 | * Manifesto:: What's GNU? Gnu's Not Unix! | ||
| 147 | * Acknowledgments:: Major contributors to GNU Emacs. | ||
| 148 | |||
| 149 | Indexes (each index contains a large menu) | ||
| 150 | * Key Index:: An item for each standard Emacs key sequence. | ||
| 151 | * Option Index:: An item for every command-line option. | ||
| 152 | * Command Index:: An item for each command name. | ||
| 153 | * Variable Index:: An item for each documented variable. | ||
| 154 | * Concept Index:: An item for each concept. | ||
| 155 | |||
| 156 | Important General Concepts | ||
| 157 | * Screen:: How to interpret what you see on the screen. | ||
| 158 | * User Input:: Kinds of input events (characters, buttons, | ||
| 159 | function keys). | ||
| 160 | * Keys:: Key sequences: what you type to request one | ||
| 161 | editing action. | ||
| 162 | * Commands:: Named functions run by key sequences to do editing. | ||
| 163 | * Text Characters:: Character set for text (the contents of buffers | ||
| 164 | and strings). | ||
| 165 | * Entering Emacs:: Starting Emacs from the shell. | ||
| 166 | * Exiting:: Stopping or killing Emacs. | ||
| 167 | * Emacs Invocation:: Hairy startup options. | ||
| 168 | |||
| 169 | Fundamental Editing Commands | ||
| 170 | * Basic:: The most basic editing commands. | ||
| 171 | * Minibuffer:: Entering arguments that are prompted for. | ||
| 172 | * M-x:: Invoking commands by their names. | ||
| 173 | * Help:: Commands for asking Emacs about its commands. | ||
| 174 | |||
| 175 | Important Text-Changing Commands | ||
| 176 | * Mark:: The mark: how to delimit a ``region'' of text. | ||
| 177 | * Killing:: Killing (cutting) text. | ||
| 178 | * Yanking:: Recovering killed text. Moving text. (Pasting.) | ||
| 179 | * Accumulating Text:: Other ways of copying text. | ||
| 180 | * Rectangles:: Operating on the text inside a rectangle on the screen. | ||
| 181 | * Registers:: Saving a text string or a location in the buffer. | ||
| 182 | * Display:: Controlling what text is displayed. | ||
| 183 | * Search:: Finding or replacing occurrences of a string. | ||
| 184 | * Fixit:: Commands especially useful for fixing typos. | ||
| 185 | * Keyboard Macros:: A keyboard macro records a sequence of | ||
| 186 | keystrokes to be replayed with a single command. | ||
| 187 | |||
| 188 | Major Structures of Emacs | ||
| 189 | * Files:: All about handling files. | ||
| 190 | * Buffers:: Multiple buffers; editing several files at once. | ||
| 191 | * Windows:: Viewing two pieces of text at once. | ||
| 192 | * Frames:: Running the same Emacs session in multiple X windows. | ||
| 193 | * International:: Using non-@acronym{ASCII} character sets (the MULE features). | ||
| 194 | |||
| 195 | Advanced Features | ||
| 196 | * Major Modes:: Text mode vs. Lisp mode vs. C mode ... | ||
| 197 | * Indentation:: Editing the white space at the beginnings of lines. | ||
| 198 | * Text:: Commands and modes for editing English. | ||
| 199 | * Programs:: Commands and modes for editing programs. | ||
| 200 | * Building:: Compiling, running and debugging programs. | ||
| 201 | * Maintaining:: Features for maintaining large programs. | ||
| 202 | * Abbrevs:: How to define text abbreviations to reduce | ||
| 203 | the number of characters you must type. | ||
| 204 | @ifnottex | ||
| 205 | * Picture Mode:: Editing pictures made up of characters using | ||
| 206 | the quarter-plane screen model. | ||
| 207 | @end ifnottex | ||
| 208 | * Sending Mail:: Sending mail in Emacs. | ||
| 209 | * Rmail:: Reading mail in Emacs. | ||
| 210 | * Dired:: You can ``edit'' a directory to manage files in it. | ||
| 211 | * Calendar/Diary:: The calendar and diary facilities. | ||
| 212 | * Gnus:: How to read netnews with Emacs. | ||
| 213 | * Shell:: Executing shell commands from Emacs. | ||
| 214 | * Emacs Server:: Using Emacs as an editing server for @code{mail}, etc. | ||
| 215 | * Printing:: Printing hardcopies of buffers or regions. | ||
| 216 | * Sorting:: Sorting lines, paragraphs or pages within Emacs. | ||
| 217 | * Narrowing:: Restricting display and editing to a portion | ||
| 218 | of the buffer. | ||
| 219 | * Two-Column:: Splitting apart columns to edit them | ||
| 220 | in side-by-side windows. | ||
| 221 | * Editing Binary Files::Using Hexl mode to edit binary files. | ||
| 222 | * Saving Emacs Sessions:: Saving Emacs state from one session to the next. | ||
| 223 | * Recursive Edit:: A command can allow you to do editing | ||
| 224 | "within the command". This is called a | ||
| 225 | "recursive editing level". | ||
| 226 | * Emulation:: Emulating some other editors with Emacs. | ||
| 227 | * Hyperlinking:: Following links in buffers. | ||
| 228 | * Dissociated Press:: Dissociating text for fun. | ||
| 229 | * Amusements:: Various games and hacks. | ||
| 230 | * Customization:: Modifying the behavior of Emacs. | ||
| 231 | * X Resources:: X resources for customizing Emacs. | ||
| 232 | |||
| 233 | Recovery from Problems | ||
| 234 | * Quitting:: Quitting and aborting. | ||
| 235 | * Lossage:: What to do if Emacs is hung or malfunctioning. | ||
| 236 | * Bugs:: How and when to report a bug. | ||
| 237 | * Contributing:: How to contribute improvements to Emacs. | ||
| 238 | * Service:: How to get help for your own Emacs needs. | ||
| 239 | |||
| 240 | @c Do NOT modify the following 3 lines! They must have this form to | ||
| 241 | @c be correctly identified by `texinfo-multiple-files-update'. In | ||
| 242 | @c particular, the detailed menu header line MUST be identical to the | ||
| 243 | @c value of `texinfo-master-menu-header'. See texnfo-upd.el. | ||
| 244 | |||
| 245 | @detailmenu | ||
| 246 | --- The Detailed Node Listing --- | ||
| 247 | --------------------------------- | ||
| 248 | |||
| 249 | Here are some other nodes which are really inferiors of the ones | ||
| 250 | already listed, mentioned here so you can get to them in one step: | ||
| 251 | |||
| 252 | The Organization of the Screen | ||
| 253 | |||
| 254 | * Point:: The place in the text where editing commands operate. | ||
| 255 | * Echo Area:: Short messages appear at the bottom of the screen. | ||
| 256 | * Mode Line:: Interpreting the mode line. | ||
| 257 | * Menu Bar:: How to use the menu bar. | ||
| 258 | |||
| 259 | Basic Editing Commands | ||
| 260 | |||
| 261 | * Inserting Text:: Inserting text by simply typing it. | ||
| 262 | * Moving Point:: How to move the cursor to the place where you want to | ||
| 263 | change something. | ||
| 264 | * Erasing:: Deleting and killing text. | ||
| 265 | * Basic Undo:: Undoing recent changes in the text. | ||
| 266 | * Basic Files:: Visiting, creating, and saving files. | ||
| 267 | * Basic Help:: Asking what a character does. | ||
| 268 | * Blank Lines:: Commands to make or delete blank lines. | ||
| 269 | * Continuation Lines:: Lines too wide for the screen. | ||
| 270 | * Position Info:: What page, line, row, or column is point on? | ||
| 271 | * Arguments:: Numeric arguments for repeating a command. | ||
| 272 | * Repeating:: A short-cut for repeating the previous command. | ||
| 273 | |||
| 274 | The Minibuffer | ||
| 275 | |||
| 276 | * Minibuffer File:: Entering file names with the minibuffer. | ||
| 277 | * Minibuffer Edit:: How to edit in the minibuffer. | ||
| 278 | * Completion:: An abbreviation facility for minibuffer input. | ||
| 279 | * Minibuffer History:: Reusing recent minibuffer arguments. | ||
| 280 | * Repetition:: Re-executing commands that used the minibuffer. | ||
| 281 | |||
| 282 | Completion | ||
| 283 | |||
| 284 | * Example: Completion Example. Examples of using completion. | ||
| 285 | * Commands: Completion Commands. A list of completion commands. | ||
| 286 | * Strict Completion:: Different types of completion. | ||
| 287 | * Options: Completion Options. Options for completion. | ||
| 288 | |||
| 289 | Help | ||
| 290 | |||
| 291 | * Help Summary:: Brief list of all Help commands. | ||
| 292 | * Key Help:: Asking what a key does in Emacs. | ||
| 293 | * Name Help:: Asking about a command, variable or function name. | ||
| 294 | * Apropos:: Asking what pertains to a given topic. | ||
| 295 | * Help Mode:: Special features of Help mode and Help buffers. | ||
| 296 | * Library Keywords:: Finding Lisp libraries by keywords (topics). | ||
| 297 | * Language Help:: Help relating to international language support. | ||
| 298 | * Misc Help:: Other help commands. | ||
| 299 | * Help Files:: Commands to display pre-written help files. | ||
| 300 | * Help Echo:: Help on active text and tooltips (`balloon help') | ||
| 301 | |||
| 302 | The Mark and the Region | ||
| 303 | |||
| 304 | * Setting Mark:: Commands to set the mark. | ||
| 305 | * Transient Mark:: How to make Emacs highlight the region-- | ||
| 306 | when there is one. | ||
| 307 | * Momentary Mark:: Enabling Transient Mark mode momentarily. | ||
| 308 | * Using Region:: Summary of ways to operate on contents of the region. | ||
| 309 | * Marking Objects:: Commands to put region around textual units. | ||
| 310 | * Mark Ring:: Previous mark positions saved so you can go back there. | ||
| 311 | * Global Mark Ring:: Previous mark positions in various buffers. | ||
| 312 | |||
| 313 | Killing and Moving Text | ||
| 314 | |||
| 315 | * Deletion:: Commands for deleting small amounts of text and | ||
| 316 | blank areas. | ||
| 317 | * Killing by Lines:: How to kill entire lines of text at one time. | ||
| 318 | * Other Kill Commands:: Commands to kill large regions of text and | ||
| 319 | syntactic units such as words and sentences. | ||
| 320 | * CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy | ||
| 321 | and paste, with enhanced rectangle support. | ||
| 322 | |||
| 323 | Yanking | ||
| 324 | |||
| 325 | * Kill Ring:: Where killed text is stored. Basic yanking. | ||
| 326 | * Appending Kills:: Several kills in a row all yank together. | ||
| 327 | * Earlier Kills:: Yanking something killed some time ago. | ||
| 328 | |||
| 329 | Registers | ||
| 330 | |||
| 331 | * RegPos:: Saving positions in registers. | ||
| 332 | * RegText:: Saving text in registers. | ||
| 333 | * RegRect:: Saving rectangles in registers. | ||
| 334 | * RegConfig:: Saving window configurations in registers. | ||
| 335 | * RegNumbers:: Numbers in registers. | ||
| 336 | * RegFiles:: File names in registers. | ||
| 337 | * Bookmarks:: Bookmarks are like registers, but persistent. | ||
| 338 | |||
| 339 | Controlling the Display | ||
| 340 | |||
| 341 | * Scrolling:: Moving text up and down in a window. | ||
| 342 | * Auto Scrolling:: Redisplay scrolls text automatically when needed. | ||
| 343 | * Horizontal Scrolling:: Moving text left and right in a window. | ||
| 344 | * Follow Mode:: Follow mode lets two windows scroll as one. | ||
| 345 | * Faces:: How to change the display style using faces. | ||
| 346 | * Standard Faces:: Emacs' predefined faces. | ||
| 347 | * Font Lock:: Minor mode for syntactic highlighting using faces. | ||
| 348 | * Highlight Interactively:: Tell Emacs what text to highlight. | ||
| 349 | * Fringes:: Enabling or disabling window fringes. | ||
| 350 | * Displaying Boundaries:: Displaying top and bottom of the buffer. | ||
| 351 | * Useless Whitespace:: Showing possibly-spurious trailing whitespace. | ||
| 352 | * Selective Display:: Hiding lines with lots of indentation. | ||
| 353 | * Optional Mode Line:: Optional mode line display features. | ||
| 354 | * Text Display:: How text characters are normally displayed. | ||
| 355 | * Cursor Display:: Features for displaying the cursor. | ||
| 356 | * Line Truncation:: Truncating lines to fit the screen width instead | ||
| 357 | of continuing them to multiple screen lines. | ||
| 358 | * Display Custom:: Information on variables for customizing display. | ||
| 359 | |||
| 360 | Searching and Replacement | ||
| 361 | |||
| 362 | * Incremental Search:: Search happens as you type the string. | ||
| 363 | * Nonincremental Search:: Specify entire string and then search. | ||
| 364 | * Word Search:: Search for sequence of words. | ||
| 365 | * Regexp Search:: Search for match for a regexp. | ||
| 366 | * Regexps:: Syntax of regular expressions. | ||
| 367 | * Regexp Backslash:: Regular expression constructs starting with `\'. | ||
| 368 | * Regexp Example:: A complex regular expression explained. | ||
| 369 | * Search Case:: To ignore case while searching, or not. | ||
| 370 | * Replace:: Search, and replace some or all matches. | ||
| 371 | * Other Repeating Search:: Operating on all matches for some regexp. | ||
| 372 | |||
| 373 | Incremental Search | ||
| 374 | |||
| 375 | * Basic Isearch:: Basic incremental search commands. | ||
| 376 | * Repeat Isearch:: Searching for the same string again. | ||
| 377 | * Error in Isearch:: When your string is not found. | ||
| 378 | * Special Isearch:: Special input in incremental search. | ||
| 379 | * Non-ASCII Isearch:: How to search for non-ASCII characters. | ||
| 380 | * Isearch Yank:: Commands that grab text into the search string | ||
| 381 | or else edit the search string. | ||
| 382 | * Highlight Isearch:: Isearch highlights the other possible matches. | ||
| 383 | * Isearch Scroll:: Scrolling during an incremental search. | ||
| 384 | * Slow Isearch:: Incremental search features for slow terminals. | ||
| 385 | |||
| 386 | Replacement Commands | ||
| 387 | |||
| 388 | * Unconditional Replace:: Replacing all matches for a string. | ||
| 389 | * Regexp Replace:: Replacing all matches for a regexp. | ||
| 390 | * Replacement and Case:: How replacements preserve case of letters. | ||
| 391 | * Query Replace:: How to use querying. | ||
| 392 | |||
| 393 | Commands for Fixing Typos | ||
| 394 | |||
| 395 | * Undo:: Full details of Emacs undo commands. | ||
| 396 | * Kill Errors:: Commands to kill a batch of recently entered text. | ||
| 397 | * Transpose:: Exchanging two characters, words, lines, lists... | ||
| 398 | * Fixing Case:: Correcting case of last word entered. | ||
| 399 | * Spelling:: Apply spelling checker to a word or a whole buffer. | ||
| 400 | |||
| 401 | Keyboard Macros | ||
| 402 | |||
| 403 | * Basic Keyboard Macro:: Defining and running keyboard macros. | ||
| 404 | * Keyboard Macro Ring:: Where previous keyboard macros are saved. | ||
| 405 | * Keyboard Macro Counter:: Inserting incrementing numbers in macros. | ||
| 406 | * Keyboard Macro Query:: Making keyboard macros do different things each time. | ||
| 407 | * Save Keyboard Macro:: Giving keyboard macros names; saving them in files. | ||
| 408 | * Edit Keyboard Macro:: Editing keyboard macros. | ||
| 409 | * Keyboard Macro Step-Edit:: Interactively executing and editing a keyboard | ||
| 410 | macro. | ||
| 411 | |||
| 412 | File Handling | ||
| 413 | |||
| 414 | * File Names:: How to type and edit file-name arguments. | ||
| 415 | * Visiting:: Visiting a file prepares Emacs to edit the file. | ||
| 416 | * Saving:: Saving makes your changes permanent. | ||
| 417 | * Reverting:: Reverting cancels all the changes not saved. | ||
| 418 | * Autorevert:: Auto Reverting non-file buffers. | ||
| 419 | * Auto Save:: Auto Save periodically protects against loss of data. | ||
| 420 | * File Aliases:: Handling multiple names for one file. | ||
| 421 | * Version Control:: Version control systems (RCS, CVS and SCCS). | ||
| 422 | * Directories:: Creating, deleting, and listing file directories. | ||
| 423 | * Comparing Files:: Finding where two files differ. | ||
| 424 | * Diff Mode:: Editing diff output. | ||
| 425 | * Misc File Ops:: Other things you can do on files. | ||
| 426 | * Compressed Files:: Accessing compressed files. | ||
| 427 | * File Archives:: Operating on tar, zip, jar etc. archive files. | ||
| 428 | * Remote Files:: Accessing files on other sites. | ||
| 429 | * Quoted File Names:: Quoting special characters in file names. | ||
| 430 | * File Name Cache:: Completion against a list of files you often use. | ||
| 431 | * File Conveniences:: Convenience Features for Finding Files. | ||
| 432 | * Filesets:: Handling sets of files. | ||
| 433 | |||
| 434 | Saving Files | ||
| 435 | |||
| 436 | * Save Commands:: Commands for saving files. | ||
| 437 | * Backup:: How Emacs saves the old version of your file. | ||
| 438 | * Customize Save:: Customizing the saving of files. | ||
| 439 | * Interlocking:: How Emacs protects against simultaneous editing | ||
| 440 | of one file by two users. | ||
| 441 | * File Shadowing:: Copying files to "shadows" automatically. | ||
| 442 | * Time Stamps:: Emacs can update time stamps on saved files. | ||
| 443 | |||
| 444 | Backup Files | ||
| 445 | |||
| 446 | * One or Many: Numbered Backups. Whether to make one backup file or many. | ||
| 447 | * Names: Backup Names. How backup files are named. | ||
| 448 | * Deletion: Backup Deletion. Emacs deletes excess numbered backups. | ||
| 449 | * Copying: Backup Copying. Backups can be made by copying or renaming. | ||
| 450 | |||
| 451 | Auto-Saving: Protection Against Disasters | ||
| 452 | |||
| 453 | * Files: Auto Save Files. The file where auto-saved changes are | ||
| 454 | actually made until you save the file. | ||
| 455 | * Control: Auto Save Control. Controlling when and how often to auto-save. | ||
| 456 | * Recover:: Recovering text from auto-save files. | ||
| 457 | |||
| 458 | Version Control | ||
| 459 | |||
| 460 | * Introduction to VC:: How version control works in general. | ||
| 461 | * VC Mode Line:: How the mode line shows version control status. | ||
| 462 | * Basic VC Editing:: How to edit a file under version control. | ||
| 463 | * Old Versions:: Examining and comparing old versions. | ||
| 464 | * Secondary VC Commands:: The commands used a little less frequently. | ||
| 465 | * Branches:: Multiple lines of development. | ||
| 466 | * Remote Repositories:: Efficient access to remote CVS servers. | ||
| 467 | * Snapshots:: Sets of file versions treated as a unit. | ||
| 468 | * Miscellaneous VC:: Various other commands and features of VC. | ||
| 469 | * Customizing VC:: Variables that change VC's behavior. | ||
| 470 | |||
| 471 | Using Multiple Buffers | ||
| 472 | |||
| 473 | * Select Buffer:: Creating a new buffer or reselecting an old one. | ||
| 474 | * List Buffers:: Getting a list of buffers that exist. | ||
| 475 | * Misc Buffer:: Renaming; changing read-onliness; copying text. | ||
| 476 | * Kill Buffer:: Killing buffers you no longer need. | ||
| 477 | * Several Buffers:: How to go through the list of all buffers | ||
| 478 | and operate variously on several of them. | ||
| 479 | * Indirect Buffers:: An indirect buffer shares the text of another buffer. | ||
| 480 | * Buffer Convenience:: Convenience and customization features for | ||
| 481 | buffer handling. | ||
| 482 | |||
| 483 | Multiple Windows | ||
| 484 | |||
| 485 | * Basic Window:: Introduction to Emacs windows. | ||
| 486 | * Split Window:: New windows are made by splitting existing windows. | ||
| 487 | * Other Window:: Moving to another window or doing something to it. | ||
| 488 | * Pop Up Window:: Finding a file or buffer in another window. | ||
| 489 | * Force Same Window:: Forcing certain buffers to appear in the selected | ||
| 490 | window rather than in another window. | ||
| 491 | * Change Window:: Deleting windows and changing their sizes. | ||
| 492 | * Window Convenience:: Convenience functions for window handling. | ||
| 493 | |||
| 494 | Frames and Graphical Displays | ||
| 495 | |||
| 496 | * Cut and Paste:: Mouse commands for cut and paste. | ||
| 497 | * Mouse References:: Using the mouse to select an item from a list. | ||
| 498 | * Menu Mouse Clicks:: Mouse clicks that bring up menus. | ||
| 499 | * Mode Line Mouse:: Mouse clicks on the mode line. | ||
| 500 | * Creating Frames:: Creating additional Emacs frames with various contents. | ||
| 501 | * Frame Commands:: Iconifying, deleting, and switching frames. | ||
| 502 | * Speedbar:: How to make and use a speedbar frame. | ||
| 503 | * Multiple Displays:: How one Emacs job can talk to several displays. | ||
| 504 | * Special Buffer Frames:: You can make certain buffers have their own frames. | ||
| 505 | * Frame Parameters:: Changing the colors and other modes of frames. | ||
| 506 | * Scroll Bars:: How to enable and disable scroll bars; how to use them. | ||
| 507 | * Wheeled Mice:: Using mouse wheels for scrolling. | ||
| 508 | * Drag and Drop:: Using drag and drop to open files and insert text. | ||
| 509 | * Menu Bars:: Enabling and disabling the menu bar. | ||
| 510 | * Tool Bars:: Enabling and disabling the tool bar. | ||
| 511 | * Dialog Boxes:: Controlling use of dialog boxes. | ||
| 512 | * Tooltips:: Showing "tooltips", AKA "balloon help" for active text. | ||
| 513 | * Mouse Avoidance:: Moving the mouse pointer out of the way. | ||
| 514 | * Non-Window Terminals:: Multiple frames on terminals that show only one. | ||
| 515 | * Text-Only Mouse:: Using the mouse in text-only terminals. | ||
| 516 | |||
| 517 | International Character Set Support | ||
| 518 | |||
| 519 | * International Chars:: Basic concepts of multibyte characters. | ||
| 520 | * Enabling Multibyte:: Controlling whether to use multibyte characters. | ||
| 521 | * Language Environments:: Setting things up for the language you use. | ||
| 522 | * Input Methods:: Entering text characters not on your keyboard. | ||
| 523 | * Select Input Method:: Specifying your choice of input methods. | ||
| 524 | * Multibyte Conversion:: How single-byte characters convert to multibyte. | ||
| 525 | * Coding Systems:: Character set conversion when you read and | ||
| 526 | write files, and so on. | ||
| 527 | * Recognize Coding:: How Emacs figures out which conversion to use. | ||
| 528 | * Specify Coding:: Specifying a file's coding system explicitly. | ||
| 529 | * Output Coding:: Choosing coding systems for output. | ||
| 530 | * Text Coding:: Choosing conversion to use for file text. | ||
| 531 | * Communication Coding:: Coding systems for interprocess communication. | ||
| 532 | * File Name Coding:: Coding systems for file @emph{names}. | ||
| 533 | * Terminal Coding:: Specifying coding systems for converting | ||
| 534 | terminal input and output. | ||
| 535 | * Fontsets:: Fontsets are collections of fonts | ||
| 536 | that cover the whole spectrum of characters. | ||
| 537 | * Defining Fontsets:: Defining a new fontset. | ||
| 538 | * Undisplayable Characters::When characters don't display. | ||
| 539 | * Unibyte Mode:: You can pick one European character set | ||
| 540 | to use without multibyte characters. | ||
| 541 | * Charsets:: How Emacs groups its internal character codes. | ||
| 542 | |||
| 543 | Major Modes | ||
| 544 | |||
| 545 | * Choosing Modes:: How major modes are specified or chosen. | ||
| 546 | |||
| 547 | Indentation | ||
| 548 | |||
| 549 | * Indentation Commands:: Various commands and techniques for indentation. | ||
| 550 | * Tab Stops:: You can set arbitrary "tab stops" and then | ||
| 551 | indent to the next tab stop when you want to. | ||
| 552 | * Just Spaces:: You can request indentation using just spaces. | ||
| 553 | |||
| 554 | Commands for Human Languages | ||
| 555 | |||
| 556 | * Words:: Moving over and killing words. | ||
| 557 | * Sentences:: Moving over and killing sentences. | ||
| 558 | * Paragraphs:: Moving over paragraphs. | ||
| 559 | * Pages:: Moving over pages. | ||
| 560 | * Filling:: Filling or justifying text. | ||
| 561 | * Case:: Changing the case of text. | ||
| 562 | * Text Mode:: The major modes for editing text files. | ||
| 563 | * Outline Mode:: Editing outlines. | ||
| 564 | * TeX Mode:: Editing input to the formatter TeX. | ||
| 565 | * HTML Mode:: Editing HTML, SGML, and XML files. | ||
| 566 | * Nroff Mode:: Editing input to the formatter nroff. | ||
| 567 | * Formatted Text:: Editing formatted text directly in WYSIWYG fashion. | ||
| 568 | * Text Based Tables:: Editing text-based tables in WYSIWYG fashion. | ||
| 569 | |||
| 570 | Filling Text | ||
| 571 | |||
| 572 | * Auto Fill:: Auto Fill mode breaks long lines automatically. | ||
| 573 | * Refill:: Keeping paragraphs filled. | ||
| 574 | * Fill Commands:: Commands to refill paragraphs and center lines. | ||
| 575 | * Fill Prefix:: Filling paragraphs that are indented | ||
| 576 | or in a comment, etc. | ||
| 577 | * Adaptive Fill:: How Emacs can determine the fill prefix automatically. | ||
| 578 | * Longlines:: Editing text with very long lines. | ||
| 579 | |||
| 580 | Outline Mode | ||
| 581 | |||
| 582 | * Format: Outline Format. What the text of an outline looks like. | ||
| 583 | * Motion: Outline Motion. Special commands for moving through | ||
| 584 | outlines. | ||
| 585 | * Visibility: Outline Visibility. Commands to control what is visible. | ||
| 586 | * Views: Outline Views. Outlines and multiple views. | ||
| 587 | * Foldout:: Folding means zooming in on outlines. | ||
| 588 | |||
| 589 | @TeX{} Mode | ||
| 590 | |||
| 591 | * Editing: TeX Editing. Special commands for editing in TeX mode. | ||
| 592 | * LaTeX: LaTeX Editing. Additional commands for LaTeX input files. | ||
| 593 | * Printing: TeX Print. Commands for printing part of a file with TeX. | ||
| 594 | * Misc: TeX Misc. Customization of TeX mode, and related features. | ||
| 595 | |||
| 596 | Editing Formatted Text | ||
| 597 | |||
| 598 | * Requesting Formatted Text:: Entering and exiting Enriched mode. | ||
| 599 | * Hard and Soft Newlines:: There are two different kinds of newlines. | ||
| 600 | * Editing Format Info:: How to edit text properties. | ||
| 601 | * Faces: Format Faces. Bold, italic, underline, etc. | ||
| 602 | * Color: Format Colors. Changing the color of text. | ||
| 603 | * Indent: Format Indentation. Changing the left and right margins. | ||
| 604 | * Justification: Format Justification. | ||
| 605 | Centering, setting text flush with the | ||
| 606 | left or right margin, etc. | ||
| 607 | * Other: Format Properties. The "special" text properties submenu. | ||
| 608 | * Forcing Enriched Mode:: How to force use of Enriched mode. | ||
| 609 | |||
| 610 | Editing Text-based Tables | ||
| 611 | |||
| 612 | * Table Definition:: What is a text based table. | ||
| 613 | * Table Creation:: How to create a table. | ||
| 614 | * Table Recognition:: How to activate and deactivate tables. | ||
| 615 | * Cell Commands:: Cell-oriented commands in a table. | ||
| 616 | * Cell Justification:: Justifying cell contents. | ||
| 617 | * Row Commands:: Manipulating rows of table cell. | ||
| 618 | * Column Commands:: Manipulating columns of table cell. | ||
| 619 | * Fixed Width Mode:: Fixing cell width. | ||
| 620 | * Table Conversion:: Converting between plain text and tables. | ||
| 621 | * Measuring Tables:: Analyzing table dimension. | ||
| 622 | * Table Misc:: Table miscellany. | ||
| 623 | |||
| 624 | Editing Programs | ||
| 625 | |||
| 626 | * Program Modes:: Major modes for editing programs. | ||
| 627 | * Defuns:: Commands to operate on major top-level parts | ||
| 628 | of a program. | ||
| 629 | * Program Indent:: Adjusting indentation to show the nesting. | ||
| 630 | * Parentheses:: Commands that operate on parentheses. | ||
| 631 | * Comments:: Inserting, killing, and aligning comments. | ||
| 632 | * Documentation:: Getting documentation of functions you plan to call. | ||
| 633 | * Hideshow:: Displaying blocks selectively. | ||
| 634 | * Symbol Completion:: Completion on symbol names of your program or language. | ||
| 635 | * Glasses:: Making identifiersLikeThis more readable. | ||
| 636 | * Misc for Programs:: Other Emacs features useful for editing programs. | ||
| 637 | * C Modes:: Special commands of C, C++, Objective-C, | ||
| 638 | Java, and Pike modes. | ||
| 639 | * Asm Mode:: Asm mode and its special features. | ||
| 640 | * Fortran:: Fortran mode and its special features. | ||
| 641 | |||
| 642 | Top-Level Definitions, or Defuns | ||
| 643 | |||
| 644 | * Left Margin Paren:: An open-paren or similar opening delimiter | ||
| 645 | starts a defun if it is at the left margin. | ||
| 646 | * Moving by Defuns:: Commands to move over or mark a major definition. | ||
| 647 | * Imenu:: Making buffer indexes as menus. | ||
| 648 | * Which Function:: Which Function mode shows which function you are in. | ||
| 649 | |||
| 650 | Indentation for Programs | ||
| 651 | |||
| 652 | * Basic Indent:: Indenting a single line. | ||
| 653 | * Multi-line Indent:: Commands to reindent many lines at once. | ||
| 654 | * Lisp Indent:: Specifying how each Lisp function should be indented. | ||
| 655 | * C Indent:: Extra features for indenting C and related modes. | ||
| 656 | * Custom C Indent:: Controlling indentation style for C and related modes. | ||
| 657 | |||
| 658 | Commands for Editing with Parentheses | ||
| 659 | |||
| 660 | * Expressions:: Expressions with balanced parentheses. | ||
| 661 | * Moving by Parens:: Commands for moving up, down and across | ||
| 662 | in the structure of parentheses. | ||
| 663 | * Matching:: Insertion of a close-delimiter flashes matching open. | ||
| 664 | |||
| 665 | Manipulating Comments | ||
| 666 | |||
| 667 | * Comment Commands:: Inserting, killing, and aligning comments. | ||
| 668 | * Multi-Line Comments:: Commands for adding and editing multi-line comments. | ||
| 669 | * Options for Comments::Customizing the comment features. | ||
| 670 | |||
| 671 | Documentation Lookup | ||
| 672 | |||
| 673 | * Info Lookup:: Looking up library functions and commands | ||
| 674 | in Info files. | ||
| 675 | * Man Page:: Looking up man pages of library functions and commands. | ||
| 676 | * Lisp Doc:: Looking up Emacs Lisp functions, etc. | ||
| 677 | |||
| 678 | C and Related Modes | ||
| 679 | |||
| 680 | * Motion in C:: Commands to move by C statements, etc. | ||
| 681 | * Electric C:: Colon and other chars can automatically reindent. | ||
| 682 | * Hungry Delete:: A more powerful DEL command. | ||
| 683 | * Other C Commands:: Filling comments, viewing expansion of macros, | ||
| 684 | and other neat features. | ||
| 685 | |||
| 686 | Compiling and Testing Programs | ||
| 687 | |||
| 688 | * Compilation:: Compiling programs in languages other | ||
| 689 | than Lisp (C, Pascal, etc.). | ||
| 690 | * Compilation Mode:: The mode for visiting compiler errors. | ||
| 691 | * Compilation Shell:: Customizing your shell properly | ||
| 692 | for use in the compilation buffer. | ||
| 693 | * Grep Searching:: Searching with grep. | ||
| 694 | * Flymake:: Finding syntax errors on the fly. | ||
| 695 | * Debuggers:: Running symbolic debuggers for non-Lisp programs. | ||
| 696 | * Executing Lisp:: Various modes for editing Lisp programs, | ||
| 697 | with different facilities for running | ||
| 698 | the Lisp programs. | ||
| 699 | * Lisp Libraries:: Creating Lisp programs to run in Emacs. | ||
| 700 | * Lisp Eval:: Executing a single Lisp expression in Emacs. | ||
| 701 | * Lisp Interaction:: Executing Lisp in an Emacs buffer. | ||
| 702 | * External Lisp:: Communicating through Emacs with a separate Lisp. | ||
| 703 | |||
| 704 | Running Debuggers Under Emacs | ||
| 705 | |||
| 706 | * Starting GUD:: How to start a debugger subprocess. | ||
| 707 | * Debugger Operation:: Connection between the debugger and source buffers. | ||
| 708 | * Commands of GUD:: Key bindings for common commands. | ||
| 709 | * GUD Customization:: Defining your own commands for GUD. | ||
| 710 | * GDB Graphical Interface:: An enhanced mode that uses GDB features to | ||
| 711 | implement a graphical debugging environment through | ||
| 712 | Emacs. | ||
| 713 | |||
| 714 | Maintaining Large Programs | ||
| 715 | |||
| 716 | * Change Log:: Maintaining a change history for your program. | ||
| 717 | * Format of ChangeLog:: What the change log file looks like. | ||
| 718 | * Tags:: Go direct to any function in your program in one | ||
| 719 | command. Tags remembers which file it is in. | ||
| 720 | * Emerge:: A convenient way of merging two versions of a program. | ||
| 721 | |||
| 722 | Tags Tables | ||
| 723 | |||
| 724 | * Tag Syntax:: Tag syntax for various types of code and text files. | ||
| 725 | * Create Tags Table:: Creating a tags table with @code{etags}. | ||
| 726 | * Etags Regexps:: Create arbitrary tags using regular expressions. | ||
| 727 | * Select Tags Table:: How to visit a tags table. | ||
| 728 | * Find Tag:: Commands to find the definition of a specific tag. | ||
| 729 | * Tags Search:: Using a tags table for searching and replacing. | ||
| 730 | * List Tags:: Listing and finding tags defined in a file. | ||
| 731 | |||
| 732 | Abbrevs | ||
| 733 | |||
| 734 | * Abbrev Concepts:: Fundamentals of defined abbrevs. | ||
| 735 | * Defining Abbrevs:: Defining an abbrev, so it will expand when typed. | ||
| 736 | * Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion. | ||
| 737 | * Editing Abbrevs:: Viewing or editing the entire list of defined abbrevs. | ||
| 738 | * Saving Abbrevs:: Saving the entire list of abbrevs for another session. | ||
| 739 | * Dynamic Abbrevs:: Abbreviations for words already in the buffer. | ||
| 740 | * Dabbrev Customization:: What is a word, for dynamic abbrevs. Case handling. | ||
| 741 | |||
| 742 | @ifnottex | ||
| 743 | Editing Pictures | ||
| 744 | |||
| 745 | * Basic Picture:: Basic concepts and simple commands of Picture Mode. | ||
| 746 | * Insert in Picture:: Controlling direction of cursor motion | ||
| 747 | after "self-inserting" characters. | ||
| 748 | * Tabs in Picture:: Various features for tab stops and indentation. | ||
| 749 | * Rectangles in Picture:: Clearing and superimposing rectangles. | ||
| 750 | @end ifnottex | ||
| 751 | |||
| 752 | Sending Mail | ||
| 753 | |||
| 754 | * Mail Format:: Format of the mail being composed. | ||
| 755 | * Mail Headers:: Details of permitted mail header fields. | ||
| 756 | * Mail Aliases:: Abbreviating and grouping mail addresses. | ||
| 757 | * Mail Mode:: Special commands for editing mail being composed. | ||
| 758 | * Mail Amusements:: Distract the NSA's attention; add a fortune to a msg. | ||
| 759 | * Mail Methods:: Using alternative mail-composition methods. | ||
| 760 | |||
| 761 | Reading Mail with Rmail | ||
| 762 | |||
| 763 | * Rmail Basics:: Basic concepts of Rmail, and simple use. | ||
| 764 | * Rmail Scrolling:: Scrolling through a message. | ||
| 765 | * Rmail Motion:: Moving to another message. | ||
| 766 | * Rmail Deletion:: Deleting and expunging messages. | ||
| 767 | * Rmail Inbox:: How mail gets into the Rmail file. | ||
| 768 | * Rmail Files:: Using multiple Rmail files. | ||
| 769 | * Rmail Output:: Copying message out to files. | ||
| 770 | * Rmail Labels:: Classifying messages by labeling them. | ||
| 771 | * Rmail Attributes:: Certain standard labels, called attributes. | ||
| 772 | * Rmail Reply:: Sending replies to messages you are viewing. | ||
| 773 | * Rmail Summary:: Summaries show brief info on many messages. | ||
| 774 | * Rmail Sorting:: Sorting messages in Rmail. | ||
| 775 | * Rmail Display:: How Rmail displays a message; customization. | ||
| 776 | * Rmail Coding:: How Rmail handles decoding character sets. | ||
| 777 | * Rmail Editing:: Editing message text and headers in Rmail. | ||
| 778 | * Rmail Digest:: Extracting the messages from a digest message. | ||
| 779 | * Out of Rmail:: Converting an Rmail file to mailbox format. | ||
| 780 | * Rmail Rot13:: Reading messages encoded in the rot13 code. | ||
| 781 | * Movemail:: More details of fetching new mail. | ||
| 782 | * Remote Mailboxes:: Retrieving Mail from Remote Mailboxes. | ||
| 783 | * Other Mailbox Formats:: Retrieving Mail from Local Mailboxes in | ||
| 784 | Various Formats | ||
| 785 | |||
| 786 | Dired, the Directory Editor | ||
| 787 | |||
| 788 | * Dired Enter:: How to invoke Dired. | ||
| 789 | * Dired Navigation:: How to move in the Dired buffer. | ||
| 790 | * Dired Deletion:: Deleting files with Dired. | ||
| 791 | * Flagging Many Files:: Flagging files based on their names. | ||
| 792 | * Dired Visiting:: Other file operations through Dired. | ||
| 793 | * Marks vs Flags:: Flagging for deletion vs marking. | ||
| 794 | * Operating on Files:: How to copy, rename, print, compress, etc. | ||
| 795 | either one file or several files. | ||
| 796 | * Shell Commands in Dired:: Running a shell command on the marked files. | ||
| 797 | * Transforming File Names:: Using patterns to rename multiple files. | ||
| 798 | * Comparison in Dired:: Running `diff' by way of Dired. | ||
| 799 | * Subdirectories in Dired:: Adding subdirectories to the Dired buffer. | ||
| 800 | * Subdir Switches:: Subdirectory switches in Dired. | ||
| 801 | * Subdirectory Motion:: Moving across subdirectories, and up and down. | ||
| 802 | * Hiding Subdirectories:: Making subdirectories visible or invisible. | ||
| 803 | * Dired Updating:: Discarding lines for files of no interest. | ||
| 804 | * Dired and Find:: Using `find' to choose the files for Dired. | ||
| 805 | * Wdired:: Operating on files by editing the Dired buffer. | ||
| 806 | * Image-Dired:: Viewing image thumbnails in Dired | ||
| 807 | * Misc Dired Features:: Various other features. | ||
| 808 | |||
| 809 | The Calendar and the Diary | ||
| 810 | |||
| 811 | * Calendar Motion:: Moving through the calendar; selecting a date. | ||
| 812 | * Scroll Calendar:: Bringing earlier or later months onto the screen. | ||
| 813 | * Counting Days:: How many days are there between two dates? | ||
| 814 | * General Calendar:: Exiting or recomputing the calendar. | ||
| 815 | * Writing Calendar Files:: Writing calendars to files of various formats. | ||
| 816 | * Holidays:: Displaying dates of holidays. | ||
| 817 | * Sunrise/Sunset:: Displaying local times of sunrise and sunset. | ||
| 818 | * Lunar Phases:: Displaying phases of the moon. | ||
| 819 | * Other Calendars:: Converting dates to other calendar systems. | ||
| 820 | * Diary:: Displaying events from your diary. | ||
| 821 | * Appointments:: Reminders when it's time to do something. | ||
| 822 | * Importing Diary:: Converting diary events to/from other formats. | ||
| 823 | * Daylight Saving:: How to specify when daylight saving time is active. | ||
| 824 | * Time Intervals:: Keeping track of time intervals. | ||
| 825 | * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. | ||
| 826 | |||
| 827 | Movement in the Calendar | ||
| 828 | |||
| 829 | * Calendar Unit Motion:: Moving by days, weeks, months, and years. | ||
| 830 | * Move to Beginning or End:: Moving to start/end of weeks, months, and years. | ||
| 831 | * Specified Dates:: Moving to the current date or another | ||
| 832 | specific date. | ||
| 833 | |||
| 834 | Conversion To and From Other Calendars | ||
| 835 | |||
| 836 | * Calendar Systems:: The calendars Emacs understands | ||
| 837 | (aside from Gregorian). | ||
| 838 | * To Other Calendar:: Converting the selected date to various calendars. | ||
| 839 | * From Other Calendar:: Moving to a date specified in another calendar. | ||
| 840 | * Mayan Calendar:: Moving to a date specified in a Mayan calendar. | ||
| 841 | |||
| 842 | The Diary | ||
| 843 | |||
| 844 | * Displaying the Diary:: Viewing diary entries and associated calendar dates. | ||
| 845 | * Format of Diary File:: Entering events in your diary. | ||
| 846 | * Date Formats:: Various ways you can specify dates. | ||
| 847 | * Adding to Diary:: Commands to create diary entries. | ||
| 848 | * Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc. | ||
| 849 | |||
| 850 | Gnus | ||
| 851 | |||
| 852 | * Buffers of Gnus:: The group, summary, and article buffers. | ||
| 853 | * Gnus Startup:: What you should know about starting Gnus. | ||
| 854 | * Summary of Gnus:: A short description of the basic Gnus commands. | ||
| 855 | |||
| 856 | Running Shell Commands from Emacs | ||
| 857 | |||
| 858 | * Single Shell:: How to run one shell command and return. | ||
| 859 | * Interactive Shell:: Permanent shell taking input via Emacs. | ||
| 860 | * Shell Mode:: Special Emacs commands used with permanent shell. | ||
| 861 | * Shell Prompts:: Two ways to recognize shell prompts. | ||
| 862 | * Shell History:: Repeating previous commands in a shell buffer. | ||
| 863 | * Directory Tracking:: Keeping track when the subshell changes directory. | ||
| 864 | * Shell Options:: Options for customizing Shell mode. | ||
| 865 | * Terminal emulator:: An Emacs window as a terminal emulator. | ||
| 866 | * Term Mode:: Special Emacs commands used in Term mode. | ||
| 867 | * Paging in Term:: Paging in the terminal emulator. | ||
| 868 | * Remote Host:: Connecting to another computer. | ||
| 869 | |||
| 870 | Using Emacs as a Server | ||
| 871 | |||
| 872 | * Invoking emacsclient:: Emacs client startup options. | ||
| 873 | |||
| 874 | Printing Hard Copies | ||
| 875 | |||
| 876 | * PostScript:: Printing buffers or regions as PostScript. | ||
| 877 | * PostScript Variables:: Customizing the PostScript printing commands. | ||
| 878 | * Printing Package:: An optional advanced printing interface. | ||
| 879 | |||
| 880 | Hyperlinking and Navigation Features | ||
| 881 | |||
| 882 | * Browse-URL:: Following URLs. | ||
| 883 | * Goto-address:: Activating URLs. | ||
| 884 | * FFAP:: Finding files etc. at point. | ||
| 885 | |||
| 886 | Customization | ||
| 887 | |||
| 888 | * Minor Modes:: Each minor mode is one feature you can turn on | ||
| 889 | independently of any others. | ||
| 890 | * Easy Customization:: Convenient way to browse and change user options. | ||
| 891 | * Variables:: Many Emacs commands examine Emacs variables | ||
| 892 | to decide what to do; by setting variables, | ||
| 893 | you can control their functioning. | ||
| 894 | * Key Bindings:: The keymaps say what command each key runs. | ||
| 895 | By changing them, you can "redefine keys". | ||
| 896 | * Syntax:: The syntax table controls how words and | ||
| 897 | expressions are parsed. | ||
| 898 | * Init File:: How to write common customizations in the | ||
| 899 | @file{.emacs} file. | ||
| 900 | |||
| 901 | Variables | ||
| 902 | |||
| 903 | * Examining:: Examining or setting one variable's value. | ||
| 904 | * Hooks:: Hook variables let you specify programs for parts | ||
| 905 | of Emacs to run on particular occasions. | ||
| 906 | * Locals:: Per-buffer values of variables. | ||
| 907 | * File Variables:: How files can specify variable values. | ||
| 908 | |||
| 909 | Customizing Key Bindings | ||
| 910 | |||
| 911 | * Keymaps:: Generalities. The global keymap. | ||
| 912 | * Prefix Keymaps:: Keymaps for prefix keys. | ||
| 913 | * Local Keymaps:: Major and minor modes have their own keymaps. | ||
| 914 | * Minibuffer Maps:: The minibuffer uses its own local keymaps. | ||
| 915 | * Rebinding:: How to redefine one key's meaning conveniently. | ||
| 916 | * Init Rebinding:: Rebinding keys with your init file, @file{.emacs}. | ||
| 917 | * Function Keys:: Rebinding terminal function keys. | ||
| 918 | * Named ASCII Chars:: Distinguishing @key{TAB} from @kbd{C-i}, and so on. | ||
| 919 | * Mouse Buttons:: Rebinding mouse buttons in Emacs. | ||
| 920 | * Disabling:: Disabling a command means confirmation is required | ||
| 921 | before it can be executed. This is done to protect | ||
| 922 | beginners from surprises. | ||
| 923 | |||
| 924 | The Init File, @file{~/.emacs} | ||
| 925 | |||
| 926 | * Init Syntax:: Syntax of constants in Emacs Lisp. | ||
| 927 | * Init Examples:: How to do some things with an init file. | ||
| 928 | * Terminal Init:: Each terminal type can have an init file. | ||
| 929 | * Find Init:: How Emacs finds the init file. | ||
| 930 | * Init Non-ASCII:: Using non-@acronym{ASCII} characters in an init file. | ||
| 931 | |||
| 932 | Dealing with Emacs Trouble | ||
| 933 | |||
| 934 | * DEL Does Not Delete:: What to do if @key{DEL} doesn't delete. | ||
| 935 | * Stuck Recursive:: `[...]' in mode line around the parentheses. | ||
| 936 | * Screen Garbled:: Garbage on the screen. | ||
| 937 | * Text Garbled:: Garbage in the text. | ||
| 938 | * Memory Full:: How to cope when you run out of memory. | ||
| 939 | * After a Crash:: Recovering editing in an Emacs session that crashed. | ||
| 940 | * Emergency Escape:: Emergency escape--- | ||
| 941 | What to do if Emacs stops responding. | ||
| 942 | * Total Frustration:: When you are at your wits' end. | ||
| 943 | |||
| 944 | Reporting Bugs | ||
| 945 | |||
| 946 | * Bug Criteria:: Have you really found a bug? | ||
| 947 | * Understanding Bug Reporting:: How to report a bug effectively. | ||
| 948 | * Checklist:: Steps to follow for a good bug report. | ||
| 949 | * Sending Patches:: How to send a patch for GNU Emacs. | ||
| 950 | |||
| 951 | Command Line Arguments for Emacs Invocation | ||
| 952 | |||
| 953 | * Action Arguments:: Arguments to visit files, load libraries, | ||
| 954 | and call functions. | ||
| 955 | * Initial Options:: Arguments that take effect while starting Emacs. | ||
| 956 | * Command Example:: Examples of using command line arguments. | ||
| 957 | * Resume Arguments:: Specifying arguments when you resume a running Emacs. | ||
| 958 | * Environment:: Environment variables that Emacs uses. | ||
| 959 | * Display X:: Changing the default display and using remote login. | ||
| 960 | * Font X:: Choosing a font for text, under X. | ||
| 961 | * Colors:: Choosing display colors. | ||
| 962 | * Window Size X:: Start-up window size, under X. | ||
| 963 | * Borders X:: Internal and external borders, under X. | ||
| 964 | * Title X:: Specifying the initial frame's title. | ||
| 965 | * Icons X:: Choosing what sort of icon to use, under X. | ||
| 966 | * Misc X:: Other display options. | ||
| 967 | |||
| 968 | Environment Variables | ||
| 969 | |||
| 970 | * General Variables:: Environment variables that all versions of Emacs use. | ||
| 971 | * Misc Variables:: Certain system specific variables. | ||
| 972 | * MS-Windows Registry:: An alternative to the environment on MS-Windows. | ||
| 973 | |||
| 974 | X Options and Resources | ||
| 975 | |||
| 976 | * Resources:: Using X resources with Emacs (in general). | ||
| 977 | * Table of Resources:: Table of specific X resources that affect Emacs. | ||
| 978 | * Face Resources:: X resources for customizing faces. | ||
| 979 | * Lucid Resources:: X resources for Lucid menus. | ||
| 980 | * LessTif Resources:: X resources for LessTif and Motif menus. | ||
| 981 | * GTK resources:: Resources for GTK widgets. | ||
| 982 | |||
| 983 | Emacs and Mac OS | ||
| 984 | |||
| 985 | * Mac Input:: Keyboard and mouse input on Mac. | ||
| 986 | * Mac International:: International character sets on Mac. | ||
| 987 | * Mac Environment Variables:: Setting environment variables for Emacs. | ||
| 988 | * Mac Directories:: Volumes and directories on Mac. | ||
| 989 | * Mac Font Specs:: Specifying fonts on Mac. | ||
| 990 | * Mac Functions:: Mac-specific Lisp functions. | ||
| 991 | |||
| 992 | Emacs and Microsoft Windows/MS-DOS | ||
| 993 | |||
| 994 | * Text and Binary:: Text files use CRLF to terminate lines. | ||
| 995 | * Windows Files:: File-name conventions on Windows. | ||
| 996 | * ls in Lisp:: Emulation of @code{ls} for Dired. | ||
| 997 | * Windows HOME:: Where Emacs looks for your @file{.emacs}. | ||
| 998 | * Windows Keyboard:: Windows-specific keyboard features. | ||
| 999 | * Windows Mouse:: Windows-specific mouse features. | ||
| 1000 | * Windows Processes:: Running subprocesses on Windows. | ||
| 1001 | * Windows Printing:: How to specify the printer on MS-Windows. | ||
| 1002 | * Windows Misc:: Miscellaneous Windows features. | ||
| 1003 | * MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}). | ||
| 1004 | @end detailmenu | ||
| 1005 | @end menu | ||
| 1006 | |||
| 1007 | @iftex | ||
| 1008 | @unnumbered Preface | ||
| 1009 | |||
| 1010 | This manual documents the use and simple customization of the Emacs | ||
| 1011 | editor. Simple Emacs customizations do not require you to be a | ||
| 1012 | programmer, but if you are not interested in customizing, you can | ||
| 1013 | ignore the customization hints. | ||
| 1014 | |||
| 1015 | This is primarily a reference manual, but can also be used as a | ||
| 1016 | primer. If you are new to Emacs, we recommend you start with | ||
| 1017 | the on-line, learn-by-doing tutorial, before reading the manual. To | ||
| 1018 | run the tutorial, start Emacs and type @kbd{C-h t}. The tutorial | ||
| 1019 | describes commands, tells you when to try them, and explains the | ||
| 1020 | results. | ||
| 1021 | |||
| 1022 | On first reading, just skim chapters 1 and 2, which describe the | ||
| 1023 | notational conventions of the manual and the general appearance of the | ||
| 1024 | Emacs display screen. Note which questions are answered in these | ||
| 1025 | chapters, so you can refer back later. After reading chapter 4, you | ||
| 1026 | should practice the commands shown there. The next few chapters | ||
| 1027 | describe fundamental techniques and concepts that are used constantly. | ||
| 1028 | You need to understand them thoroughly, so experiment with them | ||
| 1029 | until you are fluent. | ||
| 1030 | |||
| 1031 | Chapters 14 through 19 describe intermediate-level features that are | ||
| 1032 | useful for many kinds of editing. Chapter 20 and following chapters | ||
| 1033 | describe optional but useful features; read those chapters when you | ||
| 1034 | need them. | ||
| 1035 | |||
| 1036 | Read the Trouble chapter if Emacs does not seem to be working | ||
| 1037 | properly. It explains how to cope with several common problems | ||
| 1038 | (@pxref{Lossage}), as well as when and how to report Emacs bugs | ||
| 1039 | (@pxref{Bugs}). | ||
| 1040 | |||
| 1041 | To find the documentation of a particular command, look in the index. | ||
| 1042 | Keys (character commands) and command names have separate indexes. | ||
| 1043 | There is also a glossary, with a cross reference for each term. | ||
| 1044 | |||
| 1045 | This manual is available as a printed book and also as an Info file. | ||
| 1046 | The Info file is for on-line perusal with the Info program, which is | ||
| 1047 | the principal means of accessing on-line documentation in the GNU | ||
| 1048 | system. Both the Emacs Info file and an Info reader are included with | ||
| 1049 | GNU Emacs. The Info file and the printed book contain substantially | ||
| 1050 | the same text and are generated from the same source files, which are | ||
| 1051 | also distributed with GNU Emacs. | ||
| 1052 | |||
| 1053 | GNU Emacs is a member of the Emacs editor family. There are many | ||
| 1054 | Emacs editors, all sharing common principles of organization. For | ||
| 1055 | information on the underlying philosophy of Emacs and the lessons | ||
| 1056 | learned from its development, see @cite{Emacs, the Extensible, | ||
| 1057 | Customizable Self-Documenting Display Editor}, available from | ||
| 1058 | @url{ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-519A.pdf}. | ||
| 1059 | |||
| 1060 | This edition of the manual is intended for use with GNU Emacs | ||
| 1061 | installed on GNU and Unix systems. GNU Emacs can also be used on VMS, | ||
| 1062 | MS-DOS (also called MS-DOG), Microsoft Windows, and Macintosh systems. | ||
| 1063 | Those systems use different file name syntax; in addition, VMS and | ||
| 1064 | MS-DOS do not support all GNU Emacs features. @xref{Microsoft | ||
| 1065 | Windows}, for information about using Emacs on Windows. | ||
| 1066 | @xref{Mac OS}, for information about using Emacs on Macintosh. We | ||
| 1067 | don't try to describe VMS usage in this manual. | ||
| 1068 | @end iftex | ||
| 1069 | |||
| 1070 | @node Distrib, Intro, Top, Top | ||
| 1071 | @unnumbered Distribution | ||
| 1072 | |||
| 1073 | GNU Emacs is @dfn{free software}; this means that everyone is free to | ||
| 1074 | use it and free to redistribute it on certain conditions. GNU Emacs | ||
| 1075 | is not in the public domain; it is copyrighted and there are | ||
| 1076 | restrictions on its distribution, but these restrictions are designed | ||
| 1077 | to permit everything that a good cooperating citizen would want to do. | ||
| 1078 | What is not allowed is to try to prevent others from further sharing | ||
| 1079 | any version of GNU Emacs that they might get from you. The precise | ||
| 1080 | conditions are found in the GNU General Public License that comes with | ||
| 1081 | Emacs and also appears in this manual@footnote{This manual is itself | ||
| 1082 | covered by the GNU Free Documentation License. This license is | ||
| 1083 | similar in spirit to the General Public License, but is more suitable | ||
| 1084 | for documentation. @xref{GNU Free Documentation License}.}. | ||
| 1085 | @xref{Copying}. | ||
| 1086 | |||
| 1087 | One way to get a copy of GNU Emacs is from someone else who has it. | ||
| 1088 | You need not ask for our permission to do so, or tell any one else; | ||
| 1089 | just copy it. If you have access to the Internet, you can get the | ||
| 1090 | latest distribution version of GNU Emacs by anonymous FTP; see | ||
| 1091 | @url{http://www.gnu.org/software/emacs} on our website for more | ||
| 1092 | information. | ||
| 1093 | |||
| 1094 | You may also receive GNU Emacs when you buy a computer. Computer | ||
| 1095 | manufacturers are free to distribute copies on the same terms that apply to | ||
| 1096 | everyone else. These terms require them to give you the full sources, | ||
| 1097 | including whatever changes they may have made, and to permit you to | ||
| 1098 | redistribute the GNU Emacs received from them under the usual terms of the | ||
| 1099 | General Public License. In other words, the program must be free for you | ||
| 1100 | when you get it, not just free for the manufacturer. | ||
| 1101 | |||
| 1102 | You can also order copies of GNU Emacs from the Free Software | ||
| 1103 | Foundation. This is a convenient and reliable way to get a copy; it is | ||
| 1104 | also a good way to help fund our work. We also sell hardcopy versions | ||
| 1105 | of this manual and @cite{An Introduction to Programming in Emacs Lisp}, | ||
| 1106 | by Robert J. Chassell. You can find an order form on our web site at | ||
| 1107 | @url{http://www.gnu.org/order/order.html}. For further information, | ||
| 1108 | write to | ||
| 1109 | |||
| 1110 | @display | ||
| 1111 | Free Software Foundation | ||
| 1112 | 51 Franklin Street, Fifth Floor | ||
| 1113 | Boston, MA 02110-1301 | ||
| 1114 | USA | ||
| 1115 | @end display | ||
| 1116 | |||
| 1117 | The income from distribution fees goes to support the foundation's | ||
| 1118 | purpose: the development of new free software, and improvements to our | ||
| 1119 | existing programs including GNU Emacs. | ||
| 1120 | |||
| 1121 | If you find GNU Emacs useful, please @strong{send a donation} to the | ||
| 1122 | Free Software Foundation to support our work. Donations to the Free | ||
| 1123 | Software Foundation are tax deductible in the US. If you use GNU Emacs | ||
| 1124 | at your workplace, please suggest that the company make a donation. If | ||
| 1125 | company policy is unsympathetic to the idea of donating to charity, you | ||
| 1126 | might instead suggest ordering a CD-ROM from the Foundation | ||
| 1127 | occasionally, or subscribing to periodic updates. | ||
| 1128 | |||
| 1129 | @iftex | ||
| 1130 | @node Acknowledgments, Intro, Distrib, Top | ||
| 1131 | @unnumberedsec Acknowledgments | ||
| 1132 | |||
| 1133 | Contributors to GNU Emacs include Jari Aalto, Per Abrahamsen, Tomas | ||
| 1134 | Abrahamsson, Jay K.@: Adams, Michael Albinus, Nagy Andras, Ralf | ||
| 1135 | Angeli, Joe Arceneaux, Miles Bader, David Bakhash, Juanma Barranquero, | ||
| 1136 | Eli Barzilay, Steven L.@: Baur, Jay Belanger, Alexander L.@: Belikoff, | ||
| 1137 | Boaz Ben-Zvi, Karl Berry, Anna M.@: Bigatti, Ray Blaak, Jim Blandy, Johan Bockg@aa{}rd, | ||
| 1138 | Per Bothner, Terrence Brannon, Frank Bresz, Peter Breton, Emmanuel | ||
| 1139 | Briot, Kevin Broadey, Vincent Broman, David M.@: Brown, Georges | ||
| 1140 | Brun-Cottan, Joe Buehler, W@l{}odek Bzyl, Bill Carpenter, Per | ||
| 1141 | Cederqvist, Hans Chalupsky, Chris Chase, Bob Chassell, Andrew Choi, | ||
| 1142 | Sacha Chua, James Clark, Mike Clarkson, Glynn Clements, Andrew | ||
| 1143 | Csillag, Doug Cutting, Mathias Dahl, Satyaki Das, Michael DeCorte, | ||
| 1144 | Gary Delp, Matthieu Devin, Eri Ding, Jan Dj@"{a}rv, Carsten Dominik, | ||
| 1145 | Scott Draves, Benjamin Drieu, Viktor Dukhovni, John Eaton, Rolf Ebert, | ||
| 1146 | Paul Eggert, Stephen Eglen, Torbj@"orn Einarsson, Tsugutomo Enami, | ||
| 1147 | Hans Henrik Eriksen, Michael Ernst, Ata Etemadi, Frederick Farnbach, | ||
| 1148 | Oscar Figueiredo, Fred Fish, Karl Fogel, Gary Foster, Romain | ||
| 1149 | Francoise, Noah Friedman, Andreas Fuchs, Hallvard Furuseth, Keith | ||
| 1150 | Gabryelski, Peter S.@: Galbraith, Kevin Gallagher, Kevin Gallo, Juan | ||
| 1151 | Le@'{o}n Lahoz Garc@'{@dotless{i}}a, Howard Gayle, Stephen Gildea, Julien | ||
| 1152 | Gilles, David Gillespie, Bob Glickstein, Deepak Goel, Boris Goldowsky, | ||
| 1153 | Michelangelo Grigni, Odd Gripenstam, Kai Gro@ss{}johann, Michael | ||
| 1154 | Gschwind, Henry Guillaume, Doug Gwyn, Ken'ichi Handa, Lars Hansen, | ||
| 1155 | Chris Hanson, K. Shane Hartman, John Heidemann, Jon K.@: Hellan, | ||
| 1156 | Jesper Harder, Markus Heritsch, Karl Heuer, Manabu Higashida, Anders | ||
| 1157 | Holst, Jeffrey C.@: Honig, Kurt Hornik, Tom Houlder, Joakim Hove, | ||
| 1158 | Denis Howe, Lars Ingebrigtsen, Andrew Innes, Seiichiro Inoue, Pavel | ||
| 1159 | Janik, Paul Jarc, Ulf Jasper, Michael K. Johnson, Kyle Jones, Terry | ||
| 1160 | Jones, Simon Josefsson, Arne J@o{}rgensen, Tomoji Kagatani, Brewster | ||
| 1161 | Kahle, Lute Kamstra, David Kastrup, David Kaufman, Henry Kautz, Taichi | ||
| 1162 | Kawabata, Howard Kaye, Michael Kifer, Richard King, Peter Kleiweg, | ||
| 1163 | Shuhei Kobayashi, Pavel Kobiakov, Larry K.@: Kolodney, David M.@: | ||
| 1164 | Koppelman, Koseki Yoshinori, Robert Krawitz, Sebastian Kremer, Ryszard | ||
| 1165 | Kubiak, Geoff Kuenning, David K@aa{}gedal, Daniel LaLiberte, Mario | ||
| 1166 | Lang, Aaron Larson, James R.@: Larus, Vinicius Jose Latorre, Werner | ||
| 1167 | Lemberg, Frederic Lepied, Peter Liljenberg, Lars Lindberg, Chris | ||
| 1168 | Lindblad, Anders Lindgren, Thomas Link, Juri Linkov, Francis Litterio, | ||
| 1169 | Emilio C. Lopes, Dave Love, Sascha L@"{u}decke, Eric Ludlam,Alan | ||
| 1170 | Mackenzie, Christopher J.@: Madsen, Neil M.@: Mager, Ken Manheimer, | ||
| 1171 | Bill Mann, Brian Marick, Simon Marshall, Bengt Martensson, Charlie | ||
| 1172 | Martin, Thomas May, Roland McGrath, Will Mengarini, David Megginson, | ||
| 1173 | Ben A. Mesander, Wayne Mesard, Brad Miller, Lawrence Mitchell, Richard | ||
| 1174 | Mlynarik, Gerd Moellmann, Stefan Monnier, Morioka Tomohiko, Keith | ||
| 1175 | Moore, Glenn Morris, Diane Murray, Sen Nagata, Erik Naggum, Thomas | ||
| 1176 | Neumann, Thien-Thi Nguyen, Mike Newton, Jurgen Nickelsen, Dan | ||
| 1177 | Nicolaescu, Hrvoje Niksic, Jeff Norden, Andrew Norman, Alexandre | ||
| 1178 | Oliva, Bob Olson, Michael Olson, Takaaki Ota, Pieter E.@: J.@: Pareit, | ||
| 1179 | David Pearson, Jeff Peck, Damon Anton Permezel, Tom Perrine, William | ||
| 1180 | M.@: Perry, Per Persson, Jens Petersen, Daniel Pfeiffer, Richard L.@: | ||
| 1181 | Pieri, Fred Pierresteguy, Christian Plaunt, David Ponce, Francesco | ||
| 1182 | A.@: Potorti, Michael D. Prange, Mukesh Prasad, Ken Raeburn, Marko | ||
| 1183 | Rahamaa, Ashwin Ram, Eric S. Raymond, Paul Reilly, Edward M. Reingold, | ||
| 1184 | Alex Rezinsky, Rob Riepel, David Reitter, Nick Roberts, Roland B.@: | ||
| 1185 | Roberts, John Robinson, Danny Roozendaal, William Rosenblatt, | ||
| 1186 | Guillermo J.@: Rozas, Martin Rudalics, Ivar Rummelhoff, Jason Rumney, | ||
| 1187 | Wolfgang Rupprecht, Kevin Ryde, James B. Salem, Masahiko Sato, Jorgen | ||
| 1188 | Schaefer, Holger Schauer, William Schelter, Ralph Schleicher, Gregor | ||
| 1189 | Schmid, Michael Schmidt, Ronald S. Schnell, Philippe Schnoebelen, Jan | ||
| 1190 | Schormann, Alex Schroeder, Stephen Schoef, Raymond Scholz, Randal | ||
| 1191 | Schwartz, Oliver Seidel, Manuel Serrano, Hovav Shacham, Stanislav | ||
| 1192 | Shalunov, Marc Shapiro, Richard Sharman, Olin Shivers, Espen Skoglund, | ||
| 1193 | Rick Sladkey, Lynn Slater, Chris Smith, David Smith, Paul D.@: Smith, | ||
| 1194 | Andre Spiegel, Michael Staats, William Sommerfeld, Michael Staats, | ||
| 1195 | Reiner Steib, Sam Steingold, Ake Stenhoff, Peter Stephenson, Ken | ||
| 1196 | Stevens, Jonathan Stigelman, Martin Stjernholm, Kim F.@: Storm, Steve | ||
| 1197 | Strassman, Olaf Sylvester, Naoto Takahashi, Steven Tamm, Jean-Philippe | ||
| 1198 | Theberge, Jens T.@: Berger Thielemann, Spencer Thomas, Jim Thompson, | ||
| 1199 | Luc Teirlinck, Tom Tromey, Enami Tsugutomo, Eli Tziperman, Daiki Ueno, | ||
| 1200 | Masanobu Umeda, Rajesh Vaidheeswarran, Neil W.@: Van Dyke, Didier | ||
| 1201 | Verna, Ulrik Vieth, Geoffrey Voelker, Johan Vromans, Inge Wallin, John | ||
| 1202 | Paul Wallington, Colin Walters, Barry Warsaw, Morten Welinder, Joseph | ||
| 1203 | Brian Wells, Rodney Whitby, John Wiegley, Ed Wilkinson, Mike Williams, | ||
| 1204 | Bill Wohler, Steven A. Wood, Dale R.@: Worley, Francis J.@: Wright, | ||
| 1205 | Felix S. T. Wu, Tom Wurgler, Katsumi Yamaoka, Masatake Yamato, | ||
| 1206 | Jonathan Yavner, Ryan Yeske, Chong Yidong, Ilya Zakharevich, Milan | ||
| 1207 | Zamazal, Victor Zandy, Eli Zaretskii, Jamie Zawinski, Shenghuo Zhu, | ||
| 1208 | Ian T.@: Zimmermann, Reto Zimmermann, Neal Ziring, Teodor Zlatanov, | ||
| 1209 | and Detlev Zundel. | ||
| 1210 | @end iftex | ||
| 1211 | |||
| 1212 | @node Intro, Glossary, Distrib, Top | ||
| 1213 | @unnumbered Introduction | ||
| 1214 | |||
| 1215 | You are reading about GNU Emacs, the GNU incarnation of the | ||
| 1216 | advanced, self-documenting, customizable, extensible editor Emacs. | ||
| 1217 | (The `G' in `GNU' is not silent.) | ||
| 1218 | |||
| 1219 | We call Emacs advanced because it provides much more than simple | ||
| 1220 | insertion and deletion. It can control subprocesses, indent programs | ||
| 1221 | automatically, show two or more files at once, and edit formatted | ||
| 1222 | text. Emacs editing commands operate in terms of characters, words, | ||
| 1223 | lines, sentences, paragraphs, and pages, as well as expressions and | ||
| 1224 | comments in various programming languages. | ||
| 1225 | |||
| 1226 | @dfn{Self-documenting} means that at any time you can type a special | ||
| 1227 | character, @kbd{Control-h}, to find out what your options are. You can | ||
| 1228 | also use it to find out what any command does, or to find all the commands | ||
| 1229 | that pertain to a topic. @xref{Help}. | ||
| 1230 | |||
| 1231 | @dfn{Customizable} means that you can alter Emacs commands' behavior | ||
| 1232 | in simple ways. For example, if you use a programming language in | ||
| 1233 | which comments start with @samp{<**} and end with @samp{**>}, you can | ||
| 1234 | tell the Emacs comment manipulation commands to use those strings | ||
| 1235 | (@pxref{Comments}). Another sort of customization is rearrangement of | ||
| 1236 | the command set. For example, you can rebind the basic cursor motion | ||
| 1237 | commands (up, down, left and right) to any keys on the keyboard that | ||
| 1238 | you find comfortable. @xref{Customization}. | ||
| 1239 | |||
| 1240 | @dfn{Extensible} means that you can go beyond simple customization | ||
| 1241 | and write entirely new commands---programs in the Lisp language to be | ||
| 1242 | run by Emacs's own Lisp interpreter. Emacs is an ``on-line | ||
| 1243 | extensible'' system, which means that it is divided into many | ||
| 1244 | functions that call each other, any of which can be redefined in the | ||
| 1245 | middle of an editing session. Almost any part of Emacs can be | ||
| 1246 | replaced without making a separate copy of all of Emacs. Most of the | ||
| 1247 | editing commands of Emacs are written in Lisp; the few exceptions | ||
| 1248 | could have been written in Lisp but use C instead for efficiency. | ||
| 1249 | Writing an extension is programming, but non-programmers can use it | ||
| 1250 | afterwards. @xref{Top, Emacs Lisp Intro, Preface, eintr, An | ||
| 1251 | Introduction to Programming in Emacs Lisp}, if you want to learn Emacs | ||
| 1252 | Lisp programming. | ||
| 1253 | |||
| 1254 | When running on a graphical display, Emacs provides its own menus | ||
| 1255 | and convenient handling of mouse buttons. In addition, Emacs provides | ||
| 1256 | many of the benefits of a graphical display even on a text-only | ||
| 1257 | terminal. For instance, it can highlight parts of a file, display and | ||
| 1258 | edit several files at once, move text between files, and edit files | ||
| 1259 | while running shell commands. | ||
| 1260 | |||
| 1261 | @include screen.texi | ||
| 1262 | @include commands.texi | ||
| 1263 | @include entering.texi | ||
| 1264 | @include basic.texi | ||
| 1265 | @include mini.texi | ||
| 1266 | @include m-x.texi | ||
| 1267 | @include help.texi | ||
| 1268 | @include mark.texi | ||
| 1269 | @include killing.texi | ||
| 1270 | @include regs.texi | ||
| 1271 | @include display.texi | ||
| 1272 | @include search.texi | ||
| 1273 | @include fixit.texi | ||
| 1274 | @include kmacro.texi | ||
| 1275 | @include files.texi | ||
| 1276 | @include buffers.texi | ||
| 1277 | @include windows.texi | ||
| 1278 | @include frames.texi | ||
| 1279 | @include mule.texi | ||
| 1280 | @include major.texi | ||
| 1281 | @include indent.texi | ||
| 1282 | @include text.texi | ||
| 1283 | @include programs.texi | ||
| 1284 | @include building.texi | ||
| 1285 | @include maintaining.texi | ||
| 1286 | @include abbrevs.texi | ||
| 1287 | @ifnottex | ||
| 1288 | @include picture-xtra.texi | ||
| 1289 | @end ifnottex | ||
| 1290 | @include sending.texi | ||
| 1291 | @include rmail.texi | ||
| 1292 | @include dired.texi | ||
| 1293 | @include calendar.texi | ||
| 1294 | @include misc.texi | ||
| 1295 | @include custom.texi | ||
| 1296 | @include trouble.texi | ||
| 1297 | |||
| 1298 | @node Copying, GNU Free Documentation License, Service, Top | ||
| 1299 | @appendix GNU GENERAL PUBLIC LICENSE | ||
| 1300 | @include gpl.texi | ||
| 1301 | |||
| 1302 | @node GNU Free Documentation License, Emacs Invocation, Copying, Top | ||
| 1303 | @appendix GNU Free Documentation License | ||
| 1304 | @include doclicense.texi | ||
| 1305 | |||
| 1306 | @include cmdargs.texi | ||
| 1307 | @include xresources.texi | ||
| 1308 | |||
| 1309 | @include anti.texi | ||
| 1310 | @include macos.texi | ||
| 1311 | @include msdog.texi | ||
| 1312 | @include gnu.texi | ||
| 1313 | @include glossary.texi | ||
| 1314 | @ifnottex | ||
| 1315 | @include ack.texi | ||
| 1316 | @end ifnottex | ||
| 1317 | |||
| 1318 | @c The Option Index is produced only in the on-line version, | ||
| 1319 | @c because the index entries related to command-line options | ||
| 1320 | @c tend to point to the same pages and all begin with a dash. | ||
| 1321 | @c This, and the need to keep the node links consistent, are | ||
| 1322 | @c the reasons for the funky @iftex/@ifnottex dance below. | ||
| 1323 | @c The Option Index is _not_ before Key Index, because that | ||
| 1324 | @c would require changes in the glossary.texi's @node line. | ||
| 1325 | @c It is not after Concept Index for similar reasons. | ||
| 1326 | |||
| 1327 | @iftex | ||
| 1328 | @node Key Index, Command Index, Glossary, Top | ||
| 1329 | @unnumbered Key (Character) Index | ||
| 1330 | @printindex ky | ||
| 1331 | @end iftex | ||
| 1332 | |||
| 1333 | @ifnottex | ||
| 1334 | @node Key Index, Option Index, Glossary, Top | ||
| 1335 | @unnumbered Key (Character) Index | ||
| 1336 | @printindex ky | ||
| 1337 | |||
| 1338 | @node Option Index, Command Index, Key Index, Top | ||
| 1339 | @unnumbered Command-Line Options Index | ||
| 1340 | @printindex op | ||
| 1341 | |||
| 1342 | @node Command Index, Variable Index, Option Index, Top | ||
| 1343 | @unnumbered Command and Function Index | ||
| 1344 | @printindex fn | ||
| 1345 | @end ifnottex | ||
| 1346 | |||
| 1347 | @iftex | ||
| 1348 | @node Command Index, Variable Index, Key Index, Top | ||
| 1349 | @unnumbered Command and Function Index | ||
| 1350 | @printindex fn | ||
| 1351 | @end iftex | ||
| 1352 | |||
| 1353 | @node Variable Index, Concept Index, Command Index, Top | ||
| 1354 | @unnumbered Variable Index | ||
| 1355 | @printindex vr | ||
| 1356 | |||
| 1357 | @node Concept Index, Acknowledgments, Variable Index, Top | ||
| 1358 | @unnumbered Concept Index | ||
| 1359 | @printindex cp | ||
| 1360 | |||
| 1361 | @bye | ||
| 1362 | |||
| 1363 | @ignore | ||
| 1364 | arch-tag: ed48740a-410b-46ea-9387-c9a9252a3392 | ||
| 1365 | @end ignore | ||
diff --git a/doc/emacs/emerge-xtra.texi b/doc/emacs/emerge-xtra.texi new file mode 100644 index 00000000000..e78f17e59d6 --- /dev/null +++ b/doc/emacs/emerge-xtra.texi | |||
| @@ -0,0 +1,414 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | @c | ||
| 5 | @c This file is included either in emacs-xtra.texi (when producing the | ||
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | ||
| 7 | @node Emerge | ||
| 8 | @section Merging Files with Emerge | ||
| 9 | @cindex Emerge | ||
| 10 | @cindex merging files | ||
| 11 | |||
| 12 | It's not unusual for programmers to get their signals crossed and | ||
| 13 | modify the same program in two different directions. To recover from | ||
| 14 | this confusion, you need to merge the two versions. Emerge makes this | ||
| 15 | easier. For other ways to compare files, see | ||
| 16 | @iftex | ||
| 17 | @ref{Comparing Files,,, emacs, the Emacs Manual}, | ||
| 18 | @end iftex | ||
| 19 | @ifnottex | ||
| 20 | @ref{Comparing Files}, | ||
| 21 | @end ifnottex | ||
| 22 | and @ref{Top, Ediff,, ediff, The Ediff Manual}. | ||
| 23 | |||
| 24 | @menu | ||
| 25 | * Overview of Emerge:: How to start Emerge. Basic concepts. | ||
| 26 | * Submodes of Emerge:: Fast mode vs. Edit mode. | ||
| 27 | Skip Prefers mode and Auto Advance mode. | ||
| 28 | * State of Difference:: You do the merge by specifying state A or B | ||
| 29 | for each difference. | ||
| 30 | * Merge Commands:: Commands for selecting a difference, | ||
| 31 | changing states of differences, etc. | ||
| 32 | * Exiting Emerge:: What to do when you've finished the merge. | ||
| 33 | * Combining in Emerge:: How to keep both alternatives for a difference. | ||
| 34 | * Fine Points of Emerge:: Misc. | ||
| 35 | @end menu | ||
| 36 | |||
| 37 | @node Overview of Emerge | ||
| 38 | @subsection Overview of Emerge | ||
| 39 | |||
| 40 | To start Emerge, run one of these four commands: | ||
| 41 | |||
| 42 | @table @kbd | ||
| 43 | @item M-x emerge-files | ||
| 44 | @findex emerge-files | ||
| 45 | Merge two specified files. | ||
| 46 | |||
| 47 | @item M-x emerge-files-with-ancestor | ||
| 48 | @findex emerge-files-with-ancestor | ||
| 49 | Merge two specified files, with reference to a common ancestor. | ||
| 50 | |||
| 51 | @item M-x emerge-buffers | ||
| 52 | @findex emerge-buffers | ||
| 53 | Merge two buffers. | ||
| 54 | |||
| 55 | @item M-x emerge-buffers-with-ancestor | ||
| 56 | @findex emerge-buffers-with-ancestor | ||
| 57 | Merge two buffers with reference to a common ancestor in a third | ||
| 58 | buffer. | ||
| 59 | @end table | ||
| 60 | |||
| 61 | @cindex merge buffer (Emerge) | ||
| 62 | @cindex A and B buffers (Emerge) | ||
| 63 | The Emerge commands compare two files or buffers, and display the | ||
| 64 | comparison in three buffers: one for each input text (the @dfn{A buffer} | ||
| 65 | and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging | ||
| 66 | takes place. The merge buffer shows the full merged text, not just the | ||
| 67 | differences. Wherever the two input texts differ, you can choose which | ||
| 68 | one of them to include in the merge buffer. | ||
| 69 | |||
| 70 | The Emerge commands that take input from existing buffers use only | ||
| 71 | the accessible portions of those buffers, if they are narrowed. | ||
| 72 | @iftex | ||
| 73 | @xref{Narrowing,,, emacs, the Emacs Manual}. | ||
| 74 | @end iftex | ||
| 75 | @ifnottex | ||
| 76 | @xref{Narrowing}. | ||
| 77 | @end ifnottex | ||
| 78 | |||
| 79 | |||
| 80 | If a common ancestor version is available, from which the two texts to | ||
| 81 | be merged were both derived, Emerge can use it to guess which | ||
| 82 | alternative is right. Wherever one current version agrees with the | ||
| 83 | ancestor, Emerge presumes that the other current version is a deliberate | ||
| 84 | change which should be kept in the merged version. Use the | ||
| 85 | @samp{with-ancestor} commands if you want to specify a common ancestor | ||
| 86 | text. These commands read three file or buffer names---variant A, | ||
| 87 | variant B, and the common ancestor. | ||
| 88 | |||
| 89 | After the comparison is done and the buffers are prepared, the | ||
| 90 | interactive merging starts. You control the merging by typing special | ||
| 91 | @dfn{merge commands} in the merge buffer (@pxref{Merge Commands}). | ||
| 92 | For each run of differences between the input texts, you can choose | ||
| 93 | which one of them to keep, or edit them both together. | ||
| 94 | |||
| 95 | The merge buffer uses a special major mode, Emerge mode, with commands | ||
| 96 | for making these choices. But you can also edit the buffer with | ||
| 97 | ordinary Emacs commands. | ||
| 98 | |||
| 99 | At any given time, the attention of Emerge is focused on one | ||
| 100 | particular difference, called the @dfn{selected} difference. This | ||
| 101 | difference is marked off in the three buffers like this: | ||
| 102 | |||
| 103 | @example | ||
| 104 | vvvvvvvvvvvvvvvvvvvv | ||
| 105 | @var{text that differs} | ||
| 106 | ^^^^^^^^^^^^^^^^^^^^ | ||
| 107 | @end example | ||
| 108 | |||
| 109 | @noindent | ||
| 110 | Emerge numbers all the differences sequentially and the mode | ||
| 111 | line always shows the number of the selected difference. | ||
| 112 | |||
| 113 | Normally, the merge buffer starts out with the A version of the text. | ||
| 114 | But when the A version of a difference agrees with the common ancestor, | ||
| 115 | then the B version is initially preferred for that difference. | ||
| 116 | |||
| 117 | Emerge leaves the merged text in the merge buffer when you exit. At | ||
| 118 | that point, you can save it in a file with @kbd{C-x C-w}. If you give a | ||
| 119 | numeric argument to @code{emerge-files} or | ||
| 120 | @code{emerge-files-with-ancestor}, it reads the name of the output file | ||
| 121 | using the minibuffer. (This is the last file name those commands read.) | ||
| 122 | Then exiting from Emerge saves the merged text in the output file. | ||
| 123 | |||
| 124 | Normally, Emerge commands save the output buffer in its file when you | ||
| 125 | exit. If you abort Emerge with @kbd{C-]}, the Emerge command does not | ||
| 126 | save the output buffer, but you can save it yourself if you wish. | ||
| 127 | |||
| 128 | @node Submodes of Emerge | ||
| 129 | @subsection Submodes of Emerge | ||
| 130 | |||
| 131 | You can choose between two modes for giving merge commands: Fast mode | ||
| 132 | and Edit mode. In Fast mode, basic merge commands are single | ||
| 133 | characters, but ordinary Emacs commands are disabled. This is | ||
| 134 | convenient if you use only merge commands. In Edit mode, all merge | ||
| 135 | commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs | ||
| 136 | commands are also available. This allows editing the merge buffer, but | ||
| 137 | slows down Emerge operations. | ||
| 138 | |||
| 139 | Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to | ||
| 140 | Fast mode. The mode line indicates Edit and Fast modes with @samp{E} | ||
| 141 | and @samp{F}. | ||
| 142 | |||
| 143 | Emerge has two additional submodes that affect how particular merge | ||
| 144 | commands work: Auto Advance mode and Skip Prefers mode. | ||
| 145 | |||
| 146 | If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands | ||
| 147 | advance to the next difference. This lets you go through the merge | ||
| 148 | faster as long as you simply choose one of the alternatives from the | ||
| 149 | input. The mode line indicates Auto Advance mode with @samp{A}. | ||
| 150 | |||
| 151 | If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands | ||
| 152 | skip over differences in states prefer-A and prefer-B (@pxref{State of | ||
| 153 | Difference}). Thus you see only differences for which neither version | ||
| 154 | is presumed ``correct.'' The mode line indicates Skip Prefers mode with | ||
| 155 | @samp{S}. | ||
| 156 | |||
| 157 | @findex emerge-auto-advance-mode | ||
| 158 | @findex emerge-skip-prefers-mode | ||
| 159 | Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or | ||
| 160 | clear Auto Advance mode. Use @kbd{s s} | ||
| 161 | (@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode. | ||
| 162 | These commands turn on the mode with a positive argument, turns it off | ||
| 163 | with a negative or zero argument, and toggle the mode with no argument. | ||
| 164 | |||
| 165 | @node State of Difference | ||
| 166 | @subsection State of a Difference | ||
| 167 | |||
| 168 | In the merge buffer, a difference is marked with lines of @samp{v} and | ||
| 169 | @samp{^} characters. Each difference has one of these seven states: | ||
| 170 | |||
| 171 | @table @asis | ||
| 172 | @item A | ||
| 173 | The difference is showing the A version. The @kbd{a} command always | ||
| 174 | produces this state; the mode line indicates it with @samp{A}. | ||
| 175 | |||
| 176 | @item B | ||
| 177 | The difference is showing the B version. The @kbd{b} command always | ||
| 178 | produces this state; the mode line indicates it with @samp{B}. | ||
| 179 | |||
| 180 | @item default-A | ||
| 181 | @itemx default-B | ||
| 182 | The difference is showing the A or the B state by default, because you | ||
| 183 | haven't made a choice. All differences start in the default-A state | ||
| 184 | (and thus the merge buffer is a copy of the A buffer), except those for | ||
| 185 | which one alternative is ``preferred'' (see below). | ||
| 186 | |||
| 187 | When you select a difference, its state changes from default-A or | ||
| 188 | default-B to plain A or B. Thus, the selected difference never has | ||
| 189 | state default-A or default-B, and these states are never displayed in | ||
| 190 | the mode line. | ||
| 191 | |||
| 192 | The command @kbd{d a} chooses default-A as the default state, and @kbd{d | ||
| 193 | b} chooses default-B. This chosen default applies to all differences | ||
| 194 | which you haven't ever selected and for which no alternative is preferred. | ||
| 195 | If you are moving through the merge sequentially, the differences you | ||
| 196 | haven't selected are those following the selected one. Thus, while | ||
| 197 | moving sequentially, you can effectively make the A version the default | ||
| 198 | for some sections of the merge buffer and the B version the default for | ||
| 199 | others by using @kbd{d a} and @kbd{d b} between sections. | ||
| 200 | |||
| 201 | @item prefer-A | ||
| 202 | @itemx prefer-B | ||
| 203 | The difference is showing the A or B state because it is | ||
| 204 | @dfn{preferred}. This means that you haven't made an explicit choice, | ||
| 205 | but one alternative seems likely to be right because the other | ||
| 206 | alternative agrees with the common ancestor. Thus, where the A buffer | ||
| 207 | agrees with the common ancestor, the B version is preferred, because | ||
| 208 | chances are it is the one that was actually changed. | ||
| 209 | |||
| 210 | These two states are displayed in the mode line as @samp{A*} and @samp{B*}. | ||
| 211 | |||
| 212 | @item combined | ||
| 213 | The difference is showing a combination of the A and B states, as a | ||
| 214 | result of the @kbd{x c} or @kbd{x C} commands. | ||
| 215 | |||
| 216 | Once a difference is in this state, the @kbd{a} and @kbd{b} commands | ||
| 217 | don't do anything to it unless you give them a numeric argument. | ||
| 218 | |||
| 219 | The mode line displays this state as @samp{comb}. | ||
| 220 | @end table | ||
| 221 | |||
| 222 | @node Merge Commands | ||
| 223 | @subsection Merge Commands | ||
| 224 | |||
| 225 | Here are the Merge commands for Fast mode; in Edit mode, precede them | ||
| 226 | with @kbd{C-c C-c}: | ||
| 227 | |||
| 228 | @table @kbd | ||
| 229 | @item p | ||
| 230 | Select the previous difference. | ||
| 231 | |||
| 232 | @item n | ||
| 233 | Select the next difference. | ||
| 234 | |||
| 235 | @item a | ||
| 236 | Choose the A version of this difference. | ||
| 237 | |||
| 238 | @item b | ||
| 239 | Choose the B version of this difference. | ||
| 240 | |||
| 241 | @item C-u @var{n} j | ||
| 242 | Select difference number @var{n}. | ||
| 243 | |||
| 244 | @item . | ||
| 245 | Select the difference containing point. You can use this command in the | ||
| 246 | merge buffer or in the A or B buffer. | ||
| 247 | |||
| 248 | @item q | ||
| 249 | Quit---finish the merge. | ||
| 250 | |||
| 251 | @item C-] | ||
| 252 | Abort---exit merging and do not save the output. | ||
| 253 | |||
| 254 | @item f | ||
| 255 | Go into Fast mode. (In Edit mode, this is actually @kbd{C-c C-c f}.) | ||
| 256 | |||
| 257 | @item e | ||
| 258 | Go into Edit mode. | ||
| 259 | |||
| 260 | @item l | ||
| 261 | Recenter (like @kbd{C-l}) all three windows. | ||
| 262 | |||
| 263 | @item - | ||
| 264 | Specify part of a prefix numeric argument. | ||
| 265 | |||
| 266 | @item @var{digit} | ||
| 267 | Also specify part of a prefix numeric argument. | ||
| 268 | |||
| 269 | @item d a | ||
| 270 | Choose the A version as the default from here down in | ||
| 271 | the merge buffer. | ||
| 272 | |||
| 273 | @item d b | ||
| 274 | Choose the B version as the default from here down in | ||
| 275 | the merge buffer. | ||
| 276 | |||
| 277 | @item c a | ||
| 278 | Copy the A version of this difference into the kill ring. | ||
| 279 | |||
| 280 | @item c b | ||
| 281 | Copy the B version of this difference into the kill ring. | ||
| 282 | |||
| 283 | @item i a | ||
| 284 | Insert the A version of this difference at point. | ||
| 285 | |||
| 286 | @item i b | ||
| 287 | Insert the B version of this difference at point. | ||
| 288 | |||
| 289 | @item m | ||
| 290 | Put point and mark around the difference. | ||
| 291 | |||
| 292 | @item ^ | ||
| 293 | Scroll all three windows down (like @kbd{M-v}). | ||
| 294 | |||
| 295 | @item v | ||
| 296 | Scroll all three windows up (like @kbd{C-v}). | ||
| 297 | |||
| 298 | @item < | ||
| 299 | Scroll all three windows left (like @kbd{C-x <}). | ||
| 300 | |||
| 301 | @item > | ||
| 302 | Scroll all three windows right (like @kbd{C-x >}). | ||
| 303 | |||
| 304 | @item | | ||
| 305 | Reset horizontal scroll on all three windows. | ||
| 306 | |||
| 307 | @item x 1 | ||
| 308 | Shrink the merge window to one line. (Use @kbd{C-u l} to restore it | ||
| 309 | to full size.) | ||
| 310 | |||
| 311 | @item x c | ||
| 312 | Combine the two versions of this difference (@pxref{Combining in | ||
| 313 | Emerge}). | ||
| 314 | |||
| 315 | @item x f | ||
| 316 | Show the names of the files/buffers Emerge is operating on, in a Help | ||
| 317 | window. (Use @kbd{C-u l} to restore windows.) | ||
| 318 | |||
| 319 | @item x j | ||
| 320 | Join this difference with the following one. | ||
| 321 | (@kbd{C-u x j} joins this difference with the previous one.) | ||
| 322 | |||
| 323 | @item x s | ||
| 324 | Split this difference into two differences. Before you use this | ||
| 325 | command, position point in each of the three buffers at the place where | ||
| 326 | you want to split the difference. | ||
| 327 | |||
| 328 | @item x t | ||
| 329 | Trim identical lines off the top and bottom of the difference. | ||
| 330 | Such lines occur when the A and B versions are | ||
| 331 | identical but differ from the ancestor version. | ||
| 332 | @end table | ||
| 333 | |||
| 334 | @node Exiting Emerge | ||
| 335 | @subsection Exiting Emerge | ||
| 336 | |||
| 337 | The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing | ||
| 338 | the results into the output file if you specified one. It restores the | ||
| 339 | A and B buffers to their proper contents, or kills them if they were | ||
| 340 | created by Emerge and you haven't changed them. It also disables the | ||
| 341 | Emerge commands in the merge buffer, since executing them later could | ||
| 342 | damage the contents of the various buffers. | ||
| 343 | |||
| 344 | @kbd{C-]} aborts the merge. This means exiting without writing the | ||
| 345 | output file. If you didn't specify an output file, then there is no | ||
| 346 | real difference between aborting and finishing the merge. | ||
| 347 | |||
| 348 | If the Emerge command was called from another Lisp program, then its | ||
| 349 | return value is @code{t} for successful completion, or @code{nil} if you | ||
| 350 | abort. | ||
| 351 | |||
| 352 | @node Combining in Emerge | ||
| 353 | @subsection Combining the Two Versions | ||
| 354 | |||
| 355 | Sometimes you want to keep @emph{both} alternatives for a particular | ||
| 356 | difference. To do this, use @kbd{x c}, which edits the merge buffer | ||
| 357 | like this: | ||
| 358 | |||
| 359 | @example | ||
| 360 | @group | ||
| 361 | #ifdef NEW | ||
| 362 | @var{version from A buffer} | ||
| 363 | #else /* not NEW */ | ||
| 364 | @var{version from B buffer} | ||
| 365 | #endif /* not NEW */ | ||
| 366 | @end group | ||
| 367 | @end example | ||
| 368 | |||
| 369 | @noindent | ||
| 370 | @vindex emerge-combine-versions-template | ||
| 371 | While this example shows C preprocessor conditionals delimiting the two | ||
| 372 | alternative versions, you can specify the strings to use by setting | ||
| 373 | the variable @code{emerge-combine-versions-template} to a string of your | ||
| 374 | choice. In the string, @samp{%a} says where to put version A, and | ||
| 375 | @samp{%b} says where to put version B. The default setting, which | ||
| 376 | produces the results shown above, looks like this: | ||
| 377 | |||
| 378 | @example | ||
| 379 | @group | ||
| 380 | "#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n" | ||
| 381 | @end group | ||
| 382 | @end example | ||
| 383 | |||
| 384 | @node Fine Points of Emerge | ||
| 385 | @subsection Fine Points of Emerge | ||
| 386 | |||
| 387 | During the merge, you mustn't try to edit the A and B buffers yourself. | ||
| 388 | Emerge modifies them temporarily, but ultimately puts them back the way | ||
| 389 | they were. | ||
| 390 | |||
| 391 | You can have any number of merges going at once---just don't use any one | ||
| 392 | buffer as input to more than one merge at once, since the temporary | ||
| 393 | changes made in these buffers would get in each other's way. | ||
| 394 | |||
| 395 | Starting Emerge can take a long time because it needs to compare the | ||
| 396 | files fully. Emacs can't do anything else until @code{diff} finishes. | ||
| 397 | Perhaps in the future someone will change Emerge to do the comparison in | ||
| 398 | the background when the input files are large---then you could keep on | ||
| 399 | doing other things with Emacs until Emerge is ready to accept | ||
| 400 | commands. | ||
| 401 | |||
| 402 | @vindex emerge-startup-hook | ||
| 403 | After setting up the merge, Emerge runs the hook | ||
| 404 | @code{emerge-startup-hook}. | ||
| 405 | @iftex | ||
| 406 | @xref{Hooks,,, emacs, the Emacs Manual}. | ||
| 407 | @end iftex | ||
| 408 | @ifnottex | ||
| 409 | @xref{Hooks}. | ||
| 410 | @end ifnottex | ||
| 411 | |||
| 412 | @ignore | ||
| 413 | arch-tag: cda63f09-9c5f-4ea1-adb9-4a820fdfb24e | ||
| 414 | @end ignore | ||
diff --git a/doc/emacs/entering.texi b/doc/emacs/entering.texi new file mode 100644 index 00000000000..e338a6a8619 --- /dev/null +++ b/doc/emacs/entering.texi | |||
| @@ -0,0 +1,170 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 2001, 2002, 2003, | ||
| 3 | @c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Entering Emacs, Exiting, Text Characters, Top | ||
| 6 | @chapter Entering and Exiting Emacs | ||
| 7 | @cindex entering Emacs | ||
| 8 | @cindex starting Emacs | ||
| 9 | |||
| 10 | The usual way to invoke Emacs is with the shell command | ||
| 11 | @command{emacs}. Emacs clears the screen, then displays an initial | ||
| 12 | help message and copyright notice. Some operating systems discard | ||
| 13 | your type-ahead when Emacs starts up; they give Emacs no way to | ||
| 14 | prevent this. On those systems, wait for Emacs to clear the screen | ||
| 15 | before you start typing. | ||
| 16 | |||
| 17 | From a shell window under the X Window System, run Emacs in the | ||
| 18 | background with @command{emacs&}. This way, Emacs won't tie up the | ||
| 19 | shell window, so you can use it to run other shell commands while | ||
| 20 | Emacs is running. You can type Emacs commands as soon as you direct | ||
| 21 | your keyboard input to an Emacs frame. | ||
| 22 | |||
| 23 | @vindex initial-major-mode | ||
| 24 | When Emacs starts up, it creates a buffer named @samp{*scratch*}. | ||
| 25 | That's the buffer you start out in. The @samp{*scratch*} buffer uses | ||
| 26 | Lisp Interaction mode; you can use it to type Lisp expressions and | ||
| 27 | evaluate them. You can also ignore that capability and just write notes | ||
| 28 | there. You can specify a different major mode for this buffer by | ||
| 29 | setting the variable @code{initial-major-mode} in your init file. | ||
| 30 | @xref{Init File}. | ||
| 31 | |||
| 32 | It is possible to specify files to be visited, Lisp files to be | ||
| 33 | loaded, and functions to be called through Emacs command-line | ||
| 34 | arguments. @xref{Emacs Invocation}. The feature exists mainly for | ||
| 35 | compatibility with other editors, and for scripts. | ||
| 36 | |||
| 37 | Many editors are designed to edit one file. When done with that | ||
| 38 | file, you exit the editor. The next time you want to edit a file, you | ||
| 39 | must start the editor again. Working this way, it is convenient to | ||
| 40 | use a command-line argument to say which file to edit. | ||
| 41 | |||
| 42 | However, killing Emacs after editing one each and starting it afresh | ||
| 43 | for the next file is both unnecessary and harmful, since it denies you | ||
| 44 | the full power of Emacs. Emacs can visit more than one file in a | ||
| 45 | single editing session, and that is the right way to use it. Exiting | ||
| 46 | the Emacs session loses valuable accumulated context, such as the kill | ||
| 47 | ring, registers, undo history, and mark ring. These features are | ||
| 48 | useful for operating on multiple files, or even continuing to edit one | ||
| 49 | file. If you kill Emacs after each file, you don't take advantage of | ||
| 50 | them. | ||
| 51 | |||
| 52 | The recommended way to use GNU Emacs is to start it only once, just | ||
| 53 | after you log in, and do all your editing in the same Emacs session. | ||
| 54 | Each time you edit a file, you visit it with the existing Emacs, which | ||
| 55 | eventually has many files in it ready for editing. Usually you do not | ||
| 56 | kill Emacs until you are about to log out. @xref{Files}, for more | ||
| 57 | information on visiting more than one file. | ||
| 58 | |||
| 59 | To edit a file from another program while Emacs is running, you can | ||
| 60 | use the @command{emacsclient} helper program to open a file in the | ||
| 61 | already running Emacs. @xref{Emacs Server}. | ||
| 62 | |||
| 63 | @ifnottex | ||
| 64 | @raisesections | ||
| 65 | @end ifnottex | ||
| 66 | |||
| 67 | @node Exiting, Basic, Entering Emacs, Top | ||
| 68 | @section Exiting Emacs | ||
| 69 | @cindex exiting | ||
| 70 | @cindex killing Emacs | ||
| 71 | @cindex suspending | ||
| 72 | @cindex leaving Emacs | ||
| 73 | @cindex quitting Emacs | ||
| 74 | |||
| 75 | There are two commands for exiting Emacs, and three kinds of | ||
| 76 | exiting: @dfn{iconifying} Emacs, @dfn{suspending} Emacs, and | ||
| 77 | @dfn{killing} Emacs. | ||
| 78 | |||
| 79 | @dfn{Iconifying} means replacing the Emacs frame with a small box or | ||
| 80 | ``icon'' on the screen. This is the usual way to exit Emacs when | ||
| 81 | you're using a graphical display---if you bother to ``exit'' at all. | ||
| 82 | (Just switching to another application is usually sufficient.) | ||
| 83 | |||
| 84 | @dfn{Suspending} means stopping Emacs temporarily and returning | ||
| 85 | control to its parent process (usually a shell), allowing you to | ||
| 86 | resume editing later in the same Emacs job. This is the usual way to | ||
| 87 | exit Emacs when running it on a text terminal. | ||
| 88 | |||
| 89 | @dfn{Killing} Emacs means destroying the Emacs job. You can run Emacs | ||
| 90 | again later, but you will get a fresh Emacs; there is no way to resume | ||
| 91 | the same editing session after it has been killed. | ||
| 92 | |||
| 93 | @table @kbd | ||
| 94 | @item C-z | ||
| 95 | Suspend Emacs (@code{suspend-emacs}) or iconify a frame | ||
| 96 | (@code{iconify-or-deiconify-frame}). | ||
| 97 | @item C-x C-c | ||
| 98 | Kill Emacs (@code{save-buffers-kill-emacs}). | ||
| 99 | @end table | ||
| 100 | |||
| 101 | @kindex C-z | ||
| 102 | @findex iconify-or-deiconify-frame | ||
| 103 | On graphical displays, @kbd{C-z} runs the command | ||
| 104 | @code{iconify-or-deiconify-frame}, which temporarily iconifies (or | ||
| 105 | ``minimizes'') the selected Emacs frame (@pxref{Frames}). You can | ||
| 106 | then use the window manager to select some other application. (You | ||
| 107 | could select another application without iconifying Emacs first, but | ||
| 108 | getting the Emacs frame out of the way can make it more convenient to | ||
| 109 | find the other application.) | ||
| 110 | |||
| 111 | @findex suspend-emacs | ||
| 112 | On a text terminal, @kbd{C-z} runs the command @code{suspend-emacs}. | ||
| 113 | Suspending Emacs takes you back to the shell from which you invoked | ||
| 114 | Emacs. You can resume Emacs with the shell command @command{%emacs} | ||
| 115 | in most common shells. On systems that don't support suspending | ||
| 116 | programs, @kbd{C-z} starts an inferior shell that communicates | ||
| 117 | directly with the terminal, and Emacs waits until you exit the | ||
| 118 | subshell. (The way to do that is probably with @kbd{C-d} or | ||
| 119 | @command{exit}, but it depends on which shell you use.) On these | ||
| 120 | systems, you can only get back to the shell from which Emacs was run | ||
| 121 | (to log out, for example) when you kill Emacs. | ||
| 122 | |||
| 123 | @vindex cannot-suspend | ||
| 124 | Suspending can fail if you run Emacs under a shell that doesn't | ||
| 125 | support suspendion of its subjobs, even if the system itself does | ||
| 126 | support it. In such a case, you can set the variable | ||
| 127 | @code{cannot-suspend} to a non-@code{nil} value to force @kbd{C-z} to | ||
| 128 | start an inferior shell. | ||
| 129 | |||
| 130 | @kindex C-x C-c | ||
| 131 | @findex save-buffers-kill-emacs | ||
| 132 | To exit and kill Emacs, type @kbd{C-x C-c} | ||
| 133 | (@code{save-buffers-kill-emacs}). A two-character key is used to make | ||
| 134 | it harder to type by accident. This command first offers to save any | ||
| 135 | modified file-visiting buffers. If you do not save them all, it asks | ||
| 136 | for confirmation with @kbd{yes} before killing Emacs, since any | ||
| 137 | changes not saved now will be lost forever. Also, if any subprocesses are | ||
| 138 | still running, @kbd{C-x C-c} asks for confirmation about them, since | ||
| 139 | killing Emacs will also kill the subprocesses. | ||
| 140 | |||
| 141 | @vindex confirm-kill-emacs | ||
| 142 | If the value of the variable @code{confirm-kill-emacs} is | ||
| 143 | non-@code{nil}, @kbd{C-x C-c} assumes that its value is a predicate | ||
| 144 | function, and calls that function. If the result is non-@code{nil}, the | ||
| 145 | session is killed, otherwise Emacs continues to run. One convenient | ||
| 146 | function to use as the value of @code{confirm-kill-emacs} is the | ||
| 147 | function @code{yes-or-no-p}. The default value of | ||
| 148 | @code{confirm-kill-emacs} is @code{nil}. | ||
| 149 | |||
| 150 | You can't resume an Emacs session after killing it. Emacs can, | ||
| 151 | however, record certain session information when you kill it, such as | ||
| 152 | which files you visited, so the next time you start Emacs it will try | ||
| 153 | to visit the same files. @xref{Saving Emacs Sessions}. | ||
| 154 | |||
| 155 | The operating system usually listens for certain special characters | ||
| 156 | whose meaning is to kill or suspend the program you are running. | ||
| 157 | @b{This operating system feature is turned off while you are in Emacs.} | ||
| 158 | The meanings of @kbd{C-z} and @kbd{C-x C-c} as keys in Emacs were | ||
| 159 | inspired by the use of @kbd{C-z} and @kbd{C-c} on several operating | ||
| 160 | systems as the characters for stopping or killing a program, but that is | ||
| 161 | their only relationship with the operating system. You can customize | ||
| 162 | these keys to run any commands of your choice (@pxref{Keymaps}). | ||
| 163 | |||
| 164 | @ifnottex | ||
| 165 | @lowersections | ||
| 166 | @end ifnottex | ||
| 167 | |||
| 168 | @ignore | ||
| 169 | arch-tag: df798d8b-f253-4113-b585-f528f078a944 | ||
| 170 | @end ignore | ||
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi new file mode 100644 index 00000000000..7ba36916684 --- /dev/null +++ b/doc/emacs/files.texi | |||
| @@ -0,0 +1,2950 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000, | ||
| 3 | @c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Files, Buffers, Keyboard Macros, Top | ||
| 6 | @chapter File Handling | ||
| 7 | @cindex files | ||
| 8 | |||
| 9 | The operating system stores data permanently in named @dfn{files}, so | ||
| 10 | most of the text you edit with Emacs comes from a file and is ultimately | ||
| 11 | stored in a file. | ||
| 12 | |||
| 13 | To edit a file, you must tell Emacs to read the file and prepare a | ||
| 14 | buffer containing a copy of the file's text. This is called | ||
| 15 | @dfn{visiting} the file. Editing commands apply directly to text in the | ||
| 16 | buffer; that is, to the copy inside Emacs. Your changes appear in the | ||
| 17 | file itself only when you @dfn{save} the buffer back into the file. | ||
| 18 | |||
| 19 | In addition to visiting and saving files, Emacs can delete, copy, | ||
| 20 | rename, and append to files, keep multiple versions of them, and operate | ||
| 21 | on file directories. | ||
| 22 | |||
| 23 | @menu | ||
| 24 | * File Names:: How to type and edit file-name arguments. | ||
| 25 | * Visiting:: Visiting a file prepares Emacs to edit the file. | ||
| 26 | * Saving:: Saving makes your changes permanent. | ||
| 27 | * Reverting:: Reverting cancels all the changes not saved. | ||
| 28 | @ifnottex | ||
| 29 | * Autorevert:: Auto Reverting non-file buffers. | ||
| 30 | @end ifnottex | ||
| 31 | * Auto Save:: Auto Save periodically protects against loss of data. | ||
| 32 | * File Aliases:: Handling multiple names for one file. | ||
| 33 | * Version Control:: Version control systems (RCS, CVS and SCCS). | ||
| 34 | * Directories:: Creating, deleting, and listing file directories. | ||
| 35 | * Comparing Files:: Finding where two files differ. | ||
| 36 | * Diff Mode:: Mode for editing file differences. | ||
| 37 | * Misc File Ops:: Other things you can do on files. | ||
| 38 | * Compressed Files:: Accessing compressed files. | ||
| 39 | * File Archives:: Operating on tar, zip, jar etc. archive files. | ||
| 40 | * Remote Files:: Accessing files on other sites. | ||
| 41 | * Quoted File Names:: Quoting special characters in file names. | ||
| 42 | * File Name Cache:: Completion against a list of files you often use. | ||
| 43 | * File Conveniences:: Convenience Features for Finding Files. | ||
| 44 | * Filesets:: Handling sets of files. | ||
| 45 | @end menu | ||
| 46 | |||
| 47 | @node File Names | ||
| 48 | @section File Names | ||
| 49 | @cindex file names | ||
| 50 | |||
| 51 | Most Emacs commands that operate on a file require you to specify the | ||
| 52 | file name. (Saving and reverting are exceptions; the buffer knows which | ||
| 53 | file name to use for them.) You enter the file name using the | ||
| 54 | minibuffer (@pxref{Minibuffer}). @dfn{Completion} is available | ||
| 55 | (@pxref{Completion}) to make it easier to specify long file names. When | ||
| 56 | completing file names, Emacs ignores those whose file-name extensions | ||
| 57 | appear in the variable @code{completion-ignored-extensions}; see | ||
| 58 | @ref{Completion Options}. | ||
| 59 | |||
| 60 | For most operations, there is a @dfn{default file name} which is used | ||
| 61 | if you type just @key{RET} to enter an empty argument. Normally the | ||
| 62 | default file name is the name of the file visited in the current buffer; | ||
| 63 | this makes it easy to operate on that file with any of the Emacs file | ||
| 64 | commands. | ||
| 65 | |||
| 66 | @vindex default-directory | ||
| 67 | Each buffer has a default directory which is normally the same as the | ||
| 68 | directory of the file visited in that buffer. When you enter a file | ||
| 69 | name without a directory, the default directory is used. If you specify | ||
| 70 | a directory in a relative fashion, with a name that does not start with | ||
| 71 | a slash, it is interpreted with respect to the default directory. The | ||
| 72 | default directory is kept in the variable @code{default-directory}, | ||
| 73 | which has a separate value in every buffer. | ||
| 74 | |||
| 75 | @findex cd | ||
| 76 | @findex pwd | ||
| 77 | The command @kbd{M-x pwd} displays the current buffer's default | ||
| 78 | directory, and the command @kbd{M-x cd} sets it (to a value read using | ||
| 79 | the minibuffer). A buffer's default directory changes only when the | ||
| 80 | @code{cd} command is used. A file-visiting buffer's default directory | ||
| 81 | is initialized to the directory of the file it visits. If you create | ||
| 82 | a buffer with @kbd{C-x b}, its default directory is copied from that | ||
| 83 | of the buffer that was current at the time. | ||
| 84 | |||
| 85 | For example, if the default file name is @file{/u/rms/gnu/gnu.tasks} | ||
| 86 | then the default directory is normally @file{/u/rms/gnu/}. If you | ||
| 87 | type just @samp{foo}, which does not specify a directory, it is short | ||
| 88 | for @file{/u/rms/gnu/foo}. @samp{../.login} would stand for | ||
| 89 | @file{/u/rms/.login}. @samp{new/foo} would stand for the file name | ||
| 90 | @file{/u/rms/gnu/new/foo}. | ||
| 91 | |||
| 92 | @vindex insert-default-directory | ||
| 93 | The default directory actually appears in the minibuffer when the | ||
| 94 | minibuffer becomes active to read a file name. This serves two | ||
| 95 | purposes: it @emph{shows} you what the default is, so that you can type | ||
| 96 | a relative file name and know with certainty what it will mean, and it | ||
| 97 | allows you to @emph{edit} the default to specify a different directory. | ||
| 98 | This insertion of the default directory is inhibited if the variable | ||
| 99 | @code{insert-default-directory} is set to @code{nil}. | ||
| 100 | |||
| 101 | Note that it is legitimate to type an absolute file name after you | ||
| 102 | enter the minibuffer, ignoring the presence of the default directory | ||
| 103 | name as part of the text. The final minibuffer contents may look | ||
| 104 | invalid, but that is not so. For example, if the minibuffer starts out | ||
| 105 | with @samp{/usr/tmp/} and you add @samp{/x1/rms/foo}, you get | ||
| 106 | @samp{/usr/tmp//x1/rms/foo}; but Emacs ignores everything through the | ||
| 107 | first slash in the double slash; the result is @samp{/x1/rms/foo}. | ||
| 108 | @xref{Minibuffer File}. | ||
| 109 | |||
| 110 | @cindex home directory shorthand | ||
| 111 | You can use @file{~/} in a file name to mean your home directory, | ||
| 112 | or @file{~@var{user-id}/} to mean the home directory of a user whose | ||
| 113 | login name is @code{user-id}@footnote{ | ||
| 114 | On MS-Windows and MS-DOS systems, where a user doesn't have a home | ||
| 115 | directory, Emacs replaces @file{~/} with the value of the | ||
| 116 | environment variable @code{HOME}; see @ref{General Variables}. On | ||
| 117 | these systems, the @file{~@var{user-id}/} construct is supported only | ||
| 118 | for the current user, i.e., only if @var{user-id} is the current | ||
| 119 | user's login name.}. | ||
| 120 | |||
| 121 | @cindex environment variables in file names | ||
| 122 | @cindex expansion of environment variables | ||
| 123 | @cindex @code{$} in file names | ||
| 124 | @anchor{File Names with $}@samp{$} in a file name is used to | ||
| 125 | substitute an environment variable. The environment variable name | ||
| 126 | consists of all the alphanumeric characters after the @samp{$}; | ||
| 127 | alternatively, it can be enclosed in braces after the @samp{$}. For | ||
| 128 | example, if you have used the shell command @command{export | ||
| 129 | FOO=rms/hacks} to set up an environment variable named @env{FOO}, then | ||
| 130 | you can use @file{/u/$FOO/test.c} or @file{/u/$@{FOO@}/test.c} as an | ||
| 131 | abbreviation for @file{/u/rms/hacks/test.c}. If the environment | ||
| 132 | variable is not defined, no substitution occurs: @file{/u/$notdefined} | ||
| 133 | stands for itself (assuming the environment variable @env{notdefined} | ||
| 134 | is not defined). | ||
| 135 | |||
| 136 | Note that shell commands to set environment variables affect Emacs | ||
| 137 | only when done before Emacs is started. | ||
| 138 | |||
| 139 | To access a file with @samp{$} in its name, if the @samp{$} causes | ||
| 140 | expansion, type @samp{$$}. This pair is converted to a single | ||
| 141 | @samp{$} at the same time as variable substitution is performed for a | ||
| 142 | single @samp{$}. Alternatively, quote the whole file name with | ||
| 143 | @samp{/:} (@pxref{Quoted File Names}). File names which begin with a | ||
| 144 | literal @samp{~} should also be quoted with @samp{/:}. | ||
| 145 | |||
| 146 | @findex substitute-in-file-name | ||
| 147 | The Lisp function that performs the @samp{$}-substitution is called | ||
| 148 | @code{substitute-in-file-name}. The substitution is performed only on | ||
| 149 | file names read as such using the minibuffer. | ||
| 150 | |||
| 151 | You can include non-@acronym{ASCII} characters in file names if you set the | ||
| 152 | variable @code{file-name-coding-system} to a non-@code{nil} value. | ||
| 153 | @xref{File Name Coding}. | ||
| 154 | |||
| 155 | @node Visiting | ||
| 156 | @section Visiting Files | ||
| 157 | @cindex visiting files | ||
| 158 | @cindex open file | ||
| 159 | |||
| 160 | @table @kbd | ||
| 161 | @item C-x C-f | ||
| 162 | Visit a file (@code{find-file}). | ||
| 163 | @item C-x C-r | ||
| 164 | Visit a file for viewing, without allowing changes to it | ||
| 165 | (@code{find-file-read-only}). | ||
| 166 | @item C-x C-v | ||
| 167 | Visit a different file instead of the one visited last | ||
| 168 | (@code{find-alternate-file}). | ||
| 169 | @item C-x 4 f | ||
| 170 | Visit a file, in another window (@code{find-file-other-window}). Don't | ||
| 171 | alter what is displayed in the selected window. | ||
| 172 | @item C-x 5 f | ||
| 173 | Visit a file, in a new frame (@code{find-file-other-frame}). Don't | ||
| 174 | alter what is displayed in the selected frame. | ||
| 175 | @item M-x find-file-literally | ||
| 176 | Visit a file with no conversion of the contents. | ||
| 177 | @end table | ||
| 178 | |||
| 179 | @cindex files, visiting and saving | ||
| 180 | @cindex saving files | ||
| 181 | @dfn{Visiting} a file means reading its contents into an Emacs | ||
| 182 | buffer so you can edit them. Emacs makes a new buffer for each file | ||
| 183 | that you visit. We often say that this buffer ``is visiting'' that | ||
| 184 | file, or that the buffer's ``visited file'' is that file. Emacs | ||
| 185 | constructs the buffer name from the file name by throwing away the | ||
| 186 | directory, keeping just the name proper. For example, a file named | ||
| 187 | @file{/usr/rms/emacs.tex} would get a buffer named @samp{emacs.tex}. | ||
| 188 | If there is already a buffer with that name, Emacs constructs a unique | ||
| 189 | name---the normal method is to append @samp{<2>}, @samp{<3>}, and so | ||
| 190 | on, but you can select other methods (@pxref{Uniquify}). | ||
| 191 | |||
| 192 | Each window's mode line shows the name of the buffer that is being displayed | ||
| 193 | in that window, so you can always tell what buffer you are editing. | ||
| 194 | |||
| 195 | The changes you make with editing commands are made in the Emacs | ||
| 196 | buffer. They do not take effect in the file that you visited, or any | ||
| 197 | permanent place, until you @dfn{save} the buffer. Saving the buffer | ||
| 198 | means that Emacs writes the current contents of the buffer into its | ||
| 199 | visited file. @xref{Saving}. | ||
| 200 | |||
| 201 | @cindex modified (buffer) | ||
| 202 | If a buffer contains changes that have not been saved, we say the | ||
| 203 | buffer is @dfn{modified}. This is important because it implies that | ||
| 204 | some changes will be lost if the buffer is not saved. The mode line | ||
| 205 | displays two stars near the left margin to indicate that the buffer is | ||
| 206 | modified. | ||
| 207 | |||
| 208 | @kindex C-x C-f | ||
| 209 | @findex find-file | ||
| 210 | To visit a file, use the command @kbd{C-x C-f} (@code{find-file}). Follow | ||
| 211 | the command with the name of the file you wish to visit, terminated by a | ||
| 212 | @key{RET}. | ||
| 213 | |||
| 214 | The file name is read using the minibuffer (@pxref{Minibuffer}), with | ||
| 215 | defaulting and completion in the standard manner (@pxref{File Names}). | ||
| 216 | While in the minibuffer, you can abort @kbd{C-x C-f} by typing | ||
| 217 | @kbd{C-g}. File-name completion ignores certain file names; for more | ||
| 218 | about this, see @ref{Completion Options}. | ||
| 219 | |||
| 220 | Your confirmation that @kbd{C-x C-f} has completed successfully is | ||
| 221 | the appearance of new text on the screen and a new buffer name in the | ||
| 222 | mode line. If the specified file does not exist and you could not | ||
| 223 | create it, or exists but you can't read it, then you get an error, | ||
| 224 | with an error message displayed in the echo area. | ||
| 225 | |||
| 226 | If you visit a file that is already in Emacs, @kbd{C-x C-f} does not make | ||
| 227 | another copy. It selects the existing buffer containing that file. | ||
| 228 | However, before doing so, it checks whether the file itself has changed | ||
| 229 | since you visited or saved it last. If the file has changed, Emacs offers | ||
| 230 | to reread it. | ||
| 231 | |||
| 232 | @vindex large-file-warning-threshold | ||
| 233 | @cindex maximum buffer size exceeded, error message | ||
| 234 | If you try to visit a file larger than | ||
| 235 | @code{large-file-warning-threshold} (the default is 10000000, which is | ||
| 236 | about 10 megabytes), Emacs will ask you for confirmation first. You | ||
| 237 | can answer @kbd{y} to proceed with visiting the file. Note, however, | ||
| 238 | that Emacs cannot visit files that are larger than the maximum Emacs | ||
| 239 | buffer size, which is around 256 megabytes on 32-bit machines | ||
| 240 | (@pxref{Buffers}). If you try, Emacs will display an error message | ||
| 241 | saying that the maximum buffer size has been exceeded. | ||
| 242 | |||
| 243 | @cindex file selection dialog | ||
| 244 | On graphical displays there are two additional methods for | ||
| 245 | visiting files. Firstly, when Emacs is built with a suitable GUI | ||
| 246 | toolkit, commands invoked with the mouse (by clicking on the menu bar | ||
| 247 | or tool bar) use the toolkit's standard File Selection dialog instead | ||
| 248 | of prompting for the file name in the minibuffer. On Unix and | ||
| 249 | GNU/Linux platforms, Emacs does that when built with GTK, LessTif, and | ||
| 250 | Motif toolkits; on MS-Windows and Mac, the GUI version does that by default. | ||
| 251 | For information on how to customize this, see @ref{Dialog Boxes}. | ||
| 252 | |||
| 253 | Secondly, Emacs supports ``drag and drop''; dropping a file into an | ||
| 254 | ordinary Emacs window visits the file using that window. However, | ||
| 255 | dropping a file into a window displaying a Dired buffer moves or | ||
| 256 | copies the file into the displayed directory. For details, see | ||
| 257 | @ref{Drag and Drop}, and @ref{Misc Dired Features}. | ||
| 258 | |||
| 259 | @cindex creating files | ||
| 260 | What if you want to create a new file? Just visit it. Emacs displays | ||
| 261 | @samp{(New file)} in the echo area, but in other respects behaves as if | ||
| 262 | you had visited an existing empty file. If you make any changes and | ||
| 263 | save them, the file is created. | ||
| 264 | |||
| 265 | Emacs recognizes from the contents of a file which end-of-line | ||
| 266 | convention it uses to separate lines---newline (used on GNU/Linux and | ||
| 267 | on Unix), carriage-return linefeed (used on Microsoft systems), or | ||
| 268 | just carriage-return (used on the Macintosh)---and automatically | ||
| 269 | converts the contents to the normal Emacs convention, which is that | ||
| 270 | the newline character separates lines. This is a part of the general | ||
| 271 | feature of coding system conversion (@pxref{Coding Systems}), and | ||
| 272 | makes it possible to edit files imported from different operating | ||
| 273 | systems with equal convenience. If you change the text and save the | ||
| 274 | file, Emacs performs the inverse conversion, changing newlines back | ||
| 275 | into carriage-return linefeed or just carriage-return if appropriate. | ||
| 276 | |||
| 277 | @vindex find-file-run-dired | ||
| 278 | If the file you specify is actually a directory, @kbd{C-x C-f} invokes | ||
| 279 | Dired, the Emacs directory browser, so that you can ``edit'' the contents | ||
| 280 | of the directory (@pxref{Dired}). Dired is a convenient way to view, delete, | ||
| 281 | or operate on the files in the directory. However, if the variable | ||
| 282 | @code{find-file-run-dired} is @code{nil}, then it is an error to try | ||
| 283 | to visit a directory. | ||
| 284 | |||
| 285 | Files which are actually collections of other files, or @dfn{file | ||
| 286 | archives}, are visited in special modes which invoke a Dired-like | ||
| 287 | environment to allow operations on archive members. @xref{File | ||
| 288 | Archives}, for more about these features. | ||
| 289 | |||
| 290 | @cindex wildcard characters in file names | ||
| 291 | @vindex find-file-wildcards | ||
| 292 | If the file name you specify contains shell-style wildcard | ||
| 293 | characters, Emacs visits all the files that match it. (On | ||
| 294 | case-insensitive filesystems, Emacs matches the wildcards disregarding | ||
| 295 | the letter case.) Wildcards include @samp{?}, @samp{*}, and | ||
| 296 | @samp{[@dots{}]} sequences. To enter the wild card @samp{?} in a file | ||
| 297 | name in the minibuffer, you need to type @kbd{C-q ?}. @xref{Quoted | ||
| 298 | File Names}, for information on how to visit a file whose name | ||
| 299 | actually contains wildcard characters. You can disable the wildcard | ||
| 300 | feature by customizing @code{find-file-wildcards}. | ||
| 301 | |||
| 302 | If you visit a file that the operating system won't let you modify, | ||
| 303 | or that is marked read-only, Emacs makes the buffer read-only too, so | ||
| 304 | that you won't go ahead and make changes that you'll have trouble | ||
| 305 | saving afterward. You can make the buffer writable with @kbd{C-x C-q} | ||
| 306 | (@code{toggle-read-only}). @xref{Misc Buffer}. | ||
| 307 | |||
| 308 | @kindex C-x C-r | ||
| 309 | @findex find-file-read-only | ||
| 310 | If you want to visit a file as read-only in order to protect | ||
| 311 | yourself from entering changes accidentally, visit it with the command | ||
| 312 | @kbd{C-x C-r} (@code{find-file-read-only}) instead of @kbd{C-x C-f}. | ||
| 313 | |||
| 314 | @kindex C-x C-v | ||
| 315 | @findex find-alternate-file | ||
| 316 | If you visit a nonexistent file unintentionally (because you typed the | ||
| 317 | wrong file name), use the @kbd{C-x C-v} command | ||
| 318 | (@code{find-alternate-file}) to visit the file you really wanted. | ||
| 319 | @kbd{C-x C-v} is similar to @kbd{C-x C-f}, but it kills the current | ||
| 320 | buffer (after first offering to save it if it is modified). When | ||
| 321 | @kbd{C-x C-v} reads the file name to visit, it inserts the entire | ||
| 322 | default file name in the buffer, with point just after the directory | ||
| 323 | part; this is convenient if you made a slight error in typing the name. | ||
| 324 | |||
| 325 | @kindex C-x 4 f | ||
| 326 | @findex find-file-other-window | ||
| 327 | @kbd{C-x 4 f} (@code{find-file-other-window}) is like @kbd{C-x C-f} | ||
| 328 | except that the buffer containing the specified file is selected in another | ||
| 329 | window. The window that was selected before @kbd{C-x 4 f} continues to | ||
| 330 | show the same buffer it was already showing. If this command is used when | ||
| 331 | only one window is being displayed, that window is split in two, with one | ||
| 332 | window showing the same buffer as before, and the other one showing the | ||
| 333 | newly requested file. @xref{Windows}. | ||
| 334 | |||
| 335 | @kindex C-x 5 f | ||
| 336 | @findex find-file-other-frame | ||
| 337 | @kbd{C-x 5 f} (@code{find-file-other-frame}) is similar, but opens a | ||
| 338 | new frame, or makes visible any existing frame showing the file you | ||
| 339 | seek. This feature is available only when you are using a window | ||
| 340 | system. @xref{Frames}. | ||
| 341 | |||
| 342 | @findex find-file-literally | ||
| 343 | If you wish to edit a file as a sequence of @acronym{ASCII} characters with no special | ||
| 344 | encoding or conversion, use the @kbd{M-x find-file-literally} command. | ||
| 345 | It visits a file, like @kbd{C-x C-f}, but does not do format conversion | ||
| 346 | (@pxref{Formatted Text}), character code conversion (@pxref{Coding | ||
| 347 | Systems}), or automatic uncompression (@pxref{Compressed Files}), and | ||
| 348 | does not add a final newline because of @code{require-final-newline}. | ||
| 349 | If you already have visited the same file in the usual (non-literal) | ||
| 350 | manner, this command asks you whether to visit it literally instead. | ||
| 351 | |||
| 352 | @vindex find-file-hook | ||
| 353 | @vindex find-file-not-found-functions | ||
| 354 | Two special hook variables allow extensions to modify the operation of | ||
| 355 | visiting files. Visiting a file that does not exist runs the functions | ||
| 356 | in the list @code{find-file-not-found-functions}; this variable holds a list | ||
| 357 | of functions, and the functions are called one by one (with no | ||
| 358 | arguments) until one of them returns non-@code{nil}. This is not a | ||
| 359 | normal hook, and the name ends in @samp{-functions} rather than @samp{-hook} | ||
| 360 | to indicate that fact. | ||
| 361 | |||
| 362 | Successful visiting of any file, whether existing or not, calls the | ||
| 363 | functions in the list @code{find-file-hook}, with no arguments. | ||
| 364 | This variable is a normal hook. In the case of a nonexistent file, the | ||
| 365 | @code{find-file-not-found-functions} are run first. @xref{Hooks}. | ||
| 366 | |||
| 367 | There are several ways to specify automatically the major mode for | ||
| 368 | editing the file (@pxref{Choosing Modes}), and to specify local | ||
| 369 | variables defined for that file (@pxref{File Variables}). | ||
| 370 | |||
| 371 | @node Saving | ||
| 372 | @section Saving Files | ||
| 373 | |||
| 374 | @dfn{Saving} a buffer in Emacs means writing its contents back into the file | ||
| 375 | that was visited in the buffer. | ||
| 376 | |||
| 377 | @menu | ||
| 378 | * Save Commands:: Commands for saving files. | ||
| 379 | * Backup:: How Emacs saves the old version of your file. | ||
| 380 | * Customize Save:: Customizing the saving of files. | ||
| 381 | * Interlocking:: How Emacs protects against simultaneous editing | ||
| 382 | of one file by two users. | ||
| 383 | * Shadowing: File Shadowing. Copying files to "shadows" automatically. | ||
| 384 | * Time Stamps:: Emacs can update time stamps on saved files. | ||
| 385 | @end menu | ||
| 386 | |||
| 387 | @node Save Commands | ||
| 388 | @subsection Commands for Saving Files | ||
| 389 | |||
| 390 | These are the commands that relate to saving and writing files. | ||
| 391 | |||
| 392 | @table @kbd | ||
| 393 | @item C-x C-s | ||
| 394 | Save the current buffer in its visited file on disk (@code{save-buffer}). | ||
| 395 | @item C-x s | ||
| 396 | Save any or all buffers in their visited files (@code{save-some-buffers}). | ||
| 397 | @item M-~ | ||
| 398 | Forget that the current buffer has been changed (@code{not-modified}). | ||
| 399 | With prefix argument (@kbd{C-u}), mark the current buffer as changed. | ||
| 400 | @item C-x C-w | ||
| 401 | Save the current buffer with a specified file name (@code{write-file}). | ||
| 402 | @item M-x set-visited-file-name | ||
| 403 | Change the file name under which the current buffer will be saved. | ||
| 404 | @end table | ||
| 405 | |||
| 406 | @kindex C-x C-s | ||
| 407 | @findex save-buffer | ||
| 408 | When you wish to save the file and make your changes permanent, type | ||
| 409 | @kbd{C-x C-s} (@code{save-buffer}). After saving is finished, @kbd{C-x C-s} | ||
| 410 | displays a message like this: | ||
| 411 | |||
| 412 | @example | ||
| 413 | Wrote /u/rms/gnu/gnu.tasks | ||
| 414 | @end example | ||
| 415 | |||
| 416 | @noindent | ||
| 417 | If the selected buffer is not modified (no changes have been made in it | ||
| 418 | since the buffer was created or last saved), saving is not really done, | ||
| 419 | because it would have no effect. Instead, @kbd{C-x C-s} displays a message | ||
| 420 | like this in the echo area: | ||
| 421 | |||
| 422 | @example | ||
| 423 | (No changes need to be saved) | ||
| 424 | @end example | ||
| 425 | |||
| 426 | @kindex C-x s | ||
| 427 | @findex save-some-buffers | ||
| 428 | The command @kbd{C-x s} (@code{save-some-buffers}) offers to save any | ||
| 429 | or all modified buffers. It asks you what to do with each buffer. The | ||
| 430 | possible responses are analogous to those of @code{query-replace}: | ||
| 431 | |||
| 432 | @table @kbd | ||
| 433 | @item y | ||
| 434 | Save this buffer and ask about the rest of the buffers. | ||
| 435 | @item n | ||
| 436 | Don't save this buffer, but ask about the rest of the buffers. | ||
| 437 | @item ! | ||
| 438 | Save this buffer and all the rest with no more questions. | ||
| 439 | @c following generates acceptable underfull hbox | ||
| 440 | @item @key{RET} | ||
| 441 | Terminate @code{save-some-buffers} without any more saving. | ||
| 442 | @item . | ||
| 443 | Save this buffer, then exit @code{save-some-buffers} without even asking | ||
| 444 | about other buffers. | ||
| 445 | @item C-r | ||
| 446 | View the buffer that you are currently being asked about. When you exit | ||
| 447 | View mode, you get back to @code{save-some-buffers}, which asks the | ||
| 448 | question again. | ||
| 449 | @item d | ||
| 450 | Diff the buffer against its corresponding file, so you can see | ||
| 451 | what changes you would be saving. | ||
| 452 | @item C-h | ||
| 453 | Display a help message about these options. | ||
| 454 | @end table | ||
| 455 | |||
| 456 | @kbd{C-x C-c}, the key sequence to exit Emacs, invokes | ||
| 457 | @code{save-some-buffers} and therefore asks the same questions. | ||
| 458 | |||
| 459 | @kindex M-~ | ||
| 460 | @findex not-modified | ||
| 461 | If you have changed a buffer but you do not want to save the changes, | ||
| 462 | you should take some action to prevent it. Otherwise, each time you use | ||
| 463 | @kbd{C-x s} or @kbd{C-x C-c}, you are liable to save this buffer by | ||
| 464 | mistake. One thing you can do is type @kbd{M-~} (@code{not-modified}), | ||
| 465 | which clears out the indication that the buffer is modified. If you do | ||
| 466 | this, none of the save commands will believe that the buffer needs to be | ||
| 467 | saved. (@samp{~} is often used as a mathematical symbol for `not'; thus | ||
| 468 | @kbd{M-~} is `not', metafied.) You could also use | ||
| 469 | @code{set-visited-file-name} (see below) to mark the buffer as visiting | ||
| 470 | a different file name, one which is not in use for anything important. | ||
| 471 | Alternatively, you can cancel all the changes made since the file was | ||
| 472 | visited or saved, by reading the text from the file again. This is | ||
| 473 | called @dfn{reverting}. @xref{Reverting}. (You could also undo all the | ||
| 474 | changes by repeating the undo command @kbd{C-x u} until you have undone | ||
| 475 | all the changes; but reverting is easier.) You can also kill the buffer. | ||
| 476 | |||
| 477 | @findex set-visited-file-name | ||
| 478 | @kbd{M-x set-visited-file-name} alters the name of the file that the | ||
| 479 | current buffer is visiting. It reads the new file name using the | ||
| 480 | minibuffer. Then it marks the buffer as visiting that file name, and | ||
| 481 | changes the buffer name correspondingly. @code{set-visited-file-name} | ||
| 482 | does not save the buffer in the newly visited file; it just alters the | ||
| 483 | records inside Emacs in case you do save later. It also marks the | ||
| 484 | buffer as ``modified'' so that @kbd{C-x C-s} in that buffer | ||
| 485 | @emph{will} save. | ||
| 486 | |||
| 487 | @kindex C-x C-w | ||
| 488 | @findex write-file | ||
| 489 | If you wish to mark the buffer as visiting a different file and save it | ||
| 490 | right away, use @kbd{C-x C-w} (@code{write-file}). It is | ||
| 491 | equivalent to @code{set-visited-file-name} followed by @kbd{C-x C-s} | ||
| 492 | (except that @kbd{C-x C-w} asks for confirmation if the file exists). | ||
| 493 | @kbd{C-x C-s} used on a buffer that is not visiting a file has the | ||
| 494 | same effect as @kbd{C-x C-w}; that is, it reads a file name, marks the | ||
| 495 | buffer as visiting that file, and saves it there. The default file name in | ||
| 496 | a buffer that is not visiting a file is made by combining the buffer name | ||
| 497 | with the buffer's default directory (@pxref{File Names}). | ||
| 498 | |||
| 499 | If the new file name implies a major mode, then @kbd{C-x C-w} switches | ||
| 500 | to that major mode, in most cases. The command | ||
| 501 | @code{set-visited-file-name} also does this. @xref{Choosing Modes}. | ||
| 502 | |||
| 503 | If Emacs is about to save a file and sees that the date of the latest | ||
| 504 | version on disk does not match what Emacs last read or wrote, Emacs | ||
| 505 | notifies you of this fact, because it probably indicates a problem caused | ||
| 506 | by simultaneous editing and requires your immediate attention. | ||
| 507 | @xref{Interlocking,, Simultaneous Editing}. | ||
| 508 | |||
| 509 | @node Backup | ||
| 510 | @subsection Backup Files | ||
| 511 | @cindex backup file | ||
| 512 | @vindex make-backup-files | ||
| 513 | @vindex vc-make-backup-files | ||
| 514 | |||
| 515 | On most operating systems, rewriting a file automatically destroys all | ||
| 516 | record of what the file used to contain. Thus, saving a file from Emacs | ||
| 517 | throws away the old contents of the file---or it would, except that | ||
| 518 | Emacs carefully copies the old contents to another file, called the | ||
| 519 | @dfn{backup} file, before actually saving. | ||
| 520 | |||
| 521 | For most files, the variable @code{make-backup-files} determines | ||
| 522 | whether to make backup files. On most operating systems, its default | ||
| 523 | value is @code{t}, so that Emacs does write backup files. | ||
| 524 | |||
| 525 | For files managed by a version control system (@pxref{Version | ||
| 526 | Control}), the variable @code{vc-make-backup-files} determines whether | ||
| 527 | to make backup files. By default it is @code{nil}, since backup files | ||
| 528 | are redundant when you store all the previous versions in a version | ||
| 529 | control system. | ||
| 530 | @iftex | ||
| 531 | @xref{General VC Options,,,emacs-xtra, Specialized Emacs Features}. | ||
| 532 | @end iftex | ||
| 533 | @ifnottex | ||
| 534 | @xref{General VC Options}. | ||
| 535 | @end ifnottex | ||
| 536 | |||
| 537 | |||
| 538 | At your option, Emacs can keep either a single backup for each file, | ||
| 539 | or make a series of numbered backup files for each file that you edit. | ||
| 540 | |||
| 541 | @vindex backup-enable-predicate | ||
| 542 | @vindex temporary-file-directory | ||
| 543 | @vindex small-temporary-file-directory | ||
| 544 | The default value of the @code{backup-enable-predicate} variable | ||
| 545 | prevents backup files being written for files in the directories used | ||
| 546 | for temporary files, specified by @code{temporary-file-directory} or | ||
| 547 | @code{small-temporary-file-directory}. | ||
| 548 | |||
| 549 | Emacs makes a backup for a file only the first time the file is saved | ||
| 550 | from one buffer. No matter how many times you save a file, its backup file | ||
| 551 | continues to contain the contents from before the file was visited. | ||
| 552 | Normally this means that the backup file contains the contents from before | ||
| 553 | the current editing session; however, if you kill the buffer and then visit | ||
| 554 | the file again, a new backup file will be made by the next save. | ||
| 555 | |||
| 556 | You can also explicitly request making another backup file from a | ||
| 557 | buffer even though it has already been saved at least once. If you save | ||
| 558 | the buffer with @kbd{C-u C-x C-s}, the version thus saved will be made | ||
| 559 | into a backup file if you save the buffer again. @kbd{C-u C-u C-x C-s} | ||
| 560 | saves the buffer, but first makes the previous file contents into a new | ||
| 561 | backup file. @kbd{C-u C-u C-u C-x C-s} does both things: it makes a | ||
| 562 | backup from the previous contents, and arranges to make another from the | ||
| 563 | newly saved contents if you save again. | ||
| 564 | |||
| 565 | @menu | ||
| 566 | * One or Many: Numbered Backups. Whether to make one backup file or many. | ||
| 567 | * Names: Backup Names. How backup files are named. | ||
| 568 | * Deletion: Backup Deletion. Emacs deletes excess numbered backups. | ||
| 569 | * Copying: Backup Copying. Backups can be made by copying or renaming. | ||
| 570 | @end menu | ||
| 571 | |||
| 572 | @node Numbered Backups | ||
| 573 | @subsubsection Numbered Backups | ||
| 574 | |||
| 575 | @vindex version-control | ||
| 576 | The choice of single backup file or multiple numbered backup files | ||
| 577 | is controlled by the variable @code{version-control}. Its possible | ||
| 578 | values are: | ||
| 579 | |||
| 580 | @table @code | ||
| 581 | @item t | ||
| 582 | Make numbered backups. | ||
| 583 | @item nil | ||
| 584 | Make numbered backups for files that have numbered backups already. | ||
| 585 | Otherwise, make single backups. | ||
| 586 | @item never | ||
| 587 | Never make numbered backups; always make single backups. | ||
| 588 | @end table | ||
| 589 | |||
| 590 | @noindent | ||
| 591 | The usual way to set this variable is globally, through your | ||
| 592 | @file{.emacs} file or the customization buffer. However, you can set | ||
| 593 | @code{version-control} locally in an individual buffer to control the | ||
| 594 | making of backups for that buffer's file. For example, Rmail mode | ||
| 595 | locally sets @code{version-control} to @code{never} to make sure that | ||
| 596 | there is only one backup for an Rmail file. @xref{Locals}. | ||
| 597 | |||
| 598 | @cindex @env{VERSION_CONTROL} environment variable | ||
| 599 | If you set the environment variable @env{VERSION_CONTROL}, to tell | ||
| 600 | various GNU utilities what to do with backup files, Emacs also obeys the | ||
| 601 | environment variable by setting the Lisp variable @code{version-control} | ||
| 602 | accordingly at startup. If the environment variable's value is @samp{t} | ||
| 603 | or @samp{numbered}, then @code{version-control} becomes @code{t}; if the | ||
| 604 | value is @samp{nil} or @samp{existing}, then @code{version-control} | ||
| 605 | becomes @code{nil}; if it is @samp{never} or @samp{simple}, then | ||
| 606 | @code{version-control} becomes @code{never}. | ||
| 607 | |||
| 608 | @node Backup Names | ||
| 609 | @subsubsection Single or Numbered Backups | ||
| 610 | |||
| 611 | When Emacs makes a single backup file, its name is normally | ||
| 612 | constructed by appending @samp{~} to the file name being edited; thus, | ||
| 613 | the backup file for @file{eval.c} would be @file{eval.c~}. | ||
| 614 | |||
| 615 | @vindex make-backup-file-name-function | ||
| 616 | @vindex backup-directory-alist | ||
| 617 | You can change this behavior by defining the variable | ||
| 618 | @code{make-backup-file-name-function} to a suitable function. | ||
| 619 | Alternatively you can customize the variable | ||
| 620 | @code{backup-directory-alist} to specify that files matching certain | ||
| 621 | patterns should be backed up in specific directories. | ||
| 622 | |||
| 623 | A typical use is to add an element @code{("." . @var{dir})} to make | ||
| 624 | all backups in the directory with absolute name @var{dir}; Emacs | ||
| 625 | modifies the backup file names to avoid clashes between files with the | ||
| 626 | same names originating in different directories. Alternatively, | ||
| 627 | adding, say, @code{("." . ".~")} would make backups in the invisible | ||
| 628 | subdirectory @file{.~} of the original file's directory. Emacs | ||
| 629 | creates the directory, if necessary, to make the backup. | ||
| 630 | |||
| 631 | If access control stops Emacs from writing backup files under the usual | ||
| 632 | names, it writes the backup file as @file{%backup%~} in your home | ||
| 633 | directory. Only one such file can exist, so only the most recently | ||
| 634 | made such backup is available. | ||
| 635 | |||
| 636 | If you choose to have a series of numbered backup files, backup file | ||
| 637 | names contain @samp{.~}, the number, and another @samp{~} after the | ||
| 638 | original file name. Thus, the backup files of @file{eval.c} would be | ||
| 639 | called @file{eval.c.~1~}, @file{eval.c.~2~}, and so on, all the way | ||
| 640 | through names like @file{eval.c.~259~} and beyond. The variable | ||
| 641 | @code{backup-directory-alist} applies to numbered backups just as | ||
| 642 | usual. | ||
| 643 | |||
| 644 | @node Backup Deletion | ||
| 645 | @subsubsection Automatic Deletion of Backups | ||
| 646 | |||
| 647 | To prevent excessive consumption of disk space, Emacs can delete numbered | ||
| 648 | backup versions automatically. Generally Emacs keeps the first few backups | ||
| 649 | and the latest few backups, deleting any in between. This happens every | ||
| 650 | time a new backup is made. | ||
| 651 | |||
| 652 | @vindex kept-old-versions | ||
| 653 | @vindex kept-new-versions | ||
| 654 | The two variables @code{kept-old-versions} and | ||
| 655 | @code{kept-new-versions} control this deletion. Their values are, | ||
| 656 | respectively, the number of oldest (lowest-numbered) backups to keep | ||
| 657 | and the number of newest (highest-numbered) ones to keep, each time a | ||
| 658 | new backup is made. The backups in the middle (excluding those oldest | ||
| 659 | and newest) are the excess middle versions---those backups are | ||
| 660 | deleted. These variables' values are used when it is time to delete | ||
| 661 | excess versions, just after a new backup version is made; the newly | ||
| 662 | made backup is included in the count in @code{kept-new-versions}. By | ||
| 663 | default, both variables are 2. | ||
| 664 | |||
| 665 | @vindex delete-old-versions | ||
| 666 | If @code{delete-old-versions} is @code{t}, Emacs deletes the excess | ||
| 667 | backup files silently. If it is @code{nil}, the default, Emacs asks | ||
| 668 | you whether it should delete the excess backup versions. If it has | ||
| 669 | any other value, then Emacs never automatically deletes backups. | ||
| 670 | |||
| 671 | Dired's @kbd{.} (Period) command can also be used to delete old versions. | ||
| 672 | @xref{Dired Deletion}. | ||
| 673 | |||
| 674 | @node Backup Copying | ||
| 675 | @subsubsection Copying vs.@: Renaming | ||
| 676 | |||
| 677 | Backup files can be made by copying the old file or by renaming it. | ||
| 678 | This makes a difference when the old file has multiple names (hard | ||
| 679 | links). If the old file is renamed into the backup file, then the | ||
| 680 | alternate names become names for the backup file. If the old file is | ||
| 681 | copied instead, then the alternate names remain names for the file | ||
| 682 | that you are editing, and the contents accessed by those names will be | ||
| 683 | the new contents. | ||
| 684 | |||
| 685 | The method of making a backup file may also affect the file's owner | ||
| 686 | and group. If copying is used, these do not change. If renaming is used, | ||
| 687 | you become the file's owner, and the file's group becomes the default | ||
| 688 | (different operating systems have different defaults for the group). | ||
| 689 | |||
| 690 | Having the owner change is usually a good idea, because then the owner | ||
| 691 | always shows who last edited the file. Also, the owners of the backups | ||
| 692 | show who produced those versions. Occasionally there is a file whose | ||
| 693 | owner should not change; it is a good idea for such files to contain | ||
| 694 | local variable lists to set @code{backup-by-copying-when-mismatch} | ||
| 695 | locally (@pxref{File Variables}). | ||
| 696 | |||
| 697 | @vindex backup-by-copying | ||
| 698 | @vindex backup-by-copying-when-linked | ||
| 699 | @vindex backup-by-copying-when-mismatch | ||
| 700 | @vindex backup-by-copying-when-privileged-mismatch | ||
| 701 | @cindex file ownership, and backup | ||
| 702 | @cindex backup, and user-id | ||
| 703 | The choice of renaming or copying is controlled by four variables. | ||
| 704 | Renaming is the default choice. If the variable | ||
| 705 | @code{backup-by-copying} is non-@code{nil}, copying is used. Otherwise, | ||
| 706 | if the variable @code{backup-by-copying-when-linked} is non-@code{nil}, | ||
| 707 | then copying is used for files that have multiple names, but renaming | ||
| 708 | may still be used when the file being edited has only one name. If the | ||
| 709 | variable @code{backup-by-copying-when-mismatch} is non-@code{nil}, then | ||
| 710 | copying is used if renaming would cause the file's owner or group to | ||
| 711 | change. @code{backup-by-copying-when-mismatch} is @code{t} by default | ||
| 712 | if you start Emacs as the superuser. The fourth variable, | ||
| 713 | @code{backup-by-copying-when-privileged-mismatch}, gives the highest | ||
| 714 | numeric user-id for which @code{backup-by-copying-when-mismatch} will be | ||
| 715 | forced on. This is useful when low-numbered user-ids are assigned to | ||
| 716 | special system users, such as @code{root}, @code{bin}, @code{daemon}, | ||
| 717 | etc., which must maintain ownership of files. | ||
| 718 | |||
| 719 | When a file is managed with a version control system (@pxref{Version | ||
| 720 | Control}), Emacs does not normally make backups in the usual way for | ||
| 721 | that file. But check-in and check-out are similar in some ways to | ||
| 722 | making backups. One unfortunate similarity is that these operations | ||
| 723 | typically break hard links, disconnecting the file name you visited from | ||
| 724 | any alternate names for the same file. This has nothing to do with | ||
| 725 | Emacs---the version control system does it. | ||
| 726 | |||
| 727 | @node Customize Save | ||
| 728 | @subsection Customizing Saving of Files | ||
| 729 | |||
| 730 | @vindex require-final-newline | ||
| 731 | If the value of the variable @code{require-final-newline} is | ||
| 732 | @code{t}, saving or writing a file silently puts a newline at the end | ||
| 733 | if there isn't already one there. If the value is @code{visit}, Emacs | ||
| 734 | adds a newline at the end of any file that doesn't have one, just | ||
| 735 | after it visits the file. (This marks the buffer as modified, and you | ||
| 736 | can undo it.) If the value is @code{visit-save}, that means to add | ||
| 737 | newlines both on visiting and on saving. If the value is @code{nil}, | ||
| 738 | Emacs leaves the end of the file unchanged; if it's neither @code{nil} | ||
| 739 | nor @code{t}, Emacs asks you whether to add a newline. The default is | ||
| 740 | @code{nil}. | ||
| 741 | |||
| 742 | @vindex mode-require-final-newline | ||
| 743 | Many major modes are designed for specific kinds of files that are | ||
| 744 | always supposed to end in newlines. These major modes set the | ||
| 745 | variable @code{require-final-newline} according to | ||
| 746 | @code{mode-require-final-newline}. By setting the latter variable, | ||
| 747 | you can control how these modes handle final newlines. | ||
| 748 | |||
| 749 | @vindex write-region-inhibit-fsync | ||
| 750 | When Emacs saves a file, it invokes the @code{fsync} system call to | ||
| 751 | force the data immediately out to disk. This is important for safety | ||
| 752 | if the system crashes or in case of power outage. However, it can be | ||
| 753 | disruptive on laptops using power saving, because it requires the disk | ||
| 754 | to spin up each time you save a file. Setting | ||
| 755 | @code{write-region-inhibit-fsync} to a non-@code{nil} value disables | ||
| 756 | this synchronization. Be careful---this means increased risk of data | ||
| 757 | loss. | ||
| 758 | |||
| 759 | @node Interlocking | ||
| 760 | @subsection Protection against Simultaneous Editing | ||
| 761 | |||
| 762 | @cindex file dates | ||
| 763 | @cindex simultaneous editing | ||
| 764 | Simultaneous editing occurs when two users visit the same file, both | ||
| 765 | make changes, and then both save them. If nobody were informed that | ||
| 766 | this was happening, whichever user saved first would later find that his | ||
| 767 | changes were lost. | ||
| 768 | |||
| 769 | On some systems, Emacs notices immediately when the second user starts | ||
| 770 | to change the file, and issues an immediate warning. On all systems, | ||
| 771 | Emacs checks when you save the file, and warns if you are about to | ||
| 772 | overwrite another user's changes. You can prevent loss of the other | ||
| 773 | user's work by taking the proper corrective action instead of saving the | ||
| 774 | file. | ||
| 775 | |||
| 776 | @findex ask-user-about-lock | ||
| 777 | @cindex locking files | ||
| 778 | When you make the first modification in an Emacs buffer that is | ||
| 779 | visiting a file, Emacs records that the file is @dfn{locked} by you. | ||
| 780 | (It does this by creating a symbolic link in the same directory with a | ||
| 781 | different name.) Emacs removes the lock when you save the changes. The | ||
| 782 | idea is that the file is locked whenever an Emacs buffer visiting it has | ||
| 783 | unsaved changes. | ||
| 784 | |||
| 785 | @cindex collision | ||
| 786 | If you begin to modify the buffer while the visited file is locked by | ||
| 787 | someone else, this constitutes a @dfn{collision}. When Emacs detects a | ||
| 788 | collision, it asks you what to do, by calling the Lisp function | ||
| 789 | @code{ask-user-about-lock}. You can redefine this function for the sake | ||
| 790 | of customization. The standard definition of this function asks you a | ||
| 791 | question and accepts three possible answers: | ||
| 792 | |||
| 793 | @table @kbd | ||
| 794 | @item s | ||
| 795 | Steal the lock. Whoever was already changing the file loses the lock, | ||
| 796 | and you gain the lock. | ||
| 797 | @item p | ||
| 798 | Proceed. Go ahead and edit the file despite its being locked by someone else. | ||
| 799 | @item q | ||
| 800 | Quit. This causes an error (@code{file-locked}), and the buffer | ||
| 801 | contents remain unchanged---the modification you were trying to make | ||
| 802 | does not actually take place. | ||
| 803 | @end table | ||
| 804 | |||
| 805 | Note that locking works on the basis of a file name; if a file has | ||
| 806 | multiple names, Emacs does not realize that the two names are the same file | ||
| 807 | and cannot prevent two users from editing it simultaneously under different | ||
| 808 | names. However, basing locking on names means that Emacs can interlock the | ||
| 809 | editing of new files that will not really exist until they are saved. | ||
| 810 | |||
| 811 | Some systems are not configured to allow Emacs to make locks, and | ||
| 812 | there are cases where lock files cannot be written. In these cases, | ||
| 813 | Emacs cannot detect trouble in advance, but it still can detect the | ||
| 814 | collision when you try to save a file and overwrite someone else's | ||
| 815 | changes. | ||
| 816 | |||
| 817 | If Emacs or the operating system crashes, this may leave behind lock | ||
| 818 | files which are stale, so you may occasionally get warnings about | ||
| 819 | spurious collisions. When you determine that the collision is spurious, | ||
| 820 | just use @kbd{p} to tell Emacs to go ahead anyway. | ||
| 821 | |||
| 822 | Every time Emacs saves a buffer, it first checks the last-modification | ||
| 823 | date of the existing file on disk to verify that it has not changed since the | ||
| 824 | file was last visited or saved. If the date does not match, it implies | ||
| 825 | that changes were made in the file in some other way, and these changes are | ||
| 826 | about to be lost if Emacs actually does save. To prevent this, Emacs | ||
| 827 | displays a warning message and asks for confirmation before saving. | ||
| 828 | Occasionally you will know why the file was changed and know that it does | ||
| 829 | not matter; then you can answer @kbd{yes} and proceed. Otherwise, you should | ||
| 830 | cancel the save with @kbd{C-g} and investigate the situation. | ||
| 831 | |||
| 832 | The first thing you should do when notified that simultaneous editing | ||
| 833 | has already taken place is to list the directory with @kbd{C-u C-x C-d} | ||
| 834 | (@pxref{Directories}). This shows the file's current author. You | ||
| 835 | should attempt to contact him to warn him not to continue editing. | ||
| 836 | Often the next step is to save the contents of your Emacs buffer under a | ||
| 837 | different name, and use @code{diff} to compare the two files.@refill | ||
| 838 | |||
| 839 | @node File Shadowing | ||
| 840 | @subsection Shadowing Files | ||
| 841 | @cindex shadow files | ||
| 842 | @cindex file shadows | ||
| 843 | @findex shadow-initialize | ||
| 844 | |||
| 845 | @table @kbd | ||
| 846 | @item M-x shadow-initialize | ||
| 847 | Set up file shadowing. | ||
| 848 | @item M-x shadow-define-literal-group | ||
| 849 | Declare a single file to be shared between sites. | ||
| 850 | @item M-x shadow-define-regexp-group | ||
| 851 | Make all files that match each of a group of files be shared between hosts. | ||
| 852 | @item M-x shadow-define-cluster @key{RET} @var{name} @key{RET} | ||
| 853 | Define a shadow file cluster @var{name}. | ||
| 854 | @item M-x shadow-copy-files | ||
| 855 | Copy all pending shadow files. | ||
| 856 | @item M-x shadow-cancel | ||
| 857 | Cancel the instruction to shadow some files. | ||
| 858 | @end table | ||
| 859 | |||
| 860 | You can arrange to keep identical @dfn{shadow} copies of certain files | ||
| 861 | in more than one place---possibly on different machines. To do this, | ||
| 862 | first you must set up a @dfn{shadow file group}, which is a set of | ||
| 863 | identically-named files shared between a list of sites. The file | ||
| 864 | group is permanent and applies to further Emacs sessions as well as | ||
| 865 | the current one. Once the group is set up, every time you exit Emacs, | ||
| 866 | it will copy the file you edited to the other files in its group. You | ||
| 867 | can also do the copying without exiting Emacs, by typing @kbd{M-x | ||
| 868 | shadow-copy-files}. | ||
| 869 | |||
| 870 | To set up a shadow file group, use @kbd{M-x | ||
| 871 | shadow-define-literal-group} or @kbd{M-x shadow-define-regexp-group}. | ||
| 872 | See their documentation strings for further information. | ||
| 873 | |||
| 874 | Before copying a file to its shadows, Emacs asks for confirmation. | ||
| 875 | You can answer ``no'' to bypass copying of this file, this time. If | ||
| 876 | you want to cancel the shadowing permanently for a certain file, use | ||
| 877 | @kbd{M-x shadow-cancel} to eliminate or change the shadow file group. | ||
| 878 | |||
| 879 | A @dfn{shadow cluster} is a group of hosts that share directories, so | ||
| 880 | that copying to or from one of them is sufficient to update the file | ||
| 881 | on all of them. Each shadow cluster has a name, and specifies the | ||
| 882 | network address of a primary host (the one we copy files to), and a | ||
| 883 | regular expression that matches the host names of all the other hosts | ||
| 884 | in the cluster. You can define a shadow cluster with @kbd{M-x | ||
| 885 | shadow-define-cluster}. | ||
| 886 | |||
| 887 | @node Time Stamps | ||
| 888 | @subsection Updating Time Stamps Automatically | ||
| 889 | @cindex time stamps | ||
| 890 | @cindex modification dates | ||
| 891 | @cindex locale, date format | ||
| 892 | |||
| 893 | You can arrange to put a time stamp in a file, so that it will be updated | ||
| 894 | automatically each time you edit and save the file. The time stamp | ||
| 895 | has to be in the first eight lines of the file, and you should | ||
| 896 | insert it like this: | ||
| 897 | |||
| 898 | @example | ||
| 899 | Time-stamp: <> | ||
| 900 | @end example | ||
| 901 | |||
| 902 | @noindent | ||
| 903 | or like this: | ||
| 904 | |||
| 905 | @example | ||
| 906 | Time-stamp: " " | ||
| 907 | @end example | ||
| 908 | |||
| 909 | @findex time-stamp | ||
| 910 | Then add the hook function @code{time-stamp} to the hook | ||
| 911 | @code{before-save-hook}; that hook function will automatically update | ||
| 912 | the time stamp, inserting the current date and time when you save the | ||
| 913 | file. You can also use the command @kbd{M-x time-stamp} to update the | ||
| 914 | time stamp manually. For other customizations, see the Custom group | ||
| 915 | @code{time-stamp}. Note that non-numeric fields in the time stamp are | ||
| 916 | formatted according to your locale setting (@pxref{Environment}). | ||
| 917 | |||
| 918 | @node Reverting | ||
| 919 | @section Reverting a Buffer | ||
| 920 | @findex revert-buffer | ||
| 921 | @cindex drastic changes | ||
| 922 | @cindex reread a file | ||
| 923 | |||
| 924 | If you have made extensive changes to a file and then change your mind | ||
| 925 | about them, you can get rid of them by reading in the previous version | ||
| 926 | of the file. To do this, use @kbd{M-x revert-buffer}, which operates on | ||
| 927 | the current buffer. Since reverting a buffer unintentionally could lose | ||
| 928 | a lot of work, you must confirm this command with @kbd{yes}. | ||
| 929 | |||
| 930 | @code{revert-buffer} tries to position point in such a way that, if | ||
| 931 | the file was edited only slightly, you will be at approximately the | ||
| 932 | same piece of text after reverting as before. However, if you have made | ||
| 933 | drastic changes, point may wind up in a totally different piece of text. | ||
| 934 | |||
| 935 | Reverting marks the buffer as ``not modified'' until another change is | ||
| 936 | made. | ||
| 937 | |||
| 938 | Some kinds of buffers whose contents reflect data bases other than files, | ||
| 939 | such as Dired buffers, can also be reverted. For them, reverting means | ||
| 940 | recalculating their contents from the appropriate data base. Buffers | ||
| 941 | created explicitly with @kbd{C-x b} cannot be reverted; @code{revert-buffer} | ||
| 942 | reports an error when asked to do so. | ||
| 943 | |||
| 944 | @vindex revert-without-query | ||
| 945 | When you edit a file that changes automatically and frequently---for | ||
| 946 | example, a log of output from a process that continues to run---it may be | ||
| 947 | useful for Emacs to revert the file without querying you, whenever you | ||
| 948 | visit the file again with @kbd{C-x C-f}. | ||
| 949 | |||
| 950 | To request this behavior, set the variable @code{revert-without-query} | ||
| 951 | to a list of regular expressions. When a file name matches one of these | ||
| 952 | regular expressions, @code{find-file} and @code{revert-buffer} will | ||
| 953 | revert it automatically if it has changed---provided the buffer itself | ||
| 954 | is not modified. (If you have edited the text, it would be wrong to | ||
| 955 | discard your changes.) | ||
| 956 | |||
| 957 | @cindex Global Auto-Revert mode | ||
| 958 | @cindex mode, Global Auto-Revert | ||
| 959 | @cindex Auto-Revert mode | ||
| 960 | @cindex mode, Auto-Revert | ||
| 961 | @findex global-auto-revert-mode | ||
| 962 | @findex auto-revert-mode | ||
| 963 | @findex auto-revert-tail-mode | ||
| 964 | |||
| 965 | You may find it useful to have Emacs revert files automatically when | ||
| 966 | they change. Three minor modes are available to do this. | ||
| 967 | |||
| 968 | @kbd{M-x global-auto-revert-mode} enables Global Auto-Revert mode, | ||
| 969 | which periodically checks all file buffers and reverts when the | ||
| 970 | corresponding file has changed. @kbd{M-x auto-revert-mode} enables a | ||
| 971 | local version, Auto-Revert mode, which applies only to the current | ||
| 972 | buffer. | ||
| 973 | |||
| 974 | You can use Auto-Revert mode to ``tail'' a file such as a system | ||
| 975 | log, so that changes made to that file by other programs are | ||
| 976 | continuously displayed. To do this, just move the point to the end of | ||
| 977 | the buffer, and it will stay there as the file contents change. | ||
| 978 | However, if you are sure that the file will only change by growing at | ||
| 979 | the end, use Auto-Revert Tail mode instead | ||
| 980 | (@code{auto-revert-tail-mode}). It is more efficient for this. | ||
| 981 | |||
| 982 | @vindex auto-revert-interval | ||
| 983 | The variable @code{auto-revert-interval} controls how often to check | ||
| 984 | for a changed file. Since checking a remote file is too slow, these | ||
| 985 | modes do not check or revert remote files. | ||
| 986 | |||
| 987 | @xref{VC Mode Line}, for Auto Revert peculiarities in buffers that | ||
| 988 | visit files under version control. | ||
| 989 | |||
| 990 | @ifnottex | ||
| 991 | @include arevert-xtra.texi | ||
| 992 | @end ifnottex | ||
| 993 | |||
| 994 | @node Auto Save | ||
| 995 | @section Auto-Saving: Protection Against Disasters | ||
| 996 | @cindex Auto Save mode | ||
| 997 | @cindex mode, Auto Save | ||
| 998 | @cindex crashes | ||
| 999 | |||
| 1000 | Emacs saves all the visited files from time to time (based on counting | ||
| 1001 | your keystrokes) without being asked. This is called @dfn{auto-saving}. | ||
| 1002 | It prevents you from losing more than a limited amount of work if the | ||
| 1003 | system crashes. | ||
| 1004 | |||
| 1005 | When Emacs determines that it is time for auto-saving, it considers | ||
| 1006 | each buffer, and each is auto-saved if auto-saving is enabled for it | ||
| 1007 | and it has been changed since the last time it was auto-saved. The | ||
| 1008 | message @samp{Auto-saving...} is displayed in the echo area during | ||
| 1009 | auto-saving, if any files are actually auto-saved. Errors occurring | ||
| 1010 | during auto-saving are caught so that they do not interfere with the | ||
| 1011 | execution of commands you have been typing. | ||
| 1012 | |||
| 1013 | @menu | ||
| 1014 | * Files: Auto Save Files. The file where auto-saved changes are | ||
| 1015 | actually made until you save the file. | ||
| 1016 | * Control: Auto Save Control. Controlling when and how often to auto-save. | ||
| 1017 | * Recover:: Recovering text from auto-save files. | ||
| 1018 | @end menu | ||
| 1019 | |||
| 1020 | @node Auto Save Files | ||
| 1021 | @subsection Auto-Save Files | ||
| 1022 | |||
| 1023 | Auto-saving does not normally save in the files that you visited, because | ||
| 1024 | it can be very undesirable to save a program that is in an inconsistent | ||
| 1025 | state when you have made half of a planned change. Instead, auto-saving | ||
| 1026 | is done in a different file called the @dfn{auto-save file}, and the | ||
| 1027 | visited file is changed only when you request saving explicitly (such as | ||
| 1028 | with @kbd{C-x C-s}). | ||
| 1029 | |||
| 1030 | Normally, the auto-save file name is made by appending @samp{#} to the | ||
| 1031 | front and rear of the visited file name. Thus, a buffer visiting file | ||
| 1032 | @file{foo.c} is auto-saved in a file @file{#foo.c#}. Most buffers that | ||
| 1033 | are not visiting files are auto-saved only if you request it explicitly; | ||
| 1034 | when they are auto-saved, the auto-save file name is made by appending | ||
| 1035 | @samp{#} to the front and rear of buffer name, then | ||
| 1036 | adding digits and letters at the end for uniqueness. For | ||
| 1037 | example, the @samp{*mail*} buffer in which you compose messages to be | ||
| 1038 | sent might be auto-saved in a file named @file{#*mail*#704juu}. Auto-save file | ||
| 1039 | names are made this way unless you reprogram parts of Emacs to do | ||
| 1040 | something different (the functions @code{make-auto-save-file-name} and | ||
| 1041 | @code{auto-save-file-name-p}). The file name to be used for auto-saving | ||
| 1042 | in a buffer is calculated when auto-saving is turned on in that buffer. | ||
| 1043 | |||
| 1044 | @cindex auto-save for remote files | ||
| 1045 | @vindex auto-save-file-name-transforms | ||
| 1046 | The variable @code{auto-save-file-name-transforms} allows a degree | ||
| 1047 | of control over the auto-save file name. It lets you specify a series | ||
| 1048 | of regular expressions and replacements to transform the auto save | ||
| 1049 | file name. The default value puts the auto-save files for remote | ||
| 1050 | files (@pxref{Remote Files}) into the temporary file directory on the | ||
| 1051 | local machine. | ||
| 1052 | |||
| 1053 | When you delete a substantial part of the text in a large buffer, auto | ||
| 1054 | save turns off temporarily in that buffer. This is because if you | ||
| 1055 | deleted the text unintentionally, you might find the auto-save file more | ||
| 1056 | useful if it contains the deleted text. To reenable auto-saving after | ||
| 1057 | this happens, save the buffer with @kbd{C-x C-s}, or use @kbd{C-u 1 M-x | ||
| 1058 | auto-save-mode}. | ||
| 1059 | |||
| 1060 | @vindex auto-save-visited-file-name | ||
| 1061 | If you want auto-saving to be done in the visited file rather than | ||
| 1062 | in a separate auto-save file, set the variable | ||
| 1063 | @code{auto-save-visited-file-name} to a non-@code{nil} value. In this | ||
| 1064 | mode, there is no real difference between auto-saving and explicit | ||
| 1065 | saving. | ||
| 1066 | |||
| 1067 | @vindex delete-auto-save-files | ||
| 1068 | A buffer's auto-save file is deleted when you save the buffer in its | ||
| 1069 | visited file. (You can inhibit this by setting the variable | ||
| 1070 | @code{delete-auto-save-files} to @code{nil}.) Changing the visited | ||
| 1071 | file name with @kbd{C-x C-w} or @code{set-visited-file-name} renames | ||
| 1072 | any auto-save file to go with the new visited name. | ||
| 1073 | |||
| 1074 | @node Auto Save Control | ||
| 1075 | @subsection Controlling Auto-Saving | ||
| 1076 | |||
| 1077 | @vindex auto-save-default | ||
| 1078 | @findex auto-save-mode | ||
| 1079 | Each time you visit a file, auto-saving is turned on for that file's | ||
| 1080 | buffer if the variable @code{auto-save-default} is non-@code{nil} (but not | ||
| 1081 | in batch mode; @pxref{Entering Emacs}). The default for this variable is | ||
| 1082 | @code{t}, so auto-saving is the usual practice for file-visiting buffers. | ||
| 1083 | Auto-saving can be turned on or off for any existing buffer with the | ||
| 1084 | command @kbd{M-x auto-save-mode}. Like other minor mode commands, @kbd{M-x | ||
| 1085 | auto-save-mode} turns auto-saving on with a positive argument, off with a | ||
| 1086 | zero or negative argument; with no argument, it toggles. | ||
| 1087 | |||
| 1088 | @vindex auto-save-interval | ||
| 1089 | Emacs does auto-saving periodically based on counting how many characters | ||
| 1090 | you have typed since the last time auto-saving was done. The variable | ||
| 1091 | @code{auto-save-interval} specifies how many characters there are between | ||
| 1092 | auto-saves. By default, it is 300. Emacs doesn't accept values that are | ||
| 1093 | too small: if you customize @code{auto-save-interval} to a value less | ||
| 1094 | than 20, Emacs will behave as if the value is 20. | ||
| 1095 | |||
| 1096 | @vindex auto-save-timeout | ||
| 1097 | Auto-saving also takes place when you stop typing for a while. The | ||
| 1098 | variable @code{auto-save-timeout} says how many seconds Emacs should | ||
| 1099 | wait before it does an auto save (and perhaps also a garbage | ||
| 1100 | collection). (The actual time period is longer if the current buffer is | ||
| 1101 | long; this is a heuristic which aims to keep out of your way when you | ||
| 1102 | are editing long buffers, in which auto-save takes an appreciable amount | ||
| 1103 | of time.) Auto-saving during idle periods accomplishes two things: | ||
| 1104 | first, it makes sure all your work is saved if you go away from the | ||
| 1105 | terminal for a while; second, it may avoid some auto-saving while you | ||
| 1106 | are actually typing. | ||
| 1107 | |||
| 1108 | Emacs also does auto-saving whenever it gets a fatal error. This | ||
| 1109 | includes killing the Emacs job with a shell command such as @samp{kill | ||
| 1110 | %emacs}, or disconnecting a phone line or network connection. | ||
| 1111 | |||
| 1112 | @findex do-auto-save | ||
| 1113 | You can request an auto-save explicitly with the command @kbd{M-x | ||
| 1114 | do-auto-save}. | ||
| 1115 | |||
| 1116 | @node Recover | ||
| 1117 | @subsection Recovering Data from Auto-Saves | ||
| 1118 | |||
| 1119 | @findex recover-file | ||
| 1120 | You can use the contents of an auto-save file to recover from a loss | ||
| 1121 | of data with the command @kbd{M-x recover-file @key{RET} @var{file} | ||
| 1122 | @key{RET}}. This visits @var{file} and then (after your confirmation) | ||
| 1123 | restores the contents from its auto-save file @file{#@var{file}#}. | ||
| 1124 | You can then save with @kbd{C-x C-s} to put the recovered text into | ||
| 1125 | @var{file} itself. For example, to recover file @file{foo.c} from its | ||
| 1126 | auto-save file @file{#foo.c#}, do:@refill | ||
| 1127 | |||
| 1128 | @example | ||
| 1129 | M-x recover-file @key{RET} foo.c @key{RET} | ||
| 1130 | yes @key{RET} | ||
| 1131 | C-x C-s | ||
| 1132 | @end example | ||
| 1133 | |||
| 1134 | Before asking for confirmation, @kbd{M-x recover-file} displays a | ||
| 1135 | directory listing describing the specified file and the auto-save file, | ||
| 1136 | so you can compare their sizes and dates. If the auto-save file | ||
| 1137 | is older, @kbd{M-x recover-file} does not offer to read it. | ||
| 1138 | |||
| 1139 | @findex recover-session | ||
| 1140 | If Emacs or the computer crashes, you can recover all the files you | ||
| 1141 | were editing from their auto save files with the command @kbd{M-x | ||
| 1142 | recover-session}. This first shows you a list of recorded interrupted | ||
| 1143 | sessions. Move point to the one you choose, and type @kbd{C-c C-c}. | ||
| 1144 | |||
| 1145 | Then @code{recover-session} asks about each of the files that were | ||
| 1146 | being edited during that session, asking whether to recover that file. | ||
| 1147 | If you answer @kbd{y}, it calls @code{recover-file}, which works in its | ||
| 1148 | normal fashion. It shows the dates of the original file and its | ||
| 1149 | auto-save file, and asks once again whether to recover that file. | ||
| 1150 | |||
| 1151 | When @code{recover-session} is done, the files you've chosen to | ||
| 1152 | recover are present in Emacs buffers. You should then save them. Only | ||
| 1153 | this---saving them---updates the files themselves. | ||
| 1154 | |||
| 1155 | @vindex auto-save-list-file-prefix | ||
| 1156 | Emacs records information about interrupted sessions for later | ||
| 1157 | recovery in files named | ||
| 1158 | @file{~/.emacs.d/auto-save-list/.saves-@var{pid}-@var{hostname}}. All | ||
| 1159 | of this name except the @file{@var{pid}-@var{hostname}} part comes | ||
| 1160 | from the value of @code{auto-save-list-file-prefix}. You can record | ||
| 1161 | sessions in a different place by customizing that variable. If you | ||
| 1162 | set @code{auto-save-list-file-prefix} to @code{nil} in your | ||
| 1163 | @file{.emacs} file, sessions are not recorded for recovery. | ||
| 1164 | |||
| 1165 | @node File Aliases | ||
| 1166 | @section File Name Aliases | ||
| 1167 | @cindex symbolic links (visiting) | ||
| 1168 | @cindex hard links (visiting) | ||
| 1169 | |||
| 1170 | Symbolic links and hard links both make it possible for several file | ||
| 1171 | names to refer to the same file. Hard links are alternate names that | ||
| 1172 | refer directly to the file; all the names are equally valid, and no one | ||
| 1173 | of them is preferred. By contrast, a symbolic link is a kind of defined | ||
| 1174 | alias: when @file{foo} is a symbolic link to @file{bar}, you can use | ||
| 1175 | either name to refer to the file, but @file{bar} is the real name, while | ||
| 1176 | @file{foo} is just an alias. More complex cases occur when symbolic | ||
| 1177 | links point to directories. | ||
| 1178 | |||
| 1179 | @vindex find-file-existing-other-name | ||
| 1180 | @vindex find-file-suppress-same-file-warnings | ||
| 1181 | |||
| 1182 | Normally, if you visit a file which Emacs is already visiting under | ||
| 1183 | a different name, Emacs displays a message in the echo area and uses | ||
| 1184 | the existing buffer visiting that file. This can happen on systems | ||
| 1185 | that support hard or symbolic links, or if you use a long file name on | ||
| 1186 | a system that truncates long file names, or on a case-insensitive file | ||
| 1187 | system. You can suppress the message by setting the variable | ||
| 1188 | @code{find-file-suppress-same-file-warnings} to a non-@code{nil} | ||
| 1189 | value. You can disable this feature entirely by setting the variable | ||
| 1190 | @code{find-file-existing-other-name} to @code{nil}: then if you visit | ||
| 1191 | the same file under two different names, you get a separate buffer for | ||
| 1192 | each file name. | ||
| 1193 | |||
| 1194 | @vindex find-file-visit-truename | ||
| 1195 | @cindex truenames of files | ||
| 1196 | @cindex file truenames | ||
| 1197 | If the variable @code{find-file-visit-truename} is non-@code{nil}, | ||
| 1198 | then the file name recorded for a buffer is the file's @dfn{truename} | ||
| 1199 | (made by replacing all symbolic links with their target names), rather | ||
| 1200 | than the name you specify. Setting @code{find-file-visit-truename} also | ||
| 1201 | implies the effect of @code{find-file-existing-other-name}. | ||
| 1202 | |||
| 1203 | @node Version Control | ||
| 1204 | @section Version Control | ||
| 1205 | @cindex version control | ||
| 1206 | |||
| 1207 | @dfn{Version control systems} are packages that can record multiple | ||
| 1208 | versions of a source file, usually storing the unchanged parts of the | ||
| 1209 | file just once. Version control systems also record history information | ||
| 1210 | such as the creation time of each version, who created it, and a | ||
| 1211 | description of what was changed in that version. | ||
| 1212 | |||
| 1213 | The Emacs version control interface is called VC. Its commands work | ||
| 1214 | with different version control systems---currently, it supports CVS, | ||
| 1215 | GNU Arch, RCS, Meta-CVS, Subversion, and SCCS. Of these, the GNU | ||
| 1216 | project distributes CVS, GNU Arch, and RCS; we recommend that you use | ||
| 1217 | either CVS or GNU Arch for your projects, and RCS for individual | ||
| 1218 | files. We also have free software to replace SCCS, known as CSSC; if | ||
| 1219 | you are using SCCS and don't want to make the incompatible change to | ||
| 1220 | RCS or CVS, you can switch to CSSC. | ||
| 1221 | |||
| 1222 | VC is enabled by default in Emacs. To disable it, set the | ||
| 1223 | customizable variable @code{vc-handled-backends} to @code{nil} | ||
| 1224 | @iftex | ||
| 1225 | (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). | ||
| 1226 | @end iftex | ||
| 1227 | @ifnottex | ||
| 1228 | (@pxref{Customizing VC}). | ||
| 1229 | @end ifnottex | ||
| 1230 | |||
| 1231 | |||
| 1232 | @menu | ||
| 1233 | * Introduction to VC:: How version control works in general. | ||
| 1234 | * VC Mode Line:: How the mode line shows version control status. | ||
| 1235 | * Basic VC Editing:: How to edit a file under version control. | ||
| 1236 | * Old Versions:: Examining and comparing old versions. | ||
| 1237 | * Secondary VC Commands:: The commands used a little less frequently. | ||
| 1238 | * Branches:: Multiple lines of development. | ||
| 1239 | @ifnottex | ||
| 1240 | * Remote Repositories:: Efficient access to remote CVS servers. | ||
| 1241 | * Snapshots:: Sets of file versions treated as a unit. | ||
| 1242 | * Miscellaneous VC:: Various other commands and features of VC. | ||
| 1243 | * Customizing VC:: Variables that change VC's behavior. | ||
| 1244 | @end ifnottex | ||
| 1245 | @end menu | ||
| 1246 | |||
| 1247 | @node Introduction to VC | ||
| 1248 | @subsection Introduction to Version Control | ||
| 1249 | |||
| 1250 | VC allows you to use a version control system from within Emacs, | ||
| 1251 | integrating the version control operations smoothly with editing. VC | ||
| 1252 | provides a uniform interface to version control, so that regardless of | ||
| 1253 | which version control system is in use, you can use it the same way. | ||
| 1254 | |||
| 1255 | This section provides a general overview of version control, and | ||
| 1256 | describes the version control systems that VC supports. You can skip | ||
| 1257 | this section if you are already familiar with the version control system | ||
| 1258 | you want to use. | ||
| 1259 | |||
| 1260 | @menu | ||
| 1261 | * Why Version Control?:: Understanding the problems it addresses | ||
| 1262 | * Version Systems:: Supported version control back-end systems. | ||
| 1263 | * VC Concepts:: Words and concepts related to version control. | ||
| 1264 | * Types of Log File:: The per-file VC log in contrast to the ChangeLog. | ||
| 1265 | @end menu | ||
| 1266 | |||
| 1267 | @node Why Version Control? | ||
| 1268 | @subsubsection Understanding the problems it addresses | ||
| 1269 | |||
| 1270 | Version control systems provide you with three important capabilities: | ||
| 1271 | reversibility, concurrency, and history. | ||
| 1272 | |||
| 1273 | The most basic capability you get from a version-control system is | ||
| 1274 | reversibility, the ability to back up to a saved, known-good state when | ||
| 1275 | you discover that some modification you did was a mistake or a bad idea. | ||
| 1276 | |||
| 1277 | Version-control systems also support concurrency, the ability to | ||
| 1278 | have many people modifying the same collection of code or documents | ||
| 1279 | knowing that conflicting modifications can be detected and resolved. | ||
| 1280 | |||
| 1281 | Version-control systems give you the capability to attach a history | ||
| 1282 | to your data, explanatory comments about the intention behind each | ||
| 1283 | change to it. Even for a programmer working solo change histories | ||
| 1284 | are an important aid to memory; for a multi-person project they | ||
| 1285 | become a vitally important form of communication among developers. | ||
| 1286 | |||
| 1287 | @node Version Systems | ||
| 1288 | @subsubsection Supported Version Control Systems | ||
| 1289 | |||
| 1290 | @cindex back end (version control) | ||
| 1291 | VC currently works with six different version control systems or | ||
| 1292 | ``back ends'': CVS, GNU Arch, RCS, Meta-CVS, Subversion, and SCCS. | ||
| 1293 | |||
| 1294 | @cindex CVS | ||
| 1295 | CVS is a free version control system that is used for the majority | ||
| 1296 | of free software projects today. It allows concurrent multi-user | ||
| 1297 | development either locally or over the network. Some of its | ||
| 1298 | shortcomings, corrected by newer systems such as GNU Arch, are that it | ||
| 1299 | lacks atomic commits or support for renaming files. VC supports all | ||
| 1300 | basic editing operations under CVS, but for some less common tasks you | ||
| 1301 | still need to call CVS from the command line. Note also that before | ||
| 1302 | using CVS you must set up a repository, which is a subject too complex | ||
| 1303 | to treat here. | ||
| 1304 | |||
| 1305 | @cindex GNU Arch | ||
| 1306 | @cindex Arch | ||
| 1307 | GNU Arch is a new version control system that is designed for | ||
| 1308 | distributed work. It differs in many ways from old well-known | ||
| 1309 | systems, such as CVS and RCS. It supports different transports for | ||
| 1310 | interoperating between users, offline operations, and it has good | ||
| 1311 | branching and merging features. It also supports atomic commits, and | ||
| 1312 | history of file renaming and moving. VC does not support all | ||
| 1313 | operations provided by GNU Arch, so you must sometimes invoke it from | ||
| 1314 | the command line, or use a specialized module. | ||
| 1315 | |||
| 1316 | @cindex RCS | ||
| 1317 | RCS is the free version control system around which VC was initially | ||
| 1318 | built. The VC commands are therefore conceptually closest to RCS. | ||
| 1319 | Almost everything you can do with RCS can be done through VC. You | ||
| 1320 | cannot use RCS over the network though, and it only works at the level | ||
| 1321 | of individual files, rather than projects. You should use it if you | ||
| 1322 | want a simple, yet reliable tool for handling individual files. | ||
| 1323 | |||
| 1324 | @cindex SVN | ||
| 1325 | @cindex Subversion | ||
| 1326 | Subversion is a free version control system designed to be similar | ||
| 1327 | to CVS but without CVS's problems. Subversion supports atomic commits, | ||
| 1328 | and versions directories, symbolic links, meta-data, renames, copies, | ||
| 1329 | and deletes. It can be used via http or via its own protocol. | ||
| 1330 | |||
| 1331 | @cindex MCVS | ||
| 1332 | @cindex Meta-CVS | ||
| 1333 | Meta-CVS is another attempt to solve problems arising in CVS. It | ||
| 1334 | supports directory structure versioning, improved branching and | ||
| 1335 | merging, and use of symbolic links and meta-data in repositories. | ||
| 1336 | |||
| 1337 | @cindex SCCS | ||
| 1338 | SCCS is a proprietary but widely used version control system. In | ||
| 1339 | terms of capabilities, it is the weakest of the six that VC supports. | ||
| 1340 | VC compensates for certain features missing in SCCS (snapshots, for | ||
| 1341 | example) by implementing them itself, but some other VC features, such | ||
| 1342 | as multiple branches, are not available with SCCS. Since SCCS is | ||
| 1343 | non-free, not respecting its users freedom, you should not use it; | ||
| 1344 | use its free replacement CSSC instead. But you should use CSSC only | ||
| 1345 | if for some reason you cannot use RCS, or one of the higher-level | ||
| 1346 | systems such as CVS or GNU Arch. | ||
| 1347 | |||
| 1348 | In the following, we discuss mainly RCS, SCCS and CVS. Nearly | ||
| 1349 | everything said about CVS applies to GNU Arch, Subversion and Meta-CVS | ||
| 1350 | as well. | ||
| 1351 | |||
| 1352 | @node VC Concepts | ||
| 1353 | @subsubsection Concepts of Version Control | ||
| 1354 | |||
| 1355 | @cindex master file | ||
| 1356 | @cindex registered file | ||
| 1357 | When a file is under version control, we also say that it is | ||
| 1358 | @dfn{registered} in the version control system. Each registered file | ||
| 1359 | has a corresponding @dfn{master file} which represents the file's | ||
| 1360 | present state plus its change history---enough to reconstruct the | ||
| 1361 | current version or any earlier version. Usually the master file also | ||
| 1362 | records a @dfn{log entry} for each version, describing in words what was | ||
| 1363 | changed in that version. | ||
| 1364 | |||
| 1365 | @cindex work file | ||
| 1366 | @cindex checking out files | ||
| 1367 | The file that is maintained under version control is sometimes called | ||
| 1368 | the @dfn{work file} corresponding to its master file. You edit the work | ||
| 1369 | file and make changes in it, as you would with an ordinary file. (With | ||
| 1370 | SCCS and RCS, you must @dfn{lock} the file before you start to edit it.) | ||
| 1371 | After you are done with a set of changes, you @dfn{check the file in}, | ||
| 1372 | which records the changes in the master file, along with a log entry for | ||
| 1373 | them. | ||
| 1374 | |||
| 1375 | To go beyond these basic concepts, you will need to understand three | ||
| 1376 | ways in which version-control systems can differ from each other. They | ||
| 1377 | can be locking or merging; they can be file-based or changeset-based; | ||
| 1378 | and they can be centralized or decentralized. VC handles all these | ||
| 1379 | choices, but they lead to differing behaviors which you will need | ||
| 1380 | to understand as you use it. | ||
| 1381 | |||
| 1382 | @cindex locking versus merging | ||
| 1383 | A version control system typically has some mechanism to coordinate | ||
| 1384 | between users who want to change the same file. One method is | ||
| 1385 | @dfn{locking} (analogous to the locking that Emacs uses to detect | ||
| 1386 | simultaneous editing of a file, but distinct from it). In a locking | ||
| 1387 | system, such as SCCS, you must @dfn{lock} a file before you start to | ||
| 1388 | edit it. The other method is @dfn{merging}; the system tries to | ||
| 1389 | merge your changes with other people's changes when you check them in. | ||
| 1390 | |||
| 1391 | With version control locking, work files are normally read-only so | ||
| 1392 | that you cannot change them. You ask the version control system to make | ||
| 1393 | a work file writable for you by locking it; only one user can do | ||
| 1394 | this at any given time. When you check in your changes, that unlocks | ||
| 1395 | the file, making the work file read-only again. This allows other users | ||
| 1396 | to lock the file to make further changes. | ||
| 1397 | |||
| 1398 | By contrast, a merging system lets each user check out and modify a | ||
| 1399 | work file at any time. When you check in a a file, the system will | ||
| 1400 | attempt to merge your changes with any others checked into the | ||
| 1401 | repository since you checked out the file. | ||
| 1402 | |||
| 1403 | Both locking and merging systems can have problems when multiple users | ||
| 1404 | try to modify the same file at the same time. Locking systems have | ||
| 1405 | @dfn{lock conflicts}; a user may try to check a file out and be unable | ||
| 1406 | to because it is locked. In merging systems, @dfn{merge conflicts} | ||
| 1407 | happen when you check in a change to a file that conflicts with a change | ||
| 1408 | checked in by someone else after your checkout. Both kinds of conflict | ||
| 1409 | have to be resolved by human judgment and communication. | ||
| 1410 | |||
| 1411 | SCCS always uses locking. RCS is lock-based by default but can be told | ||
| 1412 | to operate in a merging style. CVS is merge-based by default but can | ||
| 1413 | be told to operate in a locking mode. Most later version-control | ||
| 1414 | systems, such as Subversion and GNU Arch, have been fundamentally | ||
| 1415 | merging-based rather than locking-based. This is because experience | ||
| 1416 | has shown that the merging-based approach is generally superior to | ||
| 1417 | the locking one, both in convenience to developers and in minimizing | ||
| 1418 | the number and severity of conflicts that actually occur. | ||
| 1419 | |||
| 1420 | While it is rather unlikely that anyone will ever again build a | ||
| 1421 | fundamentally locking-based rather than merging-based version-control | ||
| 1422 | system in the future, merging-based version-systems sometimes have locks | ||
| 1423 | retrofitted onto them for reasons having nothing to do with technology. | ||
| 1424 | @footnote{Usually the control-freak instincts of managers.} For this | ||
| 1425 | reason, and to support older systems still in use, VC mode supports | ||
| 1426 | both locking and merging version control and tries to hide the differences | ||
| 1427 | between them as much as possible. | ||
| 1428 | |||
| 1429 | @cindex files versus changesets. | ||
| 1430 | On SCCS, RCS, CVS, and other early version-control systems, checkins | ||
| 1431 | and other operations are @dfn{file-based}; each file has its own | ||
| 1432 | @dfn{master file} with its own comment- and revision history separate | ||
| 1433 | from that of all other files in the system. Later systems, beginning | ||
| 1434 | with Subversion, are @dfn{changeset-based}; a checkin may include | ||
| 1435 | changes to several files and that change set is treated as a unit by the | ||
| 1436 | system. Any comment associated with the change doesn't belong to any | ||
| 1437 | one file, but is attached to the changeset itself. | ||
| 1438 | |||
| 1439 | Changeset-based version control is in general both more flexible and | ||
| 1440 | more powerful than file-based version control; usually, when a change to | ||
| 1441 | multiple files has to be backed out, it's good to be able to easily | ||
| 1442 | identify and remove all of it. | ||
| 1443 | |||
| 1444 | @cindex centralized vs. decentralized | ||
| 1445 | Early version-control systems were designed around a @dfn{centralized} | ||
| 1446 | model in which each project has only one repository used by all | ||
| 1447 | developers. SCCS, RCS, CVS, and Subversion share this kind of model. | ||
| 1448 | It has two important problems. One is that a single repository is a | ||
| 1449 | single point of failure---if the repository server is down all work | ||
| 1450 | stops. The other is that you need to be connected live to the server to | ||
| 1451 | do checkins and checkouts; if you're offline, you can't work. | ||
| 1452 | |||
| 1453 | Newer version-control systems like GNU Arch are @dfn{decentralized}. | ||
| 1454 | A project may have several different repositories, and these systems | ||
| 1455 | support a sort of super-merge between repositories that tries to | ||
| 1456 | reconcile their change histories. At the limit, each developer has | ||
| 1457 | his/her own repository, and repository merges replace checkin/commit | ||
| 1458 | operations. | ||
| 1459 | |||
| 1460 | VC's job is to help you manage the traffic between your personal | ||
| 1461 | workfiles and a repository. Whether that repository is a single master | ||
| 1462 | or one of a network of peer repositories is not something VC has to care | ||
| 1463 | about. Thus, the difference between a centralized and a decentralized | ||
| 1464 | version-control system is invisible to VC mode. | ||
| 1465 | |||
| 1466 | @iftex | ||
| 1467 | (@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}). | ||
| 1468 | @end iftex | ||
| 1469 | @ifnottex | ||
| 1470 | (@pxref{CVS Options}). | ||
| 1471 | @end ifnottex | ||
| 1472 | |||
| 1473 | |||
| 1474 | @node Types of Log File | ||
| 1475 | @subsubsection Types of Log File | ||
| 1476 | @cindex types of log file | ||
| 1477 | @cindex log File, types of | ||
| 1478 | @cindex version control log | ||
| 1479 | |||
| 1480 | Projects that use a revision control system can have @emph{two} | ||
| 1481 | types of log for changes. One is the per-file log maintained by the | ||
| 1482 | revision control system: each time you check in a change, you must | ||
| 1483 | fill out a @dfn{log entry} for the change (@pxref{Log Buffer}). This | ||
| 1484 | kind of log is called the @dfn{version control log}, also the | ||
| 1485 | @dfn{revision control log}, @dfn{RCS log}, or @dfn{CVS log}. | ||
| 1486 | |||
| 1487 | The other kind of log is the file @file{ChangeLog} (@pxref{Change | ||
| 1488 | Log}). It provides a chronological record of all changes to a large | ||
| 1489 | portion of a program---typically one directory and its subdirectories. | ||
| 1490 | A small program would use one @file{ChangeLog} file; a large program | ||
| 1491 | may well merit a @file{ChangeLog} file in each major directory. | ||
| 1492 | @xref{Change Log}. | ||
| 1493 | |||
| 1494 | A project maintained with version control can use just the per-file | ||
| 1495 | log, or it can use both kinds of logs. It can handle some files one | ||
| 1496 | way and some files the other way. Each project has its policy, which | ||
| 1497 | you should follow. | ||
| 1498 | |||
| 1499 | When the policy is to use both, you typically want to write an entry | ||
| 1500 | for each change just once, then put it into both logs. You can write | ||
| 1501 | the entry in @file{ChangeLog}, then copy it to the log buffer when you | ||
| 1502 | check in the change. Or you can write the entry in the log buffer | ||
| 1503 | while checking in the change, and later use the @kbd{C-x v a} command | ||
| 1504 | to copy it to @file{ChangeLog} | ||
| 1505 | @iftex | ||
| 1506 | (@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}). | ||
| 1507 | @end iftex | ||
| 1508 | @ifnottex | ||
| 1509 | (@pxref{Change Logs and VC}). | ||
| 1510 | @end ifnottex | ||
| 1511 | |||
| 1512 | |||
| 1513 | @node VC Mode Line | ||
| 1514 | @subsection Version Control and the Mode Line | ||
| 1515 | |||
| 1516 | When you visit a file that is under version control, Emacs indicates | ||
| 1517 | this on the mode line. For example, @samp{RCS-1.3} says that RCS is | ||
| 1518 | used for that file, and the current version is 1.3. | ||
| 1519 | |||
| 1520 | The character between the back-end name and the version number | ||
| 1521 | indicates the version control status of the file. @samp{-} means that | ||
| 1522 | the work file is not locked (if locking is in use), or not modified (if | ||
| 1523 | locking is not in use). @samp{:} indicates that the file is locked, or | ||
| 1524 | that it is modified. If the file is locked by some other user (for | ||
| 1525 | instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}. | ||
| 1526 | |||
| 1527 | @vindex auto-revert-check-vc-info | ||
| 1528 | When Auto Revert mode (@pxref{Reverting}) reverts a buffer that is | ||
| 1529 | under version control, it updates the version control information in | ||
| 1530 | the mode line. However, Auto Revert mode may not properly update this | ||
| 1531 | information if the version control status changes without changes to | ||
| 1532 | the work file, from outside the current Emacs session. If you set | ||
| 1533 | @code{auto-revert-check-vc-info} to @code{t}, Auto Revert mode updates | ||
| 1534 | the version control status information every | ||
| 1535 | @code{auto-revert-interval} seconds, even if the work file itself is | ||
| 1536 | unchanged. The resulting CPU usage depends on the version control | ||
| 1537 | system, but is usually not excessive. | ||
| 1538 | |||
| 1539 | @node Basic VC Editing | ||
| 1540 | @subsection Basic Editing under Version Control | ||
| 1541 | |||
| 1542 | The principal VC command is an all-purpose command that performs | ||
| 1543 | either locking or check-in, depending on the situation. | ||
| 1544 | |||
| 1545 | @table @kbd | ||
| 1546 | @itemx C-x v v | ||
| 1547 | Perform the next logical version control operation on this file. | ||
| 1548 | @end table | ||
| 1549 | |||
| 1550 | @findex vc-next-action | ||
| 1551 | @kindex C-x v v | ||
| 1552 | The precise action of this command depends on the state of the file, | ||
| 1553 | and whether the version control system uses locking or not. SCCS and | ||
| 1554 | RCS normally use locking; CVS normally does not use locking. | ||
| 1555 | |||
| 1556 | @findex vc-toggle-read-only | ||
| 1557 | @kindex C-x C-q @r{(Version Control)} | ||
| 1558 | As a special convenience that is particularly useful for files with | ||
| 1559 | locking, you can let Emacs check a file in or out whenever you change | ||
| 1560 | its read-only flag. This means, for example, that you cannot | ||
| 1561 | accidentally edit a file without properly checking it out first. To | ||
| 1562 | achieve this, bind the key @kbd{C-x C-q} to @kbd{vc-toggle-read-only} | ||
| 1563 | in your @file{~/.emacs} file. (@xref{Init Rebinding}.) | ||
| 1564 | |||
| 1565 | @menu | ||
| 1566 | * VC with Locking:: RCS in its default mode, SCCS, and optionally CVS. | ||
| 1567 | * Without Locking:: Without locking: default mode for CVS. | ||
| 1568 | * Advanced C-x v v:: Advanced features available with a prefix argument. | ||
| 1569 | * Log Buffer:: Features available in log entry buffers. | ||
| 1570 | @end menu | ||
| 1571 | |||
| 1572 | @node VC with Locking | ||
| 1573 | @subsubsection Basic Version Control with Locking | ||
| 1574 | |||
| 1575 | If locking is used for the file (as with SCCS, and RCS in its default | ||
| 1576 | mode), @kbd{C-x v v} can either lock a file or check it in: | ||
| 1577 | |||
| 1578 | @itemize @bullet | ||
| 1579 | @item | ||
| 1580 | If the file is not locked, @kbd{C-x v v} locks it, and | ||
| 1581 | makes it writable so that you can change it. | ||
| 1582 | |||
| 1583 | @item | ||
| 1584 | If the file is locked by you, and contains changes, @kbd{C-x v v} checks | ||
| 1585 | in the changes. In order to do this, it first reads the log entry | ||
| 1586 | for the new version. @xref{Log Buffer}. | ||
| 1587 | |||
| 1588 | @item | ||
| 1589 | If the file is locked by you, but you have not changed it since you | ||
| 1590 | locked it, @kbd{C-x v v} releases the lock and makes the file read-only | ||
| 1591 | again. | ||
| 1592 | |||
| 1593 | @item | ||
| 1594 | If the file is locked by some other user, @kbd{C-x v v} asks you whether | ||
| 1595 | you want to ``steal the lock'' from that user. If you say yes, the file | ||
| 1596 | becomes locked by you, but a message is sent to the person who had | ||
| 1597 | formerly locked the file, to inform him of what has happened. | ||
| 1598 | @end itemize | ||
| 1599 | |||
| 1600 | These rules also apply when you use CVS in locking mode, except | ||
| 1601 | that there is no such thing as stealing a lock. | ||
| 1602 | |||
| 1603 | @node Without Locking | ||
| 1604 | @subsubsection Basic Version Control without Locking | ||
| 1605 | |||
| 1606 | When there is no locking---the default for CVS---work files are always | ||
| 1607 | writable; you do not need to do anything before you begin to edit a | ||
| 1608 | file. The status indicator on the mode line is @samp{-} if the file is | ||
| 1609 | unmodified; it flips to @samp{:} as soon as you save any changes in the | ||
| 1610 | work file. | ||
| 1611 | |||
| 1612 | Here is what @kbd{C-x v v} does when using CVS: | ||
| 1613 | |||
| 1614 | @itemize @bullet | ||
| 1615 | @item | ||
| 1616 | If some other user has checked in changes into the master file, Emacs | ||
| 1617 | asks you whether you want to merge those changes into your own work | ||
| 1618 | file. You must do this before you can check in your own changes. (To | ||
| 1619 | pick up any recent changes from the master file @emph{without} trying | ||
| 1620 | to commit your own changes, type @kbd{C-x v m @key{RET}}.) | ||
| 1621 | @xref{Merging}. | ||
| 1622 | |||
| 1623 | @item | ||
| 1624 | If there are no new changes in the master file, but you have made | ||
| 1625 | modifications in your work file, @kbd{C-x v v} checks in your changes. | ||
| 1626 | In order to do this, it first reads the log entry for the new version. | ||
| 1627 | @xref{Log Buffer}. | ||
| 1628 | |||
| 1629 | @item | ||
| 1630 | If the file is not modified, the @kbd{C-x v v} does nothing. | ||
| 1631 | @end itemize | ||
| 1632 | |||
| 1633 | These rules also apply when you use RCS in the mode that does not | ||
| 1634 | require locking, except that automatic merging of changes from the | ||
| 1635 | master file is not implemented. Unfortunately, this means that nothing | ||
| 1636 | informs you if another user has checked in changes in the same file | ||
| 1637 | since you began editing it, and when this happens, his changes will be | ||
| 1638 | effectively removed when you check in your version (though they will | ||
| 1639 | remain in the master file, so they will not be entirely lost). You must | ||
| 1640 | therefore verify that the current version is unchanged, before you | ||
| 1641 | check in your changes. We hope to eliminate this risk and provide | ||
| 1642 | automatic merging with RCS in a future Emacs version. | ||
| 1643 | |||
| 1644 | In addition, locking is possible with RCS even in this mode, although | ||
| 1645 | it is not required; @kbd{C-x v v} with an unmodified file locks the | ||
| 1646 | file, just as it does with RCS in its normal (locking) mode. | ||
| 1647 | |||
| 1648 | @node Advanced C-x v v | ||
| 1649 | @subsubsection Advanced Control in @kbd{C-x v v} | ||
| 1650 | |||
| 1651 | @cindex version number to check in/out | ||
| 1652 | When you give a prefix argument to @code{vc-next-action} (@kbd{C-u | ||
| 1653 | C-x v v}), it still performs the next logical version control | ||
| 1654 | operation, but accepts additional arguments to specify precisely how | ||
| 1655 | to do the operation. | ||
| 1656 | |||
| 1657 | @itemize @bullet | ||
| 1658 | @item | ||
| 1659 | If the file is modified (or locked), you can specify the version | ||
| 1660 | number to use for the new version that you check in. This is one way | ||
| 1661 | to create a new branch (@pxref{Branches}). | ||
| 1662 | |||
| 1663 | @item | ||
| 1664 | If the file is not modified (and unlocked), you can specify the | ||
| 1665 | version to select; this lets you start working from an older version, | ||
| 1666 | or on another branch. If you do not enter any version, that takes you | ||
| 1667 | to the highest version on the current branch; therefore @kbd{C-u C-x | ||
| 1668 | v v @key{RET}} is a convenient way to get the latest version of a file from | ||
| 1669 | the repository. | ||
| 1670 | |||
| 1671 | @item | ||
| 1672 | @cindex specific version control system | ||
| 1673 | Instead of the version number, you can also specify the name of a | ||
| 1674 | version control system. This is useful when one file is being managed | ||
| 1675 | with two version control systems at the same time | ||
| 1676 | @iftex | ||
| 1677 | (@pxref{Local Version Control,,,emacs-xtra, Specialized Emacs | ||
| 1678 | Features}). | ||
| 1679 | @end iftex | ||
| 1680 | @ifnottex | ||
| 1681 | (@pxref{Local Version Control}). | ||
| 1682 | @end ifnottex | ||
| 1683 | |||
| 1684 | @end itemize | ||
| 1685 | |||
| 1686 | @node Log Buffer | ||
| 1687 | @subsubsection Features of the Log Entry Buffer | ||
| 1688 | |||
| 1689 | When you check in changes, @kbd{C-x v v} first reads a log entry. It | ||
| 1690 | pops up a buffer called @samp{*VC-Log*} for you to enter the log entry. | ||
| 1691 | |||
| 1692 | Sometimes the @samp{*VC-Log*} buffer contains default text when you enter it, | ||
| 1693 | typically the last log message entered. If it does, mark and point | ||
| 1694 | are set around the entire contents of the buffer so that it is easy to | ||
| 1695 | kill the contents of the buffer with @kbd{C-w}. | ||
| 1696 | |||
| 1697 | @findex log-edit-insert-changelog | ||
| 1698 | If you work by writing entries in the @file{ChangeLog} | ||
| 1699 | (@pxref{Change Log}) and then commit the change under revision | ||
| 1700 | control, you can generate the Log Edit text from the ChangeLog using | ||
| 1701 | @kbd{C-c C-a} (@kbd{log-edit-insert-changelog}). This looks for | ||
| 1702 | entries for the file(s) concerned in the top entry in the ChangeLog | ||
| 1703 | and uses those paragraphs as the log text. This text is only inserted | ||
| 1704 | if the top entry was made under your user name on the current date. | ||
| 1705 | @iftex | ||
| 1706 | @xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}, | ||
| 1707 | @end iftex | ||
| 1708 | @ifnottex | ||
| 1709 | @xref{Change Logs and VC}, | ||
| 1710 | @end ifnottex | ||
| 1711 | for the opposite way of working---generating ChangeLog entries from | ||
| 1712 | the revision control log. | ||
| 1713 | |||
| 1714 | In the @samp{*VC-Log*} buffer, @kbd{C-c C-f} (@kbd{M-x | ||
| 1715 | log-edit-show-files}) shows the list of files to be committed in case | ||
| 1716 | you need to check that. (This can be a list of more than one file if | ||
| 1717 | you use VC Dired mode or PCL-CVS. | ||
| 1718 | @iftex | ||
| 1719 | @xref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features}, | ||
| 1720 | @end iftex | ||
| 1721 | @ifnottex | ||
| 1722 | @xref{VC Dired Mode}, | ||
| 1723 | @end ifnottex | ||
| 1724 | and @ref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The Emacs | ||
| 1725 | Front-End to CVS}.) | ||
| 1726 | |||
| 1727 | When you have finished editing the log message, type @kbd{C-c C-c} to | ||
| 1728 | exit the buffer and commit the change. | ||
| 1729 | |||
| 1730 | To abort check-in, just @strong{don't} type @kbd{C-c C-c} in that | ||
| 1731 | buffer. You can switch buffers and do other editing. As long as you | ||
| 1732 | don't try to check in another file, the entry you were editing remains | ||
| 1733 | in the @samp{*VC-Log*} buffer, and you can go back to that buffer at any | ||
| 1734 | time to complete the check-in. | ||
| 1735 | |||
| 1736 | If you change several source files for the same reason, it is often | ||
| 1737 | convenient to specify the same log entry for many of the files. To do | ||
| 1738 | this, use the history of previous log entries. The commands @kbd{M-n}, | ||
| 1739 | @kbd{M-p}, @kbd{M-s} and @kbd{M-r} for doing this work just like the | ||
| 1740 | minibuffer history commands (except that these versions are used outside | ||
| 1741 | the minibuffer). | ||
| 1742 | |||
| 1743 | @vindex vc-log-mode-hook | ||
| 1744 | Each time you check in a file, the log entry buffer is put into VC Log | ||
| 1745 | mode, which involves running two hooks: @code{text-mode-hook} and | ||
| 1746 | @code{vc-log-mode-hook}. @xref{Hooks}. | ||
| 1747 | |||
| 1748 | @node Old Versions | ||
| 1749 | @subsection Examining And Comparing Old Versions | ||
| 1750 | |||
| 1751 | One of the convenient features of version control is the ability | ||
| 1752 | to examine any version of a file, or compare two versions. | ||
| 1753 | |||
| 1754 | @table @kbd | ||
| 1755 | @item C-x v ~ @var{version} @key{RET} | ||
| 1756 | Examine version @var{version} of the visited file, in a buffer of its | ||
| 1757 | own. | ||
| 1758 | |||
| 1759 | @item C-x v = | ||
| 1760 | Compare the current buffer contents with the master version from which | ||
| 1761 | you started editing. | ||
| 1762 | |||
| 1763 | @item C-u C-x v = @var{file} @key{RET} @var{oldvers} @key{RET} @var{newvers} @key{RET} | ||
| 1764 | Compare the specified two versions of @var{file}. | ||
| 1765 | |||
| 1766 | @item C-x v g | ||
| 1767 | Display the file with per-line version information and using colors. | ||
| 1768 | @end table | ||
| 1769 | |||
| 1770 | @findex vc-version-other-window | ||
| 1771 | @kindex C-x v ~ | ||
| 1772 | To examine an old version in its entirety, visit the file and then type | ||
| 1773 | @kbd{C-x v ~ @var{version} @key{RET}} (@code{vc-version-other-window}). | ||
| 1774 | This puts the text of version @var{version} in a file named | ||
| 1775 | @file{@var{filename}.~@var{version}~}, and visits it in its own buffer | ||
| 1776 | in a separate window. (In RCS, you can also select an old version | ||
| 1777 | and create a branch from it. @xref{Branches}.) | ||
| 1778 | |||
| 1779 | @findex vc-diff | ||
| 1780 | @kindex C-x v = | ||
| 1781 | It is usually more convenient to compare two versions of the file, | ||
| 1782 | with the command @kbd{C-x v =} (@code{vc-diff}). Plain @kbd{C-x v =} | ||
| 1783 | compares the current buffer contents (saving them in the file if | ||
| 1784 | necessary) with the master version from which you started editing the | ||
| 1785 | file (this is not necessarily the latest version of the file). | ||
| 1786 | @kbd{C-u C-x v =}, with a numeric argument, reads a file name and two | ||
| 1787 | version numbers, then compares those versions of the specified file. | ||
| 1788 | Both forms display the output in a special buffer in another window. | ||
| 1789 | |||
| 1790 | You can specify a checked-in version by its number; an empty input | ||
| 1791 | specifies the current contents of the work file (which may be different | ||
| 1792 | from all the checked-in versions). You can also specify a snapshot name | ||
| 1793 | @iftex | ||
| 1794 | (@pxref{Snapshots,,,emacs-xtra, Specialized Emacs Features}) | ||
| 1795 | @end iftex | ||
| 1796 | @ifnottex | ||
| 1797 | (@pxref{Snapshots}) | ||
| 1798 | @end ifnottex | ||
| 1799 | instead of one or both version numbers. | ||
| 1800 | |||
| 1801 | If you supply a directory name instead of the name of a registered | ||
| 1802 | file, this command compares the two specified versions of all registered | ||
| 1803 | files in that directory and its subdirectories. | ||
| 1804 | |||
| 1805 | @vindex vc-diff-switches | ||
| 1806 | @vindex vc-rcs-diff-switches | ||
| 1807 | @kbd{C-x v =} works by running a variant of the @code{diff} utility | ||
| 1808 | designed to work with the version control system in use. When you | ||
| 1809 | invoke @code{diff} this way, in addition to the options specified by | ||
| 1810 | @code{diff-switches} (@pxref{Comparing Files}), it receives those | ||
| 1811 | specified by @code{vc-diff-switches}, plus those specified for the | ||
| 1812 | specific back end by @code{vc-@var{backend}-diff-switches}. For | ||
| 1813 | instance, when the version control back end is RCS, @code{diff} uses | ||
| 1814 | the options in @code{vc-rcs-diff-switches}. The | ||
| 1815 | @samp{vc@dots{}diff-switches} variables are @code{nil} by default. | ||
| 1816 | |||
| 1817 | The buffer produced by @kbd{C-x v =} supports the commands of | ||
| 1818 | Compilation mode (@pxref{Compilation Mode}), such as @kbd{C-x `} and | ||
| 1819 | @kbd{C-c C-c}, in both the ``old'' and ``new'' text, and they always | ||
| 1820 | find the corresponding locations in the current work file. (Older | ||
| 1821 | versions are not, in general, present as files on your disk.) | ||
| 1822 | |||
| 1823 | @findex vc-annotate | ||
| 1824 | @kindex C-x v g | ||
| 1825 | For some back ends, you can display the file @dfn{annotated} with | ||
| 1826 | per-line version information and using colors to enhance the visual | ||
| 1827 | appearance, with the command @kbd{M-x vc-annotate}. It creates a new | ||
| 1828 | buffer (the ``annotate buffer'') displaying the file's text, with each | ||
| 1829 | part colored to show how old it is. Text colored red is new, blue means | ||
| 1830 | old, and intermediate colors indicate intermediate ages. By default, | ||
| 1831 | the color is scaled over the full range of ages, such that the oldest | ||
| 1832 | changes are blue, and the newest changes are red. | ||
| 1833 | |||
| 1834 | When you give a prefix argument to this command, it uses the | ||
| 1835 | minibuffer to read two arguments: which version number to display and | ||
| 1836 | annotate (instead of the current file contents), and the time span in | ||
| 1837 | days the color range should cover. | ||
| 1838 | |||
| 1839 | From the annotate buffer, these and other color scaling options are | ||
| 1840 | available from the @samp{VC-Annotate} menu. In this buffer, you can | ||
| 1841 | also use the following keys to browse the annotations of past revisions, | ||
| 1842 | view diffs, or view log entries: | ||
| 1843 | |||
| 1844 | @table @kbd | ||
| 1845 | @item P | ||
| 1846 | Annotate the previous revision, that is to say, the revision before | ||
| 1847 | the one currently annotated. A numeric prefix argument is a repeat | ||
| 1848 | count, so @kbd{C-u 10 P} would take you back 10 revisions. | ||
| 1849 | |||
| 1850 | @item N | ||
| 1851 | Annotate the next revision---the one after the revision currently | ||
| 1852 | annotated. A numeric prefix argument is a repeat count. | ||
| 1853 | |||
| 1854 | @item J | ||
| 1855 | Annotate the revision indicated by the current line. | ||
| 1856 | |||
| 1857 | @item A | ||
| 1858 | Annotate the revision before the one indicated by the current line. | ||
| 1859 | This is useful to see the state the file was in before the change on | ||
| 1860 | the current line was made. | ||
| 1861 | |||
| 1862 | @item D | ||
| 1863 | Display the diff between the current line's revision and the previous | ||
| 1864 | revision. This is useful to see what the current line's revision | ||
| 1865 | actually changed in the file. | ||
| 1866 | |||
| 1867 | @item L | ||
| 1868 | Show the log of the current line's revision. This is useful to see | ||
| 1869 | the author's description of the changes in the revision on the current | ||
| 1870 | line. | ||
| 1871 | |||
| 1872 | @item W | ||
| 1873 | Annotate the workfile version--the one you are editing. If you used | ||
| 1874 | @kbd{P} and @kbd{N} to browse to other revisions, use this key to | ||
| 1875 | return to your current version. | ||
| 1876 | @end table | ||
| 1877 | |||
| 1878 | @node Secondary VC Commands | ||
| 1879 | @subsection The Secondary Commands of VC | ||
| 1880 | |||
| 1881 | This section explains the secondary commands of VC; those that you might | ||
| 1882 | use once a day. | ||
| 1883 | |||
| 1884 | @menu | ||
| 1885 | * Registering:: Putting a file under version control. | ||
| 1886 | * VC Status:: Viewing the VC status of files. | ||
| 1887 | * VC Undo:: Canceling changes before or after check-in. | ||
| 1888 | @ifnottex | ||
| 1889 | * VC Dired Mode:: Listing files managed by version control. | ||
| 1890 | * VC Dired Commands:: Commands to use in a VC Dired buffer. | ||
| 1891 | @end ifnottex | ||
| 1892 | @end menu | ||
| 1893 | |||
| 1894 | @node Registering | ||
| 1895 | @subsubsection Registering a File for Version Control | ||
| 1896 | |||
| 1897 | @kindex C-x v i | ||
| 1898 | @findex vc-register | ||
| 1899 | You can put any file under version control by simply visiting it, and | ||
| 1900 | then typing @w{@kbd{C-x v i}} (@code{vc-register}). | ||
| 1901 | |||
| 1902 | @table @kbd | ||
| 1903 | @item C-x v i | ||
| 1904 | Register the visited file for version control. | ||
| 1905 | @end table | ||
| 1906 | |||
| 1907 | To register the file, Emacs must choose which version control system | ||
| 1908 | to use for it. If the file's directory already contains files | ||
| 1909 | registered in a version control system, Emacs uses that system. If | ||
| 1910 | there is more than one system in use for a directory, Emacs uses the | ||
| 1911 | one that appears first in @code{vc-handled-backends} | ||
| 1912 | @iftex | ||
| 1913 | (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). | ||
| 1914 | @end iftex | ||
| 1915 | @ifnottex | ||
| 1916 | (@pxref{Customizing VC}). | ||
| 1917 | @end ifnottex | ||
| 1918 | On the other hand, if there are no files already registered, Emacs uses | ||
| 1919 | the first system from @code{vc-handled-backends} that could register | ||
| 1920 | the file (for example, you cannot register a file under CVS if its | ||
| 1921 | directory is not already part of a CVS tree); with the default value | ||
| 1922 | of @code{vc-handled-backends}, this means that Emacs uses RCS in this | ||
| 1923 | situation. | ||
| 1924 | |||
| 1925 | If locking is in use, @kbd{C-x v i} leaves the file unlocked and | ||
| 1926 | read-only. Type @kbd{C-x v v} if you wish to start editing it. After | ||
| 1927 | registering a file with CVS, you must subsequently commit the initial | ||
| 1928 | version by typing @kbd{C-x v v}. Until you do that, the version | ||
| 1929 | appears as @samp{@@@@} in the mode line. | ||
| 1930 | |||
| 1931 | @vindex vc-default-init-version | ||
| 1932 | @cindex initial version number to register | ||
| 1933 | The initial version number for a newly registered file is 1.1, by | ||
| 1934 | default. You can specify a different default by setting the variable | ||
| 1935 | @code{vc-default-init-version}, or you can give @kbd{C-x v i} a numeric | ||
| 1936 | argument; then it reads the initial version number for this particular | ||
| 1937 | file using the minibuffer. | ||
| 1938 | |||
| 1939 | @vindex vc-initial-comment | ||
| 1940 | If @code{vc-initial-comment} is non-@code{nil}, @kbd{C-x v i} reads an | ||
| 1941 | initial comment to describe the purpose of this source file. Reading | ||
| 1942 | the initial comment works like reading a log entry (@pxref{Log Buffer}). | ||
| 1943 | |||
| 1944 | @node VC Status | ||
| 1945 | @subsubsection VC Status Commands | ||
| 1946 | |||
| 1947 | @table @kbd | ||
| 1948 | @item C-x v l | ||
| 1949 | Display version control state and change history. | ||
| 1950 | @end table | ||
| 1951 | |||
| 1952 | @kindex C-x v l | ||
| 1953 | @findex vc-print-log | ||
| 1954 | To view the detailed version control status and history of a file, | ||
| 1955 | type @kbd{C-x v l} (@code{vc-print-log}). It displays the history of | ||
| 1956 | changes to the current file, including the text of the log entries. The | ||
| 1957 | output appears in a separate window. The point is centered at the | ||
| 1958 | revision of the file that is currently being visited. | ||
| 1959 | |||
| 1960 | In the change log buffer, you can use the following keys to move | ||
| 1961 | between the logs of revisions and of files, to view past revisions, and | ||
| 1962 | to view diffs: | ||
| 1963 | |||
| 1964 | @table @kbd | ||
| 1965 | @item p | ||
| 1966 | Move to the previous revision-item in the buffer. (Revision entries in the log | ||
| 1967 | buffer are usually in reverse-chronological order, so the previous | ||
| 1968 | revision-item usually corresponds to a newer revision.) A numeric | ||
| 1969 | prefix argument is a repeat count. | ||
| 1970 | |||
| 1971 | @item n | ||
| 1972 | Move to the next revision-item (which most often corresponds to the | ||
| 1973 | previous revision of the file). A numeric prefix argument is a repeat | ||
| 1974 | count. | ||
| 1975 | |||
| 1976 | @item P | ||
| 1977 | Move to the log of the previous file, when the logs of multiple files | ||
| 1978 | are in the log buffer | ||
| 1979 | @iftex | ||
| 1980 | (@pxref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features}). | ||
| 1981 | @end iftex | ||
| 1982 | @ifnottex | ||
| 1983 | (@pxref{VC Dired Mode}). | ||
| 1984 | @end ifnottex | ||
| 1985 | Otherwise, just move to the beginning of the log. A numeric prefix | ||
| 1986 | argument is a repeat count, so @kbd{C-u 10 P} would move backward 10 | ||
| 1987 | files. | ||
| 1988 | |||
| 1989 | @item N | ||
| 1990 | Move to the log of the next file, when the logs of multiple files are | ||
| 1991 | in the log buffer | ||
| 1992 | @iftex | ||
| 1993 | (@pxref{VC Dired Mode,,,emacs-xtra, Specialized Emacs Features}). | ||
| 1994 | @end iftex | ||
| 1995 | @ifnottex | ||
| 1996 | (@pxref{VC Dired Mode}). | ||
| 1997 | @end ifnottex | ||
| 1998 | It also takes a numeric prefix argument as a repeat count. | ||
| 1999 | |||
| 2000 | @item f | ||
| 2001 | Visit the revision indicated at the current line, like typing @kbd{C-x | ||
| 2002 | v ~} and specifying this revision's number (@pxref{Old Versions}). | ||
| 2003 | |||
| 2004 | @item d | ||
| 2005 | Display the diff (@pxref{Comparing Files}) between the revision | ||
| 2006 | indicated at the current line and the next earlier revision. This is | ||
| 2007 | useful to see what actually changed when the revision indicated on the | ||
| 2008 | current line was committed. | ||
| 2009 | @end table | ||
| 2010 | |||
| 2011 | @node VC Undo | ||
| 2012 | @subsubsection Undoing Version Control Actions | ||
| 2013 | |||
| 2014 | @table @kbd | ||
| 2015 | @item C-x v u | ||
| 2016 | Revert the buffer and the file to the version from which you started | ||
| 2017 | editing the file. | ||
| 2018 | |||
| 2019 | @item C-x v c | ||
| 2020 | Remove the last-entered change from the master for the visited file. | ||
| 2021 | This undoes your last check-in. | ||
| 2022 | @end table | ||
| 2023 | |||
| 2024 | @kindex C-x v u | ||
| 2025 | @findex vc-revert-buffer | ||
| 2026 | If you want to discard your current set of changes and revert to the | ||
| 2027 | version from which you started editing the file, use @kbd{C-x v u} | ||
| 2028 | (@code{vc-revert-buffer}). This leaves the file unlocked; if locking | ||
| 2029 | is in use, you must first lock the file again before you change it | ||
| 2030 | again. @kbd{C-x v u} requires confirmation, unless it sees that you | ||
| 2031 | haven't made any changes with respect to the master version. | ||
| 2032 | |||
| 2033 | @kbd{C-x v u} is also the command to unlock a file if you lock it and | ||
| 2034 | then decide not to change it. | ||
| 2035 | |||
| 2036 | @kindex C-x v c | ||
| 2037 | @findex vc-cancel-version | ||
| 2038 | To cancel a change that you already checked in, use @kbd{C-x v c} | ||
| 2039 | (@code{vc-cancel-version}). This command discards all record of the | ||
| 2040 | most recent checked-in version, but only if your work file corresponds | ||
| 2041 | to that version---you cannot use @kbd{C-x v c} to cancel a version | ||
| 2042 | that is not the latest on its branch. @kbd{C-x v c} also offers to | ||
| 2043 | revert your work file and buffer to the previous version (the one that | ||
| 2044 | precedes the version that is deleted). | ||
| 2045 | |||
| 2046 | If you answer @kbd{no}, VC keeps your changes in the buffer, and locks | ||
| 2047 | the file. The no-revert option is useful when you have checked in a | ||
| 2048 | change and then discover a trivial error in it; you can cancel the | ||
| 2049 | erroneous check-in, fix the error, and check the file in again. | ||
| 2050 | |||
| 2051 | When @kbd{C-x v c} does not revert the buffer, it unexpands all | ||
| 2052 | version control headers in the buffer instead | ||
| 2053 | @iftex | ||
| 2054 | (@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}). | ||
| 2055 | @end iftex | ||
| 2056 | @ifnottex | ||
| 2057 | (@pxref{Version Headers}). | ||
| 2058 | @end ifnottex | ||
| 2059 | This is because the buffer no longer corresponds to any existing | ||
| 2060 | version. If you check it in again, the check-in process will expand | ||
| 2061 | the headers properly for the new version number. | ||
| 2062 | |||
| 2063 | However, it is impossible to unexpand the RCS @samp{@w{$}Log$} header | ||
| 2064 | automatically. If you use that header feature, you have to unexpand it | ||
| 2065 | by hand---by deleting the entry for the version that you just canceled. | ||
| 2066 | |||
| 2067 | Be careful when invoking @kbd{C-x v c}, as it is easy to lose a lot of | ||
| 2068 | work with it. To help you be careful, this command always requires | ||
| 2069 | confirmation with @kbd{yes}. Note also that this command is disabled | ||
| 2070 | under CVS, because canceling versions is very dangerous and discouraged | ||
| 2071 | with CVS. | ||
| 2072 | |||
| 2073 | @ifnottex | ||
| 2074 | @c vc1-xtra.texi needs extra level of lowering. | ||
| 2075 | @lowersections | ||
| 2076 | @include vc1-xtra.texi | ||
| 2077 | @raisesections | ||
| 2078 | @end ifnottex | ||
| 2079 | |||
| 2080 | @node Branches | ||
| 2081 | @subsection Multiple Branches of a File | ||
| 2082 | @cindex branch (version control) | ||
| 2083 | @cindex trunk (version control) | ||
| 2084 | |||
| 2085 | One use of version control is to maintain multiple ``current'' | ||
| 2086 | versions of a file. For example, you might have different versions of a | ||
| 2087 | program in which you are gradually adding various unfinished new | ||
| 2088 | features. Each such independent line of development is called a | ||
| 2089 | @dfn{branch}. VC allows you to create branches, switch between | ||
| 2090 | different branches, and merge changes from one branch to another. | ||
| 2091 | Please note, however, that branches are not supported for SCCS. | ||
| 2092 | |||
| 2093 | A file's main line of development is usually called the @dfn{trunk}. | ||
| 2094 | The versions on the trunk are normally numbered 1.1, 1.2, 1.3, etc. At | ||
| 2095 | any such version, you can start an independent branch. A branch | ||
| 2096 | starting at version 1.2 would have version number 1.2.1.1, and consecutive | ||
| 2097 | versions on this branch would have numbers 1.2.1.2, 1.2.1.3, 1.2.1.4, | ||
| 2098 | and so on. If there is a second branch also starting at version 1.2, it | ||
| 2099 | would consist of versions 1.2.2.1, 1.2.2.2, 1.2.2.3, etc. | ||
| 2100 | |||
| 2101 | @cindex head version | ||
| 2102 | If you omit the final component of a version number, that is called a | ||
| 2103 | @dfn{branch number}. It refers to the highest existing version on that | ||
| 2104 | branch---the @dfn{head version} of that branch. The branches in the | ||
| 2105 | example above have branch numbers 1.2.1 and 1.2.2. | ||
| 2106 | |||
| 2107 | @menu | ||
| 2108 | * Switching Branches:: How to get to another existing branch. | ||
| 2109 | * Creating Branches:: How to start a new branch. | ||
| 2110 | * Merging:: Transferring changes between branches. | ||
| 2111 | * Multi-User Branching:: Multiple users working at multiple branches | ||
| 2112 | in parallel. | ||
| 2113 | @end menu | ||
| 2114 | |||
| 2115 | @node Switching Branches | ||
| 2116 | @subsubsection Switching between Branches | ||
| 2117 | |||
| 2118 | To switch between branches, type @kbd{C-u C-x v v} and specify the | ||
| 2119 | version number you want to select. This version is then visited | ||
| 2120 | @emph{unlocked} (write-protected), so you can examine it before locking | ||
| 2121 | it. Switching branches in this way is allowed only when the file is not | ||
| 2122 | locked. | ||
| 2123 | |||
| 2124 | You can omit the minor version number, thus giving only the branch | ||
| 2125 | number; this takes you to the head version on the chosen branch. If you | ||
| 2126 | only type @key{RET}, Emacs goes to the highest version on the trunk. | ||
| 2127 | |||
| 2128 | After you have switched to any branch (including the main branch), you | ||
| 2129 | stay on it for subsequent VC commands, until you explicitly select some | ||
| 2130 | other branch. | ||
| 2131 | |||
| 2132 | @node Creating Branches | ||
| 2133 | @subsubsection Creating New Branches | ||
| 2134 | |||
| 2135 | To create a new branch from a head version (one that is the latest in | ||
| 2136 | the branch that contains it), first select that version if necessary, | ||
| 2137 | lock it with @kbd{C-x v v}, and make whatever changes you want. Then, | ||
| 2138 | when you check in the changes, use @kbd{C-u C-x v v}. This lets you | ||
| 2139 | specify the version number for the new version. You should specify a | ||
| 2140 | suitable branch number for a branch starting at the current version. | ||
| 2141 | For example, if the current version is 2.5, the branch number should be | ||
| 2142 | 2.5.1, 2.5.2, and so on, depending on the number of existing branches at | ||
| 2143 | that point. | ||
| 2144 | |||
| 2145 | To create a new branch at an older version (one that is no longer the | ||
| 2146 | head of a branch), first select that version (@pxref{Switching | ||
| 2147 | Branches}), then lock it with @kbd{C-x v v}. You'll be asked to | ||
| 2148 | confirm, when you lock the old version, that you really mean to create a | ||
| 2149 | new branch---if you say no, you'll be offered a chance to lock the | ||
| 2150 | latest version instead. | ||
| 2151 | |||
| 2152 | Then make your changes and type @kbd{C-x v v} again to check in a new | ||
| 2153 | version. This automatically creates a new branch starting from the | ||
| 2154 | selected version. You need not specially request a new branch, because | ||
| 2155 | that's the only way to add a new version at a point that is not the head | ||
| 2156 | of a branch. | ||
| 2157 | |||
| 2158 | After the branch is created, you ``stay'' on it. That means that | ||
| 2159 | subsequent check-ins create new versions on that branch. To leave the | ||
| 2160 | branch, you must explicitly select a different version with @kbd{C-u C-x | ||
| 2161 | v v}. To transfer changes from one branch to another, use the merge | ||
| 2162 | command, described in the next section. | ||
| 2163 | |||
| 2164 | @node Merging | ||
| 2165 | @subsubsection Merging Branches | ||
| 2166 | |||
| 2167 | @cindex merging changes | ||
| 2168 | When you have finished the changes on a certain branch, you will | ||
| 2169 | often want to incorporate them into the file's main line of development | ||
| 2170 | (the trunk). This is not a trivial operation, because development might | ||
| 2171 | also have proceeded on the trunk, so that you must @dfn{merge} the | ||
| 2172 | changes into a file that has already been changed otherwise. VC allows | ||
| 2173 | you to do this (and other things) with the @code{vc-merge} command. | ||
| 2174 | |||
| 2175 | @table @kbd | ||
| 2176 | @item C-x v m (vc-merge) | ||
| 2177 | Merge changes into the work file. | ||
| 2178 | @end table | ||
| 2179 | |||
| 2180 | @kindex C-x v m | ||
| 2181 | @findex vc-merge | ||
| 2182 | @kbd{C-x v m} (@code{vc-merge}) takes a set of changes and merges it | ||
| 2183 | into the current version of the work file. It firsts asks you in the | ||
| 2184 | minibuffer where the changes should come from. If you just type | ||
| 2185 | @key{RET}, Emacs merges any changes that were made on the same branch | ||
| 2186 | since you checked the file out (we call this @dfn{merging the news}). | ||
| 2187 | This is the common way to pick up recent changes from the repository, | ||
| 2188 | regardless of whether you have already changed the file yourself. | ||
| 2189 | |||
| 2190 | You can also enter a branch number or a pair of version numbers in | ||
| 2191 | the minibuffer. Then @kbd{C-x v m} finds the changes from that | ||
| 2192 | branch, or the differences between the two versions you specified, and | ||
| 2193 | merges them into the current version of the current file. | ||
| 2194 | |||
| 2195 | As an example, suppose that you have finished a certain feature on | ||
| 2196 | branch 1.3.1. In the meantime, development on the trunk has proceeded | ||
| 2197 | to version 1.5. To merge the changes from the branch to the trunk, | ||
| 2198 | first go to the head version of the trunk, by typing @kbd{C-u C-x v v | ||
| 2199 | @key{RET}}. Version 1.5 is now current. If locking is used for the file, | ||
| 2200 | type @kbd{C-x v v} to lock version 1.5 so that you can change it. Next, | ||
| 2201 | type @kbd{C-x v m 1.3.1 @key{RET}}. This takes the entire set of changes on | ||
| 2202 | branch 1.3.1 (relative to version 1.3, where the branch started, up to | ||
| 2203 | the last version on the branch) and merges it into the current version | ||
| 2204 | of the work file. You can now check in the changed file, thus creating | ||
| 2205 | version 1.6 containing the changes from the branch. | ||
| 2206 | |||
| 2207 | It is possible to do further editing after merging the branch, before | ||
| 2208 | the next check-in. But it is usually wiser to check in the merged | ||
| 2209 | version, then lock it and make the further changes. This will keep | ||
| 2210 | a better record of the history of changes. | ||
| 2211 | |||
| 2212 | @cindex conflicts | ||
| 2213 | @cindex resolving conflicts | ||
| 2214 | When you merge changes into a file that has itself been modified, the | ||
| 2215 | changes might overlap. We call this situation a @dfn{conflict}, and | ||
| 2216 | reconciling the conflicting changes is called @dfn{resolving a | ||
| 2217 | conflict}. | ||
| 2218 | |||
| 2219 | Whenever conflicts occur during merging, VC detects them, tells you | ||
| 2220 | about them in the echo area, and asks whether you want help in merging. | ||
| 2221 | If you say yes, it starts an Ediff session (@pxref{Top, | ||
| 2222 | Ediff, Ediff, ediff, The Ediff Manual}). | ||
| 2223 | |||
| 2224 | If you say no, the conflicting changes are both inserted into the | ||
| 2225 | file, surrounded by @dfn{conflict markers}. The example below shows how | ||
| 2226 | a conflict region looks; the file is called @samp{name} and the current | ||
| 2227 | master file version with user B's changes in it is 1.11. | ||
| 2228 | |||
| 2229 | @c @w here is so CVS won't think this is a conflict. | ||
| 2230 | @smallexample | ||
| 2231 | @group | ||
| 2232 | @w{<}<<<<<< name | ||
| 2233 | @var{User A's version} | ||
| 2234 | ======= | ||
| 2235 | @var{User B's version} | ||
| 2236 | @w{>}>>>>>> 1.11 | ||
| 2237 | @end group | ||
| 2238 | @end smallexample | ||
| 2239 | |||
| 2240 | @cindex vc-resolve-conflicts | ||
| 2241 | Then you can resolve the conflicts by editing the file manually. Or | ||
| 2242 | you can type @code{M-x vc-resolve-conflicts} after visiting the file. | ||
| 2243 | This starts an Ediff session, as described above. Don't forget to | ||
| 2244 | check in the merged version afterwards. | ||
| 2245 | |||
| 2246 | @node Multi-User Branching | ||
| 2247 | @subsubsection Multi-User Branching | ||
| 2248 | |||
| 2249 | It is often useful for multiple developers to work simultaneously on | ||
| 2250 | different branches of a file. CVS allows this by default; for RCS, it | ||
| 2251 | is possible if you create multiple source directories. Each source | ||
| 2252 | directory should have a link named @file{RCS} which points to a common | ||
| 2253 | directory of RCS master files. Then each source directory can have its | ||
| 2254 | own choice of selected versions, but all share the same common RCS | ||
| 2255 | records. | ||
| 2256 | |||
| 2257 | This technique works reliably and automatically, provided that the | ||
| 2258 | source files contain RCS version headers | ||
| 2259 | @iftex | ||
| 2260 | (@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}). | ||
| 2261 | @end iftex | ||
| 2262 | @ifnottex | ||
| 2263 | (@pxref{Version Headers}). | ||
| 2264 | @end ifnottex | ||
| 2265 | The headers enable Emacs to be sure, at all times, which version | ||
| 2266 | number is present in the work file. | ||
| 2267 | |||
| 2268 | If the files do not have version headers, you must instead tell Emacs | ||
| 2269 | explicitly in each session which branch you are working on. To do this, | ||
| 2270 | first find the file, then type @kbd{C-u C-x v v} and specify the correct | ||
| 2271 | branch number. This ensures that Emacs knows which branch it is using | ||
| 2272 | during this particular editing session. | ||
| 2273 | |||
| 2274 | @ifnottex | ||
| 2275 | @include vc2-xtra.texi | ||
| 2276 | @end ifnottex | ||
| 2277 | |||
| 2278 | @node Directories | ||
| 2279 | @section File Directories | ||
| 2280 | |||
| 2281 | @cindex file directory | ||
| 2282 | @cindex directory listing | ||
| 2283 | The file system groups files into @dfn{directories}. A @dfn{directory | ||
| 2284 | listing} is a list of all the files in a directory. Emacs provides | ||
| 2285 | commands to create and delete directories, and to make directory | ||
| 2286 | listings in brief format (file names only) and verbose format (sizes, | ||
| 2287 | dates, and authors included). Emacs also includes a directory browser | ||
| 2288 | feature called Dired; see @ref{Dired}. | ||
| 2289 | |||
| 2290 | @table @kbd | ||
| 2291 | @item C-x C-d @var{dir-or-pattern} @key{RET} | ||
| 2292 | Display a brief directory listing (@code{list-directory}). | ||
| 2293 | @item C-u C-x C-d @var{dir-or-pattern} @key{RET} | ||
| 2294 | Display a verbose directory listing. | ||
| 2295 | @item M-x make-directory @key{RET} @var{dirname} @key{RET} | ||
| 2296 | Create a new directory named @var{dirname}. | ||
| 2297 | @item M-x delete-directory @key{RET} @var{dirname} @key{RET} | ||
| 2298 | Delete the directory named @var{dirname}. It must be empty, | ||
| 2299 | or you get an error. | ||
| 2300 | @end table | ||
| 2301 | |||
| 2302 | @findex list-directory | ||
| 2303 | @kindex C-x C-d | ||
| 2304 | The command to display a directory listing is @kbd{C-x C-d} | ||
| 2305 | (@code{list-directory}). It reads using the minibuffer a file name | ||
| 2306 | which is either a directory to be listed or a wildcard-containing | ||
| 2307 | pattern for the files to be listed. For example, | ||
| 2308 | |||
| 2309 | @example | ||
| 2310 | C-x C-d /u2/emacs/etc @key{RET} | ||
| 2311 | @end example | ||
| 2312 | |||
| 2313 | @noindent | ||
| 2314 | lists all the files in directory @file{/u2/emacs/etc}. Here is an | ||
| 2315 | example of specifying a file name pattern: | ||
| 2316 | |||
| 2317 | @example | ||
| 2318 | C-x C-d /u2/emacs/src/*.c @key{RET} | ||
| 2319 | @end example | ||
| 2320 | |||
| 2321 | Normally, @kbd{C-x C-d} displays a brief directory listing containing | ||
| 2322 | just file names. A numeric argument (regardless of value) tells it to | ||
| 2323 | make a verbose listing including sizes, dates, and owners (like | ||
| 2324 | @samp{ls -l}). | ||
| 2325 | |||
| 2326 | @vindex list-directory-brief-switches | ||
| 2327 | @vindex list-directory-verbose-switches | ||
| 2328 | The text of a directory listing is mostly obtained by running | ||
| 2329 | @code{ls} in an inferior process. Two Emacs variables control the | ||
| 2330 | switches passed to @code{ls}: @code{list-directory-brief-switches} is | ||
| 2331 | a string giving the switches to use in brief listings (@code{"-CF"} by | ||
| 2332 | default), and @code{list-directory-verbose-switches} is a string | ||
| 2333 | giving the switches to use in a verbose listing (@code{"-l"} by | ||
| 2334 | default). | ||
| 2335 | |||
| 2336 | @vindex directory-free-space-program | ||
| 2337 | @vindex directory-free-space-args | ||
| 2338 | In verbose directory listings, Emacs adds information about the | ||
| 2339 | amount of free space on the disk that contains the directory. To do | ||
| 2340 | this, it runs the program specified by | ||
| 2341 | @code{directory-free-space-program} with arguments | ||
| 2342 | @code{directory-free-space-args}. | ||
| 2343 | |||
| 2344 | @node Comparing Files | ||
| 2345 | @section Comparing Files | ||
| 2346 | @cindex comparing files | ||
| 2347 | |||
| 2348 | @findex diff | ||
| 2349 | @vindex diff-switches | ||
| 2350 | The command @kbd{M-x diff} compares two files, displaying the | ||
| 2351 | differences in an Emacs buffer named @samp{*diff*}. It works by | ||
| 2352 | running the @code{diff} program, using options taken from the variable | ||
| 2353 | @code{diff-switches}. The value of @code{diff-switches} should be a | ||
| 2354 | string; the default is @code{"-c"} to specify a context diff. | ||
| 2355 | @xref{Top,, Diff, diff, Comparing and Merging Files}, for more | ||
| 2356 | information about @command{diff} output formats. | ||
| 2357 | |||
| 2358 | @findex diff-backup | ||
| 2359 | The command @kbd{M-x diff-backup} compares a specified file with its most | ||
| 2360 | recent backup. If you specify the name of a backup file, | ||
| 2361 | @code{diff-backup} compares it with the source file that it is a backup | ||
| 2362 | of. | ||
| 2363 | |||
| 2364 | @findex compare-windows | ||
| 2365 | The command @kbd{M-x compare-windows} compares the text in the | ||
| 2366 | current window with that in the next window. (For more information | ||
| 2367 | about windows in Emacs, @ref{Windows}.) Comparison starts at point in | ||
| 2368 | each window, after pushing each initial point value on the mark ring | ||
| 2369 | in its respective buffer. Then it moves point forward in each window, | ||
| 2370 | one character at a time, until it reaches characters that don't match. | ||
| 2371 | Then the command exits. | ||
| 2372 | |||
| 2373 | If point in the two windows is followed by non-matching text when | ||
| 2374 | the command starts, @kbd{M-x compare-windows} tries heuristically to | ||
| 2375 | advance up to matching text in the two windows, and then exits. So if | ||
| 2376 | you use @kbd{M-x compare-windows} repeatedly, each time it either | ||
| 2377 | skips one matching range or finds the start of another. | ||
| 2378 | |||
| 2379 | @vindex compare-ignore-case | ||
| 2380 | @vindex compare-ignore-whitespace | ||
| 2381 | With a numeric argument, @code{compare-windows} ignores changes in | ||
| 2382 | whitespace. If the variable @code{compare-ignore-case} is | ||
| 2383 | non-@code{nil}, the comparison ignores differences in case as well. | ||
| 2384 | If the variable @code{compare-ignore-whitespace} is non-@code{nil}, | ||
| 2385 | @code{compare-windows} normally ignores changes in whitespace, and a | ||
| 2386 | prefix argument turns that off. | ||
| 2387 | |||
| 2388 | @cindex Smerge mode | ||
| 2389 | @findex smerge-mode | ||
| 2390 | @cindex failed merges | ||
| 2391 | @cindex merges, failed | ||
| 2392 | @cindex comparing 3 files (@code{diff3}) | ||
| 2393 | You can use @kbd{M-x smerge-mode} to turn on Smerge mode, a minor | ||
| 2394 | mode for editing output from the @command{diff3} program. This is | ||
| 2395 | typically the result of a failed merge from a version control system | ||
| 2396 | ``update'' outside VC, due to conflicting changes to a file. Smerge | ||
| 2397 | mode provides commands to resolve conflicts by selecting specific | ||
| 2398 | changes. | ||
| 2399 | |||
| 2400 | @iftex | ||
| 2401 | @xref{Emerge,,, emacs-xtra, Specialized Emacs Features}, | ||
| 2402 | @end iftex | ||
| 2403 | @ifnottex | ||
| 2404 | @xref{Emerge}, | ||
| 2405 | @end ifnottex | ||
| 2406 | for the Emerge facility, which provides a powerful interface for | ||
| 2407 | merging files. | ||
| 2408 | |||
| 2409 | @node Diff Mode | ||
| 2410 | @section Diff Mode | ||
| 2411 | @cindex Diff mode | ||
| 2412 | @findex diff-mode | ||
| 2413 | @cindex patches, editing | ||
| 2414 | |||
| 2415 | Diff mode is used for the output of @kbd{M-x diff}; it is also | ||
| 2416 | useful for editing patches and comparisons produced by the | ||
| 2417 | @command{diff} program. To select Diff mode manually, type @kbd{M-x | ||
| 2418 | diff-mode}. | ||
| 2419 | |||
| 2420 | One general feature of Diff mode is that manual edits to the patch | ||
| 2421 | automatically correct line numbers, including those in the hunk | ||
| 2422 | header, so that you can actually apply the edited patch. Diff mode | ||
| 2423 | treats each hunk location as an ``error message,'' so that you can use | ||
| 2424 | commands such as @kbd{C-x '} to visit the corresponding source | ||
| 2425 | locations. It also provides the following commands to navigate, | ||
| 2426 | manipulate and apply parts of patches: | ||
| 2427 | |||
| 2428 | @table @kbd | ||
| 2429 | @item M-n | ||
| 2430 | Move to the next hunk-start (@code{diff-hunk-next}). | ||
| 2431 | |||
| 2432 | @item M-p | ||
| 2433 | Move to the previous hunk-start (@code{diff-hunk-prev}). | ||
| 2434 | |||
| 2435 | @item M-@} | ||
| 2436 | Move to the next file-start, in a multi-file patch | ||
| 2437 | (@code{diff-file-next}). | ||
| 2438 | |||
| 2439 | @item M-@{ | ||
| 2440 | Move to the previous file-start, in a multi-file patch | ||
| 2441 | (@code{diff-file-prev}). | ||
| 2442 | |||
| 2443 | @item M-k | ||
| 2444 | Kill the hunk at point (@code{diff-hunk-kill}). | ||
| 2445 | |||
| 2446 | @item M-K | ||
| 2447 | In a multi-file patch, kill the current file part. | ||
| 2448 | (@code{diff-file-kill}). | ||
| 2449 | |||
| 2450 | @item C-c C-a | ||
| 2451 | Apply this hunk to its target file (@code{diff-apply-hunk}). With a | ||
| 2452 | prefix argument of @kbd{C-u}, revert this hunk. | ||
| 2453 | |||
| 2454 | @item C-c C-c | ||
| 2455 | Go to the source corresponding to this hunk (@code{diff-goto-source}). | ||
| 2456 | |||
| 2457 | @item C-c C-e | ||
| 2458 | Start an Ediff session with the patch (@code{diff-ediff-patch}). | ||
| 2459 | @xref{Top, Ediff, Ediff, ediff, The Ediff Manual}. | ||
| 2460 | |||
| 2461 | @item C-c C-n | ||
| 2462 | Restrict the view to the current hunk (@code{diff-restrict-view}). | ||
| 2463 | @xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the | ||
| 2464 | view to the current patch of a multiple file patch. To widen again, | ||
| 2465 | use @kbd{C-x n w}. | ||
| 2466 | |||
| 2467 | @item C-c C-r | ||
| 2468 | Reverse the direction of comparison for the entire buffer | ||
| 2469 | (@code{diff-reverse-direction}). | ||
| 2470 | |||
| 2471 | @item C-c C-s | ||
| 2472 | Split the hunk at point (@code{diff-split-hunk}). This is for | ||
| 2473 | manually editing patches, and only works with the unified diff format. | ||
| 2474 | |||
| 2475 | @item C-c C-u | ||
| 2476 | Convert the entire buffer to unified format | ||
| 2477 | (@code{diff-context->unified}). With a prefix argument, convert | ||
| 2478 | unified format to context format. In Transient Mark mode, when the | ||
| 2479 | mark is active, this command operates only on the region. | ||
| 2480 | |||
| 2481 | @item C-c C-w | ||
| 2482 | Refine the current hunk so that it disregards changes in whitespace | ||
| 2483 | (@code{diff-refine-hunk}). | ||
| 2484 | @end table | ||
| 2485 | |||
| 2486 | @kbd{C-x 4 a} in Diff mode operates on behalf of the target file, | ||
| 2487 | but gets the function name from the patch itself. @xref{Change Log}. | ||
| 2488 | This is useful for making log entries for functions that are deleted | ||
| 2489 | by the patch. | ||
| 2490 | |||
| 2491 | @node Misc File Ops | ||
| 2492 | @section Miscellaneous File Operations | ||
| 2493 | |||
| 2494 | Emacs has commands for performing many other operations on files. | ||
| 2495 | All operate on one file; they do not accept wildcard file names. | ||
| 2496 | |||
| 2497 | @findex view-file | ||
| 2498 | @cindex viewing | ||
| 2499 | @cindex View mode | ||
| 2500 | @cindex mode, View | ||
| 2501 | @kbd{M-x view-file} allows you to scan or read a file by sequential | ||
| 2502 | screenfuls. It reads a file name argument using the minibuffer. After | ||
| 2503 | reading the file into an Emacs buffer, @code{view-file} displays the | ||
| 2504 | beginning. You can then type @key{SPC} to scroll forward one windowful, | ||
| 2505 | or @key{DEL} to scroll backward. Various other commands are provided | ||
| 2506 | for moving around in the file, but none for changing it; type @kbd{?} | ||
| 2507 | while viewing for a list of them. They are mostly the same as normal | ||
| 2508 | Emacs cursor motion commands. To exit from viewing, type @kbd{q}. | ||
| 2509 | The commands for viewing are defined by a special minor mode called View | ||
| 2510 | mode. | ||
| 2511 | |||
| 2512 | A related command, @kbd{M-x view-buffer}, views a buffer already present | ||
| 2513 | in Emacs. @xref{Misc Buffer}. | ||
| 2514 | |||
| 2515 | @kindex C-x i | ||
| 2516 | @findex insert-file | ||
| 2517 | @kbd{M-x insert-file} (also @kbd{C-x i}) inserts a copy of the | ||
| 2518 | contents of the specified file into the current buffer at point, | ||
| 2519 | leaving point unchanged before the contents and the mark after them. | ||
| 2520 | |||
| 2521 | @findex insert-file-literally | ||
| 2522 | @kbd{M-x insert-file-literally} is like @kbd{M-x insert-file}, | ||
| 2523 | except the file is inserted ``literally'': it is treated as a sequence | ||
| 2524 | of @acronym{ASCII} characters with no special encoding or conversion, | ||
| 2525 | similar to the @kbd{M-x find-file-literally} command | ||
| 2526 | (@pxref{Visiting}). | ||
| 2527 | |||
| 2528 | @findex write-region | ||
| 2529 | @kbd{M-x write-region} is the inverse of @kbd{M-x insert-file}; it | ||
| 2530 | copies the contents of the region into the specified file. @kbd{M-x | ||
| 2531 | append-to-file} adds the text of the region to the end of the | ||
| 2532 | specified file. @xref{Accumulating Text}. The variable | ||
| 2533 | @code{write-region-inhibit-fsync} applies to these commands, as well | ||
| 2534 | as saving files; see @ref{Customize Save}. | ||
| 2535 | |||
| 2536 | @findex delete-file | ||
| 2537 | @cindex deletion (of files) | ||
| 2538 | @kbd{M-x delete-file} deletes the specified file, like the @code{rm} | ||
| 2539 | command in the shell. If you are deleting many files in one directory, it | ||
| 2540 | may be more convenient to use Dired (@pxref{Dired}). | ||
| 2541 | |||
| 2542 | @findex rename-file | ||
| 2543 | @kbd{M-x rename-file} reads two file names @var{old} and @var{new} using | ||
| 2544 | the minibuffer, then renames file @var{old} as @var{new}. If the file name | ||
| 2545 | @var{new} already exists, you must confirm with @kbd{yes} or renaming is not | ||
| 2546 | done; this is because renaming causes the old meaning of the name @var{new} | ||
| 2547 | to be lost. If @var{old} and @var{new} are on different file systems, the | ||
| 2548 | file @var{old} is copied and deleted. | ||
| 2549 | |||
| 2550 | If the argument @var{new} is just a directory name, the real new | ||
| 2551 | name is in that directory, with the same non-directory component as | ||
| 2552 | @var{old}. For example, @kbd{M-x rename-file RET ~/foo RET /tmp RET} | ||
| 2553 | renames @file{~/foo} to @file{/tmp/foo}. The same rule applies to all | ||
| 2554 | the remaining commands in this section. All of them ask for | ||
| 2555 | confirmation when the new file name already exists, too. | ||
| 2556 | |||
| 2557 | @findex add-name-to-file | ||
| 2558 | @cindex hard links (creation) | ||
| 2559 | The similar command @kbd{M-x add-name-to-file} is used to add an | ||
| 2560 | additional name to an existing file without removing its old name. | ||
| 2561 | The new name is created as a ``hard link'' to the existing file. | ||
| 2562 | The new name must belong on the same file system that the file is on. | ||
| 2563 | On MS-Windows, this command works only if the file resides in an NTFS | ||
| 2564 | file system. On MS-DOS, it works by copying the file. | ||
| 2565 | |||
| 2566 | @findex copy-file | ||
| 2567 | @cindex copying files | ||
| 2568 | @kbd{M-x copy-file} reads the file @var{old} and writes a new file | ||
| 2569 | named @var{new} with the same contents. | ||
| 2570 | |||
| 2571 | @findex make-symbolic-link | ||
| 2572 | @cindex symbolic links (creation) | ||
| 2573 | @kbd{M-x make-symbolic-link} reads two file names @var{target} and | ||
| 2574 | @var{linkname}, then creates a symbolic link named @var{linkname}, | ||
| 2575 | which points at @var{target}. The effect is that future attempts to | ||
| 2576 | open file @var{linkname} will refer to whatever file is named | ||
| 2577 | @var{target} at the time the opening is done, or will get an error if | ||
| 2578 | the name @var{target} is nonexistent at that time. This command does | ||
| 2579 | not expand the argument @var{target}, so that it allows you to specify | ||
| 2580 | a relative name as the target of the link. | ||
| 2581 | |||
| 2582 | Not all systems support symbolic links; on systems that don't | ||
| 2583 | support them, this command is not defined. | ||
| 2584 | |||
| 2585 | @node Compressed Files | ||
| 2586 | @section Accessing Compressed Files | ||
| 2587 | @cindex compression | ||
| 2588 | @cindex uncompression | ||
| 2589 | @cindex Auto Compression mode | ||
| 2590 | @cindex mode, Auto Compression | ||
| 2591 | @pindex gzip | ||
| 2592 | |||
| 2593 | Emacs automatically uncompresses compressed files when you visit | ||
| 2594 | them, and automatically recompresses them if you alter them and save | ||
| 2595 | them. Emacs recognizes compressed files by their file names. File | ||
| 2596 | names ending in @samp{.gz} indicate a file compressed with | ||
| 2597 | @code{gzip}. Other endings indicate other compression programs. | ||
| 2598 | |||
| 2599 | Automatic uncompression and compression apply to all the operations in | ||
| 2600 | which Emacs uses the contents of a file. This includes visiting it, | ||
| 2601 | saving it, inserting its contents into a buffer, loading it, and byte | ||
| 2602 | compiling it. | ||
| 2603 | |||
| 2604 | @findex auto-compression-mode | ||
| 2605 | @vindex auto-compression-mode | ||
| 2606 | To disable this feature, type the command @kbd{M-x | ||
| 2607 | auto-compression-mode}. You can disable it permanently by | ||
| 2608 | customizing the variable @code{auto-compression-mode}. | ||
| 2609 | |||
| 2610 | @node File Archives | ||
| 2611 | @section File Archives | ||
| 2612 | @cindex mode, tar | ||
| 2613 | @cindex Tar mode | ||
| 2614 | @cindex file archives | ||
| 2615 | |||
| 2616 | A file whose name ends in @samp{.tar} is normally an @dfn{archive} | ||
| 2617 | made by the @code{tar} program. Emacs views these files in a special | ||
| 2618 | mode called Tar mode which provides a Dired-like list of the contents | ||
| 2619 | (@pxref{Dired}). You can move around through the list just as you | ||
| 2620 | would in Dired, and visit the subfiles contained in the archive. | ||
| 2621 | However, not all Dired commands are available in Tar mode. | ||
| 2622 | |||
| 2623 | If Auto Compression mode is enabled (@pxref{Compressed Files}), then | ||
| 2624 | Tar mode is used also for compressed archives---files with extensions | ||
| 2625 | @samp{.tgz}, @code{.tar.Z} and @code{.tar.gz}. | ||
| 2626 | |||
| 2627 | The keys @kbd{e}, @kbd{f} and @key{RET} all extract a component file | ||
| 2628 | into its own buffer. You can edit it there, and if you save the | ||
| 2629 | buffer, the edited version will replace the version in the Tar buffer. | ||
| 2630 | @kbd{v} extracts a file into a buffer in View mode. @kbd{o} extracts | ||
| 2631 | the file and displays it in another window, so you could edit the file | ||
| 2632 | and operate on the archive simultaneously. @kbd{d} marks a file for | ||
| 2633 | deletion when you later use @kbd{x}, and @kbd{u} unmarks a file, as in | ||
| 2634 | Dired. @kbd{C} copies a file from the archive to disk and @kbd{R} | ||
| 2635 | renames a file within the archive. @kbd{g} reverts the buffer from | ||
| 2636 | the archive on disk. | ||
| 2637 | |||
| 2638 | The keys @kbd{M}, @kbd{G}, and @kbd{O} change the file's permission | ||
| 2639 | bits, group, and owner, respectively. | ||
| 2640 | |||
| 2641 | If your display supports colors and the mouse, moving the mouse | ||
| 2642 | pointer across a file name highlights that file name, indicating that | ||
| 2643 | you can click on it. Clicking @kbd{Mouse-2} on the highlighted file | ||
| 2644 | name extracts the file into a buffer and displays that buffer. | ||
| 2645 | |||
| 2646 | Saving the Tar buffer writes a new version of the archive to disk with | ||
| 2647 | the changes you made to the components. | ||
| 2648 | |||
| 2649 | You don't need the @code{tar} program to use Tar mode---Emacs reads | ||
| 2650 | the archives directly. However, accessing compressed archives | ||
| 2651 | requires the appropriate uncompression program. | ||
| 2652 | |||
| 2653 | @cindex Archive mode | ||
| 2654 | @cindex mode, archive | ||
| 2655 | @cindex @code{arc} | ||
| 2656 | @cindex @code{jar} | ||
| 2657 | @cindex @code{zip} | ||
| 2658 | @cindex @code{lzh} | ||
| 2659 | @cindex @code{zoo} | ||
| 2660 | @pindex arc | ||
| 2661 | @pindex jar | ||
| 2662 | @pindex zip | ||
| 2663 | @pindex lzh | ||
| 2664 | @pindex zoo | ||
| 2665 | @cindex Java class archives | ||
| 2666 | @cindex unzip archives | ||
| 2667 | A separate but similar Archive mode is used for archives produced by | ||
| 2668 | the programs @code{arc}, @code{jar}, @code{lzh}, @code{zip}, and | ||
| 2669 | @code{zoo}, which have extensions corresponding to the program names. | ||
| 2670 | Archive mode also works for those @code{exe} files that are | ||
| 2671 | self-extracting executables. | ||
| 2672 | |||
| 2673 | The key bindings of Archive mode are similar to those in Tar mode, | ||
| 2674 | with the addition of the @kbd{m} key which marks a file for subsequent | ||
| 2675 | operations, and @kbd{M-@key{DEL}} which unmarks all the marked files. | ||
| 2676 | Also, the @kbd{a} key toggles the display of detailed file | ||
| 2677 | information, for those archive types where it won't fit in a single | ||
| 2678 | line. Operations such as renaming a subfile, or changing its mode or | ||
| 2679 | owner, are supported only for some of the archive formats. | ||
| 2680 | |||
| 2681 | Unlike Tar mode, Archive mode runs the archiving program to unpack | ||
| 2682 | and repack archives. Details of the program names and their options | ||
| 2683 | can be set in the @samp{Archive} Customize group. However, you don't | ||
| 2684 | need these programs to look at the archive table of contents, only to | ||
| 2685 | extract or manipulate the subfiles in the archive. | ||
| 2686 | |||
| 2687 | @node Remote Files | ||
| 2688 | @section Remote Files | ||
| 2689 | |||
| 2690 | @cindex Tramp | ||
| 2691 | @cindex FTP | ||
| 2692 | @cindex remote file access | ||
| 2693 | You can refer to files on other machines using a special file name | ||
| 2694 | syntax: | ||
| 2695 | |||
| 2696 | @example | ||
| 2697 | @group | ||
| 2698 | /@var{host}:@var{filename} | ||
| 2699 | /@var{user}@@@var{host}:@var{filename} | ||
| 2700 | /@var{user}@@@var{host}#@var{port}:@var{filename} | ||
| 2701 | /@var{method}:@var{user}@@@var{host}:@var{filename} | ||
| 2702 | /@var{method}:@var{user}@@@var{host}#@var{port}:@var{filename} | ||
| 2703 | @end group | ||
| 2704 | @end example | ||
| 2705 | |||
| 2706 | @noindent | ||
| 2707 | To carry out this request, Emacs uses either the FTP program or a | ||
| 2708 | remote-login program such as @command{ssh}, @command{rlogin}, or | ||
| 2709 | @command{telnet}. You can always specify in the file name which | ||
| 2710 | method to use---for example, | ||
| 2711 | @file{/ftp:@var{user}@@@var{host}:@var{filename}} uses FTP, whereas | ||
| 2712 | @file{/ssh:@var{user}@@@var{host}:@var{filename}} uses @command{ssh}. | ||
| 2713 | When you don't specify a method in the file name, Emacs chooses | ||
| 2714 | the method as follows: | ||
| 2715 | |||
| 2716 | @enumerate | ||
| 2717 | @item | ||
| 2718 | If the host name starts with @samp{ftp.} (with dot), then Emacs uses | ||
| 2719 | FTP. | ||
| 2720 | @item | ||
| 2721 | If the user name is @samp{ftp} or @samp{anonymous}, then Emacs uses | ||
| 2722 | FTP. | ||
| 2723 | @item | ||
| 2724 | Otherwise, Emacs uses @command{ssh}. | ||
| 2725 | @end enumerate | ||
| 2726 | |||
| 2727 | @noindent | ||
| 2728 | Remote file access through FTP is handled by the Ange-FTP package, which | ||
| 2729 | is documented in the following. Remote file access through the other | ||
| 2730 | methods is handled by the Tramp package, which has its own manual. | ||
| 2731 | @xref{Top, The Tramp Manual,, tramp, The Tramp Manual}. | ||
| 2732 | |||
| 2733 | When the Ange-FTP package is used, Emacs logs in through FTP using your | ||
| 2734 | user name or the name @var{user}. It may ask you for a password from | ||
| 2735 | time to time; this is used for logging in on @var{host}. The form using | ||
| 2736 | @var{port} allows you to access servers running on a non-default TCP | ||
| 2737 | port. | ||
| 2738 | |||
| 2739 | @cindex backups for remote files | ||
| 2740 | @vindex ange-ftp-make-backup-files | ||
| 2741 | If you want to disable backups for remote files, set the variable | ||
| 2742 | @code{ange-ftp-make-backup-files} to @code{nil}. | ||
| 2743 | |||
| 2744 | By default, the auto-save files (@pxref{Auto Save Files}) for remote | ||
| 2745 | files are made in the temporary file directory on the local machine. | ||
| 2746 | This is achieved using the variable @code{auto-save-file-name-transforms}. | ||
| 2747 | |||
| 2748 | @cindex ange-ftp | ||
| 2749 | @vindex ange-ftp-default-user | ||
| 2750 | @cindex user name for remote file access | ||
| 2751 | Normally, if you do not specify a user name in a remote file name, | ||
| 2752 | that means to use your own user name. But if you set the variable | ||
| 2753 | @code{ange-ftp-default-user} to a string, that string is used instead. | ||
| 2754 | |||
| 2755 | @cindex anonymous FTP | ||
| 2756 | @vindex ange-ftp-generate-anonymous-password | ||
| 2757 | To visit files accessible by anonymous FTP, you use special user | ||
| 2758 | names @samp{anonymous} or @samp{ftp}. Passwords for these user names | ||
| 2759 | are handled specially. The variable | ||
| 2760 | @code{ange-ftp-generate-anonymous-password} controls what happens: if | ||
| 2761 | the value of this variable is a string, then that string is used as | ||
| 2762 | the password; if non-@code{nil} (the default), then the value of | ||
| 2763 | @code{user-mail-address} is used; if @code{nil}, then Emacs prompts | ||
| 2764 | you for a password as usual. | ||
| 2765 | |||
| 2766 | @cindex firewall, and accessing remote files | ||
| 2767 | @cindex gateway, and remote file access with @code{ange-ftp} | ||
| 2768 | @vindex ange-ftp-smart-gateway | ||
| 2769 | @vindex ange-ftp-gateway-host | ||
| 2770 | Sometimes you may be unable to access files on a remote machine | ||
| 2771 | because a @dfn{firewall} in between blocks the connection for security | ||
| 2772 | reasons. If you can log in on a @dfn{gateway} machine from which the | ||
| 2773 | target files @emph{are} accessible, and whose FTP server supports | ||
| 2774 | gatewaying features, you can still use remote file names; all you have | ||
| 2775 | to do is specify the name of the gateway machine by setting the | ||
| 2776 | variable @code{ange-ftp-gateway-host}, and set | ||
| 2777 | @code{ange-ftp-smart-gateway} to @code{t}. Otherwise you may be able | ||
| 2778 | to make remote file names work, but the procedure is complex. You can | ||
| 2779 | read the instructions by typing @kbd{M-x finder-commentary @key{RET} | ||
| 2780 | ange-ftp @key{RET}}. | ||
| 2781 | |||
| 2782 | @vindex file-name-handler-alist | ||
| 2783 | @cindex disabling remote files | ||
| 2784 | You can entirely turn off the FTP file name feature by removing the | ||
| 2785 | entries @code{ange-ftp-completion-hook-function} and | ||
| 2786 | @code{ange-ftp-hook-function} from the variable | ||
| 2787 | @code{file-name-handler-alist}. You can turn off the feature in | ||
| 2788 | individual cases by quoting the file name with @samp{/:} (@pxref{Quoted | ||
| 2789 | File Names}). | ||
| 2790 | |||
| 2791 | @node Quoted File Names | ||
| 2792 | @section Quoted File Names | ||
| 2793 | |||
| 2794 | @cindex quoting file names | ||
| 2795 | @cindex file names, quote special characters | ||
| 2796 | You can @dfn{quote} an absolute file name to prevent special | ||
| 2797 | characters and syntax in it from having their special effects. | ||
| 2798 | The way to do this is to add @samp{/:} at the beginning. | ||
| 2799 | |||
| 2800 | For example, you can quote a local file name which appears remote, to | ||
| 2801 | prevent it from being treated as a remote file name. Thus, if you have | ||
| 2802 | a directory named @file{/foo:} and a file named @file{bar} in it, you | ||
| 2803 | can refer to that file in Emacs as @samp{/:/foo:/bar}. | ||
| 2804 | |||
| 2805 | @samp{/:} can also prevent @samp{~} from being treated as a special | ||
| 2806 | character for a user's home directory. For example, @file{/:/tmp/~hack} | ||
| 2807 | refers to a file whose name is @file{~hack} in directory @file{/tmp}. | ||
| 2808 | |||
| 2809 | Quoting with @samp{/:} is also a way to enter in the minibuffer a | ||
| 2810 | file name that contains @samp{$}. In order for this to work, the | ||
| 2811 | @samp{/:} must be at the beginning of the minibuffer contents. (You | ||
| 2812 | can also double each @samp{$}; see @ref{File Names with $}.) | ||
| 2813 | |||
| 2814 | You can also quote wildcard characters with @samp{/:}, for visiting. | ||
| 2815 | For example, @file{/:/tmp/foo*bar} visits the file | ||
| 2816 | @file{/tmp/foo*bar}. | ||
| 2817 | |||
| 2818 | Another method of getting the same result is to enter | ||
| 2819 | @file{/tmp/foo[*]bar}, which is a wildcard specification that matches | ||
| 2820 | only @file{/tmp/foo*bar}. However, in many cases there is no need to | ||
| 2821 | quote the wildcard characters because even unquoted they give the | ||
| 2822 | right result. For example, if the only file name in @file{/tmp} that | ||
| 2823 | starts with @samp{foo} and ends with @samp{bar} is @file{foo*bar}, | ||
| 2824 | then specifying @file{/tmp/foo*bar} will visit only | ||
| 2825 | @file{/tmp/foo*bar}. | ||
| 2826 | |||
| 2827 | @node File Name Cache | ||
| 2828 | @section File Name Cache | ||
| 2829 | |||
| 2830 | @cindex file name caching | ||
| 2831 | @cindex cache of file names | ||
| 2832 | @pindex find | ||
| 2833 | @kindex C-@key{TAB} | ||
| 2834 | @findex file-cache-minibuffer-complete | ||
| 2835 | You can use the @dfn{file name cache} to make it easy to locate a | ||
| 2836 | file by name, without having to remember exactly where it is located. | ||
| 2837 | When typing a file name in the minibuffer, @kbd{C-@key{tab}} | ||
| 2838 | (@code{file-cache-minibuffer-complete}) completes it using the file | ||
| 2839 | name cache. If you repeat @kbd{C-@key{tab}}, that cycles through the | ||
| 2840 | possible completions of what you had originally typed. (However, note | ||
| 2841 | that the @kbd{C-@key{tab}} character cannot be typed on most text-only | ||
| 2842 | terminals.) | ||
| 2843 | |||
| 2844 | The file name cache does not fill up automatically. Instead, you | ||
| 2845 | load file names into the cache using these commands: | ||
| 2846 | |||
| 2847 | @findex file-cache-add-directory | ||
| 2848 | @table @kbd | ||
| 2849 | @item M-x file-cache-add-directory @key{RET} @var{directory} @key{RET} | ||
| 2850 | Add each file name in @var{directory} to the file name cache. | ||
| 2851 | @item M-x file-cache-add-directory-using-find @key{RET} @var{directory} @key{RET} | ||
| 2852 | Add each file name in @var{directory} and all of its nested | ||
| 2853 | subdirectories to the file name cache. | ||
| 2854 | @item M-x file-cache-add-directory-using-locate @key{RET} @var{directory} @key{RET} | ||
| 2855 | Add each file name in @var{directory} and all of its nested | ||
| 2856 | subdirectories to the file name cache, using @command{locate} to find | ||
| 2857 | them all. | ||
| 2858 | @item M-x file-cache-add-directory-list @key{RET} @var{variable} @key{RET} | ||
| 2859 | Add each file name in each directory listed in @var{variable} | ||
| 2860 | to the file name cache. @var{variable} should be a Lisp variable | ||
| 2861 | such as @code{load-path} or @code{exec-path}, whose value is a list | ||
| 2862 | of directory names. | ||
| 2863 | @item M-x file-cache-clear-cache @key{RET} | ||
| 2864 | Clear the cache; that is, remove all file names from it. | ||
| 2865 | @end table | ||
| 2866 | |||
| 2867 | The file name cache is not persistent: it is kept and maintained | ||
| 2868 | only for the duration of the Emacs session. You can view the contents | ||
| 2869 | of the cache with the @code{file-cache-display} command. | ||
| 2870 | |||
| 2871 | @node File Conveniences | ||
| 2872 | @section Convenience Features for Finding Files | ||
| 2873 | |||
| 2874 | In this section, we introduce some convenient facilities for finding | ||
| 2875 | recently-opened files, reading file names from a buffer, and viewing | ||
| 2876 | image files. | ||
| 2877 | |||
| 2878 | @findex recentf-mode | ||
| 2879 | @vindex recentf-mode | ||
| 2880 | @findex recentf-save-list | ||
| 2881 | @findex recentf-edit-list | ||
| 2882 | If you enable Recentf mode, with @kbd{M-x recentf-mode}, the | ||
| 2883 | @samp{File} menu includes a submenu containing a list of recently | ||
| 2884 | opened files. @kbd{M-x recentf-save-list} saves the current | ||
| 2885 | @code{recent-file-list} to a file, and @kbd{M-x recentf-edit-list} | ||
| 2886 | edits it. | ||
| 2887 | |||
| 2888 | The @kbd{M-x ffap} command generalizes @code{find-file} with more | ||
| 2889 | powerful heuristic defaults (@pxref{FFAP}), often based on the text at | ||
| 2890 | point. Partial Completion mode offers other features extending | ||
| 2891 | @code{find-file}, which can be used with @code{ffap}. | ||
| 2892 | @xref{Completion Options}. | ||
| 2893 | |||
| 2894 | @findex image-mode | ||
| 2895 | @findex image-toggle-display | ||
| 2896 | @cindex images, viewing | ||
| 2897 | Visiting image files automatically selects Image mode. This major | ||
| 2898 | mode allows you to toggle between displaying the file as an image in | ||
| 2899 | the Emacs buffer, and displaying its underlying text representation, | ||
| 2900 | using the command @kbd{C-c C-c} (@code{image-toggle-display}). This | ||
| 2901 | works only when Emacs can display the specific image type. If the | ||
| 2902 | displayed image is wider or taller than the frame, the usual point | ||
| 2903 | motion keys (@kbd{C-f}, @kbd{C-p}, and so forth) cause different parts | ||
| 2904 | of the image to be displayed. | ||
| 2905 | |||
| 2906 | @findex thumbs-mode | ||
| 2907 | @findex mode, thumbs | ||
| 2908 | See also the Image-Dired package (@pxref{Image-Dired}) for viewing | ||
| 2909 | images as thumbnails. | ||
| 2910 | |||
| 2911 | @node Filesets | ||
| 2912 | @section Filesets | ||
| 2913 | @cindex filesets | ||
| 2914 | |||
| 2915 | @findex filesets-init | ||
| 2916 | If you regularly edit a certain group of files, you can define them | ||
| 2917 | as a @dfn{fileset}. This lets you perform certain operations, such as | ||
| 2918 | visiting, @code{query-replace}, and shell commands on all the files | ||
| 2919 | at once. To make use of filesets, you must first add the expression | ||
| 2920 | @code{(filesets-init)} to your @file{.emacs} file (@pxref{Init File}). | ||
| 2921 | This adds a @samp{Filesets} menu to the menu bar. | ||
| 2922 | |||
| 2923 | @findex filesets-add-buffer | ||
| 2924 | @findex filesets-remove-buffer | ||
| 2925 | The simplest way to define a fileset is by adding files to it one | ||
| 2926 | at a time. To add a file to fileset @var{name}, visit the file and | ||
| 2927 | type @kbd{M-x filesets-add-buffer @kbd{RET} @var{name} @kbd{RET}}. If | ||
| 2928 | there is no fileset @var{name}, this creates a new one, which | ||
| 2929 | initially creates only the current file. The command @kbd{M-x | ||
| 2930 | filesets-remove-buffer} removes the current file from a fileset. | ||
| 2931 | |||
| 2932 | You can also edit the list of filesets directly, with @kbd{M-x | ||
| 2933 | filesets-edit} (or by choosing @samp{Edit Filesets} from the | ||
| 2934 | @samp{Filesets} menu). The editing is performed in a Customize buffer | ||
| 2935 | (@pxref{Easy Customization}). Filesets need not be a simple list of | ||
| 2936 | files---you can also define filesets using regular expression matching | ||
| 2937 | file names. Some examples of these more complicated filesets are | ||
| 2938 | shown in the Customize buffer. Remember to select @samp{Save for | ||
| 2939 | future sessions} if you want to use the same filesets in future Emacs | ||
| 2940 | sessions. | ||
| 2941 | |||
| 2942 | You can use the command @kbd{M-x filesets-open} to visit all the | ||
| 2943 | files in a fileset, and @kbd{M-x filesets-close} to close them. Use | ||
| 2944 | @kbd{M-x filesets-run-cmd} to run a shell command on all the files in | ||
| 2945 | a fileset. These commands are also available from the @samp{Filesets} | ||
| 2946 | menu, where each existing fileset is represented by a submenu. | ||
| 2947 | |||
| 2948 | @ignore | ||
| 2949 | arch-tag: 768d32cb-e15a-4cc1-b7bf-62c00ee12250 | ||
| 2950 | @end ignore | ||
diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi new file mode 100644 index 00000000000..d1577e2f528 --- /dev/null +++ b/doc/emacs/fixit.texi | |||
| @@ -0,0 +1,471 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Fixit, Keyboard Macros, Search, Top | ||
| 6 | @chapter Commands for Fixing Typos | ||
| 7 | @cindex typos, fixing | ||
| 8 | @cindex mistakes, correcting | ||
| 9 | |||
| 10 | In this chapter we describe the commands that are especially useful for | ||
| 11 | the times when you catch a mistake in your text just after you have made | ||
| 12 | it, or change your mind while composing text on the fly. | ||
| 13 | |||
| 14 | The most fundamental command for correcting erroneous editing is the | ||
| 15 | undo command, @kbd{C-x u} or @kbd{C-_} or @kbd{C-/}. This command | ||
| 16 | undoes a single command (usually), a part of a command (in the case of | ||
| 17 | @code{query-replace}), or several consecutive self-inserting | ||
| 18 | characters. Consecutive repetitions of the undo command undo earlier | ||
| 19 | and earlier changes, back to the limit of the undo information | ||
| 20 | available. @xref{Undo}, for more information. | ||
| 21 | |||
| 22 | @menu | ||
| 23 | * Undo:: The Undo commands. | ||
| 24 | * Kill Errors:: Commands to kill a batch of recently entered text. | ||
| 25 | * Transpose:: Exchanging two characters, words, lines, lists... | ||
| 26 | * Fixing Case:: Correcting case of last word entered. | ||
| 27 | * Spelling:: Apply spelling checker to a word, or a whole file. | ||
| 28 | @end menu | ||
| 29 | |||
| 30 | @node Undo | ||
| 31 | @section Undo | ||
| 32 | @cindex undo | ||
| 33 | @cindex changes, undoing | ||
| 34 | |||
| 35 | The @dfn{undo} commands undo recent changes in the buffer's text. | ||
| 36 | Each buffer records changes individually, and the undo command always | ||
| 37 | applies to the current buffer. You can undo all the changes in a | ||
| 38 | buffer for as far as back these records go. Usually each editing | ||
| 39 | command makes a separate entry in the undo records, but some commands | ||
| 40 | such as @code{query-replace} divide their changes into multiple | ||
| 41 | entries for flexibility in undoing. Meanwhile, self-inserting | ||
| 42 | characters are usually grouped to make undoing less tedious. | ||
| 43 | |||
| 44 | @table @kbd | ||
| 45 | @item C-x u | ||
| 46 | @itemx C-_ | ||
| 47 | @itemx C-/ | ||
| 48 | Undo one entry in the current buffer's undo records (@code{undo}). | ||
| 49 | @end table | ||
| 50 | |||
| 51 | @kindex C-x u | ||
| 52 | @kindex C-_ | ||
| 53 | @kindex C-/ | ||
| 54 | @findex undo | ||
| 55 | To begin to undo, type the command @kbd{C-x u} (or its aliases, | ||
| 56 | @kbd{C-_} or @kbd{C-/}). This undoes the most recent change in the | ||
| 57 | buffer, and moves point back to where it was before that change. | ||
| 58 | |||
| 59 | Consecutive repetitions of @kbd{C-x u} (or its aliases) undo earlier | ||
| 60 | and earlier changes in the current buffer, back to the limit of the | ||
| 61 | current buffer's undo records. If all the recorded changes have | ||
| 62 | already been undone, the undo command just signals an error. | ||
| 63 | |||
| 64 | If you notice that a buffer has been modified accidentally, the | ||
| 65 | easiest way to recover is to type @kbd{C-_} repeatedly until the stars | ||
| 66 | disappear from the front of the mode line. At this time, all the | ||
| 67 | modifications you made have been canceled. Whenever an undo command | ||
| 68 | makes the stars disappear from the mode line, it means that the buffer | ||
| 69 | contents are the same as they were when the file was last read in or | ||
| 70 | saved. | ||
| 71 | |||
| 72 | If you do not remember whether you changed the buffer deliberately, | ||
| 73 | type @kbd{C-_} once. When you see the last change you made undone, you | ||
| 74 | will see whether it was an intentional change. If it was an accident, | ||
| 75 | leave it undone. If it was deliberate, redo the change as described | ||
| 76 | below. | ||
| 77 | |||
| 78 | @findex undo-only | ||
| 79 | Any command other than an undo command breaks the sequence of undo | ||
| 80 | commands. Starting from that moment, the previous undo commands | ||
| 81 | become ordinary changes that you can undo. Thus, to redo changes you | ||
| 82 | have undone, type @kbd{C-f} or any other command that will harmlessly | ||
| 83 | break the sequence of undoing, then type undo commands again. On the | ||
| 84 | other hand, if you want to resume undoing, without redoing previous | ||
| 85 | undo commands, use @kbd{M-x undo-only}. This is like @code{undo}, but | ||
| 86 | will not redo changes you have just undone. | ||
| 87 | |||
| 88 | @cindex selective undo | ||
| 89 | @kindex C-u C-x u | ||
| 90 | Ordinary undo applies to all changes made in the current buffer. You | ||
| 91 | can also perform @dfn{selective undo}, limited to the region. | ||
| 92 | |||
| 93 | To do this, specify the region you want, then run the @code{undo} | ||
| 94 | command with a prefix argument (the value does not matter): @kbd{C-u | ||
| 95 | C-x u} or @kbd{C-u C-_}. This undoes the most recent change in the | ||
| 96 | region. To undo further changes in the same region, repeat the | ||
| 97 | @code{undo} command (no prefix argument is needed). In Transient Mark | ||
| 98 | mode (@pxref{Transient Mark}), any use of @code{undo} when there is an | ||
| 99 | active region performs selective undo; you do not need a prefix | ||
| 100 | argument. | ||
| 101 | |||
| 102 | Some specialized buffers do not make undo records. Buffers | ||
| 103 | whose names start with spaces never do; these buffers are used | ||
| 104 | internally by Emacs and its extensions to hold text that users don't | ||
| 105 | normally look at or edit. | ||
| 106 | |||
| 107 | @vindex undo-limit | ||
| 108 | @vindex undo-strong-limit | ||
| 109 | @vindex undo-outer-limit | ||
| 110 | @cindex undo limit | ||
| 111 | When the undo records for a buffer becomes too large, Emacs | ||
| 112 | discards the oldest undo records from time to time (during garbage | ||
| 113 | collection). You can specify how much undo records to keep by | ||
| 114 | setting three variables: @code{undo-limit}, @code{undo-strong-limit}, | ||
| 115 | and @code{undo-outer-limit}. Their values are expressed in units of | ||
| 116 | bytes of space. | ||
| 117 | |||
| 118 | The variable @code{undo-limit} sets a soft limit: Emacs keeps undo | ||
| 119 | data for enough commands to reach this size, and perhaps exceed it, | ||
| 120 | but does not keep data for any earlier commands beyond that. Its | ||
| 121 | default value is 20000. The variable @code{undo-strong-limit} sets a | ||
| 122 | stricter limit: a previous command (not the most recent one) which | ||
| 123 | pushes the size past this amount is itself forgotten. The default | ||
| 124 | value of @code{undo-strong-limit} is 30000. | ||
| 125 | |||
| 126 | Regardless of the values of those variables, the most recent change | ||
| 127 | is never discarded unless it gets bigger than @code{undo-outer-limit} | ||
| 128 | (normally 3,000,000). At that point, Emacs discards the undo data and | ||
| 129 | warns you about it. This is the only situation in which you cannot | ||
| 130 | undo the last command. If this happens, you can increase the value of | ||
| 131 | @code{undo-outer-limit} to make it even less likely to happen in the | ||
| 132 | future. But if you didn't expect the command to create such large | ||
| 133 | undo data, then it is probably a bug and you should report it. | ||
| 134 | @xref{Bugs,, Reporting Bugs}. | ||
| 135 | |||
| 136 | The reason the @code{undo} command has three key bindings, @kbd{C-x | ||
| 137 | u}, @kbd{C-_} and @kbd{C-/}, is that it is worthy of a | ||
| 138 | single-character key, but @kbd{C-x u} is more straightforward for | ||
| 139 | beginners to remember and type. Meanwhile, @kbd{C--} on a text-only | ||
| 140 | terminal is really @kbd{C-_}, which makes it a natural and easily | ||
| 141 | typed binding for undoing. | ||
| 142 | |||
| 143 | @node Kill Errors | ||
| 144 | @section Killing Your Mistakes | ||
| 145 | |||
| 146 | @table @kbd | ||
| 147 | @item @key{DEL} | ||
| 148 | Delete last character (@code{delete-backward-char}). | ||
| 149 | @item M-@key{DEL} | ||
| 150 | Kill last word (@code{backward-kill-word}). | ||
| 151 | @item C-x @key{DEL} | ||
| 152 | Kill to beginning of sentence (@code{backward-kill-sentence}). | ||
| 153 | @end table | ||
| 154 | |||
| 155 | The @key{DEL} character (@code{delete-backward-char}) is the most | ||
| 156 | important correction command. It deletes the character before point. | ||
| 157 | When @key{DEL} follows a self-inserting character command, you can think | ||
| 158 | of it as canceling that command. However, avoid the confusion of thinking | ||
| 159 | of @key{DEL} as a general way to cancel a command! | ||
| 160 | |||
| 161 | When your mistake is longer than a couple of characters, it might be | ||
| 162 | more convenient to use @kbd{M-@key{DEL}} or @kbd{C-x @key{DEL}}. | ||
| 163 | @kbd{M-@key{DEL}} kills back to the start of the last word, and @kbd{C-x | ||
| 164 | @key{DEL}} kills back to the start of the last sentence. @kbd{C-x | ||
| 165 | @key{DEL}} is particularly useful when you change your mind about the | ||
| 166 | phrasing of the text you are writing. @kbd{M-@key{DEL}} and @kbd{C-x | ||
| 167 | @key{DEL}} save the killed text for @kbd{C-y} and @kbd{M-y} to | ||
| 168 | retrieve. @xref{Yanking}.@refill | ||
| 169 | |||
| 170 | @kbd{M-@key{DEL}} is often useful even when you have typed only a few | ||
| 171 | characters wrong, if you know you are confused in your typing and aren't | ||
| 172 | sure exactly what you typed. At such a time, you cannot correct with | ||
| 173 | @key{DEL} except by looking at the screen to see what you did. Often it | ||
| 174 | requires less thought to kill the whole word and start again. | ||
| 175 | |||
| 176 | @node Transpose | ||
| 177 | @section Transposing Text | ||
| 178 | |||
| 179 | @table @kbd | ||
| 180 | @item C-t | ||
| 181 | Transpose two characters (@code{transpose-chars}). | ||
| 182 | @item M-t | ||
| 183 | Transpose two words (@code{transpose-words}). | ||
| 184 | @item C-M-t | ||
| 185 | Transpose two balanced expressions (@code{transpose-sexps}). | ||
| 186 | @item C-x C-t | ||
| 187 | Transpose two lines (@code{transpose-lines}). | ||
| 188 | @end table | ||
| 189 | |||
| 190 | @kindex C-t | ||
| 191 | @findex transpose-chars | ||
| 192 | The common error of transposing two characters can be fixed, when they | ||
| 193 | are adjacent, with the @kbd{C-t} command (@code{transpose-chars}). Normally, | ||
| 194 | @kbd{C-t} transposes the two characters on either side of point. When | ||
| 195 | given at the end of a line, rather than transposing the last character of | ||
| 196 | the line with the newline, which would be useless, @kbd{C-t} transposes the | ||
| 197 | last two characters on the line. So, if you catch your transposition error | ||
| 198 | right away, you can fix it with just a @kbd{C-t}. If you don't catch it so | ||
| 199 | fast, you must move the cursor back between the two transposed | ||
| 200 | characters before you type @kbd{C-t}. If you transposed a space with | ||
| 201 | the last character of the word before it, the word motion commands are | ||
| 202 | a good way of getting there. Otherwise, a reverse search (@kbd{C-r}) | ||
| 203 | is often the best way. @xref{Search}. | ||
| 204 | |||
| 205 | @kindex C-x C-t | ||
| 206 | @findex transpose-lines | ||
| 207 | @kindex M-t | ||
| 208 | @findex transpose-words | ||
| 209 | @c Don't index C-M-t and transpose-sexps here, they are indexed in | ||
| 210 | @c programs.texi, in the "List Commands" node. | ||
| 211 | @c @kindex C-M-t | ||
| 212 | @c @findex transpose-sexps | ||
| 213 | @kbd{M-t} transposes the word before point with the word after point | ||
| 214 | (@code{transpose-words}). It moves point forward over a word, | ||
| 215 | dragging the word preceding or containing point forward as well. The | ||
| 216 | punctuation characters between the words do not move. For example, | ||
| 217 | @w{@samp{FOO, BAR}} transposes into @w{@samp{BAR, FOO}} rather than | ||
| 218 | @samp{@w{BAR FOO,}}. | ||
| 219 | |||
| 220 | @kbd{C-M-t} (@code{transpose-sexps}) is a similar command for | ||
| 221 | transposing two expressions (@pxref{Expressions}), and @kbd{C-x C-t} | ||
| 222 | (@code{transpose-lines}) exchanges lines. They work like @kbd{M-t} | ||
| 223 | except as regards what units of text they transpose. | ||
| 224 | |||
| 225 | A numeric argument to a transpose command serves as a repeat count: it | ||
| 226 | tells the transpose command to move the character (word, expression, line) | ||
| 227 | before or containing point across several other characters (words, | ||
| 228 | expressions, lines). For example, @kbd{C-u 3 C-t} moves the character before | ||
| 229 | point forward across three other characters. It would change | ||
| 230 | @samp{f@point{}oobar} into @samp{oobf@point{}ar}. This is equivalent to | ||
| 231 | repeating @kbd{C-t} three times. @kbd{C-u - 4 M-t} moves the word | ||
| 232 | before point backward across four words. @kbd{C-u - C-M-t} would cancel | ||
| 233 | the effect of plain @kbd{C-M-t}.@refill | ||
| 234 | |||
| 235 | A numeric argument of zero is assigned a special meaning (because | ||
| 236 | otherwise a command with a repeat count of zero would do nothing): to | ||
| 237 | transpose the character (word, expression, line) ending after point | ||
| 238 | with the one ending after the mark. | ||
| 239 | |||
| 240 | @node Fixing Case | ||
| 241 | @section Case Conversion | ||
| 242 | |||
| 243 | @table @kbd | ||
| 244 | @item M-- M-l | ||
| 245 | Convert last word to lower case. Note @kbd{Meta--} is Meta-minus. | ||
| 246 | @item M-- M-u | ||
| 247 | Convert last word to all upper case. | ||
| 248 | @item M-- M-c | ||
| 249 | Convert last word to lower case with capital initial. | ||
| 250 | @end table | ||
| 251 | |||
| 252 | @kindex M-@t{-} M-l | ||
| 253 | @kindex M-@t{-} M-u | ||
| 254 | @kindex M-@t{-} M-c | ||
| 255 | A very common error is to type words in the wrong case. Because of this, | ||
| 256 | the word case-conversion commands @kbd{M-l}, @kbd{M-u} and @kbd{M-c} have a | ||
| 257 | special feature when used with a negative argument: they do not move the | ||
| 258 | cursor. As soon as you see you have mistyped the last word, you can simply | ||
| 259 | case-convert it and go on typing. @xref{Case}.@refill | ||
| 260 | |||
| 261 | @node Spelling | ||
| 262 | @section Checking and Correcting Spelling | ||
| 263 | @cindex spelling, checking and correcting | ||
| 264 | @cindex checking spelling | ||
| 265 | @cindex correcting spelling | ||
| 266 | |||
| 267 | This section describes the commands to check the spelling of a single | ||
| 268 | word or of a portion of a buffer. These commands work with the spelling | ||
| 269 | checker programs Aspell and Ispell, which are not part of Emacs. | ||
| 270 | @ifnottex | ||
| 271 | @xref{Top, Aspell,, aspell, The Aspell Manual}. | ||
| 272 | @end ifnottex | ||
| 273 | |||
| 274 | @table @kbd | ||
| 275 | @item M-x flyspell-mode | ||
| 276 | Enable Flyspell mode, which highlights all misspelled words. | ||
| 277 | @item M-x flyspell-prog-mode | ||
| 278 | Enable Flyspell mode for comments and strings only. | ||
| 279 | @item M-$ | ||
| 280 | Check and correct spelling of the word at point (@code{ispell-word}). | ||
| 281 | @item M-@key{TAB} | ||
| 282 | @itemx @key{ESC} @key{TAB} | ||
| 283 | Complete the word before point based on the spelling dictionary | ||
| 284 | (@code{ispell-complete-word}). | ||
| 285 | @item M-x ispell | ||
| 286 | Spell-check the active region or the current buffer. | ||
| 287 | @item M-x ispell-buffer | ||
| 288 | Check and correct spelling of each word in the buffer. | ||
| 289 | @item M-x ispell-region | ||
| 290 | Check and correct spelling of each word in the region. | ||
| 291 | @item M-x ispell-message | ||
| 292 | Check and correct spelling of each word in a draft mail message, | ||
| 293 | excluding cited material. | ||
| 294 | @item M-x ispell-change-dictionary @key{RET} @var{dict} @key{RET} | ||
| 295 | Restart the Aspell or Ispell process, using @var{dict} as the dictionary. | ||
| 296 | @item M-x ispell-kill-ispell | ||
| 297 | Kill the Aspell or Ispell subprocess. | ||
| 298 | @end table | ||
| 299 | |||
| 300 | @cindex Flyspell mode | ||
| 301 | @findex flyspell-mode | ||
| 302 | Flyspell mode is a fully-automatic way to check spelling as you edit | ||
| 303 | in Emacs. It operates by checking words as you change or insert them. | ||
| 304 | When it finds a word that it does not recognize, it highlights that | ||
| 305 | word. This does not interfere with your editing, but when you see the | ||
| 306 | highlighted word, you can move to it and fix it. Type @kbd{M-x | ||
| 307 | flyspell-mode} to enable or disable this mode in the current buffer. | ||
| 308 | |||
| 309 | When Flyspell mode highlights a word as misspelled, you can click on | ||
| 310 | it with @kbd{Mouse-2} to display a menu of possible corrections and | ||
| 311 | actions. You can also correct the word by editing it manually in any | ||
| 312 | way you like. | ||
| 313 | |||
| 314 | @findex flyspell-prog-mode | ||
| 315 | Flyspell Prog mode works just like ordinary Flyspell mode, except that | ||
| 316 | it only checks words in comments and string constants. This feature | ||
| 317 | is useful for editing programs. Type @kbd{M-x flyspell-prog-mode} to | ||
| 318 | enable or disable this mode in the current buffer. | ||
| 319 | |||
| 320 | The other Emacs spell-checking features check or look up words when | ||
| 321 | you give an explicit command to do so. | ||
| 322 | |||
| 323 | @kindex M-$ | ||
| 324 | @findex ispell-word | ||
| 325 | To check the spelling of the word around or before point, and | ||
| 326 | optionally correct it as well, use the command @kbd{M-$} | ||
| 327 | (@code{ispell-word}). If the word is not correct, the command offers | ||
| 328 | you various alternatives for what to do about it. | ||
| 329 | |||
| 330 | @findex ispell-buffer | ||
| 331 | @findex ispell-region | ||
| 332 | To check the entire current buffer, use @kbd{M-x ispell-buffer}. Use | ||
| 333 | @kbd{M-x ispell-region} to check just the current region. To check | ||
| 334 | spelling in an email message you are writing, use @kbd{M-x | ||
| 335 | ispell-message}; that command checks the whole buffer, except for | ||
| 336 | material that is indented or appears to be cited from other messages. | ||
| 337 | |||
| 338 | @findex ispell | ||
| 339 | @cindex spell-checking the active region | ||
| 340 | The @kbd{M-x ispell} command spell-checks the active region if the | ||
| 341 | Transient Mark mode is on (@pxref{Transient Mark}), otherwise it | ||
| 342 | spell-checks the current buffer. | ||
| 343 | |||
| 344 | Each time these commands encounter an incorrect word, they ask you | ||
| 345 | what to do. They display a list of alternatives, usually including | ||
| 346 | several ``near-misses''---words that are close to the word being | ||
| 347 | checked. Then you must type a single-character response. Here are | ||
| 348 | the valid responses: | ||
| 349 | |||
| 350 | @table @kbd | ||
| 351 | @item @key{SPC} | ||
| 352 | Skip this word---continue to consider it incorrect, but don't change it | ||
| 353 | here. | ||
| 354 | |||
| 355 | @item r @var{new} @key{RET} | ||
| 356 | Replace the word (just this time) with @var{new}. (The replacement | ||
| 357 | string will be rescanned for more spelling errors.) | ||
| 358 | |||
| 359 | @item R @var{new} @key{RET} | ||
| 360 | Replace the word with @var{new}, and do a @code{query-replace} so you | ||
| 361 | can replace it elsewhere in the buffer if you wish. (The replacements | ||
| 362 | will be rescanned for more spelling errors.) | ||
| 363 | |||
| 364 | @item @var{digit} | ||
| 365 | Replace the word (just this time) with one of the displayed | ||
| 366 | near-misses. Each near-miss is listed with a digit; type that digit to | ||
| 367 | select it. | ||
| 368 | |||
| 369 | @item a | ||
| 370 | Accept the incorrect word---treat it as correct, but only in this | ||
| 371 | editing session. | ||
| 372 | |||
| 373 | @item A | ||
| 374 | Accept the incorrect word---treat it as correct, but only in this | ||
| 375 | editing session and for this buffer. | ||
| 376 | |||
| 377 | @item i | ||
| 378 | Insert this word in your private dictionary file so that Aspell or Ispell will | ||
| 379 | consider it correct from now on, even in future sessions. | ||
| 380 | |||
| 381 | @item u | ||
| 382 | Insert the lower-case version of this word in your private dic@-tion@-ary | ||
| 383 | file. | ||
| 384 | |||
| 385 | @item m | ||
| 386 | Like @kbd{i}, but you can also specify dictionary completion | ||
| 387 | information. | ||
| 388 | |||
| 389 | @item l @var{word} @key{RET} | ||
| 390 | Look in the dictionary for words that match @var{word}. These words | ||
| 391 | become the new list of ``near-misses''; you can select one of them as | ||
| 392 | the replacement by typing a digit. You can use @samp{*} in @var{word} as a | ||
| 393 | wildcard. | ||
| 394 | |||
| 395 | @item C-g | ||
| 396 | Quit interactive spell checking, leaving point at the word that was | ||
| 397 | being checked. You can restart checking again afterward with @kbd{C-u | ||
| 398 | M-$}. | ||
| 399 | |||
| 400 | @item X | ||
| 401 | Same as @kbd{C-g}. | ||
| 402 | |||
| 403 | @item x | ||
| 404 | Quit interactive spell checking and move point back to where it was | ||
| 405 | when you started spell checking. | ||
| 406 | |||
| 407 | @item q | ||
| 408 | Quit interactive spell checking and kill the Ispell subprocess. | ||
| 409 | |||
| 410 | @item C-l | ||
| 411 | Refresh the screen. | ||
| 412 | |||
| 413 | @item C-z | ||
| 414 | This key has its normal command meaning (suspend Emacs or iconify this | ||
| 415 | frame). | ||
| 416 | |||
| 417 | @item ? | ||
| 418 | Show the list of options. | ||
| 419 | @end table | ||
| 420 | |||
| 421 | @findex ispell-complete-word | ||
| 422 | The command @code{ispell-complete-word}, which is bound to the key | ||
| 423 | @kbd{M-@key{TAB}} in Text mode and related modes, shows a list of | ||
| 424 | completions based on spelling correction. Insert the beginning of a | ||
| 425 | word, and then type @kbd{M-@key{TAB}}; the command displays a | ||
| 426 | completion list window. (If your window manager intercepts | ||
| 427 | @kbd{M-@key{TAB}}, type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.) To | ||
| 428 | choose one of the completions listed, click @kbd{Mouse-2} or | ||
| 429 | @kbd{Mouse-1} fast on it, or move the cursor there in the completions | ||
| 430 | window and type @key{RET}. @xref{Text Mode}. | ||
| 431 | |||
| 432 | @ignore | ||
| 433 | @findex reload-ispell | ||
| 434 | The first time you use any of the spell checking commands, it starts | ||
| 435 | an Ispell subprocess. The first thing the subprocess does is read your | ||
| 436 | private dictionary, which defaults to the file @file{~/ispell.words}. | ||
| 437 | Words that you ``insert'' with the @kbd{i} command are added to that | ||
| 438 | file, but not right away---only at the end of the interactive | ||
| 439 | replacement procedure. Use the @kbd{M-x reload-ispell} command to | ||
| 440 | reload your private dictionary if you edit the file outside of Ispell. | ||
| 441 | @end ignore | ||
| 442 | |||
| 443 | @cindex @code{ispell} program | ||
| 444 | @findex ispell-kill-ispell | ||
| 445 | Once started, the Aspell or Ispell subprocess continues to run | ||
| 446 | (waiting for something to do), so that subsequent spell checking | ||
| 447 | commands complete more quickly. If you want to get rid of the | ||
| 448 | process, use @kbd{M-x ispell-kill-ispell}. This is not usually | ||
| 449 | necessary, since the process uses no time except when you do spelling | ||
| 450 | correction. | ||
| 451 | |||
| 452 | @vindex ispell-dictionary | ||
| 453 | Ispell and Aspell use two dictionaries together for spell checking: the | ||
| 454 | standard dictionary and your private dictionary. The variable | ||
| 455 | @code{ispell-dictionary} specifies the file name to use for the | ||
| 456 | standard dictionary; a value of @code{nil} selects the default | ||
| 457 | dictionary. The command @kbd{M-x ispell-change-dictionary} sets this | ||
| 458 | variable and then restarts the subprocess, so that it will use | ||
| 459 | a different standard dictionary. | ||
| 460 | |||
| 461 | @vindex ispell-complete-word-dict | ||
| 462 | Aspell and Ispell use a separate dictionary for word completion. | ||
| 463 | The variable @code{ispell-complete-word-dict} specifies the file name | ||
| 464 | of this dictionary. The completion dictionary must be different | ||
| 465 | because it cannot use root and affix information. For some languages | ||
| 466 | there is a spell checking dictionary but no word completion | ||
| 467 | dictionary. | ||
| 468 | |||
| 469 | @ignore | ||
| 470 | arch-tag: 3359a443-96ed-448f-9f05-c8111ba8eac0 | ||
| 471 | @end ignore | ||
diff --git a/doc/emacs/fortran-xtra.texi b/doc/emacs/fortran-xtra.texi new file mode 100644 index 00000000000..9249f5f006c --- /dev/null +++ b/doc/emacs/fortran-xtra.texi | |||
| @@ -0,0 +1,548 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | @c | ||
| 5 | @c This file is included either in emacs-xtra.texi (when producing the | ||
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | ||
| 7 | @node Fortran | ||
| 8 | @section Fortran Mode | ||
| 9 | @cindex Fortran mode | ||
| 10 | @cindex mode, Fortran | ||
| 11 | |||
| 12 | Fortran mode provides special motion commands for Fortran statements | ||
| 13 | and subprograms, and indentation commands that understand Fortran | ||
| 14 | conventions of nesting, line numbers and continuation statements. | ||
| 15 | Fortran mode has support for Auto Fill mode that breaks long lines into | ||
| 16 | proper Fortran continuation lines. | ||
| 17 | |||
| 18 | Special commands for comments are provided because Fortran comments | ||
| 19 | are unlike those of other languages. Built-in abbrevs optionally save | ||
| 20 | typing when you insert Fortran keywords. | ||
| 21 | |||
| 22 | Use @kbd{M-x fortran-mode} to switch to this major mode. This | ||
| 23 | command runs the hook @code{fortran-mode-hook}. | ||
| 24 | @iftex | ||
| 25 | @xref{Hooks,,, emacs, the Emacs Manual}. | ||
| 26 | @end iftex | ||
| 27 | @ifnottex | ||
| 28 | @xref{Hooks}. | ||
| 29 | @end ifnottex | ||
| 30 | |||
| 31 | @cindex Fortran77 and Fortran90 | ||
| 32 | @findex f90-mode | ||
| 33 | @findex fortran-mode | ||
| 34 | Fortran mode is meant for editing Fortran77 ``fixed format'' (and also | ||
| 35 | ``tab format'') source code. For editing the modern Fortran90 or | ||
| 36 | Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}). | ||
| 37 | Emacs normally uses Fortran mode for files with extension @samp{.f}, | ||
| 38 | @samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and | ||
| 39 | @samp{.f95}. GNU Fortran supports both kinds of format. | ||
| 40 | |||
| 41 | @menu | ||
| 42 | * Motion: Fortran Motion. Moving point by statements or subprograms. | ||
| 43 | * Indent: Fortran Indent. Indentation commands for Fortran. | ||
| 44 | * Comments: Fortran Comments. Inserting and aligning comments. | ||
| 45 | * Autofill: Fortran Autofill. Auto fill support for Fortran. | ||
| 46 | * Columns: Fortran Columns. Measuring columns for valid Fortran. | ||
| 47 | * Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords. | ||
| 48 | @end menu | ||
| 49 | |||
| 50 | @node Fortran Motion | ||
| 51 | @subsection Motion Commands | ||
| 52 | |||
| 53 | In addition to the normal commands for moving by and operating on | ||
| 54 | ``defuns'' (Fortran subprograms---functions and subroutines, as well as | ||
| 55 | modules for F90 mode), Fortran mode provides special commands to move by | ||
| 56 | statements and other program units. | ||
| 57 | |||
| 58 | @table @kbd | ||
| 59 | @kindex C-c C-n @r{(Fortran mode)} | ||
| 60 | @findex fortran-next-statement | ||
| 61 | @findex f90-next-statement | ||
| 62 | @item C-c C-n | ||
| 63 | Move to the beginning of the next statement | ||
| 64 | (@code{fortran-next-statement}/@code{f90-next-statement}). | ||
| 65 | |||
| 66 | @kindex C-c C-p @r{(Fortran mode)} | ||
| 67 | @findex fortran-previous-statement | ||
| 68 | @findex f90-previous-statement | ||
| 69 | @item C-c C-p | ||
| 70 | Move to the beginning of the previous statement | ||
| 71 | (@code{fortran-previous-statement}/@code{f90-previous-statement}). | ||
| 72 | If there is no previous statement (i.e. if called from the first | ||
| 73 | statement in the buffer), move to the start of the buffer. | ||
| 74 | |||
| 75 | @kindex C-c C-e @r{(F90 mode)} | ||
| 76 | @findex f90-next-block | ||
| 77 | @item C-c C-e | ||
| 78 | Move point forward to the start of the next code block | ||
| 79 | (@code{f90-next-block}). A code block is a subroutine, | ||
| 80 | @code{if}--@code{endif} statement, and so forth. This command exists | ||
| 81 | for F90 mode only, not Fortran mode. With a numeric argument, this | ||
| 82 | moves forward that many blocks. | ||
| 83 | |||
| 84 | @kindex C-c C-a @r{(F90 mode)} | ||
| 85 | @findex f90-previous-block | ||
| 86 | @item C-c C-a | ||
| 87 | Move point backward to the previous code block | ||
| 88 | (@code{f90-previous-block}). This is like @code{f90-next-block}, but | ||
| 89 | moves backwards. | ||
| 90 | |||
| 91 | @kindex C-M-n @r{(Fortran mode)} | ||
| 92 | @findex fortran-end-of-block | ||
| 93 | @findex f90-end-of-block | ||
| 94 | @item C-M-n | ||
| 95 | Move to the end of the current code block | ||
| 96 | (@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric | ||
| 97 | argument, move forward that number of blocks. The mark is set before | ||
| 98 | moving point. The F90 mode version of this command checks for | ||
| 99 | consistency of block types and labels (if present), but it does not | ||
| 100 | check the outermost block since that may be incomplete. | ||
| 101 | |||
| 102 | @kindex C-M-p @r{(Fortran mode)} | ||
| 103 | @findex fortran-beginning-of-block | ||
| 104 | @findex f90-beginning-of-block | ||
| 105 | @item C-M-p | ||
| 106 | Move to the start of the current code block | ||
| 107 | (@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This | ||
| 108 | is like @code{fortran-end-of-block}, but moves backwards. | ||
| 109 | @end table | ||
| 110 | |||
| 111 | @node Fortran Indent | ||
| 112 | @subsection Fortran Indentation | ||
| 113 | |||
| 114 | Special commands and features are needed for indenting Fortran code in | ||
| 115 | order to make sure various syntactic entities (line numbers, comment line | ||
| 116 | indicators and continuation line flags) appear in the columns that are | ||
| 117 | required for standard, fixed (or tab) format Fortran. | ||
| 118 | |||
| 119 | @menu | ||
| 120 | * Commands: ForIndent Commands. Commands for indenting and filling Fortran. | ||
| 121 | * Contline: ForIndent Cont. How continuation lines indent. | ||
| 122 | * Numbers: ForIndent Num. How line numbers auto-indent. | ||
| 123 | * Conv: ForIndent Conv. Conventions you must obey to avoid trouble. | ||
| 124 | * Vars: ForIndent Vars. Variables controlling Fortran indent style. | ||
| 125 | @end menu | ||
| 126 | |||
| 127 | @node ForIndent Commands | ||
| 128 | @subsubsection Fortran Indentation and Filling Commands | ||
| 129 | |||
| 130 | @table @kbd | ||
| 131 | @item C-M-j | ||
| 132 | Break the current line at point and set up a continuation line | ||
| 133 | (@code{fortran-split-line}). | ||
| 134 | @item M-^ | ||
| 135 | Join this line to the previous line (@code{fortran-join-line}). | ||
| 136 | @item C-M-q | ||
| 137 | Indent all the lines of the subprogram point is in | ||
| 138 | (@code{fortran-indent-subprogram}). | ||
| 139 | @item M-q | ||
| 140 | Fill a comment block or statement. | ||
| 141 | @end table | ||
| 142 | |||
| 143 | @kindex C-M-q @r{(Fortran mode)} | ||
| 144 | @findex fortran-indent-subprogram | ||
| 145 | The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command | ||
| 146 | to reindent all the lines of the Fortran subprogram (function or | ||
| 147 | subroutine) containing point. | ||
| 148 | |||
| 149 | @kindex C-M-j @r{(Fortran mode)} | ||
| 150 | @findex fortran-split-line | ||
| 151 | The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits | ||
| 152 | a line in the appropriate fashion for Fortran. In a non-comment line, | ||
| 153 | the second half becomes a continuation line and is indented | ||
| 154 | accordingly. In a comment line, both halves become separate comment | ||
| 155 | lines. | ||
| 156 | |||
| 157 | @kindex M-^ @r{(Fortran mode)} | ||
| 158 | @kindex C-c C-d @r{(Fortran mode)} | ||
| 159 | @findex fortran-join-line | ||
| 160 | @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line}, | ||
| 161 | which joins a continuation line back to the previous line, roughly as | ||
| 162 | the inverse of @code{fortran-split-line}. The point must be on a | ||
| 163 | continuation line when this command is invoked. | ||
| 164 | |||
| 165 | @kindex M-q @r{(Fortran mode)} | ||
| 166 | @kbd{M-q} in Fortran mode fills the comment block or statement that | ||
| 167 | point is in. This removes any excess statement continuations. | ||
| 168 | |||
| 169 | @node ForIndent Cont | ||
| 170 | @subsubsection Continuation Lines | ||
| 171 | @cindex Fortran continuation lines | ||
| 172 | |||
| 173 | @vindex fortran-continuation-string | ||
| 174 | Most Fortran77 compilers allow two ways of writing continuation lines. | ||
| 175 | If the first non-space character on a line is in column 5, then that | ||
| 176 | line is a continuation of the previous line. We call this @dfn{fixed | ||
| 177 | format}. (In GNU Emacs we always count columns from 0; but note that | ||
| 178 | the Fortran standard counts from 1.) The variable | ||
| 179 | @code{fortran-continuation-string} specifies what character to put in | ||
| 180 | column 5. A line that starts with a tab character followed by any digit | ||
| 181 | except @samp{0} is also a continuation line. We call this style of | ||
| 182 | continuation @dfn{tab format}. (Fortran90 introduced ``free format,'' | ||
| 183 | with another style of continuation lines). | ||
| 184 | |||
| 185 | @vindex indent-tabs-mode @r{(Fortran mode)} | ||
| 186 | @vindex fortran-analyze-depth | ||
| 187 | @vindex fortran-tab-mode-default | ||
| 188 | Fortran mode can use either style of continuation line. When you | ||
| 189 | enter Fortran mode, it tries to deduce the proper continuation style | ||
| 190 | automatically from the buffer contents. It does this by scanning up to | ||
| 191 | @code{fortran-analyze-depth} (default 100) lines from the start of the | ||
| 192 | buffer. The first line that begins with either a tab character or six | ||
| 193 | spaces determines the choice. If the scan fails (for example, if the | ||
| 194 | buffer is new and therefore empty), the value of | ||
| 195 | @code{fortran-tab-mode-default} (@code{nil} for fixed format, and | ||
| 196 | non-@code{nil} for tab format) is used. @samp{/t} in the mode line | ||
| 197 | indicates tab format is selected. Fortran mode sets the value of | ||
| 198 | @code{indent-tabs-mode} accordingly. | ||
| 199 | |||
| 200 | If the text on a line starts with the Fortran continuation marker | ||
| 201 | @samp{$}, or if it begins with any non-whitespace character in column | ||
| 202 | 5, Fortran mode treats it as a continuation line. When you indent a | ||
| 203 | continuation line with @key{TAB}, it converts the line to the current | ||
| 204 | continuation style. When you split a Fortran statement with | ||
| 205 | @kbd{C-M-j}, the continuation marker on the newline is created according | ||
| 206 | to the continuation style. | ||
| 207 | |||
| 208 | The setting of continuation style affects several other aspects of | ||
| 209 | editing in Fortran mode. In fixed format mode, the minimum column | ||
| 210 | number for the body of a statement is 6. Lines inside of Fortran | ||
| 211 | blocks that are indented to larger column numbers always use only the | ||
| 212 | space character for whitespace. In tab format mode, the minimum | ||
| 213 | column number for the statement body is 8, and the whitespace before | ||
| 214 | column 8 must always consist of one tab character. | ||
| 215 | |||
| 216 | @node ForIndent Num | ||
| 217 | @subsubsection Line Numbers | ||
| 218 | |||
| 219 | If a number is the first non-whitespace in the line, Fortran | ||
| 220 | indentation assumes it is a line number and moves it to columns 0 | ||
| 221 | through 4. (Columns always count from 0 in GNU Emacs.) | ||
| 222 | |||
| 223 | @vindex fortran-line-number-indent | ||
| 224 | Line numbers of four digits or less are normally indented one space. | ||
| 225 | The variable @code{fortran-line-number-indent} controls this; it | ||
| 226 | specifies the maximum indentation a line number can have. The default | ||
| 227 | value of the variable is 1. Fortran mode tries to prevent line number | ||
| 228 | digits passing column 4, reducing the indentation below the specified | ||
| 229 | maximum if necessary. If @code{fortran-line-number-indent} has the | ||
| 230 | value 5, line numbers are right-justified to end in column 4. | ||
| 231 | |||
| 232 | @vindex fortran-electric-line-number | ||
| 233 | Simply inserting a line number is enough to indent it according to | ||
| 234 | these rules. As each digit is inserted, the indentation is recomputed. | ||
| 235 | To turn off this feature, set the variable | ||
| 236 | @code{fortran-electric-line-number} to @code{nil}. | ||
| 237 | |||
| 238 | |||
| 239 | @node ForIndent Conv | ||
| 240 | @subsubsection Syntactic Conventions | ||
| 241 | |||
| 242 | Fortran mode assumes that you follow certain conventions that simplify | ||
| 243 | the task of understanding a Fortran program well enough to indent it | ||
| 244 | properly: | ||
| 245 | |||
| 246 | @itemize @bullet | ||
| 247 | @item | ||
| 248 | Two nested @samp{do} loops never share a @samp{continue} statement. | ||
| 249 | |||
| 250 | @item | ||
| 251 | Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do} | ||
| 252 | and others are written without embedded whitespace or line breaks. | ||
| 253 | |||
| 254 | Fortran compilers generally ignore whitespace outside of string | ||
| 255 | constants, but Fortran mode does not recognize these keywords if they | ||
| 256 | are not contiguous. Constructs such as @samp{else if} or @samp{end do} | ||
| 257 | are acceptable, but the second word should be on the same line as the | ||
| 258 | first and not on a continuation line. | ||
| 259 | @end itemize | ||
| 260 | |||
| 261 | @noindent | ||
| 262 | If you fail to follow these conventions, the indentation commands may | ||
| 263 | indent some lines unaesthetically. However, a correct Fortran program | ||
| 264 | retains its meaning when reindented even if the conventions are not | ||
| 265 | followed. | ||
| 266 | |||
| 267 | @node ForIndent Vars | ||
| 268 | @subsubsection Variables for Fortran Indentation | ||
| 269 | |||
| 270 | @vindex fortran-do-indent | ||
| 271 | @vindex fortran-if-indent | ||
| 272 | @vindex fortran-structure-indent | ||
| 273 | @vindex fortran-continuation-indent | ||
| 274 | @vindex fortran-check-all-num@dots{} | ||
| 275 | @vindex fortran-minimum-statement-indent@dots{} | ||
| 276 | Several additional variables control how Fortran indentation works: | ||
| 277 | |||
| 278 | @table @code | ||
| 279 | @item fortran-do-indent | ||
| 280 | Extra indentation within each level of @samp{do} statement (default 3). | ||
| 281 | |||
| 282 | @item fortran-if-indent | ||
| 283 | Extra indentation within each level of @samp{if}, @samp{select case}, or | ||
| 284 | @samp{where} statements (default 3). | ||
| 285 | |||
| 286 | @item fortran-structure-indent | ||
| 287 | Extra indentation within each level of @samp{structure}, @samp{union}, | ||
| 288 | @samp{map}, or @samp{interface} statements (default 3). | ||
| 289 | |||
| 290 | @item fortran-continuation-indent | ||
| 291 | Extra indentation for bodies of continuation lines (default 5). | ||
| 292 | |||
| 293 | @item fortran-check-all-num-for-matching-do | ||
| 294 | In Fortran77, a numbered @samp{do} statement is ended by any statement | ||
| 295 | with a matching line number. It is common (but not compulsory) to use a | ||
| 296 | @samp{continue} statement for this purpose. If this variable has a | ||
| 297 | non-@code{nil} value, indenting any numbered statement must check for a | ||
| 298 | @samp{do} that ends there. If you always end @samp{do} statements with | ||
| 299 | a @samp{continue} line (or if you use the more modern @samp{enddo}), | ||
| 300 | then you can speed up indentation by setting this variable to | ||
| 301 | @code{nil}. The default is @code{nil}. | ||
| 302 | |||
| 303 | @item fortran-blink-matching-if | ||
| 304 | If this is @code{t}, indenting an @samp{endif} (or @samp{enddo} | ||
| 305 | statement moves the cursor momentarily to the matching @samp{if} (or | ||
| 306 | @samp{do}) statement to show where it is. The default is @code{nil}. | ||
| 307 | |||
| 308 | @item fortran-minimum-statement-indent-fixed | ||
| 309 | Minimum indentation for Fortran statements when using fixed format | ||
| 310 | continuation line style. Statement bodies are never indented less than | ||
| 311 | this much. The default is 6. | ||
| 312 | |||
| 313 | @item fortran-minimum-statement-indent-tab | ||
| 314 | Minimum indentation for Fortran statements for tab format continuation line | ||
| 315 | style. Statement bodies are never indented less than this much. The | ||
| 316 | default is 8. | ||
| 317 | @end table | ||
| 318 | |||
| 319 | The variables controlling the indentation of comments are described in | ||
| 320 | the following section. | ||
| 321 | |||
| 322 | @node Fortran Comments | ||
| 323 | @subsection Fortran Comments | ||
| 324 | |||
| 325 | The usual Emacs comment commands assume that a comment can follow a | ||
| 326 | line of code. In Fortran77, the standard comment syntax requires an | ||
| 327 | entire line to be just a comment. Therefore, Fortran mode replaces the | ||
| 328 | standard Emacs comment commands and defines some new variables. | ||
| 329 | |||
| 330 | @vindex fortran-comment-line-start | ||
| 331 | Fortran mode can also handle the Fortran90 comment syntax where comments | ||
| 332 | start with @samp{!} and can follow other text. Because only some Fortran77 | ||
| 333 | compilers accept this syntax, Fortran mode will not insert such comments | ||
| 334 | unless you have said in advance to do so. To do this, set the variable | ||
| 335 | @code{fortran-comment-line-start} to @samp{"!"}. | ||
| 336 | |||
| 337 | @table @kbd | ||
| 338 | @item M-; | ||
| 339 | Align comment or insert new comment (@code{fortran-indent-comment}). | ||
| 340 | |||
| 341 | @item C-x ; | ||
| 342 | Applies to nonstandard @samp{!} comments only. | ||
| 343 | |||
| 344 | @item C-c ; | ||
| 345 | Turn all lines of the region into comments, or (with argument) turn them back | ||
| 346 | into real code (@code{fortran-comment-region}). | ||
| 347 | @end table | ||
| 348 | |||
| 349 | @findex fortran-indent-comment | ||
| 350 | @kbd{M-;} in Fortran mode is redefined as the command | ||
| 351 | @code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this | ||
| 352 | recognizes any kind of existing comment and aligns its text appropriately; | ||
| 353 | if there is no existing comment, a comment is inserted and aligned. But | ||
| 354 | inserting and aligning comments are not the same in Fortran mode as in | ||
| 355 | other modes. | ||
| 356 | |||
| 357 | When a new comment must be inserted, if the current line is blank, a | ||
| 358 | full-line comment is inserted. On a non-blank line, a nonstandard @samp{!} | ||
| 359 | comment is inserted if you have said you want to use them. Otherwise a | ||
| 360 | full-line comment is inserted on a new line before the current line. | ||
| 361 | |||
| 362 | Nonstandard @samp{!} comments are aligned like comments in other | ||
| 363 | languages, but full-line comments are different. In a standard full-line | ||
| 364 | comment, the comment delimiter itself must always appear in column zero. | ||
| 365 | What can be aligned is the text within the comment. You can choose from | ||
| 366 | three styles of alignment by setting the variable | ||
| 367 | @code{fortran-comment-indent-style} to one of these values: | ||
| 368 | |||
| 369 | @vindex fortran-comment-indent-style | ||
| 370 | @vindex fortran-comment-line-extra-indent | ||
| 371 | @table @code | ||
| 372 | @item fixed | ||
| 373 | Align the text at a fixed column, which is the sum of | ||
| 374 | @code{fortran-comment-line-extra-indent} and the minimum statement | ||
| 375 | indentation. This is the default. | ||
| 376 | |||
| 377 | The minimum statement indentation is | ||
| 378 | @code{fortran-minimum-statement-indent-fixed} for fixed format | ||
| 379 | continuation line style and @code{fortran-minimum-statement-indent-tab} | ||
| 380 | for tab format style. | ||
| 381 | |||
| 382 | @item relative | ||
| 383 | Align the text as if it were a line of code, but with an additional | ||
| 384 | @code{fortran-comment-line-extra-indent} columns of indentation. | ||
| 385 | |||
| 386 | @item nil | ||
| 387 | Don't move text in full-line comments automatically. | ||
| 388 | @end table | ||
| 389 | |||
| 390 | @vindex fortran-comment-indent-char | ||
| 391 | In addition, you can specify the character to be used to indent within | ||
| 392 | full-line comments by setting the variable | ||
| 393 | @code{fortran-comment-indent-char} to the single-character string you want | ||
| 394 | to use. | ||
| 395 | |||
| 396 | @vindex fortran-directive-re | ||
| 397 | Compiler directive lines, or preprocessor lines, have much the same | ||
| 398 | appearance as comment lines. It is important, though, that such lines | ||
| 399 | never be indented at all, no matter what the value of | ||
| 400 | @code{fortran-comment-indent-style}. The variable | ||
| 401 | @code{fortran-directive-re} is a regular expression that specifies which | ||
| 402 | lines are directives. Matching lines are never indented, and receive | ||
| 403 | distinctive font-locking. | ||
| 404 | |||
| 405 | The normal Emacs comment command @kbd{C-x ;} has not been redefined. If | ||
| 406 | you use @samp{!} comments, this command can be used with them. Otherwise | ||
| 407 | it is useless in Fortran mode. | ||
| 408 | |||
| 409 | @kindex C-c ; @r{(Fortran mode)} | ||
| 410 | @findex fortran-comment-region | ||
| 411 | @vindex fortran-comment-region | ||
| 412 | The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the | ||
| 413 | lines of the region into comments by inserting the string @samp{C$$$} at | ||
| 414 | the front of each one. With a numeric argument, it turns the region | ||
| 415 | back into live code by deleting @samp{C$$$} from the front of each line | ||
| 416 | in it. The string used for these comments can be controlled by setting | ||
| 417 | the variable @code{fortran-comment-region}. Note that here we have an | ||
| 418 | example of a command and a variable with the same name; these two uses | ||
| 419 | of the name never conflict because in Lisp and in Emacs it is always | ||
| 420 | clear from the context which one is meant. | ||
| 421 | |||
| 422 | @node Fortran Autofill | ||
| 423 | @subsection Auto Fill in Fortran Mode | ||
| 424 | |||
| 425 | Fortran mode has specialized support for Auto Fill mode, which is a | ||
| 426 | minor mode that automatically splits statements as you insert them | ||
| 427 | when they become too wide. Splitting a statement involves making | ||
| 428 | continuation lines using @code{fortran-continuation-string} | ||
| 429 | (@pxref{ForIndent Cont}). This splitting happens when you type | ||
| 430 | @key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran | ||
| 431 | indentation commands. You activate Auto Fill in Fortran mode in the | ||
| 432 | normal way. | ||
| 433 | @iftex | ||
| 434 | @xref{Auto Fill,,, emacs, the Emacs Manual}. | ||
| 435 | @end iftex | ||
| 436 | @ifnottex | ||
| 437 | @xref{Auto Fill}. | ||
| 438 | @end ifnottex | ||
| 439 | |||
| 440 | @vindex fortran-break-before-delimiters | ||
| 441 | Auto Fill breaks lines at spaces or delimiters when the lines get | ||
| 442 | longer than the desired width (the value of @code{fill-column}). The | ||
| 443 | delimiters (besides whitespace) that Auto Fill can break at are | ||
| 444 | @samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>}, | ||
| 445 | and @samp{,}. The line break comes after the delimiter if the | ||
| 446 | variable @code{fortran-break-before-delimiters} is @code{nil}. | ||
| 447 | Otherwise (and by default), the break comes before the delimiter. | ||
| 448 | |||
| 449 | To enable Auto Fill in all Fortran buffers, add | ||
| 450 | @code{turn-on-auto-fill} to @code{fortran-mode-hook}. | ||
| 451 | @iftex | ||
| 452 | @xref{Hooks,,, emacs, the Emacs Manual}. | ||
| 453 | @end iftex | ||
| 454 | @ifnottex | ||
| 455 | @xref{Hooks}. | ||
| 456 | @end ifnottex | ||
| 457 | |||
| 458 | @node Fortran Columns | ||
| 459 | @subsection Checking Columns in Fortran | ||
| 460 | |||
| 461 | @table @kbd | ||
| 462 | @item C-c C-r | ||
| 463 | Display a ``column ruler'' momentarily above the current line | ||
| 464 | (@code{fortran-column-ruler}). | ||
| 465 | @item C-c C-w | ||
| 466 | Split the current window horizontally temporarily so that it is 72 | ||
| 467 | columns wide (@code{fortran-window-create-momentarily}). This may | ||
| 468 | help you avoid making lines longer than the 72-character limit that | ||
| 469 | some Fortran compilers impose. | ||
| 470 | @item C-u C-c C-w | ||
| 471 | Split the current window horizontally so that it is 72 columns wide | ||
| 472 | (@code{fortran-window-create}). You can then continue editing. | ||
| 473 | @item M-x fortran-strip-sequence-nos | ||
| 474 | Delete all text in column 72 and beyond. | ||
| 475 | @end table | ||
| 476 | |||
| 477 | @kindex C-c C-r @r{(Fortran mode)} | ||
| 478 | @findex fortran-column-ruler | ||
| 479 | The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column | ||
| 480 | ruler momentarily above the current line. The comment ruler is two lines | ||
| 481 | of text that show you the locations of columns with special significance in | ||
| 482 | Fortran programs. Square brackets show the limits of the columns for line | ||
| 483 | numbers, and curly brackets show the limits of the columns for the | ||
| 484 | statement body. Column numbers appear above them. | ||
| 485 | |||
| 486 | Note that the column numbers count from zero, as always in GNU Emacs. | ||
| 487 | As a result, the numbers may be one less than those you are familiar | ||
| 488 | with; but the positions they indicate in the line are standard for | ||
| 489 | Fortran. | ||
| 490 | |||
| 491 | @vindex fortran-column-ruler-fixed | ||
| 492 | @vindex fortran-column-ruler-tabs | ||
| 493 | The text used to display the column ruler depends on the value of the | ||
| 494 | variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is | ||
| 495 | @code{nil}, then the value of the variable | ||
| 496 | @code{fortran-column-ruler-fixed} is used as the column ruler. | ||
| 497 | Otherwise, the value of the variable @code{fortran-column-ruler-tab} is | ||
| 498 | displayed. By changing these variables, you can change the column ruler | ||
| 499 | display. | ||
| 500 | |||
| 501 | @kindex C-c C-w @r{(Fortran mode)} | ||
| 502 | @findex fortran-window-create-momentarily | ||
| 503 | @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily | ||
| 504 | splits the current window horizontally, making a window 72 columns | ||
| 505 | wide, so you can see any lines that are too long. Type a space to | ||
| 506 | restore the normal width. | ||
| 507 | |||
| 508 | @kindex C-u C-c C-w @r{(Fortran mode)} | ||
| 509 | @findex fortran-window-create | ||
| 510 | You can also split the window horizontally and continue editing with | ||
| 511 | the split in place. To do this, use @kbd{C-u C-c C-w} (@code{M-x | ||
| 512 | fortran-window-create}). By editing in this window you can | ||
| 513 | immediately see when you make a line too wide to be correct Fortran. | ||
| 514 | |||
| 515 | @findex fortran-strip-sequence-nos | ||
| 516 | The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in | ||
| 517 | column 72 and beyond, on all lines in the current buffer. This is the | ||
| 518 | easiest way to get rid of old sequence numbers. | ||
| 519 | |||
| 520 | @node Fortran Abbrev | ||
| 521 | @subsection Fortran Keyword Abbrevs | ||
| 522 | |||
| 523 | Fortran mode provides many built-in abbrevs for common keywords and | ||
| 524 | declarations. These are the same sort of abbrev that you can define | ||
| 525 | yourself. To use them, you must turn on Abbrev mode. | ||
| 526 | @iftex | ||
| 527 | @xref{Abbrevs,,, emacs, the Emacs Manual}. | ||
| 528 | @end iftex | ||
| 529 | @ifnottex | ||
| 530 | @xref{Abbrevs}. | ||
| 531 | @end ifnottex | ||
| 532 | |||
| 533 | The built-in abbrevs are unusual in one way: they all start with a | ||
| 534 | semicolon. You cannot normally use semicolon in an abbrev, but Fortran | ||
| 535 | mode makes this possible by changing the syntax of semicolon to ``word | ||
| 536 | constituent.'' | ||
| 537 | |||
| 538 | For example, one built-in Fortran abbrev is @samp{;c} for | ||
| 539 | @samp{continue}. If you insert @samp{;c} and then insert a punctuation | ||
| 540 | character such as a space or a newline, the @samp{;c} expands automatically | ||
| 541 | to @samp{continue}, provided Abbrev mode is enabled.@refill | ||
| 542 | |||
| 543 | Type @samp{;?} or @samp{;C-h} to display a list of all the built-in | ||
| 544 | Fortran abbrevs and what they stand for. | ||
| 545 | |||
| 546 | @ignore | ||
| 547 | arch-tag: 23ed7c36-1517-4646-9235-2d5ade5f06f6 | ||
| 548 | @end ignore | ||
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi new file mode 100644 index 00000000000..a45b582b455 --- /dev/null +++ b/doc/emacs/frames.texi | |||
| @@ -0,0 +1,1113 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000, | ||
| 3 | @c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Frames, International, Windows, Top | ||
| 6 | @chapter Frames and Graphical Displays | ||
| 7 | @cindex frames | ||
| 8 | |||
| 9 | When using a graphical display, you can create multiple windows at | ||
| 10 | the system in a single Emacs session. Each system-level window that | ||
| 11 | belongs to Emacs displays a @dfn{frame} which can contain one or | ||
| 12 | several Emacs windows. A frame initially contains a single | ||
| 13 | general-purpose Emacs window which you can subdivide vertically or | ||
| 14 | horizontally into smaller windows. A frame normally contains its own | ||
| 15 | echo area and minibuffer, but you can make frames that don't have | ||
| 16 | these---they use the echo area and minibuffer of another frame. | ||
| 17 | |||
| 18 | To avoid confusion, we reserve the word ``window'' for the | ||
| 19 | subdivisions that Emacs implements, and never use it to refer to a | ||
| 20 | frame. | ||
| 21 | |||
| 22 | Editing you do in one frame affects the other frames. For | ||
| 23 | instance, if you put text in the kill ring in one frame, you can yank it | ||
| 24 | in another frame. If you exit Emacs through @kbd{C-x C-c} in one frame, | ||
| 25 | it terminates all the frames. To delete just one frame, use @kbd{C-x 5 | ||
| 26 | 0} (that is zero, not @kbd{o}). | ||
| 27 | |||
| 28 | Emacs compiled for MS-DOS emulates some windowing functionality, | ||
| 29 | so that you can use many of the features described in this chapter. | ||
| 30 | @iftex | ||
| 31 | @xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}. | ||
| 32 | @end iftex | ||
| 33 | @ifnottex | ||
| 34 | @xref{MS-DOS Mouse}. | ||
| 35 | @end ifnottex | ||
| 36 | |||
| 37 | @menu | ||
| 38 | * Cut and Paste:: Mouse commands for cut and paste. | ||
| 39 | * Mouse References:: Using the mouse to select an item from a list. | ||
| 40 | * Menu Mouse Clicks:: Mouse clicks that bring up menus. | ||
| 41 | * Mode Line Mouse:: Mouse clicks on the mode line. | ||
| 42 | * Creating Frames:: Creating additional Emacs frames with various contents. | ||
| 43 | * Frame Commands:: Iconifying, deleting, and switching frames. | ||
| 44 | * Speedbar:: How to make and use a speedbar frame. | ||
| 45 | * Multiple Displays:: How one Emacs job can talk to several displays. | ||
| 46 | * Special Buffer Frames:: You can make certain buffers have their own frames. | ||
| 47 | * Frame Parameters:: Changing the colors and other modes of frames. | ||
| 48 | * Scroll Bars:: How to enable and disable scroll bars; how to use them. | ||
| 49 | * Wheeled Mice:: Using mouse wheels for scrolling. | ||
| 50 | * Drag and Drop:: Using drag and drop to open files and insert text. | ||
| 51 | * Menu Bars:: Enabling and disabling the menu bar. | ||
| 52 | * Tool Bars:: Enabling and disabling the tool bar. | ||
| 53 | * Dialog Boxes:: Controlling use of dialog boxes. | ||
| 54 | * Tooltips:: Displaying information at the current mouse position. | ||
| 55 | * Mouse Avoidance:: Moving the mouse pointer out of the way. | ||
| 56 | * Non-Window Terminals:: Multiple frames on terminals that show only one. | ||
| 57 | * Text-Only Mouse:: Using the mouse in text-only terminals. | ||
| 58 | @end menu | ||
| 59 | |||
| 60 | @node Cut and Paste | ||
| 61 | @section Killing and Yanking on Graphical Displays | ||
| 62 | |||
| 63 | This section describes facilities for selecting a region, killing, | ||
| 64 | and yanking using the mouse. | ||
| 65 | |||
| 66 | @menu | ||
| 67 | * Mouse Commands:: Moving, cutting, and pasting, with the mouse. | ||
| 68 | * Cut/Paste Other App:: Transfering text between Emacs and other apps. | ||
| 69 | * Word and Line Mouse:: Mouse commands for selecting whole words or lines. | ||
| 70 | * Secondary Selection:: Cutting without altering point and mark. | ||
| 71 | * Clipboard:: Using the clipboard for selections. | ||
| 72 | @end menu | ||
| 73 | |||
| 74 | @node Mouse Commands | ||
| 75 | @subsection Mouse Commands for Editing | ||
| 76 | @cindex mouse buttons (what they do) | ||
| 77 | |||
| 78 | The mouse commands for selecting and copying a region are mostly | ||
| 79 | compatible with the @code{xterm} program. You can use the same mouse | ||
| 80 | commands for copying between Emacs and other window-based programs. | ||
| 81 | Most of these commands also work in Emacs when you run it under an | ||
| 82 | @code{xterm} terminal. | ||
| 83 | |||
| 84 | @kindex DELETE @r{(and mouse selection)} | ||
| 85 | If you select a region with any of these mouse commands, and then | ||
| 86 | immediately afterward type the @key{DELETE} function key, it deletes the | ||
| 87 | region that you selected. The @key{BACKSPACE} function key and the | ||
| 88 | @acronym{ASCII} character @key{DEL} do not do this; if you type any other key | ||
| 89 | in between the mouse command and @key{DELETE}, it does not do this. | ||
| 90 | |||
| 91 | @findex mouse-set-region | ||
| 92 | @findex mouse-set-point | ||
| 93 | @findex mouse-yank-at-click | ||
| 94 | @findex mouse-save-then-click | ||
| 95 | @kindex Mouse-1 | ||
| 96 | @kindex Mouse-2 | ||
| 97 | @kindex Mouse-3 | ||
| 98 | @table @kbd | ||
| 99 | @item Mouse-1 | ||
| 100 | Move point to where you click (@code{mouse-set-point}). | ||
| 101 | This is normally the left button. | ||
| 102 | |||
| 103 | @vindex x-mouse-click-focus-ignore-position | ||
| 104 | Normally, Emacs does not distinguish between ordinary mouse clicks and | ||
| 105 | clicks that select a frame. When you click on a frame to select it, | ||
| 106 | that also changes the selected window and cursor position according to | ||
| 107 | the mouse click position. On the X window system, you can change this | ||
| 108 | behavior by setting the variable | ||
| 109 | @code{x-mouse-click-focus-ignore-position} to @code{t}. Then the | ||
| 110 | first click selects the frame, but does not affect the selected window | ||
| 111 | or cursor position. If you click again in the same place, since that | ||
| 112 | click will be in the selected frame, it will change the window or | ||
| 113 | cursor position. | ||
| 114 | |||
| 115 | @item Drag-Mouse-1 | ||
| 116 | Set the region to the text you select by dragging, and copy it to the | ||
| 117 | kill ring (@code{mouse-set-region}). You can specify both ends of the | ||
| 118 | region with this single command. | ||
| 119 | |||
| 120 | @vindex mouse-scroll-min-lines | ||
| 121 | If you move the mouse off the top or bottom of the window while | ||
| 122 | dragging, the window scrolls at a steady rate until you move the mouse | ||
| 123 | back into the window. This way, you can select regions that don't fit | ||
| 124 | entirely on the screen. The number of lines scrolled per step depends | ||
| 125 | on how far away from the window edge the mouse has gone; the variable | ||
| 126 | @code{mouse-scroll-min-lines} specifies a minimum step size. | ||
| 127 | |||
| 128 | @vindex mouse-drag-copy-region | ||
| 129 | If the variable @code{mouse-drag-copy-region} is @code{nil}, this | ||
| 130 | mouse command does not copy the selected region into the kill ring. | ||
| 131 | |||
| 132 | @item Mouse-2 | ||
| 133 | Yank the last killed text, where you click (@code{mouse-yank-at-click}). | ||
| 134 | This is normally the middle button. | ||
| 135 | |||
| 136 | @item Mouse-3 | ||
| 137 | This command, @code{mouse-save-then-kill}, has several functions | ||
| 138 | depending on where you click and the status of the region. | ||
| 139 | |||
| 140 | The most basic case is when you click @kbd{Mouse-1} in one place and | ||
| 141 | then @kbd{Mouse-3} in another. This selects the text between those two | ||
| 142 | positions as the region. It also copies the new region to the kill | ||
| 143 | ring, so that you can copy it to someplace else. | ||
| 144 | |||
| 145 | If you click @kbd{Mouse-1} in the text, scroll with the scroll bar, and | ||
| 146 | then click @kbd{Mouse-3}, it remembers where point was before scrolling | ||
| 147 | (where you put it with @kbd{Mouse-1}), and uses that position as the | ||
| 148 | other end of the region. This is so that you can select a region that | ||
| 149 | doesn't fit entirely on the screen. | ||
| 150 | |||
| 151 | More generally, if you do not have a highlighted region, @kbd{Mouse-3} | ||
| 152 | selects the text between point and the click position as the region. It | ||
| 153 | does this by setting the mark where point was, and moving point to where | ||
| 154 | you click. | ||
| 155 | |||
| 156 | If you have a highlighted region, or if the region was set just before | ||
| 157 | by dragging button 1, @kbd{Mouse-3} adjusts the nearer end of the region | ||
| 158 | by moving it to where you click. The adjusted region's text also | ||
| 159 | replaces the old region's text in the kill ring. | ||
| 160 | |||
| 161 | If you originally specified the region using a double or triple | ||
| 162 | @kbd{Mouse-1}, so that the region is defined to consist of entire words | ||
| 163 | or lines, then adjusting the region with @kbd{Mouse-3} also proceeds by | ||
| 164 | entire words or lines. | ||
| 165 | |||
| 166 | If you use @kbd{Mouse-3} a second time consecutively, at the same place, | ||
| 167 | that kills the region already selected. | ||
| 168 | @end table | ||
| 169 | |||
| 170 | The simplest way to kill text with the mouse is to press @kbd{Mouse-1} | ||
| 171 | at one end, then press @kbd{Mouse-3} twice at the other end. | ||
| 172 | @xref{Killing}. To copy the text into the kill ring without deleting it | ||
| 173 | from the buffer, press @kbd{Mouse-3} just once---or just drag across the | ||
| 174 | text with @kbd{Mouse-1}. Then you can copy it elsewhere by yanking it. | ||
| 175 | |||
| 176 | @vindex mouse-yank-at-point | ||
| 177 | To yank the killed or copied text somewhere else, move the mouse there | ||
| 178 | and press @kbd{Mouse-2}. @xref{Yanking}. However, if | ||
| 179 | @code{mouse-yank-at-point} is non-@code{nil}, @kbd{Mouse-2} yanks at | ||
| 180 | point. Then it does not matter where you click, or even which of the | ||
| 181 | frame's windows you click on. The default value is @code{nil}. This | ||
| 182 | variable also affects yanking the secondary selection. | ||
| 183 | |||
| 184 | @cindex Delete Selection mode | ||
| 185 | @cindex mode, Delete Selection | ||
| 186 | @findex delete-selection-mode | ||
| 187 | Many graphical applications follow the convention that insertion while text | ||
| 188 | is selected deletes the selected text. You can make Emacs behave this | ||
| 189 | way by enabling Delete Selection mode---with @kbd{M-x | ||
| 190 | delete-selection-mode} or using Custom. Another effect of this mode | ||
| 191 | is that @key{DEL}, @kbd{C-d} and some other keys, when a selection | ||
| 192 | exists, will kill the whole selection. It also enables Transient Mark | ||
| 193 | mode (@pxref{Transient Mark}). | ||
| 194 | |||
| 195 | @node Cut/Paste Other App | ||
| 196 | @subsection Cut and Paste with Other Window Applications | ||
| 197 | |||
| 198 | @cindex cutting | ||
| 199 | @cindex pasting | ||
| 200 | @cindex X cutting and pasting | ||
| 201 | To copy text to another windowing application, kill it or save it in | ||
| 202 | the kill ring. Then use the ``paste'' or ``yank'' command of the | ||
| 203 | other application to insert the text. | ||
| 204 | |||
| 205 | To copy text from another windowing application, use its ``cut'' or | ||
| 206 | ``copy'' command to select the text you want. Then yank it in Emacs | ||
| 207 | with @kbd{C-y} or @kbd{Mouse-2}. | ||
| 208 | |||
| 209 | @cindex primary selection | ||
| 210 | @cindex cut buffer | ||
| 211 | @cindex selection, primary | ||
| 212 | @vindex x-cut-buffer-max | ||
| 213 | When Emacs puts text into the kill ring, or rotates text to the | ||
| 214 | front of the kill ring, it sets the @dfn{primary selection} in the | ||
| 215 | window system. This is how other windowing applications can access | ||
| 216 | the text. On the X Window System, emacs also stores the text in the | ||
| 217 | cut buffer, but only if the text is short enough (the value of | ||
| 218 | @code{x-cut-buffer-max} specifies the maximum number of characters); | ||
| 219 | putting long strings in the cut buffer can be slow. | ||
| 220 | |||
| 221 | The commands to yank the first entry in the kill ring actually check | ||
| 222 | first for a primary selection in another program; after that, they check | ||
| 223 | for text in the cut buffer. If neither of those sources provides text | ||
| 224 | to yank, the kill ring contents are used. | ||
| 225 | |||
| 226 | The standard coding system for X Window System selections is | ||
| 227 | @code{compound-text-with-extensions}. To specify another coding | ||
| 228 | system for selections, use @kbd{C-x @key{RET} x} or @kbd{C-x @key{RET} | ||
| 229 | X}. @xref{Communication Coding}. | ||
| 230 | |||
| 231 | @node Word and Line Mouse | ||
| 232 | @subsection Mouse Commands for Words and Lines | ||
| 233 | |||
| 234 | These variants of @kbd{Mouse-1} select entire words or lines at a time. | ||
| 235 | |||
| 236 | @table @kbd | ||
| 237 | @item Double-Mouse-1 | ||
| 238 | This key sets the region around the word which you click on. If you | ||
| 239 | click on a character with ``symbol'' syntax (such as underscore, in C | ||
| 240 | mode), it sets the region around the symbol surrounding that character. | ||
| 241 | |||
| 242 | If you click on a character with open-parenthesis or close-parenthesis | ||
| 243 | syntax, it sets the region around the parenthetical grouping | ||
| 244 | which that character starts or ends. If you click on a character with | ||
| 245 | string-delimiter syntax (such as a singlequote or doublequote in C), it | ||
| 246 | sets the region around the string constant (using heuristics to figure | ||
| 247 | out whether that character is the beginning or the end of it). | ||
| 248 | |||
| 249 | @item Double-Drag-Mouse-1 | ||
| 250 | This key selects a region made up of the words you drag across. | ||
| 251 | |||
| 252 | @item Triple-Mouse-1 | ||
| 253 | This key sets the region around the line you click on. | ||
| 254 | |||
| 255 | @item Triple-Drag-Mouse-1 | ||
| 256 | This key selects a region made up of the lines you drag across. | ||
| 257 | @end table | ||
| 258 | |||
| 259 | @node Secondary Selection | ||
| 260 | @subsection Secondary Selection | ||
| 261 | @cindex secondary selection | ||
| 262 | |||
| 263 | The @dfn{secondary selection} is another way of selecting text using | ||
| 264 | the X Window System. It does not use point or the mark, so you can | ||
| 265 | use it to kill text without setting point or the mark. | ||
| 266 | |||
| 267 | @table @kbd | ||
| 268 | @findex mouse-set-secondary | ||
| 269 | @kindex M-Drag-Mouse-1 | ||
| 270 | @item M-Drag-Mouse-1 | ||
| 271 | Set the secondary selection, with one end at the place where you press | ||
| 272 | down the button, and the other end at the place where you release it | ||
| 273 | (@code{mouse-set-secondary}). The highlighting appears and changes as | ||
| 274 | you drag. You can control the appearance of the highlighting by | ||
| 275 | customizing the @code{secondary-selection} face (@pxref{Face | ||
| 276 | Customization}). | ||
| 277 | |||
| 278 | If you move the mouse off the top or bottom of the window while | ||
| 279 | dragging, the window scrolls at a steady rate until you move the mouse | ||
| 280 | back into the window. This way, you can mark regions that don't fit | ||
| 281 | entirely on the screen. | ||
| 282 | |||
| 283 | This way of setting the secondary selection does not alter the kill ring. | ||
| 284 | |||
| 285 | @findex mouse-start-secondary | ||
| 286 | @kindex M-Mouse-1 | ||
| 287 | @item M-Mouse-1 | ||
| 288 | Set one endpoint for the @dfn{secondary selection} | ||
| 289 | (@code{mouse-start-secondary}). | ||
| 290 | |||
| 291 | @findex mouse-secondary-save-then-kill | ||
| 292 | @kindex M-Mouse-3 | ||
| 293 | @item M-Mouse-3 | ||
| 294 | Make a secondary selection, using the place specified with @kbd{M-Mouse-1} | ||
| 295 | as the other end (@code{mouse-secondary-save-then-kill}). This also | ||
| 296 | puts the selected text in the kill ring. A second click at the same | ||
| 297 | place kills the secondary selection just made. | ||
| 298 | |||
| 299 | @findex mouse-yank-secondary | ||
| 300 | @kindex M-Mouse-2 | ||
| 301 | @item M-Mouse-2 | ||
| 302 | Insert the secondary selection where you click | ||
| 303 | (@code{mouse-yank-secondary}). This places point at the end of the | ||
| 304 | yanked text. | ||
| 305 | @end table | ||
| 306 | |||
| 307 | Double or triple clicking of @kbd{M-Mouse-1} operates on words and | ||
| 308 | lines, much like @kbd{Mouse-1}. | ||
| 309 | |||
| 310 | If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-Mouse-2} yanks | ||
| 311 | at point. Then it does not matter precisely where you click, or even | ||
| 312 | which of the frame's windows you click on. @xref{Mouse Commands}. | ||
| 313 | |||
| 314 | @node Clipboard | ||
| 315 | @subsection Using the Clipboard | ||
| 316 | @cindex clipboard | ||
| 317 | @vindex x-select-enable-clipboard | ||
| 318 | @findex menu-bar-enable-clipboard | ||
| 319 | @cindex OpenWindows | ||
| 320 | @cindex Gnome | ||
| 321 | |||
| 322 | Apart from the primary and secondary selection types, Emacs can | ||
| 323 | handle the @dfn{clipboard} selection type which is used by some | ||
| 324 | applications, particularly under OpenWindows and Gnome. | ||
| 325 | |||
| 326 | The command @kbd{M-x menu-bar-enable-clipboard} makes the @code{Cut}, | ||
| 327 | @code{Paste} and @code{Copy} menu items, as well as the keys of the same | ||
| 328 | names, all use the clipboard. | ||
| 329 | |||
| 330 | You can customize the variable @code{x-select-enable-clipboard} to make | ||
| 331 | the Emacs yank functions consult the clipboard before the primary | ||
| 332 | selection, and to make the kill functions to store in the clipboard as | ||
| 333 | well as the primary selection. Otherwise they do not access the | ||
| 334 | clipboard at all. Using the clipboard is the default on MS-Windows and Mac, | ||
| 335 | but not on other systems. | ||
| 336 | |||
| 337 | @node Mouse References | ||
| 338 | @section Following References with the Mouse | ||
| 339 | @kindex Mouse-1 @r{(selection)} | ||
| 340 | @kindex Mouse-2 @r{(selection)} | ||
| 341 | |||
| 342 | Some read-only Emacs buffers include references you can follow, or | ||
| 343 | commands you can activate. These include names of files, of buffers, | ||
| 344 | of possible completions, of matches for a pattern, as well as the | ||
| 345 | buttons in Help buffers and customization buffers. You can follow the | ||
| 346 | reference or activate the command by moving point to it and typing | ||
| 347 | @key{RET}. You can also do this with the mouse, using either | ||
| 348 | @kbd{Mouse-1} or @kbd{Mouse-2}. | ||
| 349 | |||
| 350 | Since yanking text into a read-only buffer is not allowed, these | ||
| 351 | buffers generally define @kbd{Mouse-2} to follow a reference or | ||
| 352 | activate a command. For example, if you click @kbd{Mouse-2} on a file | ||
| 353 | name in a Dired buffer, you visit that file. If you click | ||
| 354 | @kbd{Mouse-2} on an error message in the @samp{*Compilation*} buffer, | ||
| 355 | you go to the source code for that error message. If you click | ||
| 356 | @kbd{Mouse-2} on a completion in the @samp{*Completions*} buffer, you | ||
| 357 | choose that completion. | ||
| 358 | |||
| 359 | However, most applications use @kbd{Mouse-1} to do this sort of | ||
| 360 | thing, so Emacs implements this too. If you click @kbd{Mouse-1} | ||
| 361 | quickly on a reference or button, it follows or activates. If you | ||
| 362 | click slowly, it moves point as usual. Dragging, meaning moving the | ||
| 363 | mouse while it is held down, also has its usual behavior of setting | ||
| 364 | the region. | ||
| 365 | |||
| 366 | @vindex mouse-1-click-in-non-selected-windows | ||
| 367 | Normally, the @kbd{Mouse-1} click behavior is performed on links in | ||
| 368 | any window. The variable @code{mouse-1-click-in-non-selected-windows} | ||
| 369 | controls whether @kbd{Mouse-1} has this behavior even in non-selected | ||
| 370 | windows, or only in the selected window. | ||
| 371 | |||
| 372 | @vindex mouse-highlight | ||
| 373 | You can usually tell when @kbd{Mouse-1} and @kbd{Mouse-2} have this | ||
| 374 | special sort of meaning because the sensitive text highlights when you | ||
| 375 | move the mouse over it. The variable @code{mouse-highlight} controls | ||
| 376 | whether to do this highlighting always (even when such text appears | ||
| 377 | where the mouse already is), never, or only immediately after you move | ||
| 378 | the mouse. | ||
| 379 | |||
| 380 | @vindex mouse-1-click-follows-link | ||
| 381 | In Emacs versions before 22, only @kbd{Mouse-2} follows links and | ||
| 382 | @kbd{Mouse-1} always sets point. If you prefer this older behavior, | ||
| 383 | set the variable @code{mouse-1-click-follows-link} to @code{nil}. | ||
| 384 | This variable also lets you choose various other alternatives for | ||
| 385 | following links with the mouse. Type @kbd{C-h v | ||
| 386 | mouse-1-click-follows-link @key{RET}} for more details. | ||
| 387 | |||
| 388 | @node Menu Mouse Clicks | ||
| 389 | @section Mouse Clicks for Menus | ||
| 390 | |||
| 391 | Several mouse clicks with the @key{CTRL} and @key{SHIFT} modifiers | ||
| 392 | bring up menus. | ||
| 393 | |||
| 394 | @table @kbd | ||
| 395 | @item C-Mouse-1 | ||
| 396 | @kindex C-Mouse-1 | ||
| 397 | This menu is for selecting a buffer. | ||
| 398 | |||
| 399 | The MSB (``mouse select buffer'') global minor mode makes this | ||
| 400 | menu smarter and more customizable. @xref{Buffer Menus}. | ||
| 401 | |||
| 402 | @item C-Mouse-2 | ||
| 403 | @kindex C-Mouse-2 | ||
| 404 | This menu is for specifying faces and other text properties | ||
| 405 | for editing formatted text. @xref{Formatted Text}. | ||
| 406 | |||
| 407 | @item C-Mouse-3 | ||
| 408 | @kindex C-Mouse-3 | ||
| 409 | This menu is mode-specific. For most modes if Menu-bar mode is on, | ||
| 410 | this menu has the same items as all the mode-specific menu-bar menus | ||
| 411 | put together. Some modes may specify a different menu for this | ||
| 412 | button.@footnote{Some systems use @kbd{Mouse-3} for a mode-specific | ||
| 413 | menu. We took a survey of users, and found they preferred to keep | ||
| 414 | @kbd{Mouse-3} for selecting and killing regions. Hence the decision | ||
| 415 | to use @kbd{C-Mouse-3} for this menu. To use @kbd{Mouse-3} instead, | ||
| 416 | do @code{(global-set-key [mouse-3] 'mouse-popup-menubar-stuff)}.} If | ||
| 417 | Menu-bar mode is off, this menu contains all the items which would be | ||
| 418 | present in the menu bar---not just the mode-specific ones---so that | ||
| 419 | you can access them without having to display the menu bar. | ||
| 420 | |||
| 421 | @item S-Mouse-1 | ||
| 422 | This menu is for specifying the frame's default font. | ||
| 423 | @end table | ||
| 424 | |||
| 425 | @node Mode Line Mouse | ||
| 426 | @section Mode Line Mouse Commands | ||
| 427 | @cindex mode line, mouse | ||
| 428 | @cindex mouse on mode line | ||
| 429 | |||
| 430 | You can use mouse clicks on window mode lines to select and manipulate | ||
| 431 | windows. | ||
| 432 | |||
| 433 | Some areas of the mode line, such as the buffer name and the major | ||
| 434 | mode name, have their own special mouse bindings. These areas are | ||
| 435 | highlighted when you hold the mouse over them, and information about | ||
| 436 | the special bindings will be displayed (@pxref{Tooltips}). This | ||
| 437 | section's commands do not apply in those areas. | ||
| 438 | |||
| 439 | @table @kbd | ||
| 440 | @item Mouse-1 | ||
| 441 | @kindex Mouse-1 @r{(mode line)} | ||
| 442 | @kbd{Mouse-1} on a mode line selects the window it belongs to. By | ||
| 443 | dragging @kbd{Mouse-1} on the mode line, you can move it, thus | ||
| 444 | changing the height of the windows above and below. Changing heights | ||
| 445 | with the mouse in this way never deletes windows, it just refuses to | ||
| 446 | make any window smaller than the minimum height. | ||
| 447 | |||
| 448 | @item Mouse-2 | ||
| 449 | @kindex Mouse-2 @r{(mode line)} | ||
| 450 | @kbd{Mouse-2} on a mode line expands that window to fill its frame. | ||
| 451 | |||
| 452 | @item Mouse-3 | ||
| 453 | @kindex Mouse-3 @r{(mode line)} | ||
| 454 | @kbd{Mouse-3} on a mode line deletes the window it belongs to. If the | ||
| 455 | frame has only one window, it buries the current buffer instead, and | ||
| 456 | switches to another buffer. | ||
| 457 | |||
| 458 | @item C-Mouse-2 | ||
| 459 | @kindex C-mouse-2 @r{(mode line)} | ||
| 460 | @kbd{C-Mouse-2} on a mode line splits the window above | ||
| 461 | horizontally, above the place in the mode line where you click. | ||
| 462 | @end table | ||
| 463 | |||
| 464 | @kindex C-Mouse-2 @r{(scroll bar)} | ||
| 465 | @kindex Mouse-1 @r{(scroll bar)} | ||
| 466 | Using @kbd{Mouse-1} on the divider between two side-by-side mode | ||
| 467 | lines, you can move the vertical boundary left or right. Using | ||
| 468 | @kbd{C-Mouse-2} on a scroll bar splits the corresponding window | ||
| 469 | vertically. @xref{Split Window}. | ||
| 470 | |||
| 471 | @node Creating Frames | ||
| 472 | @section Creating Frames | ||
| 473 | @cindex creating frames | ||
| 474 | |||
| 475 | @kindex C-x 5 | ||
| 476 | The prefix key @kbd{C-x 5} is analogous to @kbd{C-x 4}, with parallel | ||
| 477 | subcommands. The difference is that @kbd{C-x 5} commands create a new | ||
| 478 | frame rather than just a new window in the selected frame (@pxref{Pop | ||
| 479 | Up Window}). If an existing visible or iconified frame already displays | ||
| 480 | the requested material, these commands use the existing frame, after | ||
| 481 | raising or deiconifying as necessary. | ||
| 482 | |||
| 483 | The various @kbd{C-x 5} commands differ in how they find or create the | ||
| 484 | buffer to select: | ||
| 485 | |||
| 486 | @table @kbd | ||
| 487 | @item C-x 5 2 | ||
| 488 | @kindex C-x 5 2 | ||
| 489 | @findex make-frame-command | ||
| 490 | Create a new frame (@code{make-frame-command}). | ||
| 491 | @item C-x 5 b @var{bufname} @key{RET} | ||
| 492 | Select buffer @var{bufname} in another frame. This runs | ||
| 493 | @code{switch-to-buffer-other-frame}. | ||
| 494 | @item C-x 5 f @var{filename} @key{RET} | ||
| 495 | Visit file @var{filename} and select its buffer in another frame. This | ||
| 496 | runs @code{find-file-other-frame}. @xref{Visiting}. | ||
| 497 | @item C-x 5 d @var{directory} @key{RET} | ||
| 498 | Select a Dired buffer for directory @var{directory} in another frame. | ||
| 499 | This runs @code{dired-other-frame}. @xref{Dired}. | ||
| 500 | @item C-x 5 m | ||
| 501 | Start composing a mail message in another frame. This runs | ||
| 502 | @code{mail-other-frame}. It is the other-frame variant of @kbd{C-x m}. | ||
| 503 | @xref{Sending Mail}. | ||
| 504 | @item C-x 5 . | ||
| 505 | Find a tag in the current tag table in another frame. This runs | ||
| 506 | @code{find-tag-other-frame}, the multiple-frame variant of @kbd{M-.}. | ||
| 507 | @xref{Tags}. | ||
| 508 | @item C-x 5 r @var{filename} @key{RET} | ||
| 509 | @kindex C-x 5 r | ||
| 510 | @findex find-file-read-only-other-frame | ||
| 511 | Visit file @var{filename} read-only, and select its buffer in another | ||
| 512 | frame. This runs @code{find-file-read-only-other-frame}. | ||
| 513 | @xref{Visiting}. | ||
| 514 | @end table | ||
| 515 | |||
| 516 | @cindex default-frame-alist | ||
| 517 | @cindex initial-frame-alist | ||
| 518 | @cindex face customization, in @file{~/.emacs} | ||
| 519 | @cindex color customization, in @file{~/.emacs} | ||
| 520 | You can control the appearance of new frames you create by setting the | ||
| 521 | frame parameters in @code{default-frame-alist}. You can use the | ||
| 522 | variable @code{initial-frame-alist} to specify parameters that affect | ||
| 523 | only the initial frame. @xref{Initial Parameters,,, elisp, The Emacs | ||
| 524 | Lisp Reference Manual}, for more information. | ||
| 525 | |||
| 526 | @cindex font (default) | ||
| 527 | The easiest way to specify the principal font for all your Emacs | ||
| 528 | frames is with an X resource (@pxref{Font X}), but you can also do it by | ||
| 529 | modifying @code{default-frame-alist} to specify the @code{font} | ||
| 530 | parameter, as shown here: | ||
| 531 | |||
| 532 | @example | ||
| 533 | (add-to-list 'default-frame-alist '(font . "10x20")) | ||
| 534 | @end example | ||
| 535 | |||
| 536 | @noindent | ||
| 537 | Here's a similar example for specifying a foreground color: | ||
| 538 | |||
| 539 | @example | ||
| 540 | (add-to-list 'default-frame-alist '(foreground-color . "blue")) | ||
| 541 | @end example | ||
| 542 | |||
| 543 | @noindent | ||
| 544 | By putting such customizations in your @file{~/.emacs} init file, you | ||
| 545 | can control the appearance of all the frames Emacs creates, including | ||
| 546 | the initial one. | ||
| 547 | |||
| 548 | @node Frame Commands | ||
| 549 | @section Frame Commands | ||
| 550 | |||
| 551 | The following commands let you create, delete and operate on frames: | ||
| 552 | |||
| 553 | @table @kbd | ||
| 554 | @item C-z | ||
| 555 | @kindex C-z @r{(X windows)} | ||
| 556 | @findex iconify-or-deiconify-frame | ||
| 557 | Iconify the selected Emacs frame (@code{iconify-or-deiconify-frame}). | ||
| 558 | When typed on an Emacs frame's icon, deiconify instead. | ||
| 559 | |||
| 560 | The normal meaning of @kbd{C-z}, to suspend Emacs, is not useful under | ||
| 561 | a graphical display that allows multiple applications to operate | ||
| 562 | simultaneously in their own windows, so Emacs gives @kbd{C-z} a | ||
| 563 | different binding in that case. | ||
| 564 | |||
| 565 | @item C-x 5 0 | ||
| 566 | @kindex C-x 5 0 | ||
| 567 | @findex delete-frame | ||
| 568 | Delete the selected frame (@code{delete-frame}). This is not allowed if | ||
| 569 | there is only one frame. | ||
| 570 | |||
| 571 | @item C-x 5 o | ||
| 572 | @kindex C-x 5 o | ||
| 573 | @findex other-frame | ||
| 574 | Select another frame, raise it, and warp the mouse to it so that it | ||
| 575 | stays selected. If you repeat this command, it cycles through all the | ||
| 576 | frames on your terminal. | ||
| 577 | |||
| 578 | @item C-x 5 1 | ||
| 579 | @kindex C-x 5 1 | ||
| 580 | @findex delete-other-frames | ||
| 581 | Delete all frames except the selected one. | ||
| 582 | @end table | ||
| 583 | |||
| 584 | @vindex focus-follows-mouse | ||
| 585 | To make the command @kbd{C-x 5 o} work properly, you must tell Emacs | ||
| 586 | how the system (or the window manager) generally handles | ||
| 587 | focus-switching between windows. There are two possibilities: either | ||
| 588 | simply moving the mouse onto a window selects it (gives it focus), or | ||
| 589 | you have to click on it in a suitable way to do so. On X, this focus | ||
| 590 | policy also affects whether the focus is given to a frame that Emacs | ||
| 591 | raises. Unfortunately there is no way Emacs can find out | ||
| 592 | automatically which way the system handles this, so you have to | ||
| 593 | explicitly say, by setting the variable @code{focus-follows-mouse}. | ||
| 594 | If just moving the mouse onto a window selects it, that variable | ||
| 595 | should be @code{t}; if a click is necessary, the variable should be | ||
| 596 | @code{nil}. | ||
| 597 | |||
| 598 | The window manager that is part of MS-Windows always gives focus to a | ||
| 599 | frame that raises, so this variable has no effect in the native | ||
| 600 | MS-Windows build of Emacs. | ||
| 601 | |||
| 602 | @node Speedbar | ||
| 603 | @section Speedbar Frames | ||
| 604 | @cindex speedbar | ||
| 605 | |||
| 606 | @cindex attached frame (of speedbar) | ||
| 607 | The @dfn{speedbar} is a special frame for conveniently navigating in | ||
| 608 | or operating on another frame. The speedbar, when it exists, is | ||
| 609 | always associated with a specific frame, called its @dfn{attached | ||
| 610 | frame}; all speedbar operations act on that frame. | ||
| 611 | |||
| 612 | Type @kbd{M-x speedbar} to create the speedbar and associate it with | ||
| 613 | the current frame. To dismiss the speedbar, type @kbd{M-x speedbar} | ||
| 614 | again, or select the speedbar and type @kbd{q}. (You can also delete | ||
| 615 | the speedbar frame like any other Emacs frame.) If you wish to | ||
| 616 | associate the speedbar with a different frame, dismiss it and call | ||
| 617 | @kbd{M-x speedbar} from that frame. | ||
| 618 | |||
| 619 | The speedbar can operate in various modes. Its default mode is | ||
| 620 | @dfn{File Display} mode, which shows the files in the current | ||
| 621 | directory of the selected window of the attached frame, one file per | ||
| 622 | line. Clicking on a file name visits that file in the selected window | ||
| 623 | of the attached frame, and clicking on a directory name shows that | ||
| 624 | directory in the speedbar (@pxref{Mouse References}). Each line also | ||
| 625 | has a box, @samp{[+]} or @samp{<+>}, that you can click on to | ||
| 626 | @dfn{expand} the contents of that item. Expanding a directory adds | ||
| 627 | the contents of that directory to the speedbar display, underneath the | ||
| 628 | directory's own line. Expanding an ordinary file adds a list of the | ||
| 629 | tags in that file to the speedbar display; you can click on a tag name | ||
| 630 | to jump to that tag in the selected window of the attached frame. | ||
| 631 | When a file or directory is expanded, the @samp{[+]} changes to | ||
| 632 | @samp{[-]}; you can click on that box to @dfn{contract} the item, | ||
| 633 | hiding its contents. | ||
| 634 | |||
| 635 | You navigate through the speedbar using the keyboard, too. Typing | ||
| 636 | @kbd{RET} while point is on a line in the speedbar is equivalent to | ||
| 637 | clicking the item on the current line, and @kbd{SPC} expands or | ||
| 638 | contracts the item. @kbd{U} displays the parent directory of the | ||
| 639 | current directory. To copy, delete, or rename the file on the current | ||
| 640 | line, type @kbd{C}, @kbd{D}, and @kbd{R} respectively. To create a | ||
| 641 | new directory, type @kbd{M}. | ||
| 642 | |||
| 643 | Another general-purpose speedbar mode is @dfn{Buffer Display} mode; | ||
| 644 | in this mode, the speedbar displays a list of Emacs buffers. To | ||
| 645 | switch to this mode, type @kbd{b} in the speedbar. To return to File | ||
| 646 | Display mode, type @kbd{f}. You can also change the display mode by | ||
| 647 | clicking @kbd{mouse-3} anywhere in the speedbar window (or | ||
| 648 | @kbd{mouse-1} on the mode-line) and selecting @samp{Displays} in the | ||
| 649 | pop-up menu. | ||
| 650 | |||
| 651 | Some major modes, including Rmail mode, Info, and GUD, have | ||
| 652 | specialized ways of putting useful items into the speedbar for you to | ||
| 653 | select. For example, in Rmail mode, the speedbar shows a list of Rmail | ||
| 654 | files, and lets you move the current message to another Rmail file by | ||
| 655 | clicking on its @samp{<M>} box. | ||
| 656 | |||
| 657 | For more details on using and programming the speedbar, @xref{Top, | ||
| 658 | Speedbar,,speedbar, Speedbar Manual}. | ||
| 659 | |||
| 660 | @node Multiple Displays | ||
| 661 | @section Multiple Displays | ||
| 662 | @cindex multiple displays | ||
| 663 | |||
| 664 | A single Emacs can talk to more than one X display. Initially, Emacs | ||
| 665 | uses just one display---the one specified with the @env{DISPLAY} | ||
| 666 | environment variable or with the @samp{--display} option (@pxref{Initial | ||
| 667 | Options}). To connect to another display, use the command | ||
| 668 | @code{make-frame-on-display}: | ||
| 669 | |||
| 670 | @findex make-frame-on-display | ||
| 671 | @table @kbd | ||
| 672 | @item M-x make-frame-on-display @key{RET} @var{display} @key{RET} | ||
| 673 | Create a new frame on display @var{display}. | ||
| 674 | @end table | ||
| 675 | |||
| 676 | A single X server can handle more than one screen. When you open | ||
| 677 | frames on two screens belonging to one server, Emacs knows they share a | ||
| 678 | single keyboard, and it treats all the commands arriving from these | ||
| 679 | screens as a single stream of input. | ||
| 680 | |||
| 681 | When you open frames on different X servers, Emacs makes a separate | ||
| 682 | input stream for each server. This way, two users can type | ||
| 683 | simultaneously on the two displays, and Emacs will not garble their | ||
| 684 | input. Each server also has its own selected frame. The commands you | ||
| 685 | enter with a particular X server apply to that server's selected frame. | ||
| 686 | |||
| 687 | Despite these features, people using the same Emacs job from different | ||
| 688 | displays can still interfere with each other if they are not careful. | ||
| 689 | For example, if any one types @kbd{C-x C-c}, that exits the Emacs job | ||
| 690 | for all of them! | ||
| 691 | |||
| 692 | @node Special Buffer Frames | ||
| 693 | @section Special Buffer Frames | ||
| 694 | |||
| 695 | @vindex special-display-buffer-names | ||
| 696 | You can make certain chosen buffers, which Emacs normally displays | ||
| 697 | in ``another window,'' appear in special frames of their own. To do | ||
| 698 | this, set the variable @code{special-display-buffer-names} to a list | ||
| 699 | of buffer names; any buffer whose name is in that list automatically | ||
| 700 | gets a special frame, when an Emacs command wants to display it ``in | ||
| 701 | another window.'' | ||
| 702 | |||
| 703 | For example, if you set the variable this way, | ||
| 704 | |||
| 705 | @example | ||
| 706 | (setq special-display-buffer-names | ||
| 707 | '("*Completions*" "*grep*" "*tex-shell*")) | ||
| 708 | @end example | ||
| 709 | |||
| 710 | @noindent | ||
| 711 | then completion lists, @code{grep} output and the @TeX{} mode shell | ||
| 712 | buffer get individual frames of their own. These frames, and the | ||
| 713 | windows in them, are never automatically split or reused for any other | ||
| 714 | buffers. They continue to show the buffers they were created for, | ||
| 715 | unless you alter them by hand. Killing the special buffer deletes its | ||
| 716 | frame automatically. | ||
| 717 | |||
| 718 | @vindex special-display-regexps | ||
| 719 | More generally, you can set @code{special-display-regexps} to a list | ||
| 720 | of regular expressions; then a buffer gets its own frame if its name | ||
| 721 | matches any of those regular expressions. (Once again, this applies only | ||
| 722 | to buffers that normally get displayed for you in ``another window.'') | ||
| 723 | |||
| 724 | @vindex special-display-frame-alist | ||
| 725 | The variable @code{special-display-frame-alist} specifies the frame | ||
| 726 | parameters for these frames. It has a default value, so you don't need | ||
| 727 | to set it. | ||
| 728 | |||
| 729 | For those who know Lisp, an element of | ||
| 730 | @code{special-display-buffer-names} or @code{special-display-regexps} | ||
| 731 | can also be a list. Then the first element is the buffer name or | ||
| 732 | regular expression; the rest of the list specifies how to create the | ||
| 733 | frame. It can be an association list specifying frame parameter | ||
| 734 | values; these values take precedence over parameter values specified | ||
| 735 | in @code{special-display-frame-alist}. If you specify the symbol | ||
| 736 | @code{same-window} as a ``frame parameter'' in this list, with a | ||
| 737 | non-@code{nil} value, that means to use the selected window if | ||
| 738 | possible. If you use the symbol @code{same-frame} as a ``frame | ||
| 739 | parameter'' in this list, with a non-@code{nil} value, that means to | ||
| 740 | use the selected frame if possible. | ||
| 741 | |||
| 742 | Alternatively, the value can have this form: | ||
| 743 | |||
| 744 | @example | ||
| 745 | (@var{function} @var{args}...) | ||
| 746 | @end example | ||
| 747 | |||
| 748 | @noindent | ||
| 749 | where @var{function} is a symbol. Then the frame is constructed by | ||
| 750 | calling @var{function}; its first argument is the buffer, and its | ||
| 751 | remaining arguments are @var{args}. | ||
| 752 | |||
| 753 | An analogous feature lets you specify buffers which should be | ||
| 754 | displayed in the selected window. @xref{Force Same Window}. The | ||
| 755 | same-window feature takes precedence over the special-frame feature; | ||
| 756 | therefore, if you add a buffer name to | ||
| 757 | @code{special-display-buffer-names} and it has no effect, check to see | ||
| 758 | whether that feature is also in use for the same buffer name. | ||
| 759 | |||
| 760 | @node Frame Parameters | ||
| 761 | @section Setting Frame Parameters | ||
| 762 | @cindex Auto-Raise mode | ||
| 763 | @cindex Auto-Lower mode | ||
| 764 | |||
| 765 | @kindex S-Mouse-1 | ||
| 766 | You can specify the font and colors used for text display, and the | ||
| 767 | colors for the frame borders, the cursor, and the mouse cursor, by | ||
| 768 | customizing the faces @code{default}, @code{border}, @code{cursor} and | ||
| 769 | @code{mouse}. @xref{Face Customization}. You can also set a frame's | ||
| 770 | default font through a pop-up menu. Press @kbd{S-Mouse-1} to activate | ||
| 771 | this menu. | ||
| 772 | |||
| 773 | These commands are available for controlling the window management | ||
| 774 | behavior of the selected frame. | ||
| 775 | |||
| 776 | @table @kbd | ||
| 777 | @findex auto-raise-mode | ||
| 778 | @item M-x auto-raise-mode | ||
| 779 | Toggle whether or not the selected frame should auto-raise. Auto-raise | ||
| 780 | means that every time you move the mouse onto the frame, it raises the | ||
| 781 | frame. | ||
| 782 | |||
| 783 | Some window managers also implement auto-raise. If you enable | ||
| 784 | auto-raise for Emacs frames in your window manager, it will work, but | ||
| 785 | it is beyond Emacs' control, so @code{auto-raise-mode} has no effect | ||
| 786 | on it. | ||
| 787 | |||
| 788 | @findex auto-lower-mode | ||
| 789 | @item M-x auto-lower-mode | ||
| 790 | Toggle whether or not the selected frame should auto-lower. | ||
| 791 | Auto-lower means that every time you move the mouse off the frame, | ||
| 792 | the frame moves to the bottom of the stack on the screen. | ||
| 793 | |||
| 794 | The command @code{auto-lower-mode} has no effect on auto-lower | ||
| 795 | implemented by the window manager. To control that, you must use the | ||
| 796 | appropriate window manager features. | ||
| 797 | @end table | ||
| 798 | |||
| 799 | In Emacs versions that use an X toolkit, the color-setting and | ||
| 800 | font-setting functions don't affect menus and the menu bar, since they | ||
| 801 | are displayed by their own widget classes. To change the appearance of | ||
| 802 | the menus and menu bar, you must use X resources (@pxref{Resources}). | ||
| 803 | @xref{Colors}, regarding colors. @xref{Font X}, regarding choice of | ||
| 804 | font. | ||
| 805 | |||
| 806 | Colors, fonts, and other attributes of the frame's display can also | ||
| 807 | be customized by setting frame parameters in the variable | ||
| 808 | @code{default-frame-alist} (@pxref{Creating Frames}). For a detailed | ||
| 809 | description of frame parameters and customization, see @ref{Frame | ||
| 810 | Parameters,,, elisp, The Emacs Lisp Reference Manual}. | ||
| 811 | |||
| 812 | @node Scroll Bars | ||
| 813 | @section Scroll Bars | ||
| 814 | @cindex Scroll Bar mode | ||
| 815 | @cindex mode, Scroll Bar | ||
| 816 | |||
| 817 | On graphical displays, Emacs normally makes a @dfn{scroll bar} at | ||
| 818 | the left of each Emacs window.@footnote{Placing it at the left is | ||
| 819 | usually more useful with overlapping frames with text starting at the | ||
| 820 | left margin.} The scroll bar runs the height of the window, and shows | ||
| 821 | a moving rectangular inner box which represents the portion of the | ||
| 822 | buffer currently displayed. The entire height of the scroll bar | ||
| 823 | represents the entire length of the buffer. | ||
| 824 | |||
| 825 | You can use @kbd{Mouse-2} (normally, the middle button) in the scroll | ||
| 826 | bar to move or drag the inner box up and down. If you move it to the | ||
| 827 | top of the scroll bar, you see the top of the buffer. If you move it to | ||
| 828 | the bottom of the scroll bar, you see the bottom of the buffer. | ||
| 829 | |||
| 830 | The left and right buttons in the scroll bar scroll by controlled | ||
| 831 | increments. @kbd{Mouse-1} (normally, the left button) moves the line at | ||
| 832 | the level where you click up to the top of the window. @kbd{Mouse-3} | ||
| 833 | (normally, the right button) moves the line at the top of the window | ||
| 834 | down to the level where you click. By clicking repeatedly in the same | ||
| 835 | place, you can scroll by the same distance over and over. | ||
| 836 | |||
| 837 | You can also click @kbd{C-Mouse-2} in the scroll bar to split a | ||
| 838 | window vertically. The split occurs on the line where you click. | ||
| 839 | |||
| 840 | @findex scroll-bar-mode | ||
| 841 | @vindex scroll-bar-mode | ||
| 842 | You can enable or disable Scroll Bar mode with the command @kbd{M-x | ||
| 843 | scroll-bar-mode}. With no argument, it toggles the use of scroll | ||
| 844 | bars. With an argument, it turns use of scroll bars on if and only if | ||
| 845 | the argument is positive. This command applies to all frames, | ||
| 846 | including frames yet to be created. Customize the variable | ||
| 847 | @code{scroll-bar-mode} to control the use of scroll bars at startup. | ||
| 848 | You can use it to specify that they are placed at the right of windows | ||
| 849 | if you prefer that. You have to set this variable through the | ||
| 850 | @samp{Customize} interface (@pxref{Easy Customization}), or it will | ||
| 851 | not work properly. | ||
| 852 | |||
| 853 | You can also use the X resource @samp{verticalScrollBars} to control | ||
| 854 | the initial setting of Scroll Bar mode. @xref{Resources}. | ||
| 855 | |||
| 856 | @findex toggle-scroll-bar | ||
| 857 | To enable or disable scroll bars for just the selected frame, use the | ||
| 858 | command @kbd{M-x toggle-scroll-bar}. | ||
| 859 | |||
| 860 | @vindex scroll-bar-width | ||
| 861 | @cindex width of the scroll bar | ||
| 862 | You can control the scroll bar width by changing the value of the | ||
| 863 | @code{scroll-bar-width} frame parameter. | ||
| 864 | |||
| 865 | @node Wheeled Mice | ||
| 866 | @section Scrolling With ``Wheeled'' Mice | ||
| 867 | |||
| 868 | @cindex mouse wheel | ||
| 869 | @cindex wheel, mouse | ||
| 870 | @findex mouse-wheel-mode | ||
| 871 | @cindex Mouse Wheel minor mode | ||
| 872 | @cindex mode, Mouse Wheel | ||
| 873 | Some mice have a ``wheel'' instead of a third button. You can | ||
| 874 | usually click the wheel to act as either @kbd{Mouse-2} or | ||
| 875 | @kbd{Mouse-3}, depending on the setup. You can also use the wheel to | ||
| 876 | scroll windows instead of using the scroll bar or keyboard commands. | ||
| 877 | Mouse wheel support only works if the system generates appropriate | ||
| 878 | events; whenever possible, it is turned on by default. To toggle this | ||
| 879 | feature, use @kbd{M-x mouse-wheel-mode}. | ||
| 880 | |||
| 881 | @vindex mouse-wheel-follow-mouse | ||
| 882 | @vindex mouse-wheel-scroll-amount | ||
| 883 | @vindex mouse-wheel-progressive-speed | ||
| 884 | The two variables @code{mouse-wheel-follow-mouse} and | ||
| 885 | @code{mouse-wheel-scroll-amount} determine where and by how much | ||
| 886 | buffers are scrolled. The variable | ||
| 887 | @code{mouse-wheel-progressive-speed} determines whether the scroll | ||
| 888 | speed is linked to how fast you move the wheel. | ||
| 889 | |||
| 890 | @node Drag and Drop | ||
| 891 | @section Drag and Drop | ||
| 892 | @cindex drag and drop | ||
| 893 | |||
| 894 | Emacs supports @dfn{drag and drop} using the mouse. For instance, | ||
| 895 | dropping text onto an Emacs frame inserts the text where it is dropped. | ||
| 896 | Dropping a file onto an Emacs frame visits that file. As a special | ||
| 897 | case, dropping the file on a Dired buffer moves or copies the file | ||
| 898 | (according to the conventions of the application it came from) into the | ||
| 899 | directory displayed in that buffer. | ||
| 900 | |||
| 901 | @vindex dnd-open-file-other-window | ||
| 902 | Dropping a file normally visits it in the window you drop it on. If | ||
| 903 | you prefer to visit the file in a new window in such cases, customize | ||
| 904 | the variable @code{dnd-open-file-other-window}. | ||
| 905 | |||
| 906 | The XDND and Motif drag and drop protocols, and the old KDE 1.x | ||
| 907 | protocol, are currently supported. | ||
| 908 | |||
| 909 | @node Menu Bars | ||
| 910 | @section Menu Bars | ||
| 911 | @cindex Menu Bar mode | ||
| 912 | @cindex mode, Menu Bar | ||
| 913 | @findex menu-bar-mode | ||
| 914 | @vindex menu-bar-mode | ||
| 915 | |||
| 916 | You can turn display of menu bars on or off with @kbd{M-x | ||
| 917 | menu-bar-mode} or by customizing the variable @code{menu-bar-mode}. | ||
| 918 | With no argument, this command toggles Menu Bar mode, a | ||
| 919 | minor mode. With an argument, the command turns Menu Bar mode on if the | ||
| 920 | argument is positive, off if the argument is not positive. You can use | ||
| 921 | the X resource @samp{menuBarLines} to control the initial setting of | ||
| 922 | Menu Bar mode. @xref{Resources}. | ||
| 923 | |||
| 924 | @kindex C-Mouse-3 @r{(when menu bar is disabled)} | ||
| 925 | Expert users often turn off the menu bar, especially on text-only | ||
| 926 | terminals, where this makes one additional line available for text. | ||
| 927 | If the menu bar is off, you can still pop up a menu of its contents | ||
| 928 | with @kbd{C-Mouse-3} on a display which supports pop-up menus. | ||
| 929 | @xref{Menu Mouse Clicks}. | ||
| 930 | |||
| 931 | @xref{Menu Bar}, for information on how to invoke commands with the | ||
| 932 | menu bar. @xref{X Resources}, for how to customize the menu bar | ||
| 933 | menus' visual appearance. | ||
| 934 | |||
| 935 | @node Tool Bars | ||
| 936 | @section Tool Bars | ||
| 937 | @cindex Tool Bar mode | ||
| 938 | @cindex mode, Tool Bar | ||
| 939 | @cindex icons, toolbar | ||
| 940 | |||
| 941 | The @dfn{tool bar} is a line (or lines) of icons at the top of the | ||
| 942 | Emacs window, just below the menu bar. You can click on these icons | ||
| 943 | with the mouse to do various jobs. | ||
| 944 | |||
| 945 | The global tool bar contains general commands. Some major modes | ||
| 946 | define their own tool bars to replace it. A few ``special'' modes | ||
| 947 | that are not designed for ordinary editing remove some items from the | ||
| 948 | global tool bar. | ||
| 949 | |||
| 950 | Tool bars work only on a graphical display. The tool bar uses colored | ||
| 951 | XPM icons if Emacs was built with XPM support. Otherwise, the tool | ||
| 952 | bar uses monochrome icons (PBM or XBM format). | ||
| 953 | |||
| 954 | @findex tool-bar-mode | ||
| 955 | @vindex tool-bar-mode | ||
| 956 | You can turn display of tool bars on or off with @kbd{M-x | ||
| 957 | tool-bar-mode} or by customizing the option @code{tool-bar-mode}. | ||
| 958 | |||
| 959 | @node Dialog Boxes | ||
| 960 | @section Using Dialog Boxes | ||
| 961 | @cindex dialog boxes | ||
| 962 | |||
| 963 | @vindex use-dialog-box | ||
| 964 | A dialog box is a special kind of menu for asking you a yes-or-no | ||
| 965 | question or some other special question. Many Emacs commands use a | ||
| 966 | dialog box to ask a yes-or-no question, if you used the mouse to | ||
| 967 | invoke the command to begin with. | ||
| 968 | |||
| 969 | You can customize the variable @code{use-dialog-box} to suppress the | ||
| 970 | use of dialog boxes. This also controls whether to use file selection | ||
| 971 | windows (but those are not supported on all platforms). | ||
| 972 | |||
| 973 | @vindex use-file-dialog | ||
| 974 | A file selection window is a special kind of dialog box for asking | ||
| 975 | for file names. You can customize the variable @code{use-file-dialog} | ||
| 976 | to suppress the use of file selection windows, even if you still want | ||
| 977 | other kinds of dialogs. This variable has no effect if you have | ||
| 978 | suppressed all dialog boxes with the variable @code{use-dialog-box}. | ||
| 979 | |||
| 980 | @vindex x-gtk-show-hidden-files | ||
| 981 | For Gtk+ version 2.4 and newer, Emacs use the Gtk+ file chooser | ||
| 982 | dialog. Emacs adds a toggle button that enables and disables showing | ||
| 983 | of hidden files (files starting with a dot) in that dialog. The | ||
| 984 | variable @code{x-gtk-show-hidden-files} controls whether to show | ||
| 985 | hidden files by default. | ||
| 986 | |||
| 987 | @vindex x-gtk-use-old-file-dialog | ||
| 988 | For Gtk+ versions 2.4 through 2.10, you can select the old file | ||
| 989 | dialog (@code{gtk-file-selector}) by setting the variable | ||
| 990 | @code{x-gtk-use-old-file-dialog} to a non-@code{nil} value. If it is | ||
| 991 | @code{nil}, Emacs uses @code{gtk-file-chooser}. If Emacs is built | ||
| 992 | with a Gtk+ version that has only one file dialog, this variable has | ||
| 993 | no effect. | ||
| 994 | |||
| 995 | @vindex x-gtk-file-dialog-help-text | ||
| 996 | Emacs adds help text to the Gtk+ file chooser dialog. The variable | ||
| 997 | @code{x-gtk-file-dialog-help-text} specifies the text to add; if it is | ||
| 998 | @code{nil}, that disables the added text. | ||
| 999 | |||
| 1000 | @node Tooltips | ||
| 1001 | @section Tooltips | ||
| 1002 | @cindex tooltips | ||
| 1003 | |||
| 1004 | @dfn{Tooltips} are small windows that display text information at the | ||
| 1005 | current mouse position. They activate when there is a pause in mouse | ||
| 1006 | movement. There are two types of tooltip: help tooltips and GUD | ||
| 1007 | tooltips. | ||
| 1008 | |||
| 1009 | @dfn{Help tooltips} typically display over text---including the mode | ||
| 1010 | line---but are also available for other parts of the Emacs frame, such | ||
| 1011 | as the tool bar and menu items. | ||
| 1012 | |||
| 1013 | @findex tooltip-mode | ||
| 1014 | You can toggle display of help tooltips (Tooltip mode) with the | ||
| 1015 | command @kbd{M-x tooltip-mode}. When Tooltip mode is disabled, the | ||
| 1016 | help text is displayed in the echo area instead. | ||
| 1017 | |||
| 1018 | @dfn{GUD tooltips} show values of variables. They are useful when | ||
| 1019 | you are debugging a program. @xref{Debugger Operation}. | ||
| 1020 | |||
| 1021 | @vindex tooltip-delay | ||
| 1022 | The variables @code{tooltip-delay} specifies how long Emacs should | ||
| 1023 | wait before displaying a tooltip. For additional customization | ||
| 1024 | options for displaying tooltips, use @kbd{M-x customize-group | ||
| 1025 | @key{RET} tooltip @key{RET}}. @xref{X Resources}, for information on | ||
| 1026 | customizing the windows that display tooltips. | ||
| 1027 | |||
| 1028 | @node Mouse Avoidance | ||
| 1029 | @section Mouse Avoidance | ||
| 1030 | @cindex avoiding mouse in the way of your typing | ||
| 1031 | @cindex mouse avoidance | ||
| 1032 | |||
| 1033 | @vindex mouse-avoidance-mode | ||
| 1034 | Mouse Avoidance mode keeps the mouse pointer away from point, to avoid | ||
| 1035 | obscuring text you want to edit. Whenever it moves the mouse, it also | ||
| 1036 | raises the frame. To use Mouse Avoidance mode, customize the variable | ||
| 1037 | @code{mouse-avoidance-mode}. You can set this to various values to | ||
| 1038 | move the mouse in several ways: | ||
| 1039 | |||
| 1040 | @table @code | ||
| 1041 | @item banish | ||
| 1042 | Move the mouse to the upper-right corner on any key-press; | ||
| 1043 | @item exile | ||
| 1044 | Move the mouse to the corner only if the cursor gets too close, | ||
| 1045 | and allow it to return once the cursor is out of the way; | ||
| 1046 | @item jump | ||
| 1047 | If the cursor gets too close to the mouse, displace the mouse | ||
| 1048 | a random distance & direction; | ||
| 1049 | @item animate | ||
| 1050 | As @code{jump}, but shows steps along the way for illusion of motion; | ||
| 1051 | @item cat-and-mouse | ||
| 1052 | The same as @code{animate}; | ||
| 1053 | @item proteus | ||
| 1054 | As @code{animate}, but changes the shape of the mouse pointer too. | ||
| 1055 | @end table | ||
| 1056 | |||
| 1057 | @findex mouse-avoidance-mode | ||
| 1058 | You can also use the command @kbd{M-x mouse-avoidance-mode} to enable | ||
| 1059 | the mode. | ||
| 1060 | |||
| 1061 | @node Non-Window Terminals | ||
| 1062 | @section Non-Window Terminals | ||
| 1063 | @cindex non-window terminals | ||
| 1064 | @cindex single-frame terminals | ||
| 1065 | |||
| 1066 | On a text-only terminal, Emacs can display only one Emacs frame at a | ||
| 1067 | time. However, you can still create multiple Emacs frames, and switch | ||
| 1068 | between them. Switching frames on these terminals is much like | ||
| 1069 | switching between different window configurations. | ||
| 1070 | |||
| 1071 | Use @kbd{C-x 5 2} to create a new frame and switch to it; use @kbd{C-x | ||
| 1072 | 5 o} to cycle through the existing frames; use @kbd{C-x 5 0} to delete | ||
| 1073 | the current frame. | ||
| 1074 | |||
| 1075 | Each frame has a number to distinguish it. If your terminal can | ||
| 1076 | display only one frame at a time, the selected frame's number @var{n} | ||
| 1077 | appears near the beginning of the mode line, in the form | ||
| 1078 | @samp{F@var{n}}. | ||
| 1079 | |||
| 1080 | @findex set-frame-name | ||
| 1081 | @findex select-frame-by-name | ||
| 1082 | @samp{F@var{n}} is in fact the frame's initial name. You can give | ||
| 1083 | frames more meaningful names if you wish, and you can select a frame | ||
| 1084 | by its name. Use the command @kbd{M-x set-frame-name @key{RET} | ||
| 1085 | @var{name} @key{RET}} to specify a new name for the selected frame, | ||
| 1086 | and use @kbd{M-x select-frame-by-name @key{RET} @var{name} @key{RET}} | ||
| 1087 | to select a frame according to its name. The name you specify appears | ||
| 1088 | in the mode line when the frame is selected. | ||
| 1089 | |||
| 1090 | @node Text-Only Mouse | ||
| 1091 | @section Using a Mouse in Terminal Emulators | ||
| 1092 | @cindex mouse support | ||
| 1093 | @cindex terminal emulators, mouse support | ||
| 1094 | |||
| 1095 | Some terminal emulators support mouse clicks in the terminal window. | ||
| 1096 | |||
| 1097 | @cindex xterm | ||
| 1098 | In a terminal emulator which is compatible with @code{xterm}, | ||
| 1099 | you can use @kbd{M-x xterm-mouse-mode} to give Emacs control over | ||
| 1100 | simple use of the mouse---basically, only non-modified single clicks | ||
| 1101 | are supported. The normal @code{xterm} mouse functionality for such | ||
| 1102 | clicks is still available by holding down the @kbd{SHIFT} key when you | ||
| 1103 | press the mouse button. Xterm Mouse mode is a global minor mode | ||
| 1104 | (@pxref{Minor Modes}). Repeating the command turns the mode off | ||
| 1105 | again. | ||
| 1106 | |||
| 1107 | In the console on GNU/Linux, you can use @kbd{M-x t-mouse-mode}. You | ||
| 1108 | need to have the gpm package installed and running on your system in | ||
| 1109 | order for this to work. | ||
| 1110 | |||
| 1111 | @ignore | ||
| 1112 | arch-tag: 7dcf3a31-a43b-45d4-a900-445b10d77e49 | ||
| 1113 | @end ignore | ||
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi new file mode 100644 index 00000000000..f289c2ca1cb --- /dev/null +++ b/doc/emacs/glossary.texi | |||
| @@ -0,0 +1,1323 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Glossary, Key Index, Intro, Top | ||
| 6 | @unnumbered Glossary | ||
| 7 | |||
| 8 | @table @asis | ||
| 9 | @item Abbrev | ||
| 10 | An abbrev is a text string which expands into a different text string | ||
| 11 | when present in the buffer. For example, you might define a few letters | ||
| 12 | as an abbrev for a long phrase that you want to insert frequently. | ||
| 13 | @xref{Abbrevs}. | ||
| 14 | |||
| 15 | @item Aborting | ||
| 16 | Aborting means getting out of a recursive edit (q.v.@:). The | ||
| 17 | commands @kbd{C-]} and @kbd{M-x top-level} are used for this. | ||
| 18 | @xref{Quitting}. | ||
| 19 | |||
| 20 | @item Alt | ||
| 21 | Alt is the name of a modifier bit which a keyboard input character may | ||
| 22 | have. To make a character Alt, type it while holding down the @key{ALT} | ||
| 23 | key. Such characters are given names that start with @kbd{Alt-} | ||
| 24 | (usually written @kbd{A-} for short). (Note that many terminals have a | ||
| 25 | key labeled @key{ALT} which is really a @key{META} key.) @xref{User | ||
| 26 | Input, Alt}. | ||
| 27 | |||
| 28 | @item Argument | ||
| 29 | See `numeric argument.' | ||
| 30 | |||
| 31 | @item @acronym{ASCII} character | ||
| 32 | An @acronym{ASCII} character is either an @acronym{ASCII} control character or an @acronym{ASCII} | ||
| 33 | printing character. @xref{User Input}. | ||
| 34 | |||
| 35 | @item @acronym{ASCII} control character | ||
| 36 | An @acronym{ASCII} control character is the Control version of an upper-case | ||
| 37 | letter, or the Control version of one of the characters @samp{@@[\]^_?}. | ||
| 38 | |||
| 39 | @item @acronym{ASCII} printing character | ||
| 40 | @acronym{ASCII} printing characters include letters, digits, space, and these | ||
| 41 | punctuation characters: @samp{!@@#$%^& *()_-+=|\~` @{@}[]:;"' <>,.?/}. | ||
| 42 | |||
| 43 | @item Auto Fill Mode | ||
| 44 | Auto Fill mode is a minor mode in which text that you insert is | ||
| 45 | automatically broken into lines of a given maximum width. | ||
| 46 | @xref{Filling}. | ||
| 47 | |||
| 48 | @item Auto Saving | ||
| 49 | Auto saving is the practice of saving the contents of an Emacs buffer in | ||
| 50 | a specially-named file, so that the information will not be lost if the | ||
| 51 | buffer is lost due to a system error or user error. @xref{Auto Save}. | ||
| 52 | |||
| 53 | @item Autoloading | ||
| 54 | Emacs automatically loads Lisp libraries when a Lisp program requests a | ||
| 55 | function or a variable from those libraries. This is called | ||
| 56 | `autoloading'. @xref{Lisp Libraries}. | ||
| 57 | |||
| 58 | @item Backtrace | ||
| 59 | A backtrace is a trace of a series of function calls showing how a | ||
| 60 | program arrived to a certain point. It is used mainly for finding and | ||
| 61 | correcting bugs (q.v.@:). Emacs can display a backtrace when it signals | ||
| 62 | an error or when you type @kbd{C-g} (see `quitting'). @xref{Checklist}. | ||
| 63 | |||
| 64 | @item Backup File | ||
| 65 | A backup file records the contents that a file had before the current | ||
| 66 | editing session. Emacs makes backup files automatically to help you | ||
| 67 | track down or cancel changes you later regret making. @xref{Backup}. | ||
| 68 | |||
| 69 | @item Balancing Parentheses | ||
| 70 | Emacs can balance parentheses (or other matching delimiters) either | ||
| 71 | manually or automatically. You do manual balancing with the commands | ||
| 72 | to move over parenthetical groupings (@pxref{Moving by Parens}). | ||
| 73 | Automatic balancing works by blinking or highlighting the delimiter | ||
| 74 | that matches the one you just inserted (@pxref{Matching,,Matching | ||
| 75 | Parens}). | ||
| 76 | |||
| 77 | @item Balanced Expressions | ||
| 78 | A balanced expression is a syntactically recognizable expression, such | ||
| 79 | as a symbol, number, string constant, block, or parenthesized expression | ||
| 80 | in C. @xref{Expressions,Balanced Expressions}. | ||
| 81 | |||
| 82 | @item Balloon Help | ||
| 83 | See `tooltips.' | ||
| 84 | |||
| 85 | @item Base Buffer | ||
| 86 | A base buffer is a buffer whose text is shared by an indirect buffer | ||
| 87 | (q.v.@:). | ||
| 88 | |||
| 89 | @item Bind | ||
| 90 | To bind a key sequence means to give it a binding (q.v.@:). | ||
| 91 | @xref{Rebinding}. | ||
| 92 | |||
| 93 | @item Binding | ||
| 94 | A key sequence gets its meaning in Emacs by having a binding, which is a | ||
| 95 | command (q.v.@:), a Lisp function that is run when the user types that | ||
| 96 | sequence. @xref{Commands,Binding}. Customization often involves | ||
| 97 | rebinding a character to a different command function. The bindings of | ||
| 98 | all key sequences are recorded in the keymaps (q.v.@:). @xref{Keymaps}. | ||
| 99 | |||
| 100 | @item Blank Lines | ||
| 101 | Blank lines are lines that contain only whitespace. Emacs has several | ||
| 102 | commands for operating on the blank lines in the buffer. | ||
| 103 | |||
| 104 | @item Bookmark | ||
| 105 | Bookmarks are akin to registers (q.v.@:) in that they record positions | ||
| 106 | in buffers to which you can return later. Unlike registers, bookmarks | ||
| 107 | persist between Emacs sessions. | ||
| 108 | |||
| 109 | @item Border | ||
| 110 | A border is a thin space along the edge of the frame, used just for | ||
| 111 | spacing, not for displaying anything. An Emacs frame has an ordinary | ||
| 112 | external border, outside of everything including the menu bar, plus an | ||
| 113 | internal border that surrounds the text windows and their scroll bars | ||
| 114 | and separates them from the menu bar and tool bar. You can customize | ||
| 115 | both borders with options and resources (@pxref{Borders X}). Borders | ||
| 116 | are not the same as fringes (q.v.@:). | ||
| 117 | |||
| 118 | @item Buffer | ||
| 119 | The buffer is the basic editing unit; one buffer corresponds to one text | ||
| 120 | being edited. You can have several buffers, but at any time you are | ||
| 121 | editing only one, the `current buffer,' though several can be visible | ||
| 122 | when you are using multiple windows (q.v.@:). Most buffers are visiting | ||
| 123 | (q.v.@:) some file. @xref{Buffers}. | ||
| 124 | |||
| 125 | @item Buffer Selection History | ||
| 126 | Emacs keeps a buffer selection history which records how recently each | ||
| 127 | Emacs buffer has been selected. This is used for choosing a buffer to | ||
| 128 | select. @xref{Buffers}. | ||
| 129 | |||
| 130 | @item Bug | ||
| 131 | A bug is an incorrect or unreasonable behavior of a program, or | ||
| 132 | inaccurate or confusing documentation. Emacs developers treat bug | ||
| 133 | reports, both in Emacs code and its documentation, very seriously and | ||
| 134 | ask you to report any bugs you find. @xref{Bugs}. | ||
| 135 | |||
| 136 | @item Button Down Event | ||
| 137 | A button down event is the kind of input event generated right away when | ||
| 138 | you press down on a mouse button. @xref{Mouse Buttons}. | ||
| 139 | |||
| 140 | @item By Default | ||
| 141 | See `default.' | ||
| 142 | |||
| 143 | @item Byte Compilation | ||
| 144 | See `compilation.' | ||
| 145 | |||
| 146 | @item @kbd{C-} | ||
| 147 | @kbd{C-} in the name of a character is an abbreviation for Control. | ||
| 148 | @xref{User Input,C-}. | ||
| 149 | |||
| 150 | @item @kbd{C-M-} | ||
| 151 | @kbd{C-M-} in the name of a character is an abbreviation for | ||
| 152 | Control-Meta. @xref{User Input,C-M-}. | ||
| 153 | |||
| 154 | @item Case Conversion | ||
| 155 | Case conversion means changing text from upper case to lower case or | ||
| 156 | vice versa. @xref{Case}, for the commands for case conversion. | ||
| 157 | |||
| 158 | @item Character | ||
| 159 | Characters form the contents of an Emacs buffer; see @ref{Text | ||
| 160 | Characters}. Also, key sequences (q.v.@:) are usually made up of | ||
| 161 | characters (though they may include other input events as well). | ||
| 162 | @xref{User Input}. | ||
| 163 | |||
| 164 | @item Character Set | ||
| 165 | Emacs supports a number of character sets, each of which represents a | ||
| 166 | particular alphabet or script. @xref{International}. | ||
| 167 | |||
| 168 | @item Character Terminal | ||
| 169 | See `text-only terminal.' | ||
| 170 | |||
| 171 | @item Click Event | ||
| 172 | A click event is the kind of input event generated when you press a | ||
| 173 | mouse button and release it without moving the mouse. @xref{Mouse Buttons}. | ||
| 174 | |||
| 175 | @item Clipboard | ||
| 176 | A clipboard is a buffer provided by the window system for transferring | ||
| 177 | text between applications. On the X Window system, the clipboard is | ||
| 178 | provided in addition to the primary selection (q.v.@:); on MS-Windows and Mac, | ||
| 179 | the clipboard is used @emph{instead} of the primary selection. | ||
| 180 | @xref{Clipboard}. | ||
| 181 | |||
| 182 | @item Coding System | ||
| 183 | A coding system is an encoding for representing text characters in a | ||
| 184 | file or in a stream of information. Emacs has the ability to convert | ||
| 185 | text to or from a variety of coding systems when reading or writing it. | ||
| 186 | @xref{Coding Systems}. | ||
| 187 | |||
| 188 | @item Command | ||
| 189 | A command is a Lisp function specially defined to be able to serve as a | ||
| 190 | key binding in Emacs. When you type a key sequence (q.v.@:), its | ||
| 191 | binding (q.v.@:) is looked up in the relevant keymaps (q.v.@:) to find | ||
| 192 | the command to run. @xref{Commands}. | ||
| 193 | |||
| 194 | @item Command History | ||
| 195 | See `minibuffer history.' | ||
| 196 | |||
| 197 | @item Command Name | ||
| 198 | A command name is the name of a Lisp symbol which is a command | ||
| 199 | (@pxref{Commands}). You can invoke any command by its name using | ||
| 200 | @kbd{M-x} (@pxref{M-x,M-x,Running Commands by Name}). | ||
| 201 | |||
| 202 | @item Comment | ||
| 203 | A comment is text in a program which is intended only for humans reading | ||
| 204 | the program, and which is marked specially so that it will be ignored | ||
| 205 | when the program is loaded or compiled. Emacs offers special commands | ||
| 206 | for creating, aligning and killing comments. @xref{Comments}. | ||
| 207 | |||
| 208 | @item Common Lisp | ||
| 209 | Common Lisp is a dialect of Lisp (q.v.@:) much larger and more powerful | ||
| 210 | than Emacs Lisp. Emacs provides a subset of Common Lisp in the CL | ||
| 211 | package. @xref{Top, Common Lisp, Overview, cl, Common Lisp Extensions}. | ||
| 212 | |||
| 213 | @item Compilation | ||
| 214 | Compilation is the process of creating an executable program from source | ||
| 215 | code. Emacs has commands for compiling files of Emacs Lisp code | ||
| 216 | (@pxref{Byte Compilation,,, elisp, the Emacs Lisp | ||
| 217 | Reference Manual}) and programs in C and other languages | ||
| 218 | (@pxref{Compilation}). | ||
| 219 | |||
| 220 | @item Complete Key | ||
| 221 | A complete key is a key sequence which fully specifies one action to be | ||
| 222 | performed by Emacs. For example, @kbd{X} and @kbd{C-f} and @kbd{C-x m} | ||
| 223 | are complete keys. Complete keys derive their meanings from being bound | ||
| 224 | (q.v.@:) to commands (q.v.@:). Thus, @kbd{X} is conventionally bound to | ||
| 225 | a command to insert @samp{X} in the buffer; @kbd{C-x m} is | ||
| 226 | conventionally bound to a command to begin composing a mail message. | ||
| 227 | @xref{Keys}. | ||
| 228 | |||
| 229 | @item Completion | ||
| 230 | Completion is what Emacs does when it automatically fills out an | ||
| 231 | abbreviation for a name into the entire name. Completion is done for | ||
| 232 | minibuffer (q.v.@:) arguments when the set of possible valid inputs | ||
| 233 | is known; for example, on command names, buffer names, and | ||
| 234 | file names. Completion occurs when @key{TAB}, @key{SPC} or @key{RET} | ||
| 235 | is typed. @xref{Completion}.@refill | ||
| 236 | |||
| 237 | @item Continuation Line | ||
| 238 | When a line of text is longer than the width of the window, it | ||
| 239 | takes up more than one screen line when displayed. We say that the | ||
| 240 | text line is continued, and all screen lines used for it after the | ||
| 241 | first are called continuation lines. @xref{Continuation Lines}. | ||
| 242 | A related Emacs feature is `filling' (q.v.@:). | ||
| 243 | |||
| 244 | @item Control Character | ||
| 245 | A control character is a character that you type by holding down the | ||
| 246 | @key{CTRL} key. Some control characters also have their own keys, so | ||
| 247 | that you can type them without using @key{CTRL}. For example, | ||
| 248 | @key{RET}, @key{TAB}, @key{ESC} and @key{DEL} are all control | ||
| 249 | characters. @xref{User Input}. | ||
| 250 | |||
| 251 | @item Copyleft | ||
| 252 | A copyleft is a notice giving the public legal permission to | ||
| 253 | redistribute and modify a program or other work of art, but requiring | ||
| 254 | modified versions to carry similar permission. Copyright is normally | ||
| 255 | used to keep users divided and helpless; with copyleft we turn that | ||
| 256 | around to empower users and encourage them to cooperate. | ||
| 257 | |||
| 258 | The particular form of copyleft used by the GNU project is called the | ||
| 259 | GNU General Public License. @xref{Copying}. | ||
| 260 | |||
| 261 | @item @key{CTRL} | ||
| 262 | The @key{CTRL} or ``control'' key is what you hold down | ||
| 263 | in order to enter a control character (q.v.). | ||
| 264 | |||
| 265 | @item Current Buffer | ||
| 266 | The current buffer in Emacs is the Emacs buffer on which most editing | ||
| 267 | commands operate. You can select any Emacs buffer as the current one. | ||
| 268 | @xref{Buffers}. | ||
| 269 | |||
| 270 | @item Current Line | ||
| 271 | The current line is the line that point is on (@pxref{Point}). | ||
| 272 | |||
| 273 | @item Current Paragraph | ||
| 274 | The current paragraph is the paragraph that point is in. If point is | ||
| 275 | between two paragraphs, the current paragraph is the one that follows | ||
| 276 | point. @xref{Paragraphs}. | ||
| 277 | |||
| 278 | @item Current Defun | ||
| 279 | The current defun is the defun (q.v.@:) that point is in. If point is | ||
| 280 | between defuns, the current defun is the one that follows point. | ||
| 281 | @xref{Defuns}. | ||
| 282 | |||
| 283 | @item Cursor | ||
| 284 | The cursor is the rectangle on the screen which indicates the position | ||
| 285 | called point (q.v.@:) at which insertion and deletion takes place. | ||
| 286 | The cursor is on or under the character that follows point. Often | ||
| 287 | people speak of `the cursor' when, strictly speaking, they mean | ||
| 288 | `point.' @xref{Point,Cursor}. | ||
| 289 | |||
| 290 | @item Customization | ||
| 291 | Customization is making minor changes in the way Emacs works. It is | ||
| 292 | often done by setting variables (@pxref{Variables}) or faces | ||
| 293 | (@pxref{Face Customization}), or by rebinding key sequences | ||
| 294 | (@pxref{Keymaps}). | ||
| 295 | |||
| 296 | @cindex cut and paste | ||
| 297 | @item Cut and Paste | ||
| 298 | See `killing' and `yanking.' | ||
| 299 | |||
| 300 | @item Default Argument | ||
| 301 | The default for an argument is the value that will be assumed if you | ||
| 302 | do not specify one. When the minibuffer is used to read an argument, | ||
| 303 | the default argument is used if you just type @key{RET}. | ||
| 304 | @xref{Minibuffer}. | ||
| 305 | |||
| 306 | @item Default | ||
| 307 | A default is the value that is used for a certain purpose if and when | ||
| 308 | you do not specify a value to use. | ||
| 309 | |||
| 310 | @item Default Directory | ||
| 311 | When you specify a file name that does not start with @samp{/} or @samp{~}, | ||
| 312 | it is interpreted relative to the current buffer's default directory. | ||
| 313 | (On MS-Windows and MS-DOS, file names which start with a drive letter | ||
| 314 | @samp{@var{x}:} are treated as absolute, not relative.) | ||
| 315 | @xref{Minibuffer File,Default Directory}. | ||
| 316 | |||
| 317 | @item Defun | ||
| 318 | A defun is a major definition at the top level in a program. The name | ||
| 319 | `defun' comes from Lisp, where most such definitions use the construct | ||
| 320 | @code{defun}. @xref{Defuns}. | ||
| 321 | |||
| 322 | @item @key{DEL} | ||
| 323 | @key{DEL} is a character that runs the command to delete one character | ||
| 324 | of text before the cursor. It is typically either the @key{DELETE} | ||
| 325 | key or the @key{BACKSPACE} key, whichever one is easy to type. | ||
| 326 | @xref{Erasing,DEL}. | ||
| 327 | |||
| 328 | @item Deletion | ||
| 329 | Deletion means erasing text without copying it into the kill ring | ||
| 330 | (q.v.@:). The alternative is killing (q.v.@:). @xref{Killing,Deletion}. | ||
| 331 | |||
| 332 | @item Deletion of Files | ||
| 333 | Deleting a file means erasing it from the file system. | ||
| 334 | @xref{Misc File Ops,Misc File Ops,Miscellaneous File Operations}. | ||
| 335 | |||
| 336 | @item Deletion of Messages | ||
| 337 | Deleting a message means flagging it to be eliminated from your mail | ||
| 338 | file. Until you expunge (q.v.@:) the Rmail file, you can still undelete | ||
| 339 | the messages you have deleted. @xref{Rmail Deletion}. | ||
| 340 | |||
| 341 | @item Deletion of Windows | ||
| 342 | Deleting a window means eliminating it from the screen. Other windows | ||
| 343 | expand to use up the space. The deleted window can never come back, | ||
| 344 | but no actual text is thereby lost. @xref{Windows}. | ||
| 345 | |||
| 346 | @item Directory | ||
| 347 | File directories are named collections in the file system, within which | ||
| 348 | you can place individual files or subdirectories. @xref{Directories}. | ||
| 349 | |||
| 350 | @item Dired | ||
| 351 | Dired is the Emacs facility that displays the contents of a file | ||
| 352 | directory and allows you to ``edit the directory,'' performing | ||
| 353 | operations on the files in the directory. @xref{Dired}. | ||
| 354 | |||
| 355 | @item Disabled Command | ||
| 356 | A disabled command is one that you may not run without special | ||
| 357 | confirmation. The usual reason for disabling a command is that it is | ||
| 358 | confusing for beginning users. @xref{Disabling}. | ||
| 359 | |||
| 360 | @item Down Event | ||
| 361 | Short for `button down event' (q.v.@:). | ||
| 362 | |||
| 363 | @item Drag Event | ||
| 364 | A drag event is the kind of input event generated when you press a mouse | ||
| 365 | button, move the mouse, and then release the button. @xref{Mouse | ||
| 366 | Buttons}. | ||
| 367 | |||
| 368 | @item Dribble File | ||
| 369 | A dribble file is a file into which Emacs writes all the characters that | ||
| 370 | you type on the keyboard. Dribble files are used to make a record | ||
| 371 | for debugging Emacs bugs. Emacs does not make a dribble file unless you | ||
| 372 | tell it to. @xref{Bugs}. | ||
| 373 | |||
| 374 | @item Echo Area | ||
| 375 | The echo area is the bottom line of the screen, used for echoing the | ||
| 376 | arguments to commands, for asking questions, and showing brief messages | ||
| 377 | (including error messages). The messages are stored in the buffer | ||
| 378 | @samp{*Messages*} so you can review them later. @xref{Echo Area}. | ||
| 379 | |||
| 380 | @item Echoing | ||
| 381 | Echoing is acknowledging the receipt of input events by displaying | ||
| 382 | them (in the echo area). Emacs never echoes single-character key | ||
| 383 | sequences; longer key sequences echo only if you pause while typing | ||
| 384 | them. | ||
| 385 | |||
| 386 | @item Electric | ||
| 387 | We say that a character is electric if it is normally self-inserting | ||
| 388 | (q.v.@:), but the current major mode (q.v.@:) redefines it to do something | ||
| 389 | else as well. For example, some programming language major modes define | ||
| 390 | particular delimiter characters to reindent the line or insert one or | ||
| 391 | more newlines in addition to self-insertion. | ||
| 392 | |||
| 393 | @item End Of Line | ||
| 394 | End of line is a character or a sequence of characters that indicate | ||
| 395 | the end of a text line. On GNU and Unix systems, this is a newline | ||
| 396 | (q.v.@:), but other systems have other conventions. @xref{Coding | ||
| 397 | Systems,end-of-line}. Emacs can recognize several end-of-line | ||
| 398 | conventions in files and convert between them. | ||
| 399 | |||
| 400 | @item Environment Variable | ||
| 401 | An environment variable is one of a collection of variables stored by | ||
| 402 | the operating system, each one having a name and a value. Emacs can | ||
| 403 | access environment variables set by its parent shell, and it can set | ||
| 404 | variables in the environment it passes to programs it invokes. | ||
| 405 | @xref{Environment}. | ||
| 406 | |||
| 407 | @item EOL | ||
| 408 | See `end of line.' | ||
| 409 | |||
| 410 | @item Error | ||
| 411 | An error occurs when an Emacs command cannot execute in the current | ||
| 412 | circumstances. When an error occurs, execution of the command stops | ||
| 413 | (unless the command has been programmed to do otherwise) and Emacs | ||
| 414 | reports the error by displaying an error message (q.v.@:). Type-ahead | ||
| 415 | is discarded. Then Emacs is ready to read another editing command. | ||
| 416 | |||
| 417 | @item Error Message | ||
| 418 | An error message is a single line of output displayed by Emacs when the | ||
| 419 | user asks for something impossible to do (such as, killing text | ||
| 420 | forward when point is at the end of the buffer). They appear in the | ||
| 421 | echo area, accompanied by a beep. | ||
| 422 | |||
| 423 | @item @key{ESC} | ||
| 424 | @key{ESC} is a character used as a prefix for typing Meta characters on | ||
| 425 | keyboards lacking a @key{META} key. Unlike the @key{META} key (which, | ||
| 426 | like the @key{SHIFT} key, is held down while another character is | ||
| 427 | typed), you press the @key{ESC} key as you would press a letter key, and | ||
| 428 | it applies to the next character you type. | ||
| 429 | |||
| 430 | @item Expression | ||
| 431 | See `balanced expression.' | ||
| 432 | |||
| 433 | @item Expunging | ||
| 434 | Expunging an Rmail file or Dired buffer or a Gnus newsgroup buffer is an | ||
| 435 | operation that truly discards the messages or files you have previously | ||
| 436 | flagged for deletion. | ||
| 437 | |||
| 438 | @item Face | ||
| 439 | A face is a style of displaying characters. It specifies attributes | ||
| 440 | such as font family and size, foreground and background colors, | ||
| 441 | underline and strike-through, background stipple, etc. Emacs provides | ||
| 442 | features to associate specific faces with portions of buffer text, in | ||
| 443 | order to display that text as specified by the face attributes. | ||
| 444 | @xref{Faces}. | ||
| 445 | |||
| 446 | @item File Locking | ||
| 447 | Emacs uses file locking to notice when two different users | ||
| 448 | start to edit one file at the same time. @xref{Interlocking}. | ||
| 449 | |||
| 450 | @item File Name | ||
| 451 | A file name is a name that refers to a file. File names may be relative | ||
| 452 | or absolute; the meaning of a relative file name depends on the current | ||
| 453 | directory, but an absolute file name refers to the same file regardless | ||
| 454 | of which directory is current. On GNU and Unix systems, an absolute | ||
| 455 | file name starts with a slash (the root directory) or with @samp{~/} or | ||
| 456 | @samp{~@var{user}/} (a home directory). On MS-Windows/MS-DOS, an | ||
| 457 | absolute file name can also start with a drive letter and a colon | ||
| 458 | @samp{@var{d}:}. | ||
| 459 | |||
| 460 | Some people use the term ``pathname'' for file names, but we do not; | ||
| 461 | we use the word ``path'' only in the term ``search path'' (q.v.@:). | ||
| 462 | |||
| 463 | @item File-Name Component | ||
| 464 | A file-name component names a file directly within a particular | ||
| 465 | directory. On GNU and Unix systems, a file name is a sequence of | ||
| 466 | file-name components, separated by slashes. For example, @file{foo/bar} | ||
| 467 | is a file name containing two components, @samp{foo} and @samp{bar}; it | ||
| 468 | refers to the file named @samp{bar} in the directory named @samp{foo} in | ||
| 469 | the current directory. MS-DOS/MS-Windows file names can also use | ||
| 470 | backslashes to separate components, as in @file{foo\bar}. | ||
| 471 | |||
| 472 | @item Fill Prefix | ||
| 473 | The fill prefix is a string that should be expected at the beginning | ||
| 474 | of each line when filling is done. It is not regarded as part of the | ||
| 475 | text to be filled. @xref{Filling}. | ||
| 476 | |||
| 477 | @item Filling | ||
| 478 | Filling text means shifting text between consecutive lines so that all | ||
| 479 | the lines are approximately the same length. @xref{Filling}. Some | ||
| 480 | other editors call this feature `line wrapping.' | ||
| 481 | |||
| 482 | @item Font Lock | ||
| 483 | Font Lock is a mode that highlights parts of buffer text according to | ||
| 484 | its syntax. @xref{Font Lock}. | ||
| 485 | |||
| 486 | @item Fontset | ||
| 487 | A fontset is a named collection of fonts. A fontset specification lists | ||
| 488 | character sets and which font to use to display each of them. Fontsets | ||
| 489 | make it easy to change several fonts at once by specifying the name of a | ||
| 490 | fontset, rather than changing each font separately. @xref{Fontsets}. | ||
| 491 | |||
| 492 | @item Formatted Text | ||
| 493 | Formatted text is text that displays with formatting information while | ||
| 494 | you edit. Formatting information includes fonts, colors, and specified | ||
| 495 | margins. @xref{Formatted Text}. | ||
| 496 | |||
| 497 | @item Formfeed Character | ||
| 498 | See `page.' | ||
| 499 | |||
| 500 | @item Frame | ||
| 501 | A frame is a rectangular cluster of Emacs windows. Emacs starts out | ||
| 502 | with one frame, but you can create more. You can subdivide each frame | ||
| 503 | into Emacs windows (q.v.@:). When you are using a window system | ||
| 504 | (q.v.@:), all the frames can be visible at the same time. | ||
| 505 | @xref{Frames}. Some other editors use the term ``window'' for this, | ||
| 506 | but in Emacs a window means something else. | ||
| 507 | |||
| 508 | @item Fringe | ||
| 509 | On a graphical display (q.v.@:), there's a narrow portion of the | ||
| 510 | frame (q.v.@:) between the text area and the window's border. Emacs | ||
| 511 | displays the fringe using a special face (q.v.@:) called | ||
| 512 | @code{fringe}. @xref{Faces,fringe}. | ||
| 513 | |||
| 514 | @item FTP | ||
| 515 | FTP is an acronym for File Transfer Protocol. Emacs uses an FTP client | ||
| 516 | program to provide access to remote files (q.v.@:). | ||
| 517 | |||
| 518 | @item Function Key | ||
| 519 | A function key is a key on the keyboard that sends input but does not | ||
| 520 | correspond to any character. @xref{Function Keys}. | ||
| 521 | |||
| 522 | @item Global | ||
| 523 | Global means ``independent of the current environment; in effect | ||
| 524 | throughout Emacs.'' It is the opposite of local (q.v.@:). Particular | ||
| 525 | examples of the use of `global' appear below. | ||
| 526 | |||
| 527 | @item Global Abbrev | ||
| 528 | A global definition of an abbrev (q.v.@:) is effective in all major | ||
| 529 | modes that do not have local (q.v.@:) definitions for the same abbrev. | ||
| 530 | @xref{Abbrevs}. | ||
| 531 | |||
| 532 | @item Global Keymap | ||
| 533 | The global keymap (q.v.@:) contains key bindings that are in effect | ||
| 534 | except when overridden by local key bindings in a major mode's local | ||
| 535 | keymap (q.v.@:). @xref{Keymaps}. | ||
| 536 | |||
| 537 | @item Global Mark Ring | ||
| 538 | The global mark ring records the series of buffers you have recently | ||
| 539 | set a mark (q.v.@:) in. In many cases you can use this to backtrack | ||
| 540 | through buffers you have been editing in, or in which you have found | ||
| 541 | tags (see `tags table'). @xref{Global Mark Ring}. | ||
| 542 | |||
| 543 | @item Global Substitution | ||
| 544 | Global substitution means replacing each occurrence of one string by | ||
| 545 | another string throughout a large amount of text. @xref{Replace}. | ||
| 546 | |||
| 547 | @item Global Variable | ||
| 548 | The global value of a variable (q.v.@:) takes effect in all buffers | ||
| 549 | that do not have their own local (q.v.@:) values for the variable. | ||
| 550 | @xref{Variables}. | ||
| 551 | |||
| 552 | @item Graphic Character | ||
| 553 | Graphic characters are those assigned pictorial images rather than | ||
| 554 | just names. All the non-Meta (q.v.@:) characters except for the | ||
| 555 | Control (q.v.@:) characters are graphic characters. These include | ||
| 556 | letters, digits, punctuation, and spaces; they do not include | ||
| 557 | @key{RET} or @key{ESC}. In Emacs, typing a graphic character inserts | ||
| 558 | that character (in ordinary editing modes). @xref{Inserting Text}. | ||
| 559 | |||
| 560 | @item Graphical Display | ||
| 561 | A graphical display is one that can display images and multiple fonts. | ||
| 562 | Usually it also has a window system (q.v.@:). | ||
| 563 | |||
| 564 | @item Highlighting | ||
| 565 | Highlighting text means displaying it with a different foreground and/or | ||
| 566 | background color to make it stand out from the rest of the text in the | ||
| 567 | buffer. | ||
| 568 | |||
| 569 | Emacs uses highlighting in several ways. When you mark a region with | ||
| 570 | the mouse, the region is always highlighted. Optionally Emacs can | ||
| 571 | also highlight the region whenever it is active (@pxref{Transient | ||
| 572 | Mark}). Incremental search also highlights matches (@pxref{Incremental | ||
| 573 | Search}). See also `font lock'. | ||
| 574 | |||
| 575 | @item Hardcopy | ||
| 576 | Hardcopy means printed output. Emacs has commands for making printed | ||
| 577 | listings of text in Emacs buffers. @xref{Printing}. | ||
| 578 | |||
| 579 | @item @key{HELP} | ||
| 580 | @key{HELP} is the Emacs name for @kbd{C-h} or @key{F1}. You can type | ||
| 581 | @key{HELP} at any time to ask what options you have, or to ask what any | ||
| 582 | command does. @xref{Help}. | ||
| 583 | |||
| 584 | @item Help Echo | ||
| 585 | Help echo is a short message displayed in the echo area when the mouse | ||
| 586 | pointer is located on portions of display that require some | ||
| 587 | explanations. Emacs displays help echo for menu items, parts of the | ||
| 588 | mode line, tool-bar buttons, etc. On graphics displays, the messages | ||
| 589 | can be displayed as tooltips (q.v.@:). @xref{Tooltips}. | ||
| 590 | |||
| 591 | @item Hook | ||
| 592 | A hook is a list of functions to be called on specific occasions, such | ||
| 593 | as saving a buffer in a file, major mode activation, etc. By | ||
| 594 | customizing the various hooks, you can modify Emacs's behavior without | ||
| 595 | changing any of its code. @xref{Hooks}. | ||
| 596 | |||
| 597 | @item Hyper | ||
| 598 | Hyper is the name of a modifier bit which a keyboard input character may | ||
| 599 | have. To make a character Hyper, type it while holding down the | ||
| 600 | @key{HYPER} key. Such characters are given names that start with | ||
| 601 | @kbd{Hyper-} (usually written @kbd{H-} for short). @xref{User Input, | ||
| 602 | Hyper}. | ||
| 603 | |||
| 604 | @item Iff | ||
| 605 | ``Iff'' means ``if and only if.'' This terminology comes from | ||
| 606 | mathematics. Try to avoid using this term in documentation, since | ||
| 607 | many are unfamiliar with it and mistake it for a typo. | ||
| 608 | |||
| 609 | @item Inbox | ||
| 610 | An inbox is a file in which mail is delivered by the operating system. | ||
| 611 | Rmail transfers mail from inboxes to Rmail files (q.v.@:) in which the | ||
| 612 | mail is then stored permanently or until explicitly deleted. | ||
| 613 | @xref{Rmail Inbox}. | ||
| 614 | |||
| 615 | @item Incremental Search | ||
| 616 | Emacs provides an incremental search facility, whereby Emacs searches | ||
| 617 | for the string as you type it. @xref{Incremental Search}. | ||
| 618 | |||
| 619 | @item Indentation | ||
| 620 | Indentation means blank space at the beginning of a line. Most | ||
| 621 | programming languages have conventions for using indentation to | ||
| 622 | illuminate the structure of the program, and Emacs has special | ||
| 623 | commands to adjust indentation. | ||
| 624 | @xref{Indentation}. | ||
| 625 | |||
| 626 | @item Indirect Buffer | ||
| 627 | An indirect buffer is a buffer that shares the text of another buffer, | ||
| 628 | called its base buffer (q.v.@:). @xref{Indirect Buffers}. | ||
| 629 | |||
| 630 | @item Info | ||
| 631 | Info is the hypertext format used by the GNU project for writing | ||
| 632 | documentation. | ||
| 633 | |||
| 634 | @item Input Event | ||
| 635 | An input event represents, within Emacs, one action taken by the user on | ||
| 636 | the terminal. Input events include typing characters, typing function | ||
| 637 | keys, pressing or releasing mouse buttons, and switching between Emacs | ||
| 638 | frames. @xref{User Input}. | ||
| 639 | |||
| 640 | @item Input Method | ||
| 641 | An input method is a system for entering non-@acronym{ASCII} text characters by | ||
| 642 | typing sequences of @acronym{ASCII} characters (q.v.@:). @xref{Input Methods}. | ||
| 643 | |||
| 644 | @item Insertion | ||
| 645 | Insertion means copying text into the buffer, either from the keyboard | ||
| 646 | or from some other place in Emacs. | ||
| 647 | |||
| 648 | @item Interlocking | ||
| 649 | Interlocking is a feature for warning when you start to alter a file | ||
| 650 | that someone else is already editing. | ||
| 651 | @xref{Interlocking,Interlocking,Simultaneous Editing}. | ||
| 652 | |||
| 653 | @item Isearch | ||
| 654 | See `incremental search.' | ||
| 655 | |||
| 656 | @item Justification | ||
| 657 | Justification means adding extra spaces within lines of text to make | ||
| 658 | them extend exactly to a specified width. | ||
| 659 | @xref{Format Justification}. | ||
| 660 | |||
| 661 | @item Keybinding | ||
| 662 | See `binding.' | ||
| 663 | |||
| 664 | @item Keyboard Macro | ||
| 665 | Keyboard macros are a way of defining new Emacs commands from | ||
| 666 | sequences of existing ones, with no need to write a Lisp program. | ||
| 667 | @xref{Keyboard Macros}. | ||
| 668 | |||
| 669 | @cindex keyboard shortcuts | ||
| 670 | @item Keyboard Shortcut | ||
| 671 | A keyboard shortcut is a key sequence (q.v.@:) which invokes a | ||
| 672 | command. What some programs call ``assigning a keyboard shortcut,'' | ||
| 673 | Emacs calls ``binding a key sequence.'' See `binding.' | ||
| 674 | |||
| 675 | @item Key Sequence | ||
| 676 | A key sequence (key, for short) is a sequence of input events (q.v.@:) | ||
| 677 | that are meaningful as a single unit. If the key sequence is enough to | ||
| 678 | specify one action, it is a complete key (q.v.@:); if it is not enough, | ||
| 679 | it is a prefix key (q.v.@:). @xref{Keys}. | ||
| 680 | |||
| 681 | @item Keymap | ||
| 682 | The keymap is the data structure that records the bindings (q.v.@:) of | ||
| 683 | key sequences to the commands that they run. For example, the global | ||
| 684 | keymap binds the character @kbd{C-n} to the command function | ||
| 685 | @code{next-line}. @xref{Keymaps}. | ||
| 686 | |||
| 687 | @item Keyboard Translation Table | ||
| 688 | The keyboard translation table is an array that translates the character | ||
| 689 | codes that come from the terminal into the character codes that make up | ||
| 690 | key sequences. | ||
| 691 | |||
| 692 | @item Kill Ring | ||
| 693 | The kill ring is where all text you have killed recently is saved. | ||
| 694 | You can reinsert any of the killed text still in the ring; this is | ||
| 695 | called yanking (q.v.@:). @xref{Yanking}. | ||
| 696 | |||
| 697 | @item Killing | ||
| 698 | Killing means erasing text and saving it on the kill ring so it can be | ||
| 699 | yanked (q.v.@:) later. Some other systems call this ``cutting.'' | ||
| 700 | Most Emacs commands that erase text perform killing, as opposed to | ||
| 701 | deletion (q.v.@:). @xref{Killing}. | ||
| 702 | |||
| 703 | @item Killing a Job | ||
| 704 | Killing a job (such as, an invocation of Emacs) means making it cease | ||
| 705 | to exist. Any data within it, if not saved in a file, is lost. | ||
| 706 | @xref{Exiting}. | ||
| 707 | |||
| 708 | @item Language Environment | ||
| 709 | Your choice of language environment specifies defaults for the input | ||
| 710 | method (q.v.@:) and coding system (q.v.@:). @xref{Language | ||
| 711 | Environments}. These defaults are relevant if you edit non-@acronym{ASCII} text | ||
| 712 | (@pxref{International}). | ||
| 713 | |||
| 714 | @item Line Wrapping | ||
| 715 | See `filling.' | ||
| 716 | |||
| 717 | @item Lisp | ||
| 718 | Lisp is a programming language. Most of Emacs is written in a dialect | ||
| 719 | of Lisp, called Emacs Lisp, that is extended with special features which | ||
| 720 | make it especially suitable for text editing tasks. | ||
| 721 | |||
| 722 | @item List | ||
| 723 | A list is, approximately, a text string beginning with an open | ||
| 724 | parenthesis and ending with the matching close parenthesis. In C mode | ||
| 725 | and other non-Lisp modes, groupings surrounded by other kinds of matched | ||
| 726 | delimiters appropriate to the language, such as braces, are also | ||
| 727 | considered lists. Emacs has special commands for many operations on | ||
| 728 | lists. @xref{Moving by Parens}. | ||
| 729 | |||
| 730 | @item Local | ||
| 731 | Local means ``in effect only in a particular context''; the relevant | ||
| 732 | kind of context is a particular function execution, a particular | ||
| 733 | buffer, or a particular major mode. It is the opposite of `global' | ||
| 734 | (q.v.@:). Specific uses of `local' in Emacs terminology appear below. | ||
| 735 | |||
| 736 | @item Local Abbrev | ||
| 737 | A local abbrev definition is effective only if a particular major mode | ||
| 738 | is selected. In that major mode, it overrides any global definition | ||
| 739 | for the same abbrev. @xref{Abbrevs}. | ||
| 740 | |||
| 741 | @item Local Keymap | ||
| 742 | A local keymap is used in a particular major mode; the key bindings | ||
| 743 | (q.v.@:) in the current local keymap override global bindings of the | ||
| 744 | same key sequences. @xref{Keymaps}. | ||
| 745 | |||
| 746 | @item Local Variable | ||
| 747 | A local value of a variable (q.v.@:) applies to only one buffer. | ||
| 748 | @xref{Locals}. | ||
| 749 | |||
| 750 | @item @kbd{M-} | ||
| 751 | @kbd{M-} in the name of a character is an abbreviation for @key{META}, | ||
| 752 | one of the modifier keys that can accompany any character. | ||
| 753 | @xref{User Input,M-}. | ||
| 754 | |||
| 755 | @item @kbd{M-C-} | ||
| 756 | @kbd{M-C-} in the name of a character is an abbreviation for | ||
| 757 | Control-Meta; it means the same thing as @kbd{C-M-}. If your | ||
| 758 | terminal lacks a real @key{META} key, you type a Control-Meta character by | ||
| 759 | typing @key{ESC} and then typing the corresponding Control character. | ||
| 760 | @xref{User Input,C-M-}. | ||
| 761 | |||
| 762 | @item @kbd{M-x} | ||
| 763 | @kbd{M-x} is the key sequence which is used to call an Emacs command by | ||
| 764 | name. This is how you run commands that are not bound to key sequences. | ||
| 765 | @xref{M-x,M-x,Running Commands by Name}. | ||
| 766 | |||
| 767 | @item Mail | ||
| 768 | Mail means messages sent from one user to another through the computer | ||
| 769 | system, to be read at the recipient's convenience. Emacs has commands for | ||
| 770 | composing and sending mail, and for reading and editing the mail you have | ||
| 771 | received. @xref{Sending Mail}. @xref{Rmail}, for how to read mail. | ||
| 772 | |||
| 773 | @item Mail Composition Method | ||
| 774 | A mail composition method is a program runnable within Emacs for editing | ||
| 775 | and sending a mail message. Emacs lets you select from several | ||
| 776 | alternative mail composition methods. @xref{Mail Methods}. | ||
| 777 | |||
| 778 | @item Major Mode | ||
| 779 | The Emacs major modes are a mutually exclusive set of options, each of | ||
| 780 | which configures Emacs for editing a certain sort of text. Ideally, | ||
| 781 | each programming language has its own major mode. @xref{Major Modes}. | ||
| 782 | |||
| 783 | @item Margin | ||
| 784 | The space between the usable part of a window (including the | ||
| 785 | fringe) and the window edge. | ||
| 786 | |||
| 787 | @item Mark | ||
| 788 | The mark points to a position in the text. It specifies one end of the | ||
| 789 | region (q.v.@:), point being the other end. Many commands operate on | ||
| 790 | all the text from point to the mark. Each buffer has its own mark. | ||
| 791 | @xref{Mark}. | ||
| 792 | |||
| 793 | @item Mark Ring | ||
| 794 | The mark ring is used to hold several recent previous locations of the | ||
| 795 | mark, just in case you want to move back to them. Each buffer has its | ||
| 796 | own mark ring; in addition, there is a single global mark ring (q.v.@:). | ||
| 797 | @xref{Mark Ring}. | ||
| 798 | |||
| 799 | @item Menu Bar | ||
| 800 | The menu bar is the line at the top of an Emacs frame. It contains | ||
| 801 | words you can click on with the mouse to bring up menus, or you can use | ||
| 802 | a keyboard interface to navigate it. @xref{Menu Bars}. | ||
| 803 | |||
| 804 | @item Message | ||
| 805 | See `mail.' | ||
| 806 | |||
| 807 | @item Meta | ||
| 808 | Meta is the name of a modifier bit which you can use in a command | ||
| 809 | character. To enter a meta character, you hold down the @key{META} | ||
| 810 | key while typing the character. We refer to such characters with | ||
| 811 | names that start with @kbd{Meta-} (usually written @kbd{M-} for | ||
| 812 | short). For example, @kbd{M-<} is typed by holding down @key{META} | ||
| 813 | and at the same time typing @kbd{<} (which itself is done, on most | ||
| 814 | terminals, by holding down @key{SHIFT} and typing @kbd{,}). | ||
| 815 | @xref{User Input,Meta}. | ||
| 816 | |||
| 817 | On some terminals, the @key{META} key is actually labeled @key{ALT} | ||
| 818 | or @key{EDIT}. | ||
| 819 | |||
| 820 | @item Meta Character | ||
| 821 | A Meta character is one whose character code includes the Meta bit. | ||
| 822 | |||
| 823 | @item Minibuffer | ||
| 824 | The minibuffer is the window that appears when necessary inside the | ||
| 825 | echo area (q.v.@:), used for reading arguments to commands. | ||
| 826 | @xref{Minibuffer}. | ||
| 827 | |||
| 828 | @item Minibuffer History | ||
| 829 | The minibuffer history records the text you have specified in the past | ||
| 830 | for minibuffer arguments, so you can conveniently use the same text | ||
| 831 | again. @xref{Minibuffer History}. | ||
| 832 | |||
| 833 | @item Minor Mode | ||
| 834 | A minor mode is an optional feature of Emacs which can be switched on | ||
| 835 | or off independently of all other features. Each minor mode has a | ||
| 836 | command to turn it on or off. @xref{Minor Modes}. | ||
| 837 | |||
| 838 | @item Minor Mode Keymap | ||
| 839 | A minor mode keymap is a keymap that belongs to a minor mode and is | ||
| 840 | active when that mode is enabled. Minor mode keymaps take precedence | ||
| 841 | over the buffer's local keymap, just as the local keymap takes | ||
| 842 | precedence over the global keymap. @xref{Keymaps}. | ||
| 843 | |||
| 844 | @item Mode Line | ||
| 845 | The mode line is the line at the bottom of each window (q.v.@:), giving | ||
| 846 | status information on the buffer displayed in that window. @xref{Mode | ||
| 847 | Line}. | ||
| 848 | |||
| 849 | @item Modified Buffer | ||
| 850 | A buffer (q.v.@:) is modified if its text has been changed since the | ||
| 851 | last time the buffer was saved (or since when it was created, if it | ||
| 852 | has never been saved). @xref{Saving}. | ||
| 853 | |||
| 854 | @item Moving Text | ||
| 855 | Moving text means erasing it from one place and inserting it in | ||
| 856 | another. The usual way to move text is by killing (q.v.@:) it and then | ||
| 857 | yanking (q.v.@:) it. @xref{Killing}. | ||
| 858 | |||
| 859 | @item MULE | ||
| 860 | MULE refers to the Emacs features for editing multilingual non-@acronym{ASCII} text | ||
| 861 | using multibyte characters (q.v.@:). @xref{International}. | ||
| 862 | |||
| 863 | @item Multibyte Character | ||
| 864 | A multibyte character is a character that takes up several bytes in a | ||
| 865 | buffer. Emacs uses multibyte characters to represent non-@acronym{ASCII} text, | ||
| 866 | since the number of non-@acronym{ASCII} characters is much more than 256. | ||
| 867 | @xref{International Chars, International Characters}. | ||
| 868 | |||
| 869 | @item Named Mark | ||
| 870 | A named mark is a register (q.v.@:) in its role of recording a | ||
| 871 | location in text so that you can move point to that location. | ||
| 872 | @xref{Registers}. | ||
| 873 | |||
| 874 | @item Narrowing | ||
| 875 | Narrowing means creating a restriction (q.v.@:) that limits editing in | ||
| 876 | the current buffer to only a part of the text in the buffer. Text | ||
| 877 | outside that part is inaccessible for editing until the boundaries are | ||
| 878 | widened again, but it is still there, and saving the file saves it | ||
| 879 | all. @xref{Narrowing}. | ||
| 880 | |||
| 881 | @item Newline | ||
| 882 | Control-J characters in the buffer terminate lines of text and are | ||
| 883 | therefore also called newlines. @xref{Text Characters,Newline}. | ||
| 884 | |||
| 885 | @cindex nil | ||
| 886 | @cindex t | ||
| 887 | @item @code{nil} | ||
| 888 | @code{nil} is a value usually interpreted as a logical ``false.'' Its | ||
| 889 | opposite is @code{t}, interpreted as ``true.'' | ||
| 890 | |||
| 891 | @item Numeric Argument | ||
| 892 | A numeric argument is a number, specified before a command, to change | ||
| 893 | the effect of the command. Often the numeric argument serves as a | ||
| 894 | repeat count. @xref{Arguments}. | ||
| 895 | |||
| 896 | @item Overwrite Mode | ||
| 897 | Overwrite mode is a minor mode. When it is enabled, ordinary text | ||
| 898 | characters replace the existing text after point rather than pushing | ||
| 899 | it to the right. @xref{Minor Modes}. | ||
| 900 | |||
| 901 | @item Page | ||
| 902 | A page is a unit of text, delimited by formfeed characters (@acronym{ASCII} | ||
| 903 | control-L, code 014) coming at the beginning of a line. Some Emacs | ||
| 904 | commands are provided for moving over and operating on pages. | ||
| 905 | @xref{Pages}. | ||
| 906 | |||
| 907 | @item Paragraph | ||
| 908 | Paragraphs are the medium-size unit of human-language text. There are | ||
| 909 | special Emacs commands for moving over and operating on paragraphs. | ||
| 910 | @xref{Paragraphs}. | ||
| 911 | |||
| 912 | @item Parsing | ||
| 913 | We say that certain Emacs commands parse words or expressions in the | ||
| 914 | text being edited. Really, all they know how to do is find the other | ||
| 915 | end of a word or expression. @xref{Syntax}. | ||
| 916 | |||
| 917 | @item Point | ||
| 918 | Point is the place in the buffer at which insertion and deletion | ||
| 919 | occur. Point is considered to be between two characters, not at one | ||
| 920 | character. The terminal's cursor (q.v.@:) indicates the location of | ||
| 921 | point. @xref{Point}. | ||
| 922 | |||
| 923 | @item Prefix Argument | ||
| 924 | See `numeric argument.' | ||
| 925 | |||
| 926 | @item Prefix Key | ||
| 927 | A prefix key is a key sequence (q.v.@:) whose sole function is to | ||
| 928 | introduce a set of longer key sequences. @kbd{C-x} is an example of | ||
| 929 | prefix key; any two-character sequence starting with @kbd{C-x} is | ||
| 930 | therefore a legitimate key sequence. @xref{Keys}. | ||
| 931 | |||
| 932 | @item Primary Rmail File | ||
| 933 | Your primary Rmail file is the file named @samp{RMAIL} in your home | ||
| 934 | directory. That's where Rmail stores your incoming mail, unless you | ||
| 935 | specify a different file name. @xref{Rmail}. | ||
| 936 | |||
| 937 | @item Primary Selection | ||
| 938 | The primary selection is one particular X selection (q.v.@:); it is the | ||
| 939 | selection that most X applications use for transferring text to and from | ||
| 940 | other applications. | ||
| 941 | |||
| 942 | The Emacs kill commands set the primary selection and the yank command | ||
| 943 | uses the primary selection when appropriate. @xref{Killing}. | ||
| 944 | |||
| 945 | @item Prompt | ||
| 946 | A prompt is text used to ask the user for input. Displaying a prompt | ||
| 947 | is called prompting. Emacs prompts always appear in the echo area | ||
| 948 | (q.v.@:). One kind of prompting happens when the minibuffer is used to | ||
| 949 | read an argument (@pxref{Minibuffer}); the echoing which happens when | ||
| 950 | you pause in the middle of typing a multi-character key sequence is also | ||
| 951 | a kind of prompting (@pxref{Echo Area}). | ||
| 952 | |||
| 953 | @item Query-Replace | ||
| 954 | Query-replace is an interactive string replacement feature provided by | ||
| 955 | Emacs. @xref{Query Replace}. | ||
| 956 | |||
| 957 | @item Quitting | ||
| 958 | Quitting means canceling a partially typed command or a running | ||
| 959 | command, using @kbd{C-g} (or @kbd{C-@key{BREAK}} on MS-DOS). @xref{Quitting}. | ||
| 960 | |||
| 961 | @item Quoting | ||
| 962 | Quoting means depriving a character of its usual special significance. | ||
| 963 | The most common kind of quoting in Emacs is with @kbd{C-q}. What | ||
| 964 | constitutes special significance depends on the context and on | ||
| 965 | convention. For example, an ``ordinary'' character as an Emacs command | ||
| 966 | inserts itself; so in this context, a special character is any character | ||
| 967 | that does not normally insert itself (such as @key{DEL}, for example), | ||
| 968 | and quoting it makes it insert itself as if it were not special. Not | ||
| 969 | all contexts allow quoting. @xref{Inserting Text,Quoting}. | ||
| 970 | |||
| 971 | @item Quoting File Names | ||
| 972 | Quoting a file name turns off the special significance of constructs | ||
| 973 | such as @samp{$}, @samp{~} and @samp{:}. @xref{Quoted File Names}. | ||
| 974 | |||
| 975 | @item Read-Only Buffer | ||
| 976 | A read-only buffer is one whose text you are not allowed to change. | ||
| 977 | Normally Emacs makes buffers read-only when they contain text which | ||
| 978 | has a special significance to Emacs; for example, Dired buffers. | ||
| 979 | Visiting a file that is write-protected also makes a read-only buffer. | ||
| 980 | @xref{Buffers}. | ||
| 981 | |||
| 982 | @item Rectangle | ||
| 983 | A rectangle consists of the text in a given range of columns on a given | ||
| 984 | range of lines. Normally you specify a rectangle by putting point at | ||
| 985 | one corner and putting the mark at the diagonally opposite corner. | ||
| 986 | @xref{Rectangles}. | ||
| 987 | |||
| 988 | @item Recursive Editing Level | ||
| 989 | A recursive editing level is a state in which part of the execution of | ||
| 990 | a command involves asking you to edit some text. This text may | ||
| 991 | or may not be the same as the text to which the command was applied. | ||
| 992 | The mode line indicates recursive editing levels with square brackets | ||
| 993 | (@samp{[} and @samp{]}). @xref{Recursive Edit}. | ||
| 994 | |||
| 995 | @item Redisplay | ||
| 996 | Redisplay is the process of correcting the image on the screen to | ||
| 997 | correspond to changes that have been made in the text being edited. | ||
| 998 | @xref{Screen,Redisplay}. | ||
| 999 | |||
| 1000 | @item Regexp | ||
| 1001 | See `regular expression.' | ||
| 1002 | |||
| 1003 | @item Region | ||
| 1004 | The region is the text between point (q.v.@:) and the mark (q.v.@:). | ||
| 1005 | Many commands operate on the text of the region. @xref{Mark,Region}. | ||
| 1006 | |||
| 1007 | @item Register | ||
| 1008 | Registers are named slots in which text or buffer positions or | ||
| 1009 | rectangles can be saved for later use. @xref{Registers}. A related | ||
| 1010 | Emacs feature is `bookmarks' (q.v.@:). | ||
| 1011 | |||
| 1012 | @item Regular Expression | ||
| 1013 | A regular expression is a pattern that can match various text strings; | ||
| 1014 | for example, @samp{a[0-9]+} matches @samp{a} followed by one or more | ||
| 1015 | digits. @xref{Regexps}. | ||
| 1016 | |||
| 1017 | @item Remote File | ||
| 1018 | A remote file is a file that is stored on a system other than your own. | ||
| 1019 | Emacs can access files on other computers provided that they are | ||
| 1020 | connected to the same network as your machine, and (obviously) that | ||
| 1021 | you have a supported method to gain access to those files. | ||
| 1022 | @xref{Remote Files}. | ||
| 1023 | |||
| 1024 | @item Repeat Count | ||
| 1025 | See `numeric argument.' | ||
| 1026 | |||
| 1027 | @item Replacement | ||
| 1028 | See `global substitution.' | ||
| 1029 | |||
| 1030 | @item Restriction | ||
| 1031 | A buffer's restriction is the amount of text, at the beginning or the | ||
| 1032 | end of the buffer, that is temporarily inaccessible. Giving a buffer a | ||
| 1033 | nonzero amount of restriction is called narrowing (q.v.@:); removing | ||
| 1034 | a restriction is called widening (q.v.@:). @xref{Narrowing}. | ||
| 1035 | |||
| 1036 | @item @key{RET} | ||
| 1037 | @key{RET} is a character that in Emacs runs the command to insert a | ||
| 1038 | newline into the text. It is also used to terminate most arguments | ||
| 1039 | read in the minibuffer (q.v.@:). @xref{User Input,Return}. | ||
| 1040 | |||
| 1041 | @item Reverting | ||
| 1042 | Reverting means returning to the original state. Emacs lets you | ||
| 1043 | revert a buffer by re-reading its file from disk. @xref{Reverting}. | ||
| 1044 | |||
| 1045 | @item Rmail File | ||
| 1046 | An Rmail file is a file containing text in a special format used by | ||
| 1047 | Rmail for storing mail. @xref{Rmail}. | ||
| 1048 | |||
| 1049 | @item Saving | ||
| 1050 | Saving a buffer means copying its text into the file that was visited | ||
| 1051 | (q.v.@:) in that buffer. This is the way text in files actually gets | ||
| 1052 | changed by your Emacs editing. @xref{Saving}. | ||
| 1053 | |||
| 1054 | @item Scroll Bar | ||
| 1055 | A scroll bar is a tall thin hollow box that appears at the side of a | ||
| 1056 | window. You can use mouse commands in the scroll bar to scroll the | ||
| 1057 | window. The scroll bar feature is supported only under windowing | ||
| 1058 | systems. @xref{Scroll Bars}. | ||
| 1059 | |||
| 1060 | @item Scrolling | ||
| 1061 | Scrolling means shifting the text in the Emacs window so as to see a | ||
| 1062 | different part of the buffer. @xref{Scrolling}. | ||
| 1063 | |||
| 1064 | @item Searching | ||
| 1065 | Searching means moving point to the next occurrence of a specified | ||
| 1066 | string or the next match for a specified regular expression. | ||
| 1067 | @xref{Search}. | ||
| 1068 | |||
| 1069 | @item Search Path | ||
| 1070 | A search path is a list of directory names, to be used for searching for | ||
| 1071 | files for certain purposes. For example, the variable @code{load-path} | ||
| 1072 | holds a search path for finding Lisp library files. @xref{Lisp Libraries}. | ||
| 1073 | |||
| 1074 | @item Secondary Selection | ||
| 1075 | The secondary selection is one particular X selection; some X | ||
| 1076 | applications can use it for transferring text to and from other | ||
| 1077 | applications. Emacs has special mouse commands for transferring text | ||
| 1078 | using the secondary selection. @xref{Secondary Selection}. | ||
| 1079 | |||
| 1080 | @item Selected Frame | ||
| 1081 | The selected frame is the one your input currently operates on. | ||
| 1082 | @xref{Frames}. | ||
| 1083 | |||
| 1084 | @item Selected Window | ||
| 1085 | The selected frame is the one your input currently operates on. | ||
| 1086 | @xref{Basic Window}. | ||
| 1087 | |||
| 1088 | @item Selecting a Buffer | ||
| 1089 | Selecting a buffer means making it the current (q.v.@:) buffer. | ||
| 1090 | @xref{Select Buffer}. | ||
| 1091 | |||
| 1092 | @item Selection | ||
| 1093 | Windowing systems allow an application program to specify | ||
| 1094 | selections whose values are text. A program can also read the | ||
| 1095 | selections that other programs have set up. This is the principal way | ||
| 1096 | of transferring text between window applications. Emacs has commands to | ||
| 1097 | work with the primary (q.v.@:) selection and the secondary (q.v.@:) | ||
| 1098 | selection, and also with the clipboard (q.v.@:). | ||
| 1099 | |||
| 1100 | @item Self-Documentation | ||
| 1101 | Self-documentation is the feature of Emacs which can tell you what any | ||
| 1102 | command does, or give you a list of all commands related to a topic | ||
| 1103 | you specify. You ask for self-documentation with the help character, | ||
| 1104 | @kbd{C-h}. @xref{Help}. | ||
| 1105 | |||
| 1106 | @item Self-Inserting Character | ||
| 1107 | A character is self-inserting if typing that character inserts that | ||
| 1108 | character in the buffer. Ordinary printing and whitespace characters | ||
| 1109 | are self-inserting in Emacs, except in certain special major modes. | ||
| 1110 | |||
| 1111 | @item Sentences | ||
| 1112 | Emacs has commands for moving by or killing by sentences. | ||
| 1113 | @xref{Sentences}. | ||
| 1114 | |||
| 1115 | @item Sexp | ||
| 1116 | A sexp (short for ``s-expression'') is the basic syntactic unit of | ||
| 1117 | Lisp in its textual form: either a list, or Lisp atom. Sexps are also | ||
| 1118 | the balanced expressions (q.v.@:) of the Lisp language; this is why | ||
| 1119 | the commands for editing balanced expressions have `sexp' in their | ||
| 1120 | name. @xref{Expressions,Sexps}. | ||
| 1121 | |||
| 1122 | @item Simultaneous Editing | ||
| 1123 | Simultaneous editing means two users modifying the same file at once. | ||
| 1124 | Simultaneous editing, if not detected, can cause one user to lose his | ||
| 1125 | or her work. Emacs detects all cases of simultaneous editing, and | ||
| 1126 | warns one of the users to investigate. | ||
| 1127 | @xref{Interlocking,Interlocking,Simultaneous Editing}. | ||
| 1128 | |||
| 1129 | @item @key{SPC} | ||
| 1130 | @key{SPC} is the space character, which you enter by pressing the | ||
| 1131 | space bar. | ||
| 1132 | |||
| 1133 | @item Speedbar | ||
| 1134 | The speedbar is a special tall frame that provides fast access to Emacs | ||
| 1135 | buffers, functions within those buffers, Info nodes, and other | ||
| 1136 | interesting parts of text within Emacs. @xref{Speedbar}. | ||
| 1137 | |||
| 1138 | @item Spell Checking | ||
| 1139 | Spell checking means checking correctness of the written form of each | ||
| 1140 | one of the words in a text. Emacs uses the Ispell spelling-checker | ||
| 1141 | program to check the spelling of parts of a buffer via a convenient user | ||
| 1142 | interface. @xref{Spelling}. | ||
| 1143 | |||
| 1144 | @item String | ||
| 1145 | A string is a kind of Lisp data object which contains a sequence of | ||
| 1146 | characters. Many Emacs variables are intended to have strings as | ||
| 1147 | values. The Lisp syntax for a string consists of the characters in the | ||
| 1148 | string with a @samp{"} before and another @samp{"} after. A @samp{"} | ||
| 1149 | that is part of the string must be written as @samp{\"} and a @samp{\} | ||
| 1150 | that is part of the string must be written as @samp{\\}. All other | ||
| 1151 | characters, including newline, can be included just by writing them | ||
| 1152 | inside the string; however, backslash sequences as in C, such as | ||
| 1153 | @samp{\n} for newline or @samp{\241} using an octal character code, are | ||
| 1154 | allowed as well. | ||
| 1155 | |||
| 1156 | @item String Substitution | ||
| 1157 | See `global substitution'. | ||
| 1158 | |||
| 1159 | @item Syntax Highlighting | ||
| 1160 | See `font lock.' | ||
| 1161 | |||
| 1162 | @item Syntax Table | ||
| 1163 | The syntax table tells Emacs which characters are part of a word, | ||
| 1164 | which characters balance each other like parentheses, etc. | ||
| 1165 | @xref{Syntax}. | ||
| 1166 | |||
| 1167 | @item Super | ||
| 1168 | Super is the name of a modifier bit which a keyboard input character may | ||
| 1169 | have. To make a character Super, type it while holding down the | ||
| 1170 | @key{SUPER} key. Such characters are given names that start with | ||
| 1171 | @kbd{Super-} (usually written @kbd{s-} for short). @xref{User Input, | ||
| 1172 | Super}. | ||
| 1173 | |||
| 1174 | @item Suspending | ||
| 1175 | Suspending Emacs means stopping it temporarily and returning control | ||
| 1176 | to its parent process, which is usually a shell. Unlike killing a job | ||
| 1177 | (q.v.@:), you can later resume the suspended Emacs job without losing | ||
| 1178 | your buffers, unsaved edits, undo history, etc. @xref{Exiting}. | ||
| 1179 | |||
| 1180 | @item @key{TAB} | ||
| 1181 | @key{TAB} is the tab character. In Emacs it is typically used for | ||
| 1182 | indentation or completion. | ||
| 1183 | |||
| 1184 | @item Tags Table | ||
| 1185 | A tags table is a file that serves as an index to the function | ||
| 1186 | definitions in one or more other files. @xref{Tags}. | ||
| 1187 | |||
| 1188 | @item Termscript File | ||
| 1189 | A termscript file contains a record of all characters sent by Emacs to | ||
| 1190 | the terminal. It is used for tracking down bugs in Emacs redisplay. | ||
| 1191 | Emacs does not make a termscript file unless you tell it to. | ||
| 1192 | @xref{Bugs}. | ||
| 1193 | |||
| 1194 | @item Text | ||
| 1195 | `Text' has two meanings (@pxref{Text}): | ||
| 1196 | |||
| 1197 | @itemize @bullet | ||
| 1198 | @item | ||
| 1199 | Data consisting of a sequence of characters, as opposed to binary | ||
| 1200 | numbers, executable programs, and the like. The basic contents of an | ||
| 1201 | Emacs buffer (aside from the text properties, q.v.@:) are always text | ||
| 1202 | in this sense. | ||
| 1203 | @item | ||
| 1204 | Data consisting of written human language, as opposed to programs, | ||
| 1205 | or following the stylistic conventions of human language. | ||
| 1206 | @end itemize | ||
| 1207 | |||
| 1208 | @item Text-only Terminal | ||
| 1209 | A text-only terminal is a display that is limited to displaying text in | ||
| 1210 | character units. Such a terminal cannot control individual pixels it | ||
| 1211 | displays. Emacs supports a subset of display features on text-only | ||
| 1212 | terminals. | ||
| 1213 | |||
| 1214 | @item Text Properties | ||
| 1215 | Text properties are annotations recorded for particular characters in | ||
| 1216 | the buffer. Images in the buffer are recorded as text properties; | ||
| 1217 | they also specify formatting information. @xref{Editing Format Info}. | ||
| 1218 | |||
| 1219 | @item Tool Bar | ||
| 1220 | The tool bar is a line (sometimes multiple lines) of icons at the top | ||
| 1221 | of an Emacs frame. Clicking on one of these icons executes a command. | ||
| 1222 | You can think of this as a graphical relative of the menu bar (q.v.@:). | ||
| 1223 | @xref{Tool Bars}. | ||
| 1224 | |||
| 1225 | @item Tooltips | ||
| 1226 | Tooltips are small windows displaying a help echo (q.v.@:) text that | ||
| 1227 | explains parts of the display, lists useful options available via mouse | ||
| 1228 | clicks, etc. @xref{Tooltips}. | ||
| 1229 | |||
| 1230 | @item Top Level | ||
| 1231 | Top level is the normal state of Emacs, in which you are editing the | ||
| 1232 | text of the file you have visited. You are at top level whenever you | ||
| 1233 | are not in a recursive editing level (q.v.@:) or the minibuffer | ||
| 1234 | (q.v.@:), and not in the middle of a command. You can get back to top | ||
| 1235 | level by aborting (q.v.@:) and quitting (q.v.@:). @xref{Quitting}. | ||
| 1236 | |||
| 1237 | @item Transposition | ||
| 1238 | Transposing two units of text means putting each one into the place | ||
| 1239 | formerly occupied by the other. There are Emacs commands to transpose | ||
| 1240 | two adjacent characters, words, balanced expressions (q.v.@:) or lines | ||
| 1241 | (@pxref{Transpose}). | ||
| 1242 | |||
| 1243 | @item Truncation | ||
| 1244 | Truncating text lines in the display means leaving out any text on a | ||
| 1245 | line that does not fit within the right margin of the window | ||
| 1246 | displaying it. See also `continuation line.' | ||
| 1247 | @xref{Continuation Lines,Truncation}. | ||
| 1248 | |||
| 1249 | @item TTY | ||
| 1250 | See `text-only terminal.' | ||
| 1251 | |||
| 1252 | @item Undoing | ||
| 1253 | Undoing means making your previous editing go in reverse, bringing | ||
| 1254 | back the text that existed earlier in the editing session. | ||
| 1255 | @xref{Undo}. | ||
| 1256 | |||
| 1257 | @item User Option | ||
| 1258 | A user option is a face (q.v.@:) or a variable (q.v.@:) that exists so | ||
| 1259 | that you can customize Emacs by setting it to a new value. | ||
| 1260 | @xref{Easy Customization}. | ||
| 1261 | |||
| 1262 | @item Variable | ||
| 1263 | A variable is an object in Lisp that can store an arbitrary value. | ||
| 1264 | Emacs uses some variables for internal purposes, and has others (known | ||
| 1265 | as `user options' (q.v.@:)) just so that you can set their values to | ||
| 1266 | control the behavior of Emacs. The variables used in Emacs that you | ||
| 1267 | are likely to be interested in are listed in the Variables Index in | ||
| 1268 | this manual (@pxref{Variable Index}). @xref{Variables}, for | ||
| 1269 | information on variables. | ||
| 1270 | |||
| 1271 | @item Version Control | ||
| 1272 | Version control systems keep track of multiple versions of a source file. | ||
| 1273 | They provide a more powerful alternative to keeping backup files (q.v.@:). | ||
| 1274 | @xref{Version Control}. | ||
| 1275 | |||
| 1276 | @item Visiting | ||
| 1277 | Visiting a file means loading its contents into a buffer (q.v.@:) | ||
| 1278 | where they can be edited. @xref{Visiting}. | ||
| 1279 | |||
| 1280 | @item Whitespace | ||
| 1281 | Whitespace is any run of consecutive formatting characters (space, | ||
| 1282 | tab, newline, and backspace). | ||
| 1283 | |||
| 1284 | @item Widening | ||
| 1285 | Widening is removing any restriction (q.v.@:) on the current buffer; | ||
| 1286 | it is the opposite of narrowing (q.v.@:). @xref{Narrowing}. | ||
| 1287 | |||
| 1288 | @item Window | ||
| 1289 | Emacs divides a frame (q.v.@:) into one or more windows, each of which | ||
| 1290 | can display the contents of one buffer (q.v.@:) at any time. | ||
| 1291 | @xref{Screen}, for basic information on how Emacs uses the screen. | ||
| 1292 | @xref{Windows}, for commands to control the use of windows. Some | ||
| 1293 | other editors use the term ``window'' for what we call a `frame' | ||
| 1294 | (q.v.@:) in Emacs. | ||
| 1295 | |||
| 1296 | @item Window System | ||
| 1297 | A window system is software that operates on a graphical display | ||
| 1298 | (q.v.@:), to subdivide the screen so that multiple applications can | ||
| 1299 | have their] own windows at the same time. All modern operating systems | ||
| 1300 | include a window system. | ||
| 1301 | |||
| 1302 | @item Word Abbrev | ||
| 1303 | See `abbrev.' | ||
| 1304 | |||
| 1305 | @item Word Search | ||
| 1306 | Word search is searching for a sequence of words, considering the | ||
| 1307 | punctuation between them as insignificant. @xref{Word Search}. | ||
| 1308 | |||
| 1309 | @item WYSIWYG | ||
| 1310 | WYSIWYG stands for ``What you see is what you get.'' Emacs generally | ||
| 1311 | provides WYSIWYG editing for files of characters; in Enriched mode | ||
| 1312 | (@pxref{Formatted Text}), it provides WYSIWYG editing for files that | ||
| 1313 | include text formatting information. | ||
| 1314 | |||
| 1315 | @item Yanking | ||
| 1316 | Yanking means reinserting text previously killed. It can be used to | ||
| 1317 | undo a mistaken kill, or for copying or moving text. Some other | ||
| 1318 | systems call this ``pasting.'' @xref{Yanking}. | ||
| 1319 | @end table | ||
| 1320 | |||
| 1321 | @ignore | ||
| 1322 | arch-tag: 0dd53ce1-5f09-4ac2-b13b-cf22b0f28d23 | ||
| 1323 | @end ignore | ||
diff --git a/doc/emacs/gnu.texi b/doc/emacs/gnu.texi new file mode 100644 index 00000000000..1cf85f41c3c --- /dev/null +++ b/doc/emacs/gnu.texi | |||
| @@ -0,0 +1,567 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1995, 2001, 2002, 2003, 2004, | ||
| 3 | @c 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @ifclear justgnu | ||
| 5 | @node Manifesto,, Microsoft Windows, Top | ||
| 6 | @unnumbered The GNU Manifesto | ||
| 7 | @end ifclear | ||
| 8 | @ifset justgnu | ||
| 9 | Copyright @copyright{} 1985, 1993, 2001, 2002, 2003, 2004, | ||
| 10 | 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 11 | |||
| 12 | Permission is granted to copy, distribute and/or modify this document | ||
| 13 | under the terms of the GNU Free Documentation License, Version 1.2 or | ||
| 14 | any later version published by the Free Software Foundation; with no | ||
| 15 | Invariant Sections, with the Front-Cover texts being ``A GNU | ||
| 16 | Manual'', and with the Back-Cover Texts as in (a) below. A copy of the | ||
| 17 | license is included in the section entitled ``GNU Free Documentation | ||
| 18 | License'' in the Emacs manual. | ||
| 19 | |||
| 20 | (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify | ||
| 21 | this GNU Manual, like GNU software. Copies published by the Free | ||
| 22 | Software Foundation raise funds for GNU development.'' | ||
| 23 | |||
| 24 | This document is part of a collection distributed under the GNU Free | ||
| 25 | Documentation License. If you want to distribute this document | ||
| 26 | separately from the collection, you can do so by adding a copy of the | ||
| 27 | license to the document, as described in section 6 of the license. | ||
| 28 | |||
| 29 | @node Top | ||
| 30 | @top The GNU Manifesto | ||
| 31 | @end ifset | ||
| 32 | |||
| 33 | @quotation | ||
| 34 | The GNU Manifesto which appears below was written by Richard Stallman at | ||
| 35 | the beginning of the GNU project, to ask for participation and support. | ||
| 36 | For the first few years, it was updated in minor ways to account for | ||
| 37 | developments, but now it seems best to leave it unchanged as most people | ||
| 38 | have seen it. | ||
| 39 | |||
| 40 | Since that time, we have learned about certain common misunderstandings | ||
| 41 | that different wording could help avoid. Footnotes added in 1993 help | ||
| 42 | clarify these points. | ||
| 43 | |||
| 44 | For up-to-date information about available GNU software, please see | ||
| 45 | our web site, @uref{http://www.gnu.org}. For software tasks and other | ||
| 46 | ways to contribute, see @uref{http://www.gnu.org/help}. | ||
| 47 | @end quotation | ||
| 48 | |||
| 49 | @unnumberedsec What's GNU? Gnu's Not Unix! | ||
| 50 | |||
| 51 | GNU, which stands for Gnu's Not Unix, is the name for the complete | ||
| 52 | Unix-compatible software system which I am writing so that I can give it | ||
| 53 | away free to everyone who can use it.@footnote{The wording here was | ||
| 54 | careless. The intention was that nobody would have to pay for | ||
| 55 | @emph{permission} to use the GNU system. But the words don't make this | ||
| 56 | clear, and people often interpret them as saying that copies of GNU | ||
| 57 | should always be distributed at little or no charge. That was never the | ||
| 58 | intent; later on, the manifesto mentions the possibility of companies | ||
| 59 | providing the service of distribution for a profit. Subsequently I have | ||
| 60 | learned to distinguish carefully between ``free'' in the sense of | ||
| 61 | freedom and ``free'' in the sense of price. Free software is software | ||
| 62 | that users have the freedom to distribute and change. Some users may | ||
| 63 | obtain copies at no charge, while others pay to obtain copies---and if | ||
| 64 | the funds help support improving the software, so much the better. The | ||
| 65 | important thing is that everyone who has a copy has the freedom to | ||
| 66 | cooperate with others in using it.} Several other volunteers are helping | ||
| 67 | me. Contributions of time, money, programs and equipment are greatly | ||
| 68 | needed. | ||
| 69 | |||
| 70 | So far we have an Emacs text editor with Lisp for writing editor commands, | ||
| 71 | a source level debugger, a yacc-compatible parser generator, a linker, and | ||
| 72 | around 35 utilities. A shell (command interpreter) is nearly completed. A | ||
| 73 | new portable optimizing C compiler has compiled itself and may be released | ||
| 74 | this year. An initial kernel exists but many more features are needed to | ||
| 75 | emulate Unix. When the kernel and compiler are finished, it will be | ||
| 76 | possible to distribute a GNU system suitable for program development. We | ||
| 77 | will use @TeX{} as our text formatter, but an nroff is being worked on. We | ||
| 78 | will use the free, portable X window system as well. After this we will | ||
| 79 | add a portable Common Lisp, an Empire game, a spreadsheet, and hundreds of | ||
| 80 | other things, plus on-line documentation. We hope to supply, eventually, | ||
| 81 | everything useful that normally comes with a Unix system, and more. | ||
| 82 | |||
| 83 | GNU will be able to run Unix programs, but will not be identical to Unix. | ||
| 84 | We will make all improvements that are convenient, based on our experience | ||
| 85 | with other operating systems. In particular, we plan to have longer | ||
| 86 | file names, file version numbers, a crashproof file system, file name | ||
| 87 | completion perhaps, terminal-independent display support, and perhaps | ||
| 88 | eventually a Lisp-based window system through which several Lisp programs | ||
| 89 | and ordinary Unix programs can share a screen. Both C and Lisp will be | ||
| 90 | available as system programming languages. We will try to support UUCP, | ||
| 91 | MIT Chaosnet, and Internet protocols for communication. | ||
| 92 | |||
| 93 | GNU is aimed initially at machines in the 68000/16000 class with virtual | ||
| 94 | memory, because they are the easiest machines to make it run on. The extra | ||
| 95 | effort to make it run on smaller machines will be left to someone who wants | ||
| 96 | to use it on them. | ||
| 97 | |||
| 98 | To avoid horrible confusion, please pronounce the `G' in the word `GNU' | ||
| 99 | when it is the name of this project. | ||
| 100 | |||
| 101 | @unnumberedsec Why I Must Write GNU | ||
| 102 | |||
| 103 | I consider that the golden rule requires that if I like a program I must | ||
| 104 | share it with other people who like it. Software sellers want to divide | ||
| 105 | the users and conquer them, making each user agree not to share with | ||
| 106 | others. I refuse to break solidarity with other users in this way. I | ||
| 107 | cannot in good conscience sign a nondisclosure agreement or a software | ||
| 108 | license agreement. For years I worked within the Artificial Intelligence | ||
| 109 | Lab to resist such tendencies and other inhospitalities, but eventually | ||
| 110 | they had gone too far: I could not remain in an institution where such | ||
| 111 | things are done for me against my will. | ||
| 112 | |||
| 113 | So that I can continue to use computers without dishonor, I have decided to | ||
| 114 | put together a sufficient body of free software so that I will be able to | ||
| 115 | get along without any software that is not free. I have resigned from the | ||
| 116 | AI lab to deny MIT any legal excuse to prevent me from giving GNU away. | ||
| 117 | |||
| 118 | @unnumberedsec Why GNU Will Be Compatible with Unix | ||
| 119 | |||
| 120 | Unix is not my ideal system, but it is not too bad. The essential features | ||
| 121 | of Unix seem to be good ones, and I think I can fill in what Unix lacks | ||
| 122 | without spoiling them. And a system compatible with Unix would be | ||
| 123 | convenient for many other people to adopt. | ||
| 124 | |||
| 125 | @unnumberedsec How GNU Will Be Available | ||
| 126 | |||
| 127 | GNU is not in the public domain. Everyone will be permitted to modify and | ||
| 128 | redistribute GNU, but no distributor will be allowed to restrict its | ||
| 129 | further redistribution. That is to say, proprietary modifications will not | ||
| 130 | be allowed. I want to make sure that all versions of GNU remain free. | ||
| 131 | |||
| 132 | @unnumberedsec Why Many Other Programmers Want to Help | ||
| 133 | |||
| 134 | I have found many other programmers who are excited about GNU and want to | ||
| 135 | help. | ||
| 136 | |||
| 137 | Many programmers are unhappy about the commercialization of system | ||
| 138 | software. It may enable them to make more money, but it requires them to | ||
| 139 | feel in conflict with other programmers in general rather than feel as | ||
| 140 | comrades. The fundamental act of friendship among programmers is the | ||
| 141 | sharing of programs; marketing arrangements now typically used essentially | ||
| 142 | forbid programmers to treat others as friends. The purchaser of software | ||
| 143 | must choose between friendship and obeying the law. Naturally, many decide | ||
| 144 | that friendship is more important. But those who believe in law often do | ||
| 145 | not feel at ease with either choice. They become cynical and think that | ||
| 146 | programming is just a way of making money. | ||
| 147 | |||
| 148 | By working on and using GNU rather than proprietary programs, we can be | ||
| 149 | hospitable to everyone and obey the law. In addition, GNU serves as an | ||
| 150 | example to inspire and a banner to rally others to join us in sharing. | ||
| 151 | This can give us a feeling of harmony which is impossible if we use | ||
| 152 | software that is not free. For about half the programmers I talk to, this | ||
| 153 | is an important happiness that money cannot replace. | ||
| 154 | |||
| 155 | @unnumberedsec How You Can Contribute | ||
| 156 | |||
| 157 | I am asking computer manufacturers for donations of machines and money. | ||
| 158 | I'm asking individuals for donations of programs and work. | ||
| 159 | |||
| 160 | One consequence you can expect if you donate machines is that GNU will run | ||
| 161 | on them at an early date. The machines should be complete, ready to use | ||
| 162 | systems, approved for use in a residential area, and not in need of | ||
| 163 | sophisticated cooling or power. | ||
| 164 | |||
| 165 | I have found very many programmers eager to contribute part-time work for | ||
| 166 | GNU. For most projects, such part-time distributed work would be very hard | ||
| 167 | to coordinate; the independently-written parts would not work together. | ||
| 168 | But for the particular task of replacing Unix, this problem is absent. A | ||
| 169 | complete Unix system contains hundreds of utility programs, each of which | ||
| 170 | is documented separately. Most interface specifications are fixed by Unix | ||
| 171 | compatibility. If each contributor can write a compatible replacement for | ||
| 172 | a single Unix utility, and make it work properly in place of the original | ||
| 173 | on a Unix system, then these utilities will work right when put together. | ||
| 174 | Even allowing for Murphy to create a few unexpected problems, assembling | ||
| 175 | these components will be a feasible task. (The kernel will require closer | ||
| 176 | communication and will be worked on by a small, tight group.) | ||
| 177 | |||
| 178 | If I get donations of money, I may be able to hire a few people full or | ||
| 179 | part time. The salary won't be high by programmers' standards, but I'm | ||
| 180 | looking for people for whom building community spirit is as important as | ||
| 181 | making money. I view this as a way of enabling dedicated people to devote | ||
| 182 | their full energies to working on GNU by sparing them the need to make a | ||
| 183 | living in another way. | ||
| 184 | |||
| 185 | @unnumberedsec Why All Computer Users Will Benefit | ||
| 186 | |||
| 187 | Once GNU is written, everyone will be able to obtain good system | ||
| 188 | software free, just like air.@footnote{This is another place I failed to | ||
| 189 | distinguish carefully between the two different meanings of ``free.'' | ||
| 190 | The statement as it stands is not false---you can get copies of GNU | ||
| 191 | software at no charge, from your friends or over the net. But it does | ||
| 192 | suggest the wrong idea.} | ||
| 193 | |||
| 194 | This means much more than just saving everyone the price of a Unix license. | ||
| 195 | It means that much wasteful duplication of system programming effort will | ||
| 196 | be avoided. This effort can go instead into advancing the state of the | ||
| 197 | art. | ||
| 198 | |||
| 199 | Complete system sources will be available to everyone. As a result, a user | ||
| 200 | who needs changes in the system will always be free to make them himself, | ||
| 201 | or hire any available programmer or company to make them for him. Users | ||
| 202 | will no longer be at the mercy of one programmer or company which owns the | ||
| 203 | sources and is in sole position to make changes. | ||
| 204 | |||
| 205 | Schools will be able to provide a much more educational environment by | ||
| 206 | encouraging all students to study and improve the system code. Harvard's | ||
| 207 | computer lab used to have the policy that no program could be installed on | ||
| 208 | the system if its sources were not on public display, and upheld it by | ||
| 209 | actually refusing to install certain programs. I was very much inspired by | ||
| 210 | this. | ||
| 211 | |||
| 212 | Finally, the overhead of considering who owns the system software and what | ||
| 213 | one is or is not entitled to do with it will be lifted. | ||
| 214 | |||
| 215 | Arrangements to make people pay for using a program, including licensing of | ||
| 216 | copies, always incur a tremendous cost to society through the cumbersome | ||
| 217 | mechanisms necessary to figure out how much (that is, which programs) a | ||
| 218 | person must pay for. And only a police state can force everyone to obey | ||
| 219 | them. Consider a space station where air must be manufactured at great | ||
| 220 | cost: charging each breather per liter of air may be fair, but wearing the | ||
| 221 | metered gas mask all day and all night is intolerable even if everyone can | ||
| 222 | afford to pay the air bill. And the TV cameras everywhere to see if you | ||
| 223 | ever take the mask off are outrageous. It's better to support the air | ||
| 224 | plant with a head tax and chuck the masks. | ||
| 225 | |||
| 226 | Copying all or parts of a program is as natural to a programmer as | ||
| 227 | breathing, and as productive. It ought to be as free. | ||
| 228 | |||
| 229 | @unnumberedsec Some Easily Rebutted Objections to GNU's Goals | ||
| 230 | |||
| 231 | @quotation | ||
| 232 | ``Nobody will use it if it is free, because that means they can't rely | ||
| 233 | on any support.'' | ||
| 234 | |||
| 235 | ``You have to charge for the program to pay for providing the | ||
| 236 | support.'' | ||
| 237 | @end quotation | ||
| 238 | |||
| 239 | If people would rather pay for GNU plus service than get GNU free without | ||
| 240 | service, a company to provide just service to people who have obtained GNU | ||
| 241 | free ought to be profitable.@footnote{Several such companies now exist.} | ||
| 242 | |||
| 243 | We must distinguish between support in the form of real programming work | ||
| 244 | and mere handholding. The former is something one cannot rely on from a | ||
| 245 | software vendor. If your problem is not shared by enough people, the | ||
| 246 | vendor will tell you to get lost. | ||
| 247 | |||
| 248 | If your business needs to be able to rely on support, the only way is to | ||
| 249 | have all the necessary sources and tools. Then you can hire any available | ||
| 250 | person to fix your problem; you are not at the mercy of any individual. | ||
| 251 | With Unix, the price of sources puts this out of consideration for most | ||
| 252 | businesses. With GNU this will be easy. It is still possible for there to | ||
| 253 | be no available competent person, but this problem cannot be blamed on | ||
| 254 | distribution arrangements. GNU does not eliminate all the world's problems, | ||
| 255 | only some of them. | ||
| 256 | |||
| 257 | Meanwhile, the users who know nothing about computers need handholding: | ||
| 258 | doing things for them which they could easily do themselves but don't know | ||
| 259 | how. | ||
| 260 | |||
| 261 | Such services could be provided by companies that sell just hand-holding | ||
| 262 | and repair service. If it is true that users would rather spend money and | ||
| 263 | get a product with service, they will also be willing to buy the service | ||
| 264 | having got the product free. The service companies will compete in quality | ||
| 265 | and price; users will not be tied to any particular one. Meanwhile, those | ||
| 266 | of us who don't need the service should be able to use the program without | ||
| 267 | paying for the service. | ||
| 268 | |||
| 269 | @quotation | ||
| 270 | ``You cannot reach many people without advertising, | ||
| 271 | and you must charge for the program to support that.'' | ||
| 272 | |||
| 273 | ``It's no use advertising a program people can get free.'' | ||
| 274 | @end quotation | ||
| 275 | |||
| 276 | There are various forms of free or very cheap publicity that can be used to | ||
| 277 | inform numbers of computer users about something like GNU. But it may be | ||
| 278 | true that one can reach more microcomputer users with advertising. If this | ||
| 279 | is really so, a business which advertises the service of copying and | ||
| 280 | mailing GNU for a fee ought to be successful enough to pay for its | ||
| 281 | advertising and more. This way, only the users who benefit from the | ||
| 282 | advertising pay for it. | ||
| 283 | |||
| 284 | On the other hand, if many people get GNU from their friends, and such | ||
| 285 | companies don't succeed, this will show that advertising was not really | ||
| 286 | necessary to spread GNU. Why is it that free market advocates don't | ||
| 287 | want to let the free market decide this?@footnote{The Free Software | ||
| 288 | Foundation raises most of its funds from a distribution service, | ||
| 289 | although it is a charity rather than a company. If @emph{no one} | ||
| 290 | chooses to obtain copies by ordering from the FSF, it will be unable | ||
| 291 | to do its work. But this does not mean that proprietary restrictions | ||
| 292 | are justified to force every user to pay. If a small fraction of all | ||
| 293 | the users order copies from the FSF, that is sufficient to keep the FSF | ||
| 294 | afloat. So we ask users to choose to support us in this way. Have you | ||
| 295 | done your part?} | ||
| 296 | |||
| 297 | @quotation | ||
| 298 | ``My company needs a proprietary operating system | ||
| 299 | to get a competitive edge.'' | ||
| 300 | @end quotation | ||
| 301 | |||
| 302 | GNU will remove operating system software from the realm of competition. | ||
| 303 | You will not be able to get an edge in this area, but neither will your | ||
| 304 | competitors be able to get an edge over you. You and they will compete in | ||
| 305 | other areas, while benefiting mutually in this one. If your business is | ||
| 306 | selling an operating system, you will not like GNU, but that's tough on | ||
| 307 | you. If your business is something else, GNU can save you from being | ||
| 308 | pushed into the expensive business of selling operating systems. | ||
| 309 | |||
| 310 | I would like to see GNU development supported by gifts from many | ||
| 311 | manufacturers and users, reducing the cost to each.@footnote{A group of | ||
| 312 | computer companies recently pooled funds to support maintenance of the | ||
| 313 | GNU C Compiler.} | ||
| 314 | |||
| 315 | @quotation | ||
| 316 | ``Don't programmers deserve a reward for their creativity?'' | ||
| 317 | @end quotation | ||
| 318 | |||
| 319 | If anything deserves a reward, it is social contribution. Creativity can | ||
| 320 | be a social contribution, but only in so far as society is free to use the | ||
| 321 | results. If programmers deserve to be rewarded for creating innovative | ||
| 322 | programs, by the same token they deserve to be punished if they restrict | ||
| 323 | the use of these programs. | ||
| 324 | |||
| 325 | @quotation | ||
| 326 | ``Shouldn't a programmer be able to ask for a reward for his creativity?'' | ||
| 327 | @end quotation | ||
| 328 | |||
| 329 | There is nothing wrong with wanting pay for work, or seeking to maximize | ||
| 330 | one's income, as long as one does not use means that are destructive. But | ||
| 331 | the means customary in the field of software today are based on | ||
| 332 | destruction. | ||
| 333 | |||
| 334 | Extracting money from users of a program by restricting their use of it is | ||
| 335 | destructive because the restrictions reduce the amount and the ways that | ||
| 336 | the program can be used. This reduces the amount of wealth that humanity | ||
| 337 | derives from the program. When there is a deliberate choice to restrict, | ||
| 338 | the harmful consequences are deliberate destruction. | ||
| 339 | |||
| 340 | The reason a good citizen does not use such destructive means to become | ||
| 341 | wealthier is that, if everyone did so, we would all become poorer from the | ||
| 342 | mutual destructiveness. This is Kantian ethics; or, the Golden Rule. | ||
| 343 | Since I do not like the consequences that result if everyone hoards | ||
| 344 | information, I am required to consider it wrong for one to do so. | ||
| 345 | Specifically, the desire to be rewarded for one's creativity does not | ||
| 346 | justify depriving the world in general of all or part of that creativity. | ||
| 347 | |||
| 348 | @quotation | ||
| 349 | ``Won't programmers starve?'' | ||
| 350 | @end quotation | ||
| 351 | |||
| 352 | I could answer that nobody is forced to be a programmer. Most of us cannot | ||
| 353 | manage to get any money for standing on the street and making faces. But | ||
| 354 | we are not, as a result, condemned to spend our lives standing on the | ||
| 355 | street making faces, and starving. We do something else. | ||
| 356 | |||
| 357 | But that is the wrong answer because it accepts the questioner's implicit | ||
| 358 | assumption: that without ownership of software, programmers cannot possibly | ||
| 359 | be paid a cent. Supposedly it is all or nothing. | ||
| 360 | |||
| 361 | The real reason programmers will not starve is that it will still be | ||
| 362 | possible for them to get paid for programming; just not paid as much as | ||
| 363 | now. | ||
| 364 | |||
| 365 | Restricting copying is not the only basis for business in software. It is | ||
| 366 | the most common basis because it brings in the most money. If it were | ||
| 367 | prohibited, or rejected by the customer, software business would move to | ||
| 368 | other bases of organization which are now used less often. There are | ||
| 369 | always numerous ways to organize any kind of business. | ||
| 370 | |||
| 371 | Probably programming will not be as lucrative on the new basis as it is | ||
| 372 | now. But that is not an argument against the change. It is not considered | ||
| 373 | an injustice that sales clerks make the salaries that they now do. If | ||
| 374 | programmers made the same, that would not be an injustice either. (In | ||
| 375 | practice they would still make considerably more than that.) | ||
| 376 | |||
| 377 | @quotation | ||
| 378 | ``Don't people have a right to control how their creativity is used?'' | ||
| 379 | @end quotation | ||
| 380 | |||
| 381 | ``Control over the use of one's ideas'' really constitutes control over | ||
| 382 | other people's lives; and it is usually used to make their lives more | ||
| 383 | difficult. | ||
| 384 | |||
| 385 | People who have studied the issue of intellectual property | ||
| 386 | rights@footnote{In the 80s I had not yet realized how confusing it was | ||
| 387 | to speak of ``the issue'' of ``intellectual property.'' That term is | ||
| 388 | obviously biased; more subtle is the fact that it lumps together | ||
| 389 | various disparate laws which raise very different issues. Nowadays I | ||
| 390 | urge people to reject the term ``intellectual property'' entirely, | ||
| 391 | lest it lead others to suppose that those laws form one coherent | ||
| 392 | issue. The way to be clear is to discuss patents, copyrights, and | ||
| 393 | trademarks separately. See | ||
| 394 | @uref{http://www.gnu.org/philosophy/not-ipr.xhtml} for more | ||
| 395 | explanation of how this term spreads confusion and bias.} carefully | ||
| 396 | (such as lawyers) say that there is no intrinsic right to intellectual | ||
| 397 | property. The kinds of supposed intellectual property rights that the | ||
| 398 | government recognizes were created by specific acts of legislation for | ||
| 399 | specific purposes. | ||
| 400 | |||
| 401 | For example, the patent system was established to encourage inventors to | ||
| 402 | disclose the details of their inventions. Its purpose was to help society | ||
| 403 | rather than to help inventors. At the time, the life span of 17 years for | ||
| 404 | a patent was short compared with the rate of advance of the state of the | ||
| 405 | art. Since patents are an issue only among manufacturers, for whom the | ||
| 406 | cost and effort of a license agreement are small compared with setting up | ||
| 407 | production, the patents often do not do much harm. They do not obstruct | ||
| 408 | most individuals who use patented products. | ||
| 409 | |||
| 410 | The idea of copyright did not exist in ancient times, when authors | ||
| 411 | frequently copied other authors at length in works of non-fiction. This | ||
| 412 | practice was useful, and is the only way many authors' works have survived | ||
| 413 | even in part. The copyright system was created expressly for the purpose | ||
| 414 | of encouraging authorship. In the domain for which it was | ||
| 415 | invented---books, which could be copied economically only on a printing | ||
| 416 | press---it did little harm, and did not obstruct most of the individuals | ||
| 417 | who read the books. | ||
| 418 | |||
| 419 | All intellectual property rights are just licenses granted by society | ||
| 420 | because it was thought, rightly or wrongly, that society as a whole would | ||
| 421 | benefit by granting them. But in any particular situation, we have to ask: | ||
| 422 | are we really better off granting such license? What kind of act are we | ||
| 423 | licensing a person to do? | ||
| 424 | |||
| 425 | The case of programs today is very different from that of books a hundred | ||
| 426 | years ago. The fact that the easiest way to copy a program is from one | ||
| 427 | neighbor to another, the fact that a program has both source code and | ||
| 428 | object code which are distinct, and the fact that a program is used rather | ||
| 429 | than read and enjoyed, combine to create a situation in which a person who | ||
| 430 | enforces a copyright is harming society as a whole both materially and | ||
| 431 | spiritually; in which a person should not do so regardless of whether the | ||
| 432 | law enables him to. | ||
| 433 | |||
| 434 | @quotation | ||
| 435 | ``Competition makes things get done better.'' | ||
| 436 | @end quotation | ||
| 437 | |||
| 438 | The paradigm of competition is a race: by rewarding the winner, we | ||
| 439 | encourage everyone to run faster. When capitalism really works this way, | ||
| 440 | it does a good job; but its defenders are wrong in assuming it always works | ||
| 441 | this way. If the runners forget why the reward is offered and become | ||
| 442 | intent on winning, no matter how, they may find other strategies---such as, | ||
| 443 | attacking other runners. If the runners get into a fist fight, they will | ||
| 444 | all finish late. | ||
| 445 | |||
| 446 | Proprietary and secret software is the moral equivalent of runners in a | ||
| 447 | fist fight. Sad to say, the only referee we've got does not seem to | ||
| 448 | object to fights; he just regulates them (``For every ten yards you run, | ||
| 449 | you can fire one shot''). He really ought to break them up, and penalize | ||
| 450 | runners for even trying to fight. | ||
| 451 | |||
| 452 | @quotation | ||
| 453 | ``Won't everyone stop programming without a monetary incentive?'' | ||
| 454 | @end quotation | ||
| 455 | |||
| 456 | Actually, many people will program with absolutely no monetary incentive. | ||
| 457 | Programming has an irresistible fascination for some people, usually the | ||
| 458 | people who are best at it. There is no shortage of professional musicians | ||
| 459 | who keep at it even though they have no hope of making a living that way. | ||
| 460 | |||
| 461 | But really this question, though commonly asked, is not appropriate to the | ||
| 462 | situation. Pay for programmers will not disappear, only become less. So | ||
| 463 | the right question is, will anyone program with a reduced monetary | ||
| 464 | incentive? My experience shows that they will. | ||
| 465 | |||
| 466 | For more than ten years, many of the world's best programmers worked at the | ||
| 467 | Artificial Intelligence Lab for far less money than they could have had | ||
| 468 | anywhere else. They got many kinds of non-monetary rewards: fame and | ||
| 469 | appreciation, for example. And creativity is also fun, a reward in itself. | ||
| 470 | |||
| 471 | Then most of them left when offered a chance to do the same interesting | ||
| 472 | work for a lot of money. | ||
| 473 | |||
| 474 | What the facts show is that people will program for reasons other than | ||
| 475 | riches; but if given a chance to make a lot of money as well, they will | ||
| 476 | come to expect and demand it. Low-paying organizations do poorly in | ||
| 477 | competition with high-paying ones, but they do not have to do badly if the | ||
| 478 | high-paying ones are banned. | ||
| 479 | |||
| 480 | @quotation | ||
| 481 | ``We need the programmers desperately. If they demand that we | ||
| 482 | stop helping our neighbors, we have to obey.'' | ||
| 483 | @end quotation | ||
| 484 | |||
| 485 | You're never so desperate that you have to obey this sort of demand. | ||
| 486 | Remember: millions for defense, but not a cent for tribute! | ||
| 487 | |||
| 488 | @quotation | ||
| 489 | ``Programmers need to make a living somehow.'' | ||
| 490 | @end quotation | ||
| 491 | |||
| 492 | In the short run, this is true. However, there are plenty of ways that | ||
| 493 | programmers could make a living without selling the right to use a program. | ||
| 494 | This way is customary now because it brings programmers and businessmen the | ||
| 495 | most money, not because it is the only way to make a living. It is easy to | ||
| 496 | find other ways if you want to find them. Here are a number of examples. | ||
| 497 | |||
| 498 | A manufacturer introducing a new computer will pay for the porting of | ||
| 499 | operating systems onto the new hardware. | ||
| 500 | |||
| 501 | The sale of teaching, hand-holding and maintenance services could also | ||
| 502 | employ programmers. | ||
| 503 | |||
| 504 | People with new ideas could distribute programs as | ||
| 505 | freeware@footnote{Subsequently we have discovered the need to | ||
| 506 | distinguish between ``free software'' and ``freeware''. The term | ||
| 507 | ``freeware'' means software you are free to redistribute, but usually | ||
| 508 | you are not free to study and change the source code, so most of it is | ||
| 509 | not free software. See | ||
| 510 | @uref{http://www.gnu.org/philosophy/words-to-avoid.html} for more | ||
| 511 | explanation.}, asking for donations from satisfied users, or selling | ||
| 512 | hand-holding services. I have met people who are already working this | ||
| 513 | way successfully. | ||
| 514 | |||
| 515 | Users with related needs can form users' groups, and pay dues. A group | ||
| 516 | would contract with programming companies to write programs that the | ||
| 517 | group's members would like to use. | ||
| 518 | |||
| 519 | All sorts of development can be funded with a Software Tax: | ||
| 520 | |||
| 521 | @quotation | ||
| 522 | Suppose everyone who buys a computer has to pay x percent of | ||
| 523 | the price as a software tax. The government gives this to | ||
| 524 | an agency like the NSF to spend on software development. | ||
| 525 | |||
| 526 | But if the computer buyer makes a donation to software development | ||
| 527 | himself, he can take a credit against the tax. He can donate to | ||
| 528 | the project of his own choosing---often, chosen because he hopes to | ||
| 529 | use the results when it is done. He can take a credit for any amount | ||
| 530 | of donation up to the total tax he had to pay. | ||
| 531 | |||
| 532 | The total tax rate could be decided by a vote of the payers of | ||
| 533 | the tax, weighted according to the amount they will be taxed on. | ||
| 534 | |||
| 535 | The consequences: | ||
| 536 | |||
| 537 | @itemize @bullet | ||
| 538 | @item | ||
| 539 | The computer-using community supports software development. | ||
| 540 | @item | ||
| 541 | This community decides what level of support is needed. | ||
| 542 | @item | ||
| 543 | Users who care which projects their share is spent on | ||
| 544 | can choose this for themselves. | ||
| 545 | @end itemize | ||
| 546 | @end quotation | ||
| 547 | |||
| 548 | In the long run, making programs free is a step toward the post-scarcity | ||
| 549 | world, where nobody will have to work very hard just to make a living. | ||
| 550 | People will be free to devote themselves to activities that are fun, such | ||
| 551 | as programming, after spending the necessary ten hours a week on required | ||
| 552 | tasks such as legislation, family counseling, robot repair and asteroid | ||
| 553 | prospecting. There will be no need to be able to make a living from | ||
| 554 | programming. | ||
| 555 | |||
| 556 | We have already greatly reduced the amount of work that the whole society | ||
| 557 | must do for its actual productivity, but only a little of this has | ||
| 558 | translated itself into leisure for workers because much nonproductive | ||
| 559 | activity is required to accompany productive activity. The main causes of | ||
| 560 | this are bureaucracy and isometric struggles against competition. Free | ||
| 561 | software will greatly reduce these drains in the area of software | ||
| 562 | production. We must do this, in order for technical gains in productivity | ||
| 563 | to translate into less work for us. | ||
| 564 | |||
| 565 | @ignore | ||
| 566 | arch-tag: 21eb38f8-6fa0-480a-91cd-f3dab7148542 | ||
| 567 | @end ignore | ||
diff --git a/doc/emacs/gpl.texi b/doc/emacs/gpl.texi new file mode 100644 index 00000000000..5b416d3cb41 --- /dev/null +++ b/doc/emacs/gpl.texi | |||
| @@ -0,0 +1,721 @@ | |||
| 1 | @c The GNU General Public License. | ||
| 2 | @center Version 3, 29 June 2007 | ||
| 3 | |||
| 4 | @c This file is intended to be included within another document, | ||
| 5 | @c hence no sectioning command or @node. | ||
| 6 | |||
| 7 | @display | ||
| 8 | Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} | ||
| 9 | |||
| 10 | Everyone is permitted to copy and distribute verbatim copies of this | ||
| 11 | license document, but changing it is not allowed. | ||
| 12 | @end display | ||
| 13 | |||
| 14 | @heading Preamble | ||
| 15 | |||
| 16 | The GNU General Public License is a free, copyleft license for | ||
| 17 | software and other kinds of works. | ||
| 18 | |||
| 19 | The licenses for most software and other practical works are designed | ||
| 20 | to take away your freedom to share and change the works. By contrast, | ||
| 21 | the GNU General Public License is intended to guarantee your freedom | ||
| 22 | to share and change all versions of a program---to make sure it remains | ||
| 23 | free software for all its users. We, the Free Software Foundation, | ||
| 24 | use the GNU General Public License for most of our software; it | ||
| 25 | applies also to any other work released this way by its authors. You | ||
| 26 | can apply it to your programs, too. | ||
| 27 | |||
| 28 | When we speak of free software, we are referring to freedom, not | ||
| 29 | price. Our General Public Licenses are designed to make sure that you | ||
| 30 | have the freedom to distribute copies of free software (and charge for | ||
| 31 | them if you wish), that you receive source code or can get it if you | ||
| 32 | want it, that you can change the software or use pieces of it in new | ||
| 33 | free programs, and that you know you can do these things. | ||
| 34 | |||
| 35 | To protect your rights, we need to prevent others from denying you | ||
| 36 | these rights or asking you to surrender the rights. Therefore, you | ||
| 37 | have certain responsibilities if you distribute copies of the | ||
| 38 | software, or if you modify it: responsibilities to respect the freedom | ||
| 39 | of others. | ||
| 40 | |||
| 41 | For example, if you distribute copies of such a program, whether | ||
| 42 | gratis or for a fee, you must pass on to the recipients the same | ||
| 43 | freedoms that you received. You must make sure that they, too, | ||
| 44 | receive or can get the source code. And you must show them these | ||
| 45 | terms so they know their rights. | ||
| 46 | |||
| 47 | Developers that use the GNU GPL protect your rights with two steps: | ||
| 48 | (1) assert copyright on the software, and (2) offer you this License | ||
| 49 | giving you legal permission to copy, distribute and/or modify it. | ||
| 50 | |||
| 51 | For the developers' and authors' protection, the GPL clearly explains | ||
| 52 | that there is no warranty for this free software. For both users' and | ||
| 53 | authors' sake, the GPL requires that modified versions be marked as | ||
| 54 | changed, so that their problems will not be attributed erroneously to | ||
| 55 | authors of previous versions. | ||
| 56 | |||
| 57 | Some devices are designed to deny users access to install or run | ||
| 58 | modified versions of the software inside them, although the | ||
| 59 | manufacturer can do so. This is fundamentally incompatible with the | ||
| 60 | aim of protecting users' freedom to change the software. The | ||
| 61 | systematic pattern of such abuse occurs in the area of products for | ||
| 62 | individuals to use, which is precisely where it is most unacceptable. | ||
| 63 | Therefore, we have designed this version of the GPL to prohibit the | ||
| 64 | practice for those products. If such problems arise substantially in | ||
| 65 | other domains, we stand ready to extend this provision to those | ||
| 66 | domains in future versions of the GPL, as needed to protect the | ||
| 67 | freedom of users. | ||
| 68 | |||
| 69 | Finally, every program is threatened constantly by software patents. | ||
| 70 | States should not allow patents to restrict development and use of | ||
| 71 | software on general-purpose computers, but in those that do, we wish | ||
| 72 | to avoid the special danger that patents applied to a free program | ||
| 73 | could make it effectively proprietary. To prevent this, the GPL | ||
| 74 | assures that patents cannot be used to render the program non-free. | ||
| 75 | |||
| 76 | The precise terms and conditions for copying, distribution and | ||
| 77 | modification follow. | ||
| 78 | |||
| 79 | @heading TERMS AND CONDITIONS | ||
| 80 | |||
| 81 | @enumerate 0 | ||
| 82 | @item Definitions. | ||
| 83 | |||
| 84 | ``This License'' refers to version 3 of the GNU General Public License. | ||
| 85 | |||
| 86 | ``Copyright'' also means copyright-like laws that apply to other kinds | ||
| 87 | of works, such as semiconductor masks. | ||
| 88 | |||
| 89 | ``The Program'' refers to any copyrightable work licensed under this | ||
| 90 | License. Each licensee is addressed as ``you''. ``Licensees'' and | ||
| 91 | ``recipients'' may be individuals or organizations. | ||
| 92 | |||
| 93 | To ``modify'' a work means to copy from or adapt all or part of the work | ||
| 94 | in a fashion requiring copyright permission, other than the making of | ||
| 95 | an exact copy. The resulting work is called a ``modified version'' of | ||
| 96 | the earlier work or a work ``based on'' the earlier work. | ||
| 97 | |||
| 98 | A ``covered work'' means either the unmodified Program or a work based | ||
| 99 | on the Program. | ||
| 100 | |||
| 101 | To ``propagate'' a work means to do anything with it that, without | ||
| 102 | permission, would make you directly or secondarily liable for | ||
| 103 | infringement under applicable copyright law, except executing it on a | ||
| 104 | computer or modifying a private copy. Propagation includes copying, | ||
| 105 | distribution (with or without modification), making available to the | ||
| 106 | public, and in some countries other activities as well. | ||
| 107 | |||
| 108 | To ``convey'' a work means any kind of propagation that enables other | ||
| 109 | parties to make or receive copies. Mere interaction with a user | ||
| 110 | through a computer network, with no transfer of a copy, is not | ||
| 111 | conveying. | ||
| 112 | |||
| 113 | An interactive user interface displays ``Appropriate Legal Notices'' to | ||
| 114 | the extent that it includes a convenient and prominently visible | ||
| 115 | feature that (1) displays an appropriate copyright notice, and (2) | ||
| 116 | tells the user that there is no warranty for the work (except to the | ||
| 117 | extent that warranties are provided), that licensees may convey the | ||
| 118 | work under this License, and how to view a copy of this License. If | ||
| 119 | the interface presents a list of user commands or options, such as a | ||
| 120 | menu, a prominent item in the list meets this criterion. | ||
| 121 | |||
| 122 | @item Source Code. | ||
| 123 | |||
| 124 | The ``source code'' for a work means the preferred form of the work for | ||
| 125 | making modifications to it. ``Object code'' means any non-source form | ||
| 126 | of a work. | ||
| 127 | |||
| 128 | A ``Standard Interface'' means an interface that either is an official | ||
| 129 | standard defined by a recognized standards body, or, in the case of | ||
| 130 | interfaces specified for a particular programming language, one that | ||
| 131 | is widely used among developers working in that language. | ||
| 132 | |||
| 133 | The ``System Libraries'' of an executable work include anything, other | ||
| 134 | than the work as a whole, that (a) is included in the normal form of | ||
| 135 | packaging a Major Component, but which is not part of that Major | ||
| 136 | Component, and (b) serves only to enable use of the work with that | ||
| 137 | Major Component, or to implement a Standard Interface for which an | ||
| 138 | implementation is available to the public in source code form. A | ||
| 139 | ``Major Component'', in this context, means a major essential component | ||
| 140 | (kernel, window system, and so on) of the specific operating system | ||
| 141 | (if any) on which the executable work runs, or a compiler used to | ||
| 142 | produce the work, or an object code interpreter used to run it. | ||
| 143 | |||
| 144 | The ``Corresponding Source'' for a work in object code form means all | ||
| 145 | the source code needed to generate, install, and (for an executable | ||
| 146 | work) run the object code and to modify the work, including scripts to | ||
| 147 | control those activities. However, it does not include the work's | ||
| 148 | System Libraries, or general-purpose tools or generally available free | ||
| 149 | programs which are used unmodified in performing those activities but | ||
| 150 | which are not part of the work. For example, Corresponding Source | ||
| 151 | includes interface definition files associated with source files for | ||
| 152 | the work, and the source code for shared libraries and dynamically | ||
| 153 | linked subprograms that the work is specifically designed to require, | ||
| 154 | such as by intimate data communication or control flow between those | ||
| 155 | subprograms and other parts of the work. | ||
| 156 | |||
| 157 | The Corresponding Source need not include anything that users can | ||
| 158 | regenerate automatically from other parts of the Corresponding Source. | ||
| 159 | |||
| 160 | The Corresponding Source for a work in source code form is that same | ||
| 161 | work. | ||
| 162 | |||
| 163 | @item Basic Permissions. | ||
| 164 | |||
| 165 | All rights granted under this License are granted for the term of | ||
| 166 | copyright on the Program, and are irrevocable provided the stated | ||
| 167 | conditions are met. This License explicitly affirms your unlimited | ||
| 168 | permission to run the unmodified Program. The output from running a | ||
| 169 | covered work is covered by this License only if the output, given its | ||
| 170 | content, constitutes a covered work. This License acknowledges your | ||
| 171 | rights of fair use or other equivalent, as provided by copyright law. | ||
| 172 | |||
| 173 | You may make, run and propagate covered works that you do not convey, | ||
| 174 | without conditions so long as your license otherwise remains in force. | ||
| 175 | You may convey covered works to others for the sole purpose of having | ||
| 176 | them make modifications exclusively for you, or provide you with | ||
| 177 | facilities for running those works, provided that you comply with the | ||
| 178 | terms of this License in conveying all material for which you do not | ||
| 179 | control copyright. Those thus making or running the covered works for | ||
| 180 | you must do so exclusively on your behalf, under your direction and | ||
| 181 | control, on terms that prohibit them from making any copies of your | ||
| 182 | copyrighted material outside their relationship with you. | ||
| 183 | |||
| 184 | Conveying under any other circumstances is permitted solely under the | ||
| 185 | conditions stated below. Sublicensing is not allowed; section 10 | ||
| 186 | makes it unnecessary. | ||
| 187 | |||
| 188 | @item Protecting Users' Legal Rights From Anti-Circumvention Law. | ||
| 189 | |||
| 190 | No covered work shall be deemed part of an effective technological | ||
| 191 | measure under any applicable law fulfilling obligations under article | ||
| 192 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or | ||
| 193 | similar laws prohibiting or restricting circumvention of such | ||
| 194 | measures. | ||
| 195 | |||
| 196 | When you convey a covered work, you waive any legal power to forbid | ||
| 197 | circumvention of technological measures to the extent such | ||
| 198 | circumvention is effected by exercising rights under this License with | ||
| 199 | respect to the covered work, and you disclaim any intention to limit | ||
| 200 | operation or modification of the work as a means of enforcing, against | ||
| 201 | the work's users, your or third parties' legal rights to forbid | ||
| 202 | circumvention of technological measures. | ||
| 203 | |||
| 204 | @item Conveying Verbatim Copies. | ||
| 205 | |||
| 206 | You may convey verbatim copies of the Program's source code as you | ||
| 207 | receive it, in any medium, provided that you conspicuously and | ||
| 208 | appropriately publish on each copy an appropriate copyright notice; | ||
| 209 | keep intact all notices stating that this License and any | ||
| 210 | non-permissive terms added in accord with section 7 apply to the code; | ||
| 211 | keep intact all notices of the absence of any warranty; and give all | ||
| 212 | recipients a copy of this License along with the Program. | ||
| 213 | |||
| 214 | You may charge any price or no price for each copy that you convey, | ||
| 215 | and you may offer support or warranty protection for a fee. | ||
| 216 | |||
| 217 | @item Conveying Modified Source Versions. | ||
| 218 | |||
| 219 | You may convey a work based on the Program, or the modifications to | ||
| 220 | produce it from the Program, in the form of source code under the | ||
| 221 | terms of section 4, provided that you also meet all of these | ||
| 222 | conditions: | ||
| 223 | |||
| 224 | @enumerate a | ||
| 225 | @item | ||
| 226 | The work must carry prominent notices stating that you modified it, | ||
| 227 | and giving a relevant date. | ||
| 228 | |||
| 229 | @item | ||
| 230 | The work must carry prominent notices stating that it is released | ||
| 231 | under this License and any conditions added under section 7. This | ||
| 232 | requirement modifies the requirement in section 4 to ``keep intact all | ||
| 233 | notices''. | ||
| 234 | |||
| 235 | @item | ||
| 236 | You must license the entire work, as a whole, under this License to | ||
| 237 | anyone who comes into possession of a copy. This License will | ||
| 238 | therefore apply, along with any applicable section 7 additional terms, | ||
| 239 | to the whole of the work, and all its parts, regardless of how they | ||
| 240 | are packaged. This License gives no permission to license the work in | ||
| 241 | any other way, but it does not invalidate such permission if you have | ||
| 242 | separately received it. | ||
| 243 | |||
| 244 | @item | ||
| 245 | If the work has interactive user interfaces, each must display | ||
| 246 | Appropriate Legal Notices; however, if the Program has interactive | ||
| 247 | interfaces that do not display Appropriate Legal Notices, your work | ||
| 248 | need not make them do so. | ||
| 249 | @end enumerate | ||
| 250 | |||
| 251 | A compilation of a covered work with other separate and independent | ||
| 252 | works, which are not by their nature extensions of the covered work, | ||
| 253 | and which are not combined with it such as to form a larger program, | ||
| 254 | in or on a volume of a storage or distribution medium, is called an | ||
| 255 | ``aggregate'' if the compilation and its resulting copyright are not | ||
| 256 | used to limit the access or legal rights of the compilation's users | ||
| 257 | beyond what the individual works permit. Inclusion of a covered work | ||
| 258 | in an aggregate does not cause this License to apply to the other | ||
| 259 | parts of the aggregate. | ||
| 260 | |||
| 261 | @item Conveying Non-Source Forms. | ||
| 262 | |||
| 263 | You may convey a covered work in object code form under the terms of | ||
| 264 | sections 4 and 5, provided that you also convey the machine-readable | ||
| 265 | Corresponding Source under the terms of this License, in one of these | ||
| 266 | ways: | ||
| 267 | |||
| 268 | @enumerate a | ||
| 269 | @item | ||
| 270 | Convey the object code in, or embodied in, a physical product | ||
| 271 | (including a physical distribution medium), accompanied by the | ||
| 272 | Corresponding Source fixed on a durable physical medium customarily | ||
| 273 | used for software interchange. | ||
| 274 | |||
| 275 | @item | ||
| 276 | Convey the object code in, or embodied in, a physical product | ||
| 277 | (including a physical distribution medium), accompanied by a written | ||
| 278 | offer, valid for at least three years and valid for as long as you | ||
| 279 | offer spare parts or customer support for that product model, to give | ||
| 280 | anyone who possesses the object code either (1) a copy of the | ||
| 281 | Corresponding Source for all the software in the product that is | ||
| 282 | covered by this License, on a durable physical medium customarily used | ||
| 283 | for software interchange, for a price no more than your reasonable | ||
| 284 | cost of physically performing this conveying of source, or (2) access | ||
| 285 | to copy the Corresponding Source from a network server at no charge. | ||
| 286 | |||
| 287 | @item | ||
| 288 | Convey individual copies of the object code with a copy of the written | ||
| 289 | offer to provide the Corresponding Source. This alternative is | ||
| 290 | allowed only occasionally and noncommercially, and only if you | ||
| 291 | received the object code with such an offer, in accord with subsection | ||
| 292 | 6b. | ||
| 293 | |||
| 294 | @item | ||
| 295 | Convey the object code by offering access from a designated place | ||
| 296 | (gratis or for a charge), and offer equivalent access to the | ||
| 297 | Corresponding Source in the same way through the same place at no | ||
| 298 | further charge. You need not require recipients to copy the | ||
| 299 | Corresponding Source along with the object code. If the place to copy | ||
| 300 | the object code is a network server, the Corresponding Source may be | ||
| 301 | on a different server (operated by you or a third party) that supports | ||
| 302 | equivalent copying facilities, provided you maintain clear directions | ||
| 303 | next to the object code saying where to find the Corresponding Source. | ||
| 304 | Regardless of what server hosts the Corresponding Source, you remain | ||
| 305 | obligated to ensure that it is available for as long as needed to | ||
| 306 | satisfy these requirements. | ||
| 307 | |||
| 308 | @item | ||
| 309 | Convey the object code using peer-to-peer transmission, provided you | ||
| 310 | inform other peers where the object code and Corresponding Source of | ||
| 311 | the work are being offered to the general public at no charge under | ||
| 312 | subsection 6d. | ||
| 313 | |||
| 314 | @end enumerate | ||
| 315 | |||
| 316 | A separable portion of the object code, whose source code is excluded | ||
| 317 | from the Corresponding Source as a System Library, need not be | ||
| 318 | included in conveying the object code work. | ||
| 319 | |||
| 320 | A ``User Product'' is either (1) a ``consumer product'', which means any | ||
| 321 | tangible personal property which is normally used for personal, | ||
| 322 | family, or household purposes, or (2) anything designed or sold for | ||
| 323 | incorporation into a dwelling. In determining whether a product is a | ||
| 324 | consumer product, doubtful cases shall be resolved in favor of | ||
| 325 | coverage. For a particular product received by a particular user, | ||
| 326 | ``normally used'' refers to a typical or common use of that class of | ||
| 327 | product, regardless of the status of the particular user or of the way | ||
| 328 | in which the particular user actually uses, or expects or is expected | ||
| 329 | to use, the product. A product is a consumer product regardless of | ||
| 330 | whether the product has substantial commercial, industrial or | ||
| 331 | non-consumer uses, unless such uses represent the only significant | ||
| 332 | mode of use of the product. | ||
| 333 | |||
| 334 | ``Installation Information'' for a User Product means any methods, | ||
| 335 | procedures, authorization keys, or other information required to | ||
| 336 | install and execute modified versions of a covered work in that User | ||
| 337 | Product from a modified version of its Corresponding Source. The | ||
| 338 | information must suffice to ensure that the continued functioning of | ||
| 339 | the modified object code is in no case prevented or interfered with | ||
| 340 | solely because modification has been made. | ||
| 341 | |||
| 342 | If you convey an object code work under this section in, or with, or | ||
| 343 | specifically for use in, a User Product, and the conveying occurs as | ||
| 344 | part of a transaction in which the right of possession and use of the | ||
| 345 | User Product is transferred to the recipient in perpetuity or for a | ||
| 346 | fixed term (regardless of how the transaction is characterized), the | ||
| 347 | Corresponding Source conveyed under this section must be accompanied | ||
| 348 | by the Installation Information. But this requirement does not apply | ||
| 349 | if neither you nor any third party retains the ability to install | ||
| 350 | modified object code on the User Product (for example, the work has | ||
| 351 | been installed in ROM). | ||
| 352 | |||
| 353 | The requirement to provide Installation Information does not include a | ||
| 354 | requirement to continue to provide support service, warranty, or | ||
| 355 | updates for a work that has been modified or installed by the | ||
| 356 | recipient, or for the User Product in which it has been modified or | ||
| 357 | installed. Access to a network may be denied when the modification | ||
| 358 | itself materially and adversely affects the operation of the network | ||
| 359 | or violates the rules and protocols for communication across the | ||
| 360 | network. | ||
| 361 | |||
| 362 | Corresponding Source conveyed, and Installation Information provided, | ||
| 363 | in accord with this section must be in a format that is publicly | ||
| 364 | documented (and with an implementation available to the public in | ||
| 365 | source code form), and must require no special password or key for | ||
| 366 | unpacking, reading or copying. | ||
| 367 | |||
| 368 | @item Additional Terms. | ||
| 369 | |||
| 370 | ``Additional permissions'' are terms that supplement the terms of this | ||
| 371 | License by making exceptions from one or more of its conditions. | ||
| 372 | Additional permissions that are applicable to the entire Program shall | ||
| 373 | be treated as though they were included in this License, to the extent | ||
| 374 | that they are valid under applicable law. If additional permissions | ||
| 375 | apply only to part of the Program, that part may be used separately | ||
| 376 | under those permissions, but the entire Program remains governed by | ||
| 377 | this License without regard to the additional permissions. | ||
| 378 | |||
| 379 | When you convey a copy of a covered work, you may at your option | ||
| 380 | remove any additional permissions from that copy, or from any part of | ||
| 381 | it. (Additional permissions may be written to require their own | ||
| 382 | removal in certain cases when you modify the work.) You may place | ||
| 383 | additional permissions on material, added by you to a covered work, | ||
| 384 | for which you have or can give appropriate copyright permission. | ||
| 385 | |||
| 386 | Notwithstanding any other provision of this License, for material you | ||
| 387 | add to a covered work, you may (if authorized by the copyright holders | ||
| 388 | of that material) supplement the terms of this License with terms: | ||
| 389 | |||
| 390 | @enumerate a | ||
| 391 | @item | ||
| 392 | Disclaiming warranty or limiting liability differently from the terms | ||
| 393 | of sections 15 and 16 of this License; or | ||
| 394 | |||
| 395 | @item | ||
| 396 | Requiring preservation of specified reasonable legal notices or author | ||
| 397 | attributions in that material or in the Appropriate Legal Notices | ||
| 398 | displayed by works containing it; or | ||
| 399 | |||
| 400 | @item | ||
| 401 | Prohibiting misrepresentation of the origin of that material, or | ||
| 402 | requiring that modified versions of such material be marked in | ||
| 403 | reasonable ways as different from the original version; or | ||
| 404 | |||
| 405 | @item | ||
| 406 | Limiting the use for publicity purposes of names of licensors or | ||
| 407 | authors of the material; or | ||
| 408 | |||
| 409 | @item | ||
| 410 | Declining to grant rights under trademark law for use of some trade | ||
| 411 | names, trademarks, or service marks; or | ||
| 412 | |||
| 413 | @item | ||
| 414 | Requiring indemnification of licensors and authors of that material by | ||
| 415 | anyone who conveys the material (or modified versions of it) with | ||
| 416 | contractual assumptions of liability to the recipient, for any | ||
| 417 | liability that these contractual assumptions directly impose on those | ||
| 418 | licensors and authors. | ||
| 419 | @end enumerate | ||
| 420 | |||
| 421 | All other non-permissive additional terms are considered ``further | ||
| 422 | restrictions'' within the meaning of section 10. If the Program as you | ||
| 423 | received it, or any part of it, contains a notice stating that it is | ||
| 424 | governed by this License along with a term that is a further | ||
| 425 | restriction, you may remove that term. If a license document contains | ||
| 426 | a further restriction but permits relicensing or conveying under this | ||
| 427 | License, you may add to a covered work material governed by the terms | ||
| 428 | of that license document, provided that the further restriction does | ||
| 429 | not survive such relicensing or conveying. | ||
| 430 | |||
| 431 | If you add terms to a covered work in accord with this section, you | ||
| 432 | must place, in the relevant source files, a statement of the | ||
| 433 | additional terms that apply to those files, or a notice indicating | ||
| 434 | where to find the applicable terms. | ||
| 435 | |||
| 436 | Additional terms, permissive or non-permissive, may be stated in the | ||
| 437 | form of a separately written license, or stated as exceptions; the | ||
| 438 | above requirements apply either way. | ||
| 439 | |||
| 440 | @item Termination. | ||
| 441 | |||
| 442 | You may not propagate or modify a covered work except as expressly | ||
| 443 | provided under this License. Any attempt otherwise to propagate or | ||
| 444 | modify it is void, and will automatically terminate your rights under | ||
| 445 | this License (including any patent licenses granted under the third | ||
| 446 | paragraph of section 11). | ||
| 447 | |||
| 448 | However, if you cease all violation of this License, then your license | ||
| 449 | from a particular copyright holder is reinstated (a) provisionally, | ||
| 450 | unless and until the copyright holder explicitly and finally | ||
| 451 | terminates your license, and (b) permanently, if the copyright holder | ||
| 452 | fails to notify you of the violation by some reasonable means prior to | ||
| 453 | 60 days after the cessation. | ||
| 454 | |||
| 455 | Moreover, your license from a particular copyright holder is | ||
| 456 | reinstated permanently if the copyright holder notifies you of the | ||
| 457 | violation by some reasonable means, this is the first time you have | ||
| 458 | received notice of violation of this License (for any work) from that | ||
| 459 | copyright holder, and you cure the violation prior to 30 days after | ||
| 460 | your receipt of the notice. | ||
| 461 | |||
| 462 | Termination of your rights under this section does not terminate the | ||
| 463 | licenses of parties who have received copies or rights from you under | ||
| 464 | this License. If your rights have been terminated and not permanently | ||
| 465 | reinstated, you do not qualify to receive new licenses for the same | ||
| 466 | material under section 10. | ||
| 467 | |||
| 468 | @item Acceptance Not Required for Having Copies. | ||
| 469 | |||
| 470 | You are not required to accept this License in order to receive or run | ||
| 471 | a copy of the Program. Ancillary propagation of a covered work | ||
| 472 | occurring solely as a consequence of using peer-to-peer transmission | ||
| 473 | to receive a copy likewise does not require acceptance. However, | ||
| 474 | nothing other than this License grants you permission to propagate or | ||
| 475 | modify any covered work. These actions infringe copyright if you do | ||
| 476 | not accept this License. Therefore, by modifying or propagating a | ||
| 477 | covered work, you indicate your acceptance of this License to do so. | ||
| 478 | |||
| 479 | @item Automatic Licensing of Downstream Recipients. | ||
| 480 | |||
| 481 | Each time you convey a covered work, the recipient automatically | ||
| 482 | receives a license from the original licensors, to run, modify and | ||
| 483 | propagate that work, subject to this License. You are not responsible | ||
| 484 | for enforcing compliance by third parties with this License. | ||
| 485 | |||
| 486 | An ``entity transaction'' is a transaction transferring control of an | ||
| 487 | organization, or substantially all assets of one, or subdividing an | ||
| 488 | organization, or merging organizations. If propagation of a covered | ||
| 489 | work results from an entity transaction, each party to that | ||
| 490 | transaction who receives a copy of the work also receives whatever | ||
| 491 | licenses to the work the party's predecessor in interest had or could | ||
| 492 | give under the previous paragraph, plus a right to possession of the | ||
| 493 | Corresponding Source of the work from the predecessor in interest, if | ||
| 494 | the predecessor has it or can get it with reasonable efforts. | ||
| 495 | |||
| 496 | You may not impose any further restrictions on the exercise of the | ||
| 497 | rights granted or affirmed under this License. For example, you may | ||
| 498 | not impose a license fee, royalty, or other charge for exercise of | ||
| 499 | rights granted under this License, and you may not initiate litigation | ||
| 500 | (including a cross-claim or counterclaim in a lawsuit) alleging that | ||
| 501 | any patent claim is infringed by making, using, selling, offering for | ||
| 502 | sale, or importing the Program or any portion of it. | ||
| 503 | |||
| 504 | @item Patents. | ||
| 505 | |||
| 506 | A ``contributor'' is a copyright holder who authorizes use under this | ||
| 507 | License of the Program or a work on which the Program is based. The | ||
| 508 | work thus licensed is called the contributor's ``contributor version''. | ||
| 509 | |||
| 510 | A contributor's ``essential patent claims'' are all patent claims owned | ||
| 511 | or controlled by the contributor, whether already acquired or | ||
| 512 | hereafter acquired, that would be infringed by some manner, permitted | ||
| 513 | by this License, of making, using, or selling its contributor version, | ||
| 514 | but do not include claims that would be infringed only as a | ||
| 515 | consequence of further modification of the contributor version. For | ||
| 516 | purposes of this definition, ``control'' includes the right to grant | ||
| 517 | patent sublicenses in a manner consistent with the requirements of | ||
| 518 | this License. | ||
| 519 | |||
| 520 | Each contributor grants you a non-exclusive, worldwide, royalty-free | ||
| 521 | patent license under the contributor's essential patent claims, to | ||
| 522 | make, use, sell, offer for sale, import and otherwise run, modify and | ||
| 523 | propagate the contents of its contributor version. | ||
| 524 | |||
| 525 | In the following three paragraphs, a ``patent license'' is any express | ||
| 526 | agreement or commitment, however denominated, not to enforce a patent | ||
| 527 | (such as an express permission to practice a patent or covenant not to | ||
| 528 | sue for patent infringement). To ``grant'' such a patent license to a | ||
| 529 | party means to make such an agreement or commitment not to enforce a | ||
| 530 | patent against the party. | ||
| 531 | |||
| 532 | If you convey a covered work, knowingly relying on a patent license, | ||
| 533 | and the Corresponding Source of the work is not available for anyone | ||
| 534 | to copy, free of charge and under the terms of this License, through a | ||
| 535 | publicly available network server or other readily accessible means, | ||
| 536 | then you must either (1) cause the Corresponding Source to be so | ||
| 537 | available, or (2) arrange to deprive yourself of the benefit of the | ||
| 538 | patent license for this particular work, or (3) arrange, in a manner | ||
| 539 | consistent with the requirements of this License, to extend the patent | ||
| 540 | license to downstream recipients. ``Knowingly relying'' means you have | ||
| 541 | actual knowledge that, but for the patent license, your conveying the | ||
| 542 | covered work in a country, or your recipient's use of the covered work | ||
| 543 | in a country, would infringe one or more identifiable patents in that | ||
| 544 | country that you have reason to believe are valid. | ||
| 545 | |||
| 546 | If, pursuant to or in connection with a single transaction or | ||
| 547 | arrangement, you convey, or propagate by procuring conveyance of, a | ||
| 548 | covered work, and grant a patent license to some of the parties | ||
| 549 | receiving the covered work authorizing them to use, propagate, modify | ||
| 550 | or convey a specific copy of the covered work, then the patent license | ||
| 551 | you grant is automatically extended to all recipients of the covered | ||
| 552 | work and works based on it. | ||
| 553 | |||
| 554 | A patent license is ``discriminatory'' if it does not include within the | ||
| 555 | scope of its coverage, prohibits the exercise of, or is conditioned on | ||
| 556 | the non-exercise of one or more of the rights that are specifically | ||
| 557 | granted under this License. You may not convey a covered work if you | ||
| 558 | are a party to an arrangement with a third party that is in the | ||
| 559 | business of distributing software, under which you make payment to the | ||
| 560 | third party based on the extent of your activity of conveying the | ||
| 561 | work, and under which the third party grants, to any of the parties | ||
| 562 | who would receive the covered work from you, a discriminatory patent | ||
| 563 | license (a) in connection with copies of the covered work conveyed by | ||
| 564 | you (or copies made from those copies), or (b) primarily for and in | ||
| 565 | connection with specific products or compilations that contain the | ||
| 566 | covered work, unless you entered into that arrangement, or that patent | ||
| 567 | license was granted, prior to 28 March 2007. | ||
| 568 | |||
| 569 | Nothing in this License shall be construed as excluding or limiting | ||
| 570 | any implied license or other defenses to infringement that may | ||
| 571 | otherwise be available to you under applicable patent law. | ||
| 572 | |||
| 573 | @item No Surrender of Others' Freedom. | ||
| 574 | |||
| 575 | If conditions are imposed on you (whether by court order, agreement or | ||
| 576 | otherwise) that contradict the conditions of this License, they do not | ||
| 577 | excuse you from the conditions of this License. If you cannot convey | ||
| 578 | a covered work so as to satisfy simultaneously your obligations under | ||
| 579 | this License and any other pertinent obligations, then as a | ||
| 580 | consequence you may not convey it at all. For example, if you agree | ||
| 581 | to terms that obligate you to collect a royalty for further conveying | ||
| 582 | from those to whom you convey the Program, the only way you could | ||
| 583 | satisfy both those terms and this License would be to refrain entirely | ||
| 584 | from conveying the Program. | ||
| 585 | |||
| 586 | @item Use with the GNU Affero General Public License. | ||
| 587 | |||
| 588 | Notwithstanding any other provision of this License, you have | ||
| 589 | permission to link or combine any covered work with a work licensed | ||
| 590 | under version 3 of the GNU Affero General Public License into a single | ||
| 591 | combined work, and to convey the resulting work. The terms of this | ||
| 592 | License will continue to apply to the part which is the covered work, | ||
| 593 | but the special requirements of the GNU Affero General Public License, | ||
| 594 | section 13, concerning interaction through a network will apply to the | ||
| 595 | combination as such. | ||
| 596 | |||
| 597 | @item Revised Versions of this License. | ||
| 598 | |||
| 599 | The Free Software Foundation may publish revised and/or new versions | ||
| 600 | of the GNU General Public License from time to time. Such new | ||
| 601 | versions will be similar in spirit to the present version, but may | ||
| 602 | differ in detail to address new problems or concerns. | ||
| 603 | |||
| 604 | Each version is given a distinguishing version number. If the Program | ||
| 605 | specifies that a certain numbered version of the GNU General Public | ||
| 606 | License ``or any later version'' applies to it, you have the option of | ||
| 607 | following the terms and conditions either of that numbered version or | ||
| 608 | of any later version published by the Free Software Foundation. If | ||
| 609 | the Program does not specify a version number of the GNU General | ||
| 610 | Public License, you may choose any version ever published by the Free | ||
| 611 | Software Foundation. | ||
| 612 | |||
| 613 | If the Program specifies that a proxy can decide which future versions | ||
| 614 | of the GNU General Public License can be used, that proxy's public | ||
| 615 | statement of acceptance of a version permanently authorizes you to | ||
| 616 | choose that version for the Program. | ||
| 617 | |||
| 618 | Later license versions may give you additional or different | ||
| 619 | permissions. However, no additional obligations are imposed on any | ||
| 620 | author or copyright holder as a result of your choosing to follow a | ||
| 621 | later version. | ||
| 622 | |||
| 623 | @item Disclaimer of Warranty. | ||
| 624 | |||
| 625 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | ||
| 626 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | ||
| 627 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT | ||
| 628 | WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT | ||
| 629 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 630 | A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND | ||
| 631 | PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE | ||
| 632 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR | ||
| 633 | CORRECTION. | ||
| 634 | |||
| 635 | @item Limitation of Liability. | ||
| 636 | |||
| 637 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||
| 638 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR | ||
| 639 | CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | ||
| 640 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES | ||
| 641 | ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT | ||
| 642 | NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR | ||
| 643 | LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM | ||
| 644 | TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER | ||
| 645 | PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | ||
| 646 | |||
| 647 | @item Interpretation of Sections 15 and 16. | ||
| 648 | |||
| 649 | If the disclaimer of warranty and limitation of liability provided | ||
| 650 | above cannot be given local legal effect according to their terms, | ||
| 651 | reviewing courts shall apply local law that most closely approximates | ||
| 652 | an absolute waiver of all civil liability in connection with the | ||
| 653 | Program, unless a warranty or assumption of liability accompanies a | ||
| 654 | copy of the Program in return for a fee. | ||
| 655 | |||
| 656 | @end enumerate | ||
| 657 | |||
| 658 | @heading END OF TERMS AND CONDITIONS | ||
| 659 | |||
| 660 | @heading How to Apply These Terms to Your New Programs | ||
| 661 | |||
| 662 | If you develop a new program, and you want it to be of the greatest | ||
| 663 | possible use to the public, the best way to achieve this is to make it | ||
| 664 | free software which everyone can redistribute and change under these | ||
| 665 | terms. | ||
| 666 | |||
| 667 | To do so, attach the following notices to the program. It is safest | ||
| 668 | to attach them to the start of each source file to most effectively | ||
| 669 | state the exclusion of warranty; and each file should have at least | ||
| 670 | the ``copyright'' line and a pointer to where the full notice is found. | ||
| 671 | |||
| 672 | @smallexample | ||
| 673 | @var{one line to give the program's name and a brief idea of what it does.} | ||
| 674 | Copyright (C) @var{year} @var{name of author} | ||
| 675 | |||
| 676 | This program is free software: you can redistribute it and/or modify | ||
| 677 | it under the terms of the GNU General Public License as published by | ||
| 678 | the Free Software Foundation, either version 3 of the License, or (at | ||
| 679 | your option) any later version. | ||
| 680 | |||
| 681 | This program is distributed in the hope that it will be useful, but | ||
| 682 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 683 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 684 | General Public License for more details. | ||
| 685 | |||
| 686 | You should have received a copy of the GNU General Public License | ||
| 687 | along with this program. If not, see @url{http://www.gnu.org/licenses/}. | ||
| 688 | @end smallexample | ||
| 689 | |||
| 690 | Also add information on how to contact you by electronic and paper mail. | ||
| 691 | |||
| 692 | If the program does terminal interaction, make it output a short | ||
| 693 | notice like this when it starts in an interactive mode: | ||
| 694 | |||
| 695 | @smallexample | ||
| 696 | @var{program} Copyright (C) @var{year} @var{name of author} | ||
| 697 | This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. | ||
| 698 | This is free software, and you are welcome to redistribute it | ||
| 699 | under certain conditions; type @samp{show c} for details. | ||
| 700 | @end smallexample | ||
| 701 | |||
| 702 | The hypothetical commands @samp{show w} and @samp{show c} should show | ||
| 703 | the appropriate parts of the General Public License. Of course, your | ||
| 704 | program's commands might be different; for a GUI interface, you would | ||
| 705 | use an ``about box''. | ||
| 706 | |||
| 707 | You should also get your employer (if you work as a programmer) or school, | ||
| 708 | if any, to sign a ``copyright disclaimer'' for the program, if necessary. | ||
| 709 | For more information on this, and how to apply and follow the GNU GPL, see | ||
| 710 | @url{http://www.gnu.org/licenses/}. | ||
| 711 | |||
| 712 | The GNU General Public License does not permit incorporating your | ||
| 713 | program into proprietary programs. If your program is a subroutine | ||
| 714 | library, you may consider it more useful to permit linking proprietary | ||
| 715 | applications with the library. If this is what you want to do, use | ||
| 716 | the GNU Lesser General Public License instead of this License. But | ||
| 717 | first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}. | ||
| 718 | |||
| 719 | @ignore | ||
| 720 | arch-tag: 0c4a2556-f87e-464f-9b1d-efd920fcaf67 | ||
| 721 | @end ignore | ||
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi new file mode 100644 index 00000000000..fe7c2a85ffa --- /dev/null +++ b/doc/emacs/help.texi | |||
| @@ -0,0 +1,666 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Help, Mark, M-x, Top | ||
| 6 | @chapter Help | ||
| 7 | @kindex Help | ||
| 8 | @cindex help | ||
| 9 | @cindex self-documentation | ||
| 10 | @findex help-command | ||
| 11 | @kindex C-h | ||
| 12 | @kindex F1 | ||
| 13 | |||
| 14 | Emacs provides extensive help features, all accessible through the | ||
| 15 | @dfn{help character}, @kbd{C-h}. This is a prefix key that is used | ||
| 16 | for commands that display documentation; the next character you type | ||
| 17 | should be a @dfn{help options}, to ask for a particular kind of help. | ||
| 18 | You can cancel the @kbd{C-h} command with @kbd{C-g}. The function key | ||
| 19 | @key{F1} is equivalent to @kbd{C-h}. | ||
| 20 | |||
| 21 | @kindex C-h C-h | ||
| 22 | @findex help-for-help | ||
| 23 | @kbd{C-h} itself is one of the help options; @kbd{C-h C-h} displays | ||
| 24 | a list of help options, with a brief description of each one | ||
| 25 | (@code{help-for-help}). You can scroll the list with @key{SPC} and | ||
| 26 | @key{DEL}, then type the help option you want. To cancel, type | ||
| 27 | @kbd{C-g}. | ||
| 28 | |||
| 29 | @kbd{C-h} or @key{F1} means ``help'' in various other contexts as | ||
| 30 | well. For instance, you can type them after a prefix key to display | ||
| 31 | list of the keys that can follow the prefix key. (A few prefix keys | ||
| 32 | don't support @kbd{C-h} in this way, because they define other | ||
| 33 | meanings for it, but they all support @key{F1} for help.) | ||
| 34 | |||
| 35 | Most help buffers use a special major mode, Help mode, which lets | ||
| 36 | you scroll conveniently with @key{SPC} and @key{DEL}. You can also | ||
| 37 | follow hyperlinks to URLs, and to other facilities including Info | ||
| 38 | nodes and customization buffers. @xref{Help Mode}. | ||
| 39 | |||
| 40 | @cindex searching documentation efficiently | ||
| 41 | @cindex looking for a subject in documentation | ||
| 42 | If you are looking for a certain feature, but don't know what it is | ||
| 43 | called or where to look, we recommend three methods. First, try an | ||
| 44 | apropos command, then try searching the manual index, then look in the | ||
| 45 | FAQ and the package keywords. | ||
| 46 | |||
| 47 | @table @kbd | ||
| 48 | @item C-h a @var{topics} @key{RET} | ||
| 49 | This searches for commands whose names match the argument | ||
| 50 | @var{topics}. The argument can be a keyword, a list of keywords, or a | ||
| 51 | regular expression (@pxref{Regexps}). This command displays all the | ||
| 52 | matches in a new buffer. @xref{Apropos}. | ||
| 53 | |||
| 54 | @item C-h i d m emacs @key{RET} i @var{topic} @key{RET} | ||
| 55 | This searches for @var{topic} in the indices of the on-line Emacs | ||
| 56 | manual, and displays the first match found. Press @kbd{,} to see | ||
| 57 | subsequent matches. You can use a regular expression as @var{topic}. | ||
| 58 | |||
| 59 | @item C-h i d m emacs @key{RET} s @var{topic} @key{RET} | ||
| 60 | Similar, but searches the @emph{text} of the manual rather than the | ||
| 61 | indices. | ||
| 62 | |||
| 63 | @item C-h C-f | ||
| 64 | This displays the Emacs FAQ. You can use the Info commands | ||
| 65 | to browse it. | ||
| 66 | |||
| 67 | @item C-h p | ||
| 68 | This displays the available Emacs packages based on keywords. | ||
| 69 | @xref{Library Keywords}. | ||
| 70 | @end table | ||
| 71 | |||
| 72 | @menu | ||
| 73 | * Help Summary:: Brief list of all Help commands. | ||
| 74 | * Key Help:: Asking what a key does in Emacs. | ||
| 75 | * Name Help:: Asking about a command, variable or function name. | ||
| 76 | * Apropos:: Asking what pertains to a given topic. | ||
| 77 | * Help Mode:: Special features of Help mode and Help buffers. | ||
| 78 | * Library Keywords:: Finding Lisp libraries by keywords (topics). | ||
| 79 | * Language Help:: Help relating to international language support. | ||
| 80 | * Misc Help:: Other help commands. | ||
| 81 | * Help Files:: Commands to display pre-written help files. | ||
| 82 | * Help Echo:: Help on active text and tooltips (`balloon help') | ||
| 83 | @end menu | ||
| 84 | |||
| 85 | @iftex | ||
| 86 | @node Help Summary | ||
| 87 | @end iftex | ||
| 88 | @ifnottex | ||
| 89 | @node Help Summary | ||
| 90 | @section Help Summary | ||
| 91 | @end ifnottex | ||
| 92 | |||
| 93 | Here is a summary of the Emacs interactive help commands. (The | ||
| 94 | character that follows @kbd{C-h} is the ``help option.'') @xref{Help | ||
| 95 | Files}, for other help commands that display fixed files of | ||
| 96 | information. | ||
| 97 | |||
| 98 | @table @kbd | ||
| 99 | @item C-h a @var{topics} @key{RET} | ||
| 100 | Display a list of commands whose names match @var{topics} | ||
| 101 | (@code{apropos-command}; @pxref{Apropos}). | ||
| 102 | @item C-h b | ||
| 103 | Display all active key bindings; minor mode bindings first, then those | ||
| 104 | of the major mode, then global bindings (@code{describe-bindings}). | ||
| 105 | @item C-h c @var{key} | ||
| 106 | Given a key sequence @var{key}, show the name of the command that it | ||
| 107 | runs (@code{describe-key-briefly}). Here @kbd{c} stands for | ||
| 108 | ``character.'' For more extensive information on @var{key}, use | ||
| 109 | @kbd{C-h k}. | ||
| 110 | @item C-h d @var{topics} @key{RET} | ||
| 111 | Display the commands and variables whose documentation matches | ||
| 112 | @var{topics} (@code{apropos-documentation}). | ||
| 113 | @item C-h e | ||
| 114 | Display the @code{*Messages*} buffer | ||
| 115 | (@code{view-echo-area-messages}). | ||
| 116 | @item C-h f @var{function} @key{RET} | ||
| 117 | Display documentation on the Lisp function named @var{function} | ||
| 118 | (@code{describe-function}). Since commands are Lisp functions, | ||
| 119 | this works for commands too. | ||
| 120 | @item C-h h | ||
| 121 | Display the @file{HELLO} file, which shows examples of various character | ||
| 122 | sets. | ||
| 123 | @item C-h i | ||
| 124 | Run Info, the GNU documentation browser (@code{info}). | ||
| 125 | The complete Emacs manual is available on-line in Info. | ||
| 126 | @item C-h k @var{key} | ||
| 127 | Display the name and documentation of the command that @var{key} runs | ||
| 128 | (@code{describe-key}). | ||
| 129 | @item C-h l | ||
| 130 | Display a description of the last 100 characters you typed | ||
| 131 | (@code{view-lossage}). | ||
| 132 | @item C-h m | ||
| 133 | Display documentation of the current major mode (@code{describe-mode}). | ||
| 134 | @item C-h p | ||
| 135 | Find packages by topic keyword (@code{finder-by-keyword}). | ||
| 136 | @item C-h s | ||
| 137 | Display the current contents of the syntax table, with an explanation of | ||
| 138 | what they mean (@code{describe-syntax}). @xref{Syntax}. | ||
| 139 | @item C-h t | ||
| 140 | Enter the Emacs interactive tutorial (@code{help-with-tutorial}). | ||
| 141 | @item C-h v @var{var} @key{RET} | ||
| 142 | Display the documentation of the Lisp variable @var{var} | ||
| 143 | (@code{describe-variable}). | ||
| 144 | @item C-h w @var{command} @key{RET} | ||
| 145 | Show which keys run the command named @var{command} (@code{where-is}). | ||
| 146 | @item C-h C @var{coding} @key{RET} | ||
| 147 | Describe the coding system @var{coding} | ||
| 148 | (@code{describe-coding-system}). | ||
| 149 | @item C-h C @key{RET} | ||
| 150 | Describe the coding systems currently in use. | ||
| 151 | @item C-h I @var{method} @key{RET} | ||
| 152 | Describe the input method @var{method} (@code{describe-input-method}). | ||
| 153 | @item C-h L @var{language-env} @key{RET} | ||
| 154 | Display information on the character sets, coding systems, and input | ||
| 155 | methods used in language environment @var{language-env} | ||
| 156 | (@code{describe-language-environment}). | ||
| 157 | @item C-h F @var{function} @key{RET} | ||
| 158 | Enter Info and goes to the node that documents the Emacs function | ||
| 159 | @var{function} (@code{Info-goto-emacs-command-node}). | ||
| 160 | @item C-h K @var{key} | ||
| 161 | Enter Info and goes to the node that documents the key sequence | ||
| 162 | @var{key} (@code{Info-goto-emacs-key-command-node}). | ||
| 163 | @item C-h S @var{symbol} @key{RET} | ||
| 164 | Display the Info documentation on symbol @var{symbol} according to the | ||
| 165 | programming language you are editing (@code{info-lookup-symbol}). | ||
| 166 | @item C-h . | ||
| 167 | Display the help message for a special text area, if point is in one | ||
| 168 | (@code{display-local-help}). (These include, for example, links in | ||
| 169 | @samp{*Help*} buffers.) | ||
| 170 | @end table | ||
| 171 | |||
| 172 | @node Key Help | ||
| 173 | @section Documentation for a Key | ||
| 174 | |||
| 175 | @kindex C-h c | ||
| 176 | @findex describe-key-briefly | ||
| 177 | The help commands to get information about a key sequence are | ||
| 178 | @kbd{C-h c} and @w{@kbd{C-h k}}. @kbd{C-h c @var{key}} displays in | ||
| 179 | the echo area the name of the command that @var{key} is bound to. For | ||
| 180 | example, @kbd{C-h c C-f} displays @samp{forward-char}. Since command | ||
| 181 | names are chosen to describe what the commands do, this gives you a | ||
| 182 | very brief description of what @var{key} does. | ||
| 183 | |||
| 184 | @kindex C-h k | ||
| 185 | @findex describe-key | ||
| 186 | @kbd{C-h k @var{key}} is similar but gives more information: it | ||
| 187 | displays the documentation string of the command as well as its name. | ||
| 188 | It displays this information in a window, since it may not fit in the | ||
| 189 | echo area. | ||
| 190 | |||
| 191 | @kindex C-h K | ||
| 192 | @findex Info-goto-emacs-key-command-node | ||
| 193 | To find the documentation of a key sequence @var{key}, type @kbd{C-h | ||
| 194 | K @var{key}}. This displays the appropriate manual section which | ||
| 195 | contains the documentation of @var{key}. | ||
| 196 | |||
| 197 | @kbd{C-h c}, @kbd{C-h k} and @kbd{C-h K} work for any sort of key | ||
| 198 | sequences, including function keys, menus, and mouse events. For | ||
| 199 | instance, after @kbd{C-h k} you can select a menu item from the menu | ||
| 200 | bar, to view the documentation string of the command it runs. | ||
| 201 | |||
| 202 | @kindex C-h w | ||
| 203 | @findex where-is | ||
| 204 | @kbd{C-h w @var{command} @key{RET}} lists the keys that are bound to | ||
| 205 | @var{command}. It displays the list in the echo area. If it says the | ||
| 206 | command is not on any key, that means you must use @kbd{M-x} to run | ||
| 207 | it. @kbd{C-h w} runs the command @code{where-is}. | ||
| 208 | |||
| 209 | @node Name Help | ||
| 210 | @section Help by Command or Variable Name | ||
| 211 | |||
| 212 | @kindex C-h f | ||
| 213 | @findex describe-function | ||
| 214 | @kbd{C-h f @var{function} @key{RET}} (@code{describe-function}) | ||
| 215 | displays the documentation of Lisp function @var{function}, in a | ||
| 216 | window. Since commands are Lisp functions, you can use this method to | ||
| 217 | view the documentation of any command whose name you know. For | ||
| 218 | example, | ||
| 219 | |||
| 220 | @example | ||
| 221 | C-h f auto-fill-mode @key{RET} | ||
| 222 | @end example | ||
| 223 | |||
| 224 | @noindent | ||
| 225 | displays the documentation of @code{auto-fill-mode}. This is the only | ||
| 226 | way to get the documentation of a command that is not bound to any key | ||
| 227 | (one which you would normally run using @kbd{M-x}). | ||
| 228 | |||
| 229 | @kbd{C-h f} is also useful for Lisp functions that you use in a Lisp | ||
| 230 | program. For example, if you have just written the expression | ||
| 231 | @code{(make-vector len)} and want to check that you are using | ||
| 232 | @code{make-vector} properly, type @kbd{C-h f make-vector @key{RET}}. | ||
| 233 | Because @kbd{C-h f} allows all function names, not just command names, | ||
| 234 | you may find that some of your favorite completion abbreviations that | ||
| 235 | work in @kbd{M-x} don't work in @kbd{C-h f}. An abbreviation that is | ||
| 236 | unique among command names may not be unique among all function names. | ||
| 237 | |||
| 238 | If you type @kbd{C-h f @key{RET}}, it describes the function called | ||
| 239 | by the innermost Lisp expression in the buffer around point, | ||
| 240 | @emph{provided} that function name is a valid, defined Lisp function. | ||
| 241 | (That name appears as the default while you enter the argument.) For | ||
| 242 | example, if point is located following the text @samp{(make-vector | ||
| 243 | (car x)}, the innermost list containing point is the one that starts | ||
| 244 | with @samp{(make-vector}, so @kbd{C-h f @key{RET}} will describe the | ||
| 245 | function @code{make-vector}. | ||
| 246 | |||
| 247 | @kbd{C-h f} is also useful just to verify that you spelled a | ||
| 248 | function name correctly. If the minibuffer prompt for @kbd{C-h f} | ||
| 249 | shows the function name from the buffer as the default, it means that | ||
| 250 | name is defined as a Lisp function. Type @kbd{C-g} to cancel the | ||
| 251 | @kbd{C-h f} command if you don't really want to view the | ||
| 252 | documentation. | ||
| 253 | |||
| 254 | @kindex C-h v | ||
| 255 | @findex describe-variable | ||
| 256 | @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but | ||
| 257 | describes Lisp variables instead of Lisp functions. Its default is | ||
| 258 | the Lisp symbol around or before point, if that is the name of a | ||
| 259 | defined Lisp variable. @xref{Variables}. | ||
| 260 | |||
| 261 | Help buffers that describe Emacs variables and functions normally | ||
| 262 | have hyperlinks to the corresponding source definition, if you have | ||
| 263 | the source files installed. (@xref{Hyperlinking}.) If you know Lisp | ||
| 264 | (or C), this provides the ultimate documentation. If you don't know | ||
| 265 | Lisp, you should learn it. (The Introduction to Emacs Lisp | ||
| 266 | Programming, available from the FSF through fsf.org, is a good way to | ||
| 267 | get started.) If Emacs feels you are just @emph{using} it, treating | ||
| 268 | it as an object program, its feelings may be hurt. For real intimacy, | ||
| 269 | read the Emacs source code. | ||
| 270 | |||
| 271 | @kindex C-h F | ||
| 272 | @findex Info-goto-emacs-command-node | ||
| 273 | To find a function's documentation in a manual, use @kbd{C-h F} | ||
| 274 | (@code{Info-goto-emacs-command-node}). This knows about various | ||
| 275 | manuals, not just the Emacs manual, and finds the right one. | ||
| 276 | |||
| 277 | @node Apropos | ||
| 278 | @section Apropos | ||
| 279 | |||
| 280 | The @dfn{apropos} commands answer questions like, ``What are the | ||
| 281 | commands for working with files?'' More precisely, you specify an | ||
| 282 | @dfn{apropos pattern}, which means either a word, a list of words, or | ||
| 283 | a regular expression. Each apropos command displays a list of items | ||
| 284 | that match the pattern, in a separate buffer. | ||
| 285 | |||
| 286 | @table @kbd | ||
| 287 | @item C-h a @var{pattern} @key{RET} | ||
| 288 | Search for commands whose names match @var{pattern}. | ||
| 289 | |||
| 290 | @item M-x apropos @key{RET} @var{pattern} @key{RET} | ||
| 291 | Search for functions and variables whose names match @var{pattern}. | ||
| 292 | Both interactive functions (commands) and noninteractive functions can | ||
| 293 | be found by this command. | ||
| 294 | |||
| 295 | @item M-x apropos-variable @key{RET} @var{pattern} @key{RET} | ||
| 296 | Search for user-option variables whose names match @var{pattern}. | ||
| 297 | |||
| 298 | @item M-x apropos-value @key{RET} @var{pattern} @key{RET} | ||
| 299 | Search for functions whose definitions @var{pattern}, and variables | ||
| 300 | whose values match @var{pattern}. | ||
| 301 | |||
| 302 | @item C-h d @var{pattern} @key{RET} | ||
| 303 | Search for functions and variables whose @strong{documentation | ||
| 304 | strings} match @var{pattern}. | ||
| 305 | @end table | ||
| 306 | |||
| 307 | @kindex C-h a | ||
| 308 | @findex apropos-command | ||
| 309 | @cindex apropos | ||
| 310 | The simplest kind of apropos pattern is one word. Anything which | ||
| 311 | contains that word matches the pattern. Thus, to find the commands | ||
| 312 | that work on files, type @kbd{C-h a file @key{RET}}. This displays a | ||
| 313 | list of all command names that contain @samp{file}, including | ||
| 314 | @code{copy-file}, @code{find-file}, and so on. Each command name | ||
| 315 | comes with a brief description and a list of keys you can currently | ||
| 316 | invoke it with. In our example, it would say that you can invoke | ||
| 317 | @code{find-file} by typing @kbd{C-x C-f}. | ||
| 318 | |||
| 319 | The @kbd{a} in @kbd{C-h a} stands for ``Apropos''; @kbd{C-h a} | ||
| 320 | runs the command @code{apropos-command}. This command normally checks | ||
| 321 | only commands (interactive functions); if you specify a prefix | ||
| 322 | argument, it checks noninteractive functions as well. | ||
| 323 | |||
| 324 | For more information about a function definition, variable or symbol | ||
| 325 | property listed in the apropos buffer, you can click on it with | ||
| 326 | @kbd{Mouse-1} or @kbd{Mouse-2}, or move there and type @key{RET}. | ||
| 327 | |||
| 328 | When you specify more than one word in the apropos pattern, a name | ||
| 329 | must contain at least two of the words in order to match. Thus, if | ||
| 330 | you are looking for commands to kill a chunk of text before point, you | ||
| 331 | could try @kbd{C-h a kill back backward behind before @key{RET}}. The | ||
| 332 | real command name @code{kill-backward} will match that; if there were | ||
| 333 | a command @code{kill-text-before}, it would also match, since it | ||
| 334 | contains two of the specified words. | ||
| 335 | |||
| 336 | For even greater flexibility, you can specify a regular expression | ||
| 337 | (@pxref{Regexps}). An apropos pattern is interpreted as a regular | ||
| 338 | expression if it contains any of the regular expression special | ||
| 339 | characters, @samp{^$*+?.\[}. | ||
| 340 | |||
| 341 | Following the conventions for naming Emacs commands, here are some | ||
| 342 | words that you'll find useful in apropos patterns. By using them in | ||
| 343 | @kbd{C-h a}, you will also get a feel for the naming conventions. | ||
| 344 | |||
| 345 | @quotation | ||
| 346 | char, line, word, sentence, paragraph, region, page, sexp, list, defun, | ||
| 347 | rect, buffer, frame, window, face, file, dir, register, mode, beginning, end, | ||
| 348 | forward, backward, next, previous, up, down, search, goto, kill, delete, | ||
| 349 | mark, insert, yank, fill, indent, case, change, set, what, list, find, | ||
| 350 | view, describe, default. | ||
| 351 | @end quotation | ||
| 352 | |||
| 353 | @findex apropos | ||
| 354 | Use @kbd{M-x apropos} instead of @kbd{C-h a} to list all the Lisp | ||
| 355 | symbols that match an apropos pattern, not just the symbols that are | ||
| 356 | commands. This command does not list key bindings by default; specify | ||
| 357 | a numeric argument if you want it to list them. | ||
| 358 | |||
| 359 | @findex apropos-variable | ||
| 360 | Use @kbd{M-x apropos-variable} to list user-customizable variables | ||
| 361 | that match an apropos pattern. If you specify a prefix argument, it | ||
| 362 | lists all matching variables. | ||
| 363 | |||
| 364 | @kindex C-h d | ||
| 365 | @findex apropos-documentation | ||
| 366 | The @code{apropos-documentation} command is like @code{apropos} | ||
| 367 | except that it searches documentation strings instead of symbol names | ||
| 368 | for matches. | ||
| 369 | |||
| 370 | @findex apropos-value | ||
| 371 | The @code{apropos-value} command is like @code{apropos} except that | ||
| 372 | it searches variables' values for matches for the apropos pattern. | ||
| 373 | With a prefix argument, it also checks symbols' function definitions | ||
| 374 | and property lists. | ||
| 375 | |||
| 376 | @vindex apropos-do-all | ||
| 377 | If the variable @code{apropos-do-all} is non-@code{nil}, the apropos | ||
| 378 | commands always behave as if they had been given a prefix argument. | ||
| 379 | |||
| 380 | @vindex apropos-sort-by-scores | ||
| 381 | @cindex apropos search results, order by score | ||
| 382 | By default, apropos lists the search results in alphabetical order. | ||
| 383 | If the variable @code{apropos-sort-by-scores} is non-@code{nil}, the | ||
| 384 | apropos commands try to guess the relevance of each result, and | ||
| 385 | display the most relevant ones first. | ||
| 386 | |||
| 387 | @vindex apropos-documentation-sort-by-scores | ||
| 388 | By default, apropos lists the search results for | ||
| 389 | @code{apropos-documentation} in order of relevance of the match. If | ||
| 390 | the variable @code{apropos-documentation-sort-by-scores} is | ||
| 391 | @code{nil}, apropos lists the symbols found in alphabetical order. | ||
| 392 | |||
| 393 | @node Help Mode | ||
| 394 | @section Help Mode Commands | ||
| 395 | |||
| 396 | Help buffers provide the same commands as View mode (@pxref{Misc File | ||
| 397 | Ops}), plus a few special commands of their own. | ||
| 398 | |||
| 399 | @table @kbd | ||
| 400 | @item @key{SPC} | ||
| 401 | Scroll forward. | ||
| 402 | @item @key{DEL} | ||
| 403 | Scroll backward. | ||
| 404 | @item @key{RET} | ||
| 405 | Follow a cross reference at point. | ||
| 406 | @item @key{TAB} | ||
| 407 | Move point forward to the next cross reference. | ||
| 408 | @item S-@key{TAB} | ||
| 409 | Move point back to the previous cross reference. | ||
| 410 | @item Mouse-1 | ||
| 411 | @itemx Mouse-2 | ||
| 412 | Follow a cross reference that you click on. | ||
| 413 | @item C-c C-c | ||
| 414 | Show all documentation about the symbol at point. | ||
| 415 | @end table | ||
| 416 | |||
| 417 | When a function name (@pxref{M-x,, Running Commands by Name}), | ||
| 418 | variable name (@pxref{Variables}), or face name (@pxref{Faces}) | ||
| 419 | appears in the documentation, it normally appears inside paired | ||
| 420 | single-quotes. To view the documentation of that command, variable or | ||
| 421 | face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2}, | ||
| 422 | or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace | ||
| 423 | your steps. | ||
| 424 | |||
| 425 | @cindex URL, viewing in help | ||
| 426 | @cindex help, viewing web pages | ||
| 427 | @cindex viewing web pages in help | ||
| 428 | @cindex web pages, viewing in help | ||
| 429 | @findex browse-url | ||
| 430 | You can follow cross references to URLs (web pages) also. This uses | ||
| 431 | the @code{browse-url} command to view the page in the browser you | ||
| 432 | choose. @xref{Browse-URL}. | ||
| 433 | |||
| 434 | @kindex @key{TAB} @r{(Help mode)} | ||
| 435 | @findex help-next-ref | ||
| 436 | @kindex S-@key{TAB} @r{(Help mode)} | ||
| 437 | @findex help-previous-ref | ||
| 438 | There are convenient commands to move point to cross references in | ||
| 439 | the help text. @key{TAB} (@code{help-next-ref}) moves point down to | ||
| 440 | the next cross reference. @kbd{S-@key{TAB}} moves up to the previous | ||
| 441 | cross reference (@code{help-previous-ref}). | ||
| 442 | |||
| 443 | To view all documentation about any symbol name that appears in the | ||
| 444 | text, move point to the symbol name and type @kbd{C-c C-c} | ||
| 445 | (@code{help-follow-symbol}). This shows all available documentation | ||
| 446 | about the symbol as a variable, function and/or face. As above, use | ||
| 447 | @kbd{C-c C-b} to retrace your steps. | ||
| 448 | |||
| 449 | @node Library Keywords | ||
| 450 | @section Keyword Search for Lisp Libraries | ||
| 451 | |||
| 452 | @kindex C-h p | ||
| 453 | @findex finder-by-keyword | ||
| 454 | The @kbd{C-h p} command lets you search the standard Emacs Lisp | ||
| 455 | libraries by topic keywords. Here is a partial list of keywords you can | ||
| 456 | use: | ||
| 457 | |||
| 458 | @multitable {convenience} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} | ||
| 459 | @item abbrev@tab abbreviation handling, typing shortcuts, macros. | ||
| 460 | @item bib@tab code related to the @code{bib} bibliography processor. | ||
| 461 | @item c@tab support for the C language and related languages. | ||
| 462 | @item calendar@tab calendar and time management support. | ||
| 463 | @item comm@tab communications, networking, remote access to files. | ||
| 464 | @item convenience@tab convenience features for faster editing. | ||
| 465 | @item data@tab support for editing files of data. | ||
| 466 | @item docs@tab support for Emacs documentation. | ||
| 467 | @item emulations@tab emulations of other editors. | ||
| 468 | @item extensions@tab Emacs Lisp language extensions. | ||
| 469 | @item faces@tab support for multiple fonts. | ||
| 470 | @item files@tab support for editing and manipulating files. | ||
| 471 | @item frames@tab support for Emacs frames and window systems. | ||
| 472 | @item games@tab games, jokes and amusements. | ||
| 473 | @item hardware@tab support for interfacing with exotic hardware. | ||
| 474 | @item help@tab support for on-line help systems. | ||
| 475 | @item hypermedia@tab support for links between text or other media types. | ||
| 476 | @item i18n@tab internationalization and alternate character-set support. | ||
| 477 | @item internal@tab code for Emacs internals, build process, defaults. | ||
| 478 | @item languages@tab specialized modes for editing programming languages. | ||
| 479 | @item lisp@tab Lisp support, including Emacs Lisp. | ||
| 480 | @item local@tab code local to your site. | ||
| 481 | @item maint@tab maintenance aids for the Emacs development group. | ||
| 482 | @item mail@tab modes for electronic-mail handling. | ||
| 483 | @item matching@tab various sorts of searching and matching. | ||
| 484 | @item mouse@tab mouse support. | ||
| 485 | @item multimedia@tab images and sound support. | ||
| 486 | @item news@tab support for netnews reading and posting. | ||
| 487 | @item oop@tab support for object-oriented programming. | ||
| 488 | @item outlines@tab support for hierarchical outlining. | ||
| 489 | @item processes@tab process, subshell, compilation, and job control support. | ||
| 490 | @item terminals@tab support for terminal types. | ||
| 491 | @item tex@tab supporting code for the @TeX{} formatter. | ||
| 492 | @item tools@tab programming tools. | ||
| 493 | @item unix@tab front-ends/assistants for, or emulators of, UNIX-like features. | ||
| 494 | @item wp@tab word processing. | ||
| 495 | @end multitable | ||
| 496 | |||
| 497 | @node Language Help | ||
| 498 | @section Help for International Language Support | ||
| 499 | |||
| 500 | You can use the command @kbd{C-h L} | ||
| 501 | (@code{describe-language-environment}) to get information about a | ||
| 502 | specific language environment. @xref{Language Environments}. This | ||
| 503 | tells you which languages this language environment supports. It also | ||
| 504 | lists the character sets, coding systems, and input methods that work | ||
| 505 | with this language environment, and finally shows some sample text to | ||
| 506 | illustrate scripts. | ||
| 507 | |||
| 508 | The command @kbd{C-h h} (@code{view-hello-file}) displays the file | ||
| 509 | @file{etc/HELLO}, which shows how to say ``hello'' in many languages. | ||
| 510 | |||
| 511 | The command @kbd{C-h I} (@code{describe-input-method}) describes an | ||
| 512 | input method---either a specified input method, or by default the | ||
| 513 | input method currently in use. @xref{Input Methods}. | ||
| 514 | |||
| 515 | The command @kbd{C-h C} (@code{describe-coding-system}) describes | ||
| 516 | coding systems---either a specified coding system, or the ones | ||
| 517 | currently in use. @xref{Coding Systems}. | ||
| 518 | |||
| 519 | @node Misc Help | ||
| 520 | @section Other Help Commands | ||
| 521 | |||
| 522 | @kindex C-h i | ||
| 523 | @findex info | ||
| 524 | @cindex Info | ||
| 525 | @cindex manuals, on-line | ||
| 526 | @cindex on-line manuals | ||
| 527 | @kbd{C-h i} (@code{info}) runs the Info program, which browses | ||
| 528 | structured documentation files. The entire Emacs manual is available | ||
| 529 | within Info, along with many other manuals for the GNU system. Type | ||
| 530 | @kbd{h} after entering Info to run a tutorial on using Info. | ||
| 531 | |||
| 532 | @cindex find Info manual by its file name | ||
| 533 | With a numeric argument @var{n}, @kbd{C-h i} selects the Info buffer | ||
| 534 | @samp{*info*<@var{n}>}. This is useful if you want to browse multiple | ||
| 535 | Info manuals simultaneously. If you specify just @kbd{C-u} as the | ||
| 536 | prefix argument, @kbd{C-h i} prompts for the name of a documentation | ||
| 537 | file, so you can browse a file which doesn't have an entry in the | ||
| 538 | top-level Info menu. | ||
| 539 | |||
| 540 | The help commands @kbd{C-h F @var{function} @key{RET}} and @kbd{C-h | ||
| 541 | K @var{key}}, described above, enter Info and go straight to the | ||
| 542 | documentation of @var{function} or @var{key}. | ||
| 543 | |||
| 544 | @kindex C-h S | ||
| 545 | @findex info-lookup-symbol | ||
| 546 | When editing a program, if you have an Info version of the manual | ||
| 547 | for the programming language, you can use @kbd{C-h S} | ||
| 548 | (@code{info-lookup-symbol}) to find symbol (keyword, function or | ||
| 549 | variable) in the proper manual. The details of how this command works | ||
| 550 | depend on the major mode. | ||
| 551 | |||
| 552 | @kindex C-h l | ||
| 553 | @findex view-lossage | ||
| 554 | If something surprising happens, and you are not sure what you | ||
| 555 | typed, use @kbd{C-h l} (@code{view-lossage}). @kbd{C-h l} displays | ||
| 556 | the last 100 characters you typed in Emacs. If you see commands that | ||
| 557 | you don't know, you can use @kbd{C-h c} to find out what they do. | ||
| 558 | |||
| 559 | @kindex C-h e | ||
| 560 | @findex view-echo-area-messages | ||
| 561 | To review recent echo area messages, use @kbd{C-h e} | ||
| 562 | (@code{view-echo-area-messages}). This displays the buffer | ||
| 563 | @code{*Messages*}, where those messages are kept. | ||
| 564 | |||
| 565 | @kindex C-h m | ||
| 566 | @findex describe-mode | ||
| 567 | Each Emacs major mode typically redefines a few keys and makes other | ||
| 568 | changes in how editing works. @kbd{C-h m} (@code{describe-mode}) | ||
| 569 | displays documentation on the current major mode, which normally | ||
| 570 | describes the commands and features that are changed in this mode. | ||
| 571 | |||
| 572 | @kindex C-h b | ||
| 573 | @findex describe-bindings | ||
| 574 | @kbd{C-h b} (@code{describe-bindings}) and @kbd{C-h s} | ||
| 575 | (@code{describe-syntax}) show other information about the current | ||
| 576 | environment within Emacs. @kbd{C-h b} displays a list of all the key | ||
| 577 | bindings now in effect: first the local bindings of the current minor | ||
| 578 | modes, then the local bindings defined by the current major mode, and | ||
| 579 | finally the global bindings (@pxref{Key Bindings}). @kbd{C-h s} | ||
| 580 | displays the contents of the syntax table, with explanations of each | ||
| 581 | character's syntax (@pxref{Syntax}). | ||
| 582 | |||
| 583 | You can get a list of subcommands for a particular prefix key by | ||
| 584 | typing @kbd{C-h} after the prefix key. (There are a few prefix keys | ||
| 585 | for which this does not work---those that provide their own bindings | ||
| 586 | for @kbd{C-h}. One of these is @key{ESC}, because @kbd{@key{ESC} C-h} | ||
| 587 | is actually @kbd{C-M-h}, which marks a defun.) | ||
| 588 | |||
| 589 | @node Help Files | ||
| 590 | @section Help Files | ||
| 591 | |||
| 592 | The Emacs help commands described above display dynamic help based | ||
| 593 | on the current state within Emacs, or refer to manuals. Other help | ||
| 594 | commands display pre-written, static help files. These commands all | ||
| 595 | have the form @kbd{C-h C-@var{char}}; that is, @kbd{C-h} followed by a | ||
| 596 | control character. | ||
| 597 | |||
| 598 | @kindex C-h C-c | ||
| 599 | @findex describe-copying | ||
| 600 | @kindex C-h C-d | ||
| 601 | @findex describe-distribution | ||
| 602 | @kindex C-h C-e | ||
| 603 | @findex view-emacs-problems | ||
| 604 | @kindex C-h C-f | ||
| 605 | @findex view-emacs-FAQ | ||
| 606 | @kindex C-h C-n | ||
| 607 | @findex view-emacs-news | ||
| 608 | @kindex C-h C-p | ||
| 609 | @findex describe-project | ||
| 610 | @kindex C-h C-t | ||
| 611 | @findex view-emacs-todo | ||
| 612 | @kindex C-h C-w | ||
| 613 | @findex describe-no-warranty | ||
| 614 | |||
| 615 | @table @kbd | ||
| 616 | @item C-h C-c | ||
| 617 | Display the Emacs copying conditions (@code{describe-copying}). | ||
| 618 | These are the rules under which you can copy and redistribute Emacs. | ||
| 619 | @item C-h C-d | ||
| 620 | Display how to download or order the latest version of | ||
| 621 | Emacs and other GNU software (@code{describe-distribution}). | ||
| 622 | @item C-h C-e | ||
| 623 | Display the list of known Emacs problems, sometimes with suggested | ||
| 624 | workarounds (@code{view-emacs-problems}). | ||
| 625 | @item C-h C-f | ||
| 626 | Display the Emacs frequently-answered-questions list (@code{view-emacs-FAQ}). | ||
| 627 | @item C-h C-n | ||
| 628 | Display the Emacs ``news'' file, which lists new features in the most | ||
| 629 | recent version of Emacs (@code{view-emacs-news}). | ||
| 630 | @item C-h C-p | ||
| 631 | Display general information about the GNU Project | ||
| 632 | (@code{describe-project}). | ||
| 633 | @item C-h C-t | ||
| 634 | Display the Emacs to-do list (@code{view-todo}). | ||
| 635 | @item C-h C-w | ||
| 636 | Display the full details on the complete absence of warranty for GNU | ||
| 637 | Emacs (@code{describe-no-warranty}). | ||
| 638 | @end table | ||
| 639 | |||
| 640 | @node Help Echo | ||
| 641 | @section Help on Active Text and Tooltips | ||
| 642 | |||
| 643 | @cindex tooltips | ||
| 644 | @cindex balloon help | ||
| 645 | When a region of text is ``active,'' so that you can select it with | ||
| 646 | the mouse or a key like @kbd{RET}, it often has associated help text. | ||
| 647 | For instance, most parts of the mode line have help text. On | ||
| 648 | graphical displays, the help text is displayed as a ``tooltip'' | ||
| 649 | (sometimes known as ``balloon help''), when you move the mouse over | ||
| 650 | the active text. @xref{Tooltips}. On some systems, it is shown in | ||
| 651 | the echo area. On text-only terminals, if Emacs cannot follow the | ||
| 652 | mouse, it cannot show the help text on mouse-over. | ||
| 653 | |||
| 654 | @kindex C-h . | ||
| 655 | @findex display-local-help | ||
| 656 | @vindex help-at-pt-display-when-idle | ||
| 657 | You can also access text region help info using the keyboard. The | ||
| 658 | command @kbd{C-h .} (@code{display-local-help}) displays any help text | ||
| 659 | associated with the text at point, using the echo area. If you want | ||
| 660 | help text to be displayed automatically whenever it is available at | ||
| 661 | point, set the variable @code{help-at-pt-display-when-idle} to | ||
| 662 | @code{t}. | ||
| 663 | |||
| 664 | @ignore | ||
| 665 | arch-tag: 6f33ab62-bc75-4367-8057-fd67cc15c3a1 | ||
| 666 | @end ignore | ||
diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi new file mode 100644 index 00000000000..568b54897fa --- /dev/null +++ b/doc/emacs/indent.texi | |||
| @@ -0,0 +1,244 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Indentation, Text, Major Modes, Top | ||
| 6 | @chapter Indentation | ||
| 7 | @cindex indentation | ||
| 8 | @cindex columns (indentation) | ||
| 9 | |||
| 10 | This chapter describes the Emacs commands that add, remove, or | ||
| 11 | adjust indentation. | ||
| 12 | |||
| 13 | @table @kbd | ||
| 14 | @item @key{TAB} | ||
| 15 | Indent the current line ``appropriately'' in a mode-dependent fashion. | ||
| 16 | @item @kbd{C-j} | ||
| 17 | Perform @key{RET} followed by @key{TAB} (@code{newline-and-indent}). | ||
| 18 | @item M-^ | ||
| 19 | Merge the previous and the current line (@code{delete-indentation}). | ||
| 20 | This would cancel the effect of a preceding @kbd{C-j}. | ||
| 21 | @item C-M-o | ||
| 22 | Split the current line at point; text on the line after point becomes a | ||
| 23 | new line indented to the same column where point is located | ||
| 24 | (@code{split-line}). | ||
| 25 | @item M-m | ||
| 26 | Move (forward or back) to the first nonblank character on the current | ||
| 27 | line (@code{back-to-indentation}). | ||
| 28 | @item C-M-\ | ||
| 29 | Indent lines in the region to the same column (@code{indent-region}). | ||
| 30 | @item C-x @key{TAB} | ||
| 31 | Shift lines in the region rigidly right or left (@code{indent-rigidly}). | ||
| 32 | @item M-i | ||
| 33 | Indent from point to the next prespecified tab stop column | ||
| 34 | (@code{tab-to-tab-stop}). | ||
| 35 | @item M-x indent-relative | ||
| 36 | Indent from point to under an indentation point in the previous line. | ||
| 37 | @end table | ||
| 38 | |||
| 39 | Emacs supports four general categories of operations that could all | ||
| 40 | be called `indentation': | ||
| 41 | |||
| 42 | @enumerate | ||
| 43 | @item | ||
| 44 | Insert a tab character. You can type @kbd{C-q @key{TAB}} to do this. | ||
| 45 | |||
| 46 | A tab character is displayed as a stretch of whitespace which extends | ||
| 47 | to the next display tab stop position, and the default width of a tab | ||
| 48 | stop is eight. @xref{Text Display}, for more details. | ||
| 49 | |||
| 50 | @item | ||
| 51 | Insert whitespace up to the next tab stop. You can set tab stops at | ||
| 52 | your choice of column positions, then type @kbd{M-i} to advance to the | ||
| 53 | next tab stop. The default tab stop settings have a tab stop every | ||
| 54 | eight columns, which means by default @kbd{M-i} inserts a tab | ||
| 55 | character. To set the tab stops, use @kbd{M-x edit-tab-stops}. | ||
| 56 | |||
| 57 | @item | ||
| 58 | Align a line with the previous line. More precisely, the command | ||
| 59 | @kbd{M-x indent-relative} indents the current line under the beginning | ||
| 60 | of some word in the previous line. In Fundamental mode and in Text | ||
| 61 | mode, @key{TAB} runs the command @code{indent-relative}. | ||
| 62 | |||
| 63 | @item | ||
| 64 | The most sophisticated method is @dfn{syntax-driven indentation}. | ||
| 65 | Most programming languages have an indentation convention. For Lisp | ||
| 66 | code, lines are indented according to their nesting in parentheses. C | ||
| 67 | code uses the same general idea, but many details are different. | ||
| 68 | |||
| 69 | @kindex TAB | ||
| 70 | Type @key{TAB} to do syntax-driven indentation, in a mode that | ||
| 71 | supports it. It realigns the current line according with the syntax | ||
| 72 | of the preceding lines. No matter where in the line you are when you | ||
| 73 | type @key{TAB}, it aligns the line as a whole. | ||
| 74 | @end enumerate | ||
| 75 | |||
| 76 | Normally, most of the above methods insert an optimal mix of tabs and | ||
| 77 | spaces to align to the desired column. @xref{Just Spaces}, for how to | ||
| 78 | disable use of tabs. However, @kbd{C-q @key{TAB}} always inserts a | ||
| 79 | tab, even when tabs are disabled for the indentation commands. | ||
| 80 | |||
| 81 | @menu | ||
| 82 | * Indentation Commands:: Various commands and techniques for indentation. | ||
| 83 | * Tab Stops:: You can set arbitrary "tab stops" and then | ||
| 84 | indent to the next tab stop when you want to. | ||
| 85 | * Just Spaces:: You can request indentation using just spaces. | ||
| 86 | @end menu | ||
| 87 | |||
| 88 | @node Indentation Commands, Tab Stops, Indentation, Indentation | ||
| 89 | @section Indentation Commands and Techniques | ||
| 90 | |||
| 91 | @kindex M-m | ||
| 92 | @findex back-to-indentation | ||
| 93 | To move over the indentation on a line, do @kbd{M-m} | ||
| 94 | (@code{back-to-indentation}). This command, given anywhere on a line, | ||
| 95 | positions point at the first nonblank character on the line, if any, | ||
| 96 | or else at the end of the line. | ||
| 97 | |||
| 98 | To insert an indented line before the current line, do @kbd{C-a C-o | ||
| 99 | @key{TAB}}. To make an indented line after the current line, use | ||
| 100 | @kbd{C-e C-j}. | ||
| 101 | |||
| 102 | If you just want to insert a tab character in the buffer, you can type | ||
| 103 | @kbd{C-q @key{TAB}}. | ||
| 104 | |||
| 105 | @kindex C-M-o | ||
| 106 | @findex split-line | ||
| 107 | @kbd{C-M-o} (@code{split-line}) moves the text from point to the end of | ||
| 108 | the line vertically down, so that the current line becomes two lines. | ||
| 109 | @kbd{C-M-o} first moves point forward over any spaces and tabs. Then it | ||
| 110 | inserts after point a newline and enough indentation to reach the same | ||
| 111 | column point is on. Point remains before the inserted newline; in this | ||
| 112 | regard, @kbd{C-M-o} resembles @kbd{C-o}. | ||
| 113 | |||
| 114 | @kindex M-^ | ||
| 115 | @findex delete-indentation | ||
| 116 | To join two lines cleanly, use the @kbd{M-^} | ||
| 117 | (@code{delete-indentation}) command. It deletes the indentation at | ||
| 118 | the front of the current line, and the line boundary as well, | ||
| 119 | replacing them with a single space. As a special case (useful for | ||
| 120 | Lisp code) the single space is omitted if the characters to be joined | ||
| 121 | are consecutive open parentheses or closing parentheses, or if the | ||
| 122 | junction follows another newline. To delete just the indentation of a | ||
| 123 | line, go to the beginning of the line and use @kbd{M-\} | ||
| 124 | (@code{delete-horizontal-space}), which deletes all spaces and tabs | ||
| 125 | around the cursor. | ||
| 126 | |||
| 127 | If you have a fill prefix, @kbd{M-^} deletes the fill prefix if it | ||
| 128 | appears after the newline that is deleted. @xref{Fill Prefix}. | ||
| 129 | |||
| 130 | @kindex C-M-\ | ||
| 131 | @kindex C-x TAB | ||
| 132 | @findex indent-region | ||
| 133 | @findex indent-rigidly | ||
| 134 | There are also commands for changing the indentation of several lines | ||
| 135 | at once. They apply to all the lines that begin in the region. | ||
| 136 | @kbd{C-M-\} (@code{indent-region}) indents each line in the ``usual'' | ||
| 137 | way, as if you had typed @key{TAB} at the beginning of the line. A | ||
| 138 | numeric argument specifies the column to indent to, and each line is | ||
| 139 | shifted left or right so that its first nonblank character appears in | ||
| 140 | that column. @kbd{C-x @key{TAB}} (@code{indent-rigidly}) moves all of | ||
| 141 | the lines in the region right by its argument (left, for negative | ||
| 142 | arguments). The whole group of lines moves rigidly sideways, which is | ||
| 143 | how the command gets its name. | ||
| 144 | |||
| 145 | @cindex remove indentation | ||
| 146 | To remove all indentation from all of the lines in the region, | ||
| 147 | invoke @kbd{C-x @key{TAB}} with a large negative argument, such as | ||
| 148 | -1000. | ||
| 149 | |||
| 150 | @findex indent-relative | ||
| 151 | @kbd{M-x indent-relative} indents at point based on the previous line | ||
| 152 | (actually, the last nonempty line). It inserts whitespace at point, moving | ||
| 153 | point, until it is underneath the next indentation point in the previous line. | ||
| 154 | An indentation point is the end of a sequence of whitespace or the end of | ||
| 155 | the line. If point is farther right than any indentation point in the | ||
| 156 | previous line, @code{indent-relative} runs @code{tab-to-tab-stop} | ||
| 157 | @ifnottex | ||
| 158 | (@pxref{Tab Stops}), | ||
| 159 | @end ifnottex | ||
| 160 | @iftex | ||
| 161 | (see next section), | ||
| 162 | @end iftex | ||
| 163 | unless it is called with a numeric argument, in which case it does | ||
| 164 | nothing. | ||
| 165 | |||
| 166 | @xref{Format Indentation}, for another way of specifying the | ||
| 167 | indentation for part of your text. | ||
| 168 | |||
| 169 | @node Tab Stops, Just Spaces, Indentation Commands, Indentation | ||
| 170 | @section Tab Stops | ||
| 171 | |||
| 172 | @cindex tab stops | ||
| 173 | @cindex using tab stops in making tables | ||
| 174 | @cindex tables, indentation for | ||
| 175 | @kindex M-i | ||
| 176 | @findex tab-to-tab-stop | ||
| 177 | For typing in tables, you can use @kbd{M-i} (@code{tab-to-tab-stop}). | ||
| 178 | This command inserts indentation before point, enough to reach the | ||
| 179 | next tab stop column. | ||
| 180 | |||
| 181 | @findex edit-tab-stops | ||
| 182 | @findex edit-tab-stops-note-changes | ||
| 183 | @kindex C-c C-c @r{(Edit Tab Stops)} | ||
| 184 | @vindex tab-stop-list | ||
| 185 | You can specify the tab stops used by @kbd{M-i}. They are stored in a | ||
| 186 | variable called @code{tab-stop-list}, as a list of column-numbers in | ||
| 187 | increasing order. | ||
| 188 | |||
| 189 | The convenient way to set the tab stops is with @kbd{M-x | ||
| 190 | edit-tab-stops}, which creates and selects a buffer containing a | ||
| 191 | description of the tab stop settings. You can edit this buffer to | ||
| 192 | specify different tab stops, and then type @kbd{C-c C-c} to make those | ||
| 193 | new tab stops take effect. The buffer uses Overwrite mode | ||
| 194 | (@pxref{Minor Modes}). @code{edit-tab-stops} records which buffer was | ||
| 195 | current when you invoked it, and stores the tab stops back in that | ||
| 196 | buffer; normally all buffers share the same tab stops and changing | ||
| 197 | them in one buffer affects all, but if you happen to make | ||
| 198 | @code{tab-stop-list} local in one buffer then @code{edit-tab-stops} in | ||
| 199 | that buffer will edit the local settings. | ||
| 200 | |||
| 201 | Here is what the text representing the tab stops looks like for ordinary | ||
| 202 | tab stops every eight columns. | ||
| 203 | |||
| 204 | @example | ||
| 205 | : : : : : : | ||
| 206 | 0 1 2 3 4 | ||
| 207 | 0123456789012345678901234567890123456789012345678 | ||
| 208 | To install changes, type C-c C-c | ||
| 209 | @end example | ||
| 210 | |||
| 211 | The first line contains a colon at each tab stop. The remaining lines | ||
| 212 | are present just to help you see where the colons are and know what to do. | ||
| 213 | |||
| 214 | Note that the tab stops that control @code{tab-to-tab-stop} have nothing | ||
| 215 | to do with displaying tab characters in the buffer. @xref{Text Display}, | ||
| 216 | for more information on that. | ||
| 217 | |||
| 218 | @node Just Spaces,, Tab Stops, Indentation | ||
| 219 | @section Tabs vs. Spaces | ||
| 220 | |||
| 221 | @vindex indent-tabs-mode | ||
| 222 | Emacs normally uses both tabs and spaces to indent lines. If you | ||
| 223 | prefer, all indentation can be made from spaces only. To request | ||
| 224 | this, set @code{indent-tabs-mode} to @code{nil}. This is a per-buffer | ||
| 225 | variable, so altering the variable affects only the current buffer, | ||
| 226 | but there is a default value which you can change as well. | ||
| 227 | @xref{Locals}. | ||
| 228 | |||
| 229 | A tab is not always displayed in the same way. By default, tabs are | ||
| 230 | eight columns wide, but some people like to customize their tools to | ||
| 231 | use a different tab width. So by using spaces only, you can make sure | ||
| 232 | that your file looks the same regardless of the tab width setting. | ||
| 233 | |||
| 234 | @findex tabify | ||
| 235 | @findex untabify | ||
| 236 | There are also commands to convert tabs to spaces or vice versa, always | ||
| 237 | preserving the columns of all nonblank text. @kbd{M-x tabify} scans the | ||
| 238 | region for sequences of spaces, and converts sequences of at least two | ||
| 239 | spaces to tabs if that can be done without changing indentation. @kbd{M-x | ||
| 240 | untabify} changes all tabs in the region to appropriate numbers of spaces. | ||
| 241 | |||
| 242 | @ignore | ||
| 243 | arch-tag: acc07de7-ae11-4ee8-a159-cb59c473f0fb | ||
| 244 | @end ignore | ||
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi new file mode 100644 index 00000000000..b626bfab385 --- /dev/null +++ b/doc/emacs/killing.texi | |||
| @@ -0,0 +1,699 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | |||
| 6 | @node Killing, Yanking, Mark, Top | ||
| 7 | @chapter Killing and Moving Text | ||
| 8 | |||
| 9 | @ifnottex | ||
| 10 | @raisesections | ||
| 11 | @end ifnottex | ||
| 12 | |||
| 13 | @dfn{Killing} means erasing text and copying it into the @dfn{kill | ||
| 14 | ring}, from which you can bring it back into the buffer by | ||
| 15 | @dfn{yanking} it. (Some systems use the terms ``cutting'' and | ||
| 16 | ``pasting'' for these operations.) This is the most common way of | ||
| 17 | moving or copying text within Emacs. Killing and yanking is very safe | ||
| 18 | because Emacs remembers several recent kills, not just the last one. | ||
| 19 | It is versatile, because the many commands for killing syntactic units | ||
| 20 | can also be used for moving those units. But there are other ways of | ||
| 21 | copying text for special purposes. | ||
| 22 | |||
| 23 | @iftex | ||
| 24 | @section Deletion and Killing | ||
| 25 | @end iftex | ||
| 26 | |||
| 27 | @cindex killing text | ||
| 28 | @cindex cutting text | ||
| 29 | @cindex deletion | ||
| 30 | Most commands which erase text from the buffer save it in the kill | ||
| 31 | ring. These commands are known as @dfn{kill} commands. The commands | ||
| 32 | that erase text but do not save it in the kill ring are known as | ||
| 33 | @dfn{delete} commands. The @kbd{C-x u} (@code{undo}) command | ||
| 34 | (@pxref{Undo}) can undo both kill and delete commands; the importance | ||
| 35 | of the kill ring is that you can also yank the text in a different | ||
| 36 | place or places. Emacs has only one kill ring for all buffers, so you | ||
| 37 | can kill text in one buffer and yank it in another buffer. | ||
| 38 | |||
| 39 | The delete commands include @kbd{C-d} (@code{delete-char}) and | ||
| 40 | @key{DEL} (@code{delete-backward-char}), which delete only one | ||
| 41 | character at a time, and those commands that delete only spaces or | ||
| 42 | newlines. Commands that can erase significant amounts of nontrivial | ||
| 43 | data generally do a kill operation instead. The commands' names and | ||
| 44 | individual descriptions use the words @samp{kill} and @samp{delete} to | ||
| 45 | say which kind of operation they perform. | ||
| 46 | |||
| 47 | @vindex kill-read-only-ok | ||
| 48 | @cindex read-only text, killing | ||
| 49 | You cannot kill read-only text, since such text does not allow any | ||
| 50 | kind of modification. But some users like to use the kill commands to | ||
| 51 | copy read-only text into the kill ring, without actually changing it. | ||
| 52 | Therefore, the kill commands work specially in a read-only buffer: | ||
| 53 | they move over text, and copy it to the kill ring, without actually | ||
| 54 | deleting it from the buffer. Normally, kill commands beep and display | ||
| 55 | an error message when this happens. But if you set the variable | ||
| 56 | @code{kill-read-only-ok} to a non-@code{nil} value, they just print a | ||
| 57 | message in the echo area to explain why the text has not been erased. | ||
| 58 | |||
| 59 | You can also use the mouse to kill and yank. @xref{Cut and Paste}. | ||
| 60 | |||
| 61 | @menu | ||
| 62 | * Deletion:: Commands for deleting small amounts of text and | ||
| 63 | blank areas. | ||
| 64 | * Killing by Lines:: How to kill entire lines of text at one time. | ||
| 65 | * Other Kill Commands:: Commands to kill large regions of text and | ||
| 66 | syntactic units such as words and sentences. | ||
| 67 | @end menu | ||
| 68 | |||
| 69 | @need 1500 | ||
| 70 | @node Deletion | ||
| 71 | @subsection Deletion | ||
| 72 | @findex delete-backward-char | ||
| 73 | @findex delete-char | ||
| 74 | |||
| 75 | Deletion means erasing text and not saving it in the kill ring. For | ||
| 76 | the most part, the Emacs commands that delete text are those that | ||
| 77 | erase just one character or only whitespace. | ||
| 78 | |||
| 79 | @table @kbd | ||
| 80 | @item C-d | ||
| 81 | @itemx @key{DELETE} | ||
| 82 | Delete next character (@code{delete-char}). If your keyboard has a | ||
| 83 | @key{DELETE} function key (usually located in the edit keypad), Emacs | ||
| 84 | binds it to @code{delete-char} as well. | ||
| 85 | @item @key{DEL} | ||
| 86 | @itemx @key{BS} | ||
| 87 | Delete previous character (@code{delete-backward-char}). | ||
| 88 | @item M-\ | ||
| 89 | Delete spaces and tabs around point (@code{delete-horizontal-space}). | ||
| 90 | @item M-@key{SPC} | ||
| 91 | Delete spaces and tabs around point, leaving one space | ||
| 92 | (@code{just-one-space}). | ||
| 93 | @item C-x C-o | ||
| 94 | Delete blank lines around the current line (@code{delete-blank-lines}). | ||
| 95 | @item M-^ | ||
| 96 | Join two lines by deleting the intervening newline, along with any | ||
| 97 | indentation following it (@code{delete-indentation}). | ||
| 98 | @end table | ||
| 99 | |||
| 100 | @kindex DEL | ||
| 101 | @kindex C-d | ||
| 102 | The most basic delete commands are @kbd{C-d} (@code{delete-char}) and | ||
| 103 | @key{DEL} (@code{delete-backward-char}). @kbd{C-d} deletes the | ||
| 104 | character after point, the one the cursor is ``on top of.'' This | ||
| 105 | doesn't move point. @key{DEL} deletes the character before the cursor, | ||
| 106 | and moves point back. You can delete newlines like any other characters | ||
| 107 | in the buffer; deleting a newline joins two lines. Actually, @kbd{C-d} | ||
| 108 | and @key{DEL} aren't always delete commands; when given arguments, they | ||
| 109 | kill instead, since they can erase more than one character this way. | ||
| 110 | |||
| 111 | @kindex BACKSPACE | ||
| 112 | @kindex BS | ||
| 113 | @kindex DELETE | ||
| 114 | Every keyboard has a large key which is a short distance above the | ||
| 115 | @key{RET} or @key{ENTER} key and is normally used for erasing what you | ||
| 116 | have typed. It may be labeled @key{DEL}, @key{BACKSPACE}, @key{BS}, | ||
| 117 | @key{DELETE}, or even with a left arrow. Regardless of the label on | ||
| 118 | the key, in Emacs it called @key{DEL}, and it should delete one | ||
| 119 | character backwards. | ||
| 120 | |||
| 121 | Many keyboards (including standard PC keyboards) have a | ||
| 122 | @key{BACKSPACE} key a short ways above @key{RET} or @key{ENTER}, and a | ||
| 123 | @key{DELETE} key elsewhere. In that case, the @key{BACKSPACE} key is | ||
| 124 | @key{DEL}, and the @key{DELETE} key is equivalent to @kbd{C-d}---or it | ||
| 125 | should be. | ||
| 126 | |||
| 127 | Why do we say ``or it should be''? When Emacs starts up using a | ||
| 128 | graphical display, it determines automatically which key or keys should be | ||
| 129 | equivalent to @key{DEL}. As a result, @key{BACKSPACE} and/or @key{DELETE} | ||
| 130 | keys normally do the right things. But in some unusual cases Emacs | ||
| 131 | gets the wrong information from the system. If these keys don't do | ||
| 132 | what they ought to do, you need to tell Emacs which key to use for | ||
| 133 | @key{DEL}. @xref{DEL Does Not Delete}, for how to do this. | ||
| 134 | |||
| 135 | @findex normal-erase-is-backspace-mode | ||
| 136 | On most text-only terminals, Emacs cannot tell which keys the | ||
| 137 | keyboard really has, so it follows a uniform plan which may or may not | ||
| 138 | fit your keyboard. The uniform plan is that the @acronym{ASCII} @key{DEL} | ||
| 139 | character deletes, and the @acronym{ASCII} @key{BS} (backspace) character asks | ||
| 140 | for help (it is the same as @kbd{C-h}). If this is not right for your | ||
| 141 | keyboard, such as if you find that the key which ought to delete backwards | ||
| 142 | enters Help instead, see @ref{DEL Does Not Delete}. | ||
| 143 | |||
| 144 | @kindex M-\ | ||
| 145 | @findex delete-horizontal-space | ||
| 146 | @kindex M-SPC | ||
| 147 | @findex just-one-space | ||
| 148 | The other delete commands are those which delete only whitespace | ||
| 149 | characters: spaces, tabs and newlines. @kbd{M-\} | ||
| 150 | (@code{delete-horizontal-space}) deletes all the spaces and tab | ||
| 151 | characters before and after point. With a prefix argument, this only | ||
| 152 | deletes spaces and tab characters before point. @kbd{M-@key{SPC}} | ||
| 153 | (@code{just-one-space}) does likewise but leaves a single space after | ||
| 154 | point, regardless of the number of spaces that existed previously | ||
| 155 | (even if there were none before). With a numeric argument @var{n}, it | ||
| 156 | leaves @var{n} spaces after point. | ||
| 157 | |||
| 158 | @kbd{C-x C-o} (@code{delete-blank-lines}) deletes all blank lines | ||
| 159 | after the current line. If the current line is blank, it deletes all | ||
| 160 | blank lines preceding the current line as well (leaving one blank line, | ||
| 161 | the current line). On a solitary blank line, it deletes that line. | ||
| 162 | |||
| 163 | @kbd{M-^} (@code{delete-indentation}) joins the current line and the | ||
| 164 | previous line, by deleting a newline and all surrounding spaces, usually | ||
| 165 | leaving a single space. @xref{Indentation,M-^}. | ||
| 166 | |||
| 167 | @node Killing by Lines | ||
| 168 | @subsection Killing by Lines | ||
| 169 | |||
| 170 | @table @kbd | ||
| 171 | @item C-k | ||
| 172 | Kill rest of line or one or more lines (@code{kill-line}). | ||
| 173 | @item C-S-backspace | ||
| 174 | Kill an entire line at once (@code{kill-whole-line}) | ||
| 175 | @end table | ||
| 176 | |||
| 177 | @kindex C-k | ||
| 178 | @findex kill-line | ||
| 179 | The simplest kill command is @kbd{C-k}. If given at the beginning of | ||
| 180 | a line, it kills all the text on the line, leaving it blank. When used | ||
| 181 | on a blank line, it kills the whole line including its newline. To kill | ||
| 182 | an entire non-blank line, go to the beginning and type @kbd{C-k} twice. | ||
| 183 | |||
| 184 | More generally, @kbd{C-k} kills from point up to the end of the line, | ||
| 185 | unless it is at the end of a line. In that case it kills the newline | ||
| 186 | following point, thus merging the next line into the current one. | ||
| 187 | Spaces and tabs that you can't see at the end of the line are ignored | ||
| 188 | when deciding which case applies, so if point appears to be at the end | ||
| 189 | of the line, you can be sure @kbd{C-k} will kill the newline. | ||
| 190 | |||
| 191 | When @kbd{C-k} is given a positive argument, it kills that many lines | ||
| 192 | and the newlines that follow them (however, text on the current line | ||
| 193 | before point is not killed). With a negative argument @minus{}@var{n}, it | ||
| 194 | kills @var{n} lines preceding the current line (together with the text | ||
| 195 | on the current line before point). Thus, @kbd{C-u - 2 C-k} at the front | ||
| 196 | of a line kills the two previous lines. | ||
| 197 | |||
| 198 | @kbd{C-k} with an argument of zero kills the text before point on the | ||
| 199 | current line. | ||
| 200 | |||
| 201 | @vindex kill-whole-line | ||
| 202 | If the variable @code{kill-whole-line} is non-@code{nil}, @kbd{C-k} at | ||
| 203 | the very beginning of a line kills the entire line including the | ||
| 204 | following newline. This variable is normally @code{nil}. | ||
| 205 | |||
| 206 | @kindex C-S-backspace | ||
| 207 | @findex kill-whole-line | ||
| 208 | @kbd{C-S-backspace} (@code{kill-whole-line}) will kill a whole line | ||
| 209 | including its newline regardless of the position of point within the | ||
| 210 | line. Note that many character terminals will prevent you from typing | ||
| 211 | the key sequence @kbd{C-S-backspace}. | ||
| 212 | |||
| 213 | @node Other Kill Commands | ||
| 214 | @subsection Other Kill Commands | ||
| 215 | @findex kill-region | ||
| 216 | @kindex C-w | ||
| 217 | |||
| 218 | @table @kbd | ||
| 219 | @item C-w | ||
| 220 | Kill region (from point to the mark) (@code{kill-region}). | ||
| 221 | @item M-d | ||
| 222 | Kill word (@code{kill-word}). @xref{Words}. | ||
| 223 | @item M-@key{DEL} | ||
| 224 | Kill word backwards (@code{backward-kill-word}). | ||
| 225 | @item C-x @key{DEL} | ||
| 226 | Kill back to beginning of sentence (@code{backward-kill-sentence}). | ||
| 227 | @xref{Sentences}. | ||
| 228 | @item M-k | ||
| 229 | Kill to end of sentence (@code{kill-sentence}). | ||
| 230 | @item C-M-k | ||
| 231 | Kill the following balanced expression (@code{kill-sexp}). @xref{Expressions}. | ||
| 232 | @item M-z @var{char} | ||
| 233 | Kill through the next occurrence of @var{char} (@code{zap-to-char}). | ||
| 234 | @end table | ||
| 235 | |||
| 236 | The most general kill command is @kbd{C-w} (@code{kill-region}), | ||
| 237 | which kills everything between point and the mark. With this command, | ||
| 238 | you can kill any contiguous sequence of characters, if you first set | ||
| 239 | the region around them. | ||
| 240 | |||
| 241 | @kindex M-z | ||
| 242 | @findex zap-to-char | ||
| 243 | A convenient way of killing is combined with searching: @kbd{M-z} | ||
| 244 | (@code{zap-to-char}) reads a character and kills from point up to (and | ||
| 245 | including) the next occurrence of that character in the buffer. A | ||
| 246 | numeric argument acts as a repeat count. A negative argument means to | ||
| 247 | search backward and kill text before point. | ||
| 248 | |||
| 249 | Other syntactic units can be killed: words, with @kbd{M-@key{DEL}} | ||
| 250 | and @kbd{M-d} (@pxref{Words}); balanced expressions, with @kbd{C-M-k} | ||
| 251 | (@pxref{Expressions}); and sentences, with @kbd{C-x @key{DEL}} and | ||
| 252 | @kbd{M-k} (@pxref{Sentences}).@refill | ||
| 253 | |||
| 254 | @node Yanking, Accumulating Text, Killing, Top | ||
| 255 | @section Yanking | ||
| 256 | @cindex moving text | ||
| 257 | @cindex copying text | ||
| 258 | @cindex kill ring | ||
| 259 | @cindex yanking | ||
| 260 | @cindex pasting | ||
| 261 | |||
| 262 | @dfn{Yanking} means reinserting text previously killed. This is what | ||
| 263 | some systems call ``pasting.'' The usual way to move or copy text is to | ||
| 264 | kill it and then yank it elsewhere one or more times. This is very safe | ||
| 265 | because Emacs remembers many recent kills, not just the last one. | ||
| 266 | |||
| 267 | @table @kbd | ||
| 268 | @item C-y | ||
| 269 | Yank last killed text (@code{yank}). | ||
| 270 | @item M-y | ||
| 271 | Replace text just yanked with an earlier batch of killed text | ||
| 272 | (@code{yank-pop}). | ||
| 273 | @item M-w | ||
| 274 | Save region as last killed text without actually killing it | ||
| 275 | (@code{kill-ring-save}). Some systems call this ``copying.'' | ||
| 276 | @item C-M-w | ||
| 277 | Append next kill to last batch of killed text (@code{append-next-kill}). | ||
| 278 | @end table | ||
| 279 | |||
| 280 | On graphical displays with window systems, if there is a current | ||
| 281 | selection in some other application, and you selected it more recently | ||
| 282 | than you killed any text in Emacs, @kbd{C-y} copies the selection | ||
| 283 | instead of text killed within Emacs. | ||
| 284 | |||
| 285 | @menu | ||
| 286 | * Kill Ring:: Where killed text is stored. Basic yanking. | ||
| 287 | * Appending Kills:: Several kills in a row all yank together. | ||
| 288 | * Earlier Kills:: Yanking something killed some time ago. | ||
| 289 | @end menu | ||
| 290 | |||
| 291 | @node Kill Ring | ||
| 292 | @subsection The Kill Ring | ||
| 293 | |||
| 294 | All killed text is recorded in the @dfn{kill ring}, a list of blocks of | ||
| 295 | text that have been killed. There is only one kill ring, shared by all | ||
| 296 | buffers, so you can kill text in one buffer and yank it in another buffer. | ||
| 297 | This is the usual way to move text from one file to another. | ||
| 298 | (@xref{Accumulating Text}, for some other ways.) | ||
| 299 | |||
| 300 | @kindex C-y | ||
| 301 | @findex yank | ||
| 302 | The command @kbd{C-y} (@code{yank}) reinserts the text of the most recent | ||
| 303 | kill. It leaves the cursor at the end of the text. It sets the mark at | ||
| 304 | the beginning of the text. @xref{Mark}. | ||
| 305 | |||
| 306 | @kbd{C-u C-y} leaves the cursor in front of the text, and sets the | ||
| 307 | mark after it. This happens only if the argument is specified with just | ||
| 308 | a @kbd{C-u}, precisely. Any other sort of argument, including @kbd{C-u} | ||
| 309 | and digits, specifies an earlier kill to yank (@pxref{Earlier Kills}). | ||
| 310 | |||
| 311 | @cindex yanking and text properties | ||
| 312 | @vindex yank-excluded-properties | ||
| 313 | The yank commands discard certain text properties from the text that | ||
| 314 | is yanked, those that might lead to annoying results. For instance, | ||
| 315 | they discard text properties that respond to the mouse or specify key | ||
| 316 | bindings. The variable @code{yank-excluded-properties} specifies the | ||
| 317 | properties to discard. Yanking of register contents and rectangles | ||
| 318 | also discard these properties. | ||
| 319 | |||
| 320 | @kindex M-w | ||
| 321 | @findex kill-ring-save | ||
| 322 | To copy a block of text, you can use @kbd{M-w} | ||
| 323 | (@code{kill-ring-save}), which copies the region into the kill ring | ||
| 324 | without removing it from the buffer. This is approximately equivalent | ||
| 325 | to @kbd{C-w} followed by @kbd{C-x u}, except that @kbd{M-w} does not | ||
| 326 | alter the undo history and does not temporarily change the screen. | ||
| 327 | |||
| 328 | @node Appending Kills | ||
| 329 | @subsection Appending Kills | ||
| 330 | |||
| 331 | @cindex appending kills in the ring | ||
| 332 | @cindex television | ||
| 333 | Normally, each kill command pushes a new entry onto the kill ring. | ||
| 334 | However, two or more kill commands in a row combine their text into a | ||
| 335 | single entry, so that a single @kbd{C-y} yanks all the text as a unit, | ||
| 336 | just as it was before it was killed. | ||
| 337 | |||
| 338 | Thus, if you want to yank text as a unit, you need not kill all of it | ||
| 339 | with one command; you can keep killing line after line, or word after | ||
| 340 | word, until you have killed it all, and you can still get it all back at | ||
| 341 | once. | ||
| 342 | |||
| 343 | Commands that kill forward from point add onto the end of the previous | ||
| 344 | killed text. Commands that kill backward from point add text onto the | ||
| 345 | beginning. This way, any sequence of mixed forward and backward kill | ||
| 346 | commands puts all the killed text into one entry without rearrangement. | ||
| 347 | Numeric arguments do not break the sequence of appending kills. For | ||
| 348 | example, suppose the buffer contains this text: | ||
| 349 | |||
| 350 | @example | ||
| 351 | This is a line @point{}of sample text. | ||
| 352 | @end example | ||
| 353 | |||
| 354 | @noindent | ||
| 355 | with point shown by @point{}. If you type @kbd{M-d M-@key{DEL} M-d | ||
| 356 | M-@key{DEL}}, killing alternately forward and backward, you end up with | ||
| 357 | @samp{a line of sample} as one entry in the kill ring, and @samp{This | ||
| 358 | is@ @ text.} in the buffer. (Note the double space between @samp{is} | ||
| 359 | and @samp{text}, which you can clean up with @kbd{M-@key{SPC}} or | ||
| 360 | @kbd{M-q}.) | ||
| 361 | |||
| 362 | Another way to kill the same text is to move back two words with | ||
| 363 | @kbd{M-b M-b}, then kill all four words forward with @kbd{C-u M-d}. | ||
| 364 | This produces exactly the same results in the buffer and in the kill | ||
| 365 | ring. @kbd{M-f M-f C-u M-@key{DEL}} kills the same text, all going | ||
| 366 | backward; once again, the result is the same. The text in the kill ring | ||
| 367 | entry always has the same order that it had in the buffer before you | ||
| 368 | killed it. | ||
| 369 | |||
| 370 | @kindex C-M-w | ||
| 371 | @findex append-next-kill | ||
| 372 | If a kill command is separated from the last kill command by other | ||
| 373 | commands (not just numeric arguments), it starts a new entry on the kill | ||
| 374 | ring. But you can force it to append by first typing the command | ||
| 375 | @kbd{C-M-w} (@code{append-next-kill}) right before it. The @kbd{C-M-w} | ||
| 376 | tells the following command, if it is a kill command, to append the text | ||
| 377 | it kills to the last killed text, instead of starting a new entry. With | ||
| 378 | @kbd{C-M-w}, you can kill several separated pieces of text and | ||
| 379 | accumulate them to be yanked back in one place.@refill | ||
| 380 | |||
| 381 | A kill command following @kbd{M-w} does not append to the text that | ||
| 382 | @kbd{M-w} copied into the kill ring. | ||
| 383 | |||
| 384 | @node Earlier Kills | ||
| 385 | @subsection Yanking Earlier Kills | ||
| 386 | |||
| 387 | @cindex yanking previous kills | ||
| 388 | @kindex M-y | ||
| 389 | @findex yank-pop | ||
| 390 | To recover killed text that is no longer the most recent kill, use the | ||
| 391 | @kbd{M-y} command (@code{yank-pop}). It takes the text previously | ||
| 392 | yanked and replaces it with the text from an earlier kill. So, to | ||
| 393 | recover the text of the next-to-the-last kill, first use @kbd{C-y} to | ||
| 394 | yank the last kill, and then use @kbd{M-y} to replace it with the | ||
| 395 | previous kill. @kbd{M-y} is allowed only after a @kbd{C-y} or another | ||
| 396 | @kbd{M-y}. | ||
| 397 | |||
| 398 | You can understand @kbd{M-y} in terms of a ``last yank'' pointer which | ||
| 399 | points at an entry in the kill ring. Each time you kill, the ``last | ||
| 400 | yank'' pointer moves to the newly made entry at the front of the ring. | ||
| 401 | @kbd{C-y} yanks the entry which the ``last yank'' pointer points to. | ||
| 402 | @kbd{M-y} moves the ``last yank'' pointer to a different entry, and the | ||
| 403 | text in the buffer changes to match. Enough @kbd{M-y} commands can move | ||
| 404 | the pointer to any entry in the ring, so you can get any entry into the | ||
| 405 | buffer. Eventually the pointer reaches the end of the ring; the next | ||
| 406 | @kbd{M-y} loops back around to the first entry again. | ||
| 407 | |||
| 408 | @kbd{M-y} moves the ``last yank'' pointer around the ring, but it does | ||
| 409 | not change the order of the entries in the ring, which always runs from | ||
| 410 | the most recent kill at the front to the oldest one still remembered. | ||
| 411 | |||
| 412 | @kbd{M-y} can take a numeric argument, which tells it how many entries | ||
| 413 | to advance the ``last yank'' pointer by. A negative argument moves the | ||
| 414 | pointer toward the front of the ring; from the front of the ring, it | ||
| 415 | moves ``around'' to the last entry and continues forward from there. | ||
| 416 | |||
| 417 | Once the text you are looking for is brought into the buffer, you can | ||
| 418 | stop doing @kbd{M-y} commands and it will stay there. It's just a copy | ||
| 419 | of the kill ring entry, so editing it in the buffer does not change | ||
| 420 | what's in the ring. As long as no new killing is done, the ``last | ||
| 421 | yank'' pointer remains at the same place in the kill ring, so repeating | ||
| 422 | @kbd{C-y} will yank another copy of the same previous kill. | ||
| 423 | |||
| 424 | If you know how many @kbd{M-y} commands it would take to find the | ||
| 425 | text you want, you can yank that text in one step using @kbd{C-y} with | ||
| 426 | a numeric argument. @kbd{C-y} with an argument restores the text from | ||
| 427 | the specified kill ring entry, counting back from the most recent as | ||
| 428 | 1. Thus, @kbd{C-u 2 C-y} gets the next-to-the-last block of killed | ||
| 429 | text---it is equivalent to @kbd{C-y M-y}. @kbd{C-y} with a numeric | ||
| 430 | argument starts counting from the ``last yank'' pointer, and sets the | ||
| 431 | ``last yank'' pointer to the entry that it yanks. | ||
| 432 | |||
| 433 | @vindex kill-ring-max | ||
| 434 | The length of the kill ring is controlled by the variable | ||
| 435 | @code{kill-ring-max}; no more than that many blocks of killed text are | ||
| 436 | saved. | ||
| 437 | |||
| 438 | @vindex kill-ring | ||
| 439 | The actual contents of the kill ring are stored in a variable named | ||
| 440 | @code{kill-ring}; you can view the entire contents of the kill ring with | ||
| 441 | the command @kbd{C-h v kill-ring}. | ||
| 442 | |||
| 443 | @node Accumulating Text, Rectangles, Yanking, Top | ||
| 444 | @section Accumulating Text | ||
| 445 | @findex append-to-buffer | ||
| 446 | @findex prepend-to-buffer | ||
| 447 | @findex copy-to-buffer | ||
| 448 | @findex append-to-file | ||
| 449 | |||
| 450 | @cindex accumulating scattered text | ||
| 451 | Usually we copy or move text by killing it and yanking it, but there | ||
| 452 | are other convenient methods for copying one block of text in many | ||
| 453 | places, or for copying many scattered blocks of text into one place. To | ||
| 454 | copy one block to many places, store it in a register | ||
| 455 | (@pxref{Registers}). Here we describe the commands to accumulate | ||
| 456 | scattered pieces of text into a buffer or into a file. | ||
| 457 | |||
| 458 | @table @kbd | ||
| 459 | @item M-x append-to-buffer | ||
| 460 | Append region to the contents of a specified buffer. | ||
| 461 | @item M-x prepend-to-buffer | ||
| 462 | Prepend region to the contents of a specified buffer. | ||
| 463 | @item M-x copy-to-buffer | ||
| 464 | Copy region into a specified buffer, deleting that buffer's old contents. | ||
| 465 | @item M-x insert-buffer | ||
| 466 | Insert the contents of a specified buffer into current buffer at point. | ||
| 467 | @item M-x append-to-file | ||
| 468 | Append region to the contents of a specified file, at the end. | ||
| 469 | @end table | ||
| 470 | |||
| 471 | To accumulate text into a buffer, use @kbd{M-x append-to-buffer}. | ||
| 472 | This reads a buffer name, then inserts a copy of the region into the | ||
| 473 | buffer specified. If you specify a nonexistent buffer, | ||
| 474 | @code{append-to-buffer} creates the buffer. The text is inserted | ||
| 475 | wherever point is in that buffer. If you have been using the buffer for | ||
| 476 | editing, the copied text goes into the middle of the text of the buffer, | ||
| 477 | starting from wherever point happens to be at that moment. | ||
| 478 | |||
| 479 | Point in that buffer is left at the end of the copied text, so | ||
| 480 | successive uses of @code{append-to-buffer} accumulate the text in the | ||
| 481 | specified buffer in the same order as they were copied. Strictly | ||
| 482 | speaking, @code{append-to-buffer} does not always append to the text | ||
| 483 | already in the buffer---it appends only if point in that buffer is at the end. | ||
| 484 | However, if @code{append-to-buffer} is the only command you use to alter | ||
| 485 | a buffer, then point is always at the end. | ||
| 486 | |||
| 487 | @kbd{M-x prepend-to-buffer} is just like @code{append-to-buffer} | ||
| 488 | except that point in the other buffer is left before the copied text, so | ||
| 489 | successive prependings add text in reverse order. @kbd{M-x | ||
| 490 | copy-to-buffer} is similar, except that any existing text in the other | ||
| 491 | buffer is deleted, so the buffer is left containing just the text newly | ||
| 492 | copied into it. | ||
| 493 | |||
| 494 | To retrieve the accumulated text from another buffer, use the | ||
| 495 | command @kbd{M-x insert-buffer}; this too takes @var{buffername} as an | ||
| 496 | argument. It inserts a copy of the whole text in buffer | ||
| 497 | @var{buffername} into the current buffer at point, and sets the mark | ||
| 498 | after the inserted text. Alternatively, you can select the other | ||
| 499 | buffer for editing, then copy text from it by killing. | ||
| 500 | @xref{Buffers}, for background information on buffers. | ||
| 501 | |||
| 502 | Instead of accumulating text within Emacs, in a buffer, you can append | ||
| 503 | text directly into a file with @kbd{M-x append-to-file}, which takes | ||
| 504 | @var{filename} as an argument. It adds the text of the region to the end | ||
| 505 | of the specified file. The file is changed immediately on disk. | ||
| 506 | |||
| 507 | You should use @code{append-to-file} only with files that are | ||
| 508 | @emph{not} being visited in Emacs. Using it on a file that you are | ||
| 509 | editing in Emacs would change the file behind Emacs's back, which | ||
| 510 | can lead to losing some of your editing. | ||
| 511 | |||
| 512 | @node Rectangles, CUA Bindings, Accumulating Text, Top | ||
| 513 | @section Rectangles | ||
| 514 | @cindex rectangle | ||
| 515 | @cindex columns (and rectangles) | ||
| 516 | @cindex killing rectangular areas of text | ||
| 517 | |||
| 518 | The rectangle commands operate on rectangular areas of the text: all | ||
| 519 | the characters between a certain pair of columns, in a certain range of | ||
| 520 | lines. Commands are provided to kill rectangles, yank killed rectangles, | ||
| 521 | clear them out, fill them with blanks or text, or delete them. Rectangle | ||
| 522 | commands are useful with text in multicolumn formats, and for changing | ||
| 523 | text into or out of such formats. | ||
| 524 | |||
| 525 | @cindex mark rectangle | ||
| 526 | When you must specify a rectangle for a command to work on, you do it | ||
| 527 | by putting the mark at one corner and point at the opposite corner. The | ||
| 528 | rectangle thus specified is called the @dfn{region-rectangle} because | ||
| 529 | you control it in much the same way as the region is controlled. But | ||
| 530 | remember that a given combination of point and mark values can be | ||
| 531 | interpreted either as a region or as a rectangle, depending on the | ||
| 532 | command that uses them. | ||
| 533 | |||
| 534 | If point and the mark are in the same column, the rectangle they | ||
| 535 | delimit is empty. If they are in the same line, the rectangle is one | ||
| 536 | line high. This asymmetry between lines and columns comes about | ||
| 537 | because point (and likewise the mark) is between two columns, but within | ||
| 538 | a line. | ||
| 539 | |||
| 540 | @table @kbd | ||
| 541 | @item C-x r k | ||
| 542 | Kill the text of the region-rectangle, saving its contents as the | ||
| 543 | ``last killed rectangle'' (@code{kill-rectangle}). | ||
| 544 | @item C-x r d | ||
| 545 | Delete the text of the region-rectangle (@code{delete-rectangle}). | ||
| 546 | @item C-x r y | ||
| 547 | Yank the last killed rectangle with its upper left corner at point | ||
| 548 | (@code{yank-rectangle}). | ||
| 549 | @item C-x r o | ||
| 550 | Insert blank space to fill the space of the region-rectangle | ||
| 551 | (@code{open-rectangle}). This pushes the previous contents of the | ||
| 552 | region-rectangle rightward. | ||
| 553 | @item C-x r c | ||
| 554 | Clear the region-rectangle by replacing all of its contents with spaces | ||
| 555 | (@code{clear-rectangle}). | ||
| 556 | @item M-x delete-whitespace-rectangle | ||
| 557 | Delete whitespace in each of the lines on the specified rectangle, | ||
| 558 | starting from the left edge column of the rectangle. | ||
| 559 | @item C-x r t @var{string} @key{RET} | ||
| 560 | Replace rectangle contents with @var{string} on each line | ||
| 561 | (@code{string-rectangle}). | ||
| 562 | @item M-x string-insert-rectangle @key{RET} @var{string} @key{RET} | ||
| 563 | Insert @var{string} on each line of the rectangle. | ||
| 564 | @end table | ||
| 565 | |||
| 566 | The rectangle operations fall into two classes: commands for | ||
| 567 | deleting and inserting rectangles, and commands for blank rectangles. | ||
| 568 | |||
| 569 | @kindex C-x r k | ||
| 570 | @kindex C-x r d | ||
| 571 | @findex kill-rectangle | ||
| 572 | @findex delete-rectangle | ||
| 573 | There are two ways to get rid of the text in a rectangle: you can | ||
| 574 | discard the text (delete it) or save it as the ``last killed'' | ||
| 575 | rectangle. The commands for these two ways are @kbd{C-x r d} | ||
| 576 | (@code{delete-rectangle}) and @kbd{C-x r k} (@code{kill-rectangle}). In | ||
| 577 | either case, the portion of each line that falls inside the rectangle's | ||
| 578 | boundaries is deleted, causing any following text on the line to | ||
| 579 | move left into the gap. | ||
| 580 | |||
| 581 | Note that ``killing'' a rectangle is not killing in the usual sense; the | ||
| 582 | rectangle is not stored in the kill ring, but in a special place that | ||
| 583 | can only record the most recent rectangle killed. This is because yanking | ||
| 584 | a rectangle is so different from yanking linear text that different yank | ||
| 585 | commands have to be used. It is hard to define yank-popping for rectangles, | ||
| 586 | so we do not try. | ||
| 587 | |||
| 588 | @kindex C-x r y | ||
| 589 | @findex yank-rectangle | ||
| 590 | To yank the last killed rectangle, type @kbd{C-x r y} | ||
| 591 | (@code{yank-rectangle}). Yanking a rectangle is the opposite of killing | ||
| 592 | one. Point specifies where to put the rectangle's upper left corner. | ||
| 593 | The rectangle's first line is inserted there, the rectangle's second | ||
| 594 | line is inserted at the same horizontal position, but one line | ||
| 595 | vertically down, and so on. The number of lines affected is determined | ||
| 596 | by the height of the saved rectangle. | ||
| 597 | |||
| 598 | You can convert single-column lists into double-column lists using | ||
| 599 | rectangle killing and yanking; kill the second half of the list as a | ||
| 600 | rectangle and then yank it beside the first line of the list. | ||
| 601 | @xref{Two-Column}, for another way to edit multi-column text. | ||
| 602 | |||
| 603 | You can also copy rectangles into and out of registers with @kbd{C-x r | ||
| 604 | r @var{r}} and @kbd{C-x r i @var{r}}. @xref{RegRect,,Rectangle | ||
| 605 | Registers}. | ||
| 606 | |||
| 607 | @kindex C-x r o | ||
| 608 | @findex open-rectangle | ||
| 609 | @kindex C-x r c | ||
| 610 | @findex clear-rectangle | ||
| 611 | There are two commands you can use for making blank rectangles: | ||
| 612 | @kbd{C-x r c} (@code{clear-rectangle}) which blanks out existing text, | ||
| 613 | and @kbd{C-x r o} (@code{open-rectangle}) which inserts a blank | ||
| 614 | rectangle. Clearing a rectangle is equivalent to deleting it and then | ||
| 615 | inserting a blank rectangle of the same size. | ||
| 616 | |||
| 617 | @findex delete-whitespace-rectangle | ||
| 618 | The command @kbd{M-x delete-whitespace-rectangle} deletes horizontal | ||
| 619 | whitespace starting from a particular column. This applies to each of | ||
| 620 | the lines in the rectangle, and the column is specified by the left | ||
| 621 | edge of the rectangle. The right edge of the rectangle does not make | ||
| 622 | any difference to this command. | ||
| 623 | |||
| 624 | @kindex C-x r t | ||
| 625 | @findex string-rectangle | ||
| 626 | The command @kbd{C-x r t} (@code{string-rectangle}) replaces the | ||
| 627 | contents of a region-rectangle with a string on each line. The | ||
| 628 | string's width need not be the same as the width of the rectangle. If | ||
| 629 | the string's width is less, the text after the rectangle shifts left; | ||
| 630 | if the string is wider than the rectangle, the text after the | ||
| 631 | rectangle shifts right. | ||
| 632 | |||
| 633 | @findex string-insert-rectangle | ||
| 634 | The command @kbd{M-x string-insert-rectangle} is similar to | ||
| 635 | @code{string-rectangle}, but inserts the string on each line, | ||
| 636 | shifting the original text to the right. | ||
| 637 | |||
| 638 | @node CUA Bindings, Registers, Rectangles, Top | ||
| 639 | @section CUA Bindings | ||
| 640 | @findex cua-mode | ||
| 641 | @vindex cua-mode | ||
| 642 | @cindex CUA key bindings | ||
| 643 | @vindex cua-enable-cua-keys | ||
| 644 | The command @kbd{M-x cua-mode} sets up key bindings that are | ||
| 645 | compatible with the Common User Access (CUA) system used in many other | ||
| 646 | applications. @kbd{C-x} means cut (kill), @kbd{C-c} copy, @kbd{C-v} | ||
| 647 | paste (yank), and @kbd{C-z} undo. Standard Emacs commands like | ||
| 648 | @kbd{C-x C-c} still work, because @kbd{C-x} and @kbd{C-c} only take | ||
| 649 | effect when the mark is active (and the region is highlighted). | ||
| 650 | However, if you don't want to override these bindings in Emacs at all, | ||
| 651 | set @code{cua-enable-cua-keys} to @code{nil}. | ||
| 652 | |||
| 653 | In CUA mode, using @kbd{Shift} together with the movement keys | ||
| 654 | activates and highlights the region over which they move. The | ||
| 655 | standard (unshifted) movement keys deactivate the mark, and typed text | ||
| 656 | replaces the active region as in Delete-Selection mode | ||
| 657 | (@pxref{Mouse Commands}). | ||
| 658 | |||
| 659 | To enter an Emacs command like @kbd{C-x C-f} while the mark is | ||
| 660 | active, use one of the following methods: either hold @kbd{Shift} | ||
| 661 | together with the prefix key, e.g. @kbd{S-C-x C-f}, or quickly type | ||
| 662 | the prefix key twice, e.g. @kbd{C-x C-x C-f}. | ||
| 663 | |||
| 664 | @cindex rectangle highlighting | ||
| 665 | CUA mode provides enhanced rectangle support with visible | ||
| 666 | rectangle highlighting. Use @kbd{C-RET} to start a rectangle, | ||
| 667 | extend it using the movement commands, and cut or copy it using | ||
| 668 | @kbd{C-x} or @kbd{C-c}. @kbd{RET} moves the cursor to the next | ||
| 669 | (clockwise) corner of the rectangle, so you can easily expand it in | ||
| 670 | any direction. Normal text you type is inserted to the left or right | ||
| 671 | of each line in the rectangle (on the same side as the cursor). | ||
| 672 | |||
| 673 | With CUA you can easily copy text and rectangles into and out of | ||
| 674 | registers by providing a one-digit numeric prefix to the kill, copy, | ||
| 675 | and yank commands, e.g. @kbd{C-1 C-c} copies the region into register | ||
| 676 | @code{1}, and @kbd{C-2 C-v} yanks the contents of register @code{2}. | ||
| 677 | |||
| 678 | @cindex global mark | ||
| 679 | CUA mode also has a global mark feature which allows easy moving and | ||
| 680 | copying of text between buffers. Use @kbd{C-S-SPC} to toggle the | ||
| 681 | global mark on and off. When the global mark is on, all text that you | ||
| 682 | kill or copy is automatically inserted at the global mark, and text | ||
| 683 | you type is inserted at the global mark rather than at the current | ||
| 684 | position. | ||
| 685 | |||
| 686 | For example, to copy words from various buffers into a word list in | ||
| 687 | a given buffer, set the global mark in the target buffer, then | ||
| 688 | navigate to each of the words you want in the list, mark it (e.g. with | ||
| 689 | @kbd{S-M-f}), copy it to the list with @kbd{C-c} or @kbd{M-w}, and | ||
| 690 | insert a newline after the word in the target list by pressing | ||
| 691 | @key{RET}. | ||
| 692 | |||
| 693 | @ifnottex | ||
| 694 | @lowersections | ||
| 695 | @end ifnottex | ||
| 696 | |||
| 697 | @ignore | ||
| 698 | arch-tag: d8da8f96-0928-449a-816e-ff2d3497866c | ||
| 699 | @end ignore | ||
diff --git a/doc/emacs/kmacro.texi b/doc/emacs/kmacro.texi new file mode 100644 index 00000000000..16526e1a2b8 --- /dev/null +++ b/doc/emacs/kmacro.texi | |||
| @@ -0,0 +1,616 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Keyboard Macros, Files, Fixit, Top | ||
| 6 | @chapter Keyboard Macros | ||
| 7 | @cindex defining keyboard macros | ||
| 8 | @cindex keyboard macro | ||
| 9 | |||
| 10 | In this chapter we describe how to record a sequence of editing | ||
| 11 | commands so you can repeat it conveniently later. | ||
| 12 | |||
| 13 | A @dfn{keyboard macro} is a command defined by an Emacs user to stand for | ||
| 14 | another sequence of keys. For example, if you discover that you are | ||
| 15 | about to type @kbd{C-n M-d C-d} forty times, you can speed your work by | ||
| 16 | defining a keyboard macro to do @kbd{C-n M-d C-d}, and then executing | ||
| 17 | it 39 more times. | ||
| 18 | |||
| 19 | You define a keyboard macro by executing and recording the commands | ||
| 20 | which are its definition. Put differently, as you define a keyboard | ||
| 21 | macro, the definition is being executed for the first time. This way, | ||
| 22 | you can see the effects of your commands, so that you don't have to | ||
| 23 | figure them out in your head. When you close the definition, the | ||
| 24 | keyboard macro is defined and also has been, in effect, executed once. | ||
| 25 | You can then do the whole thing over again by invoking the macro. | ||
| 26 | |||
| 27 | Keyboard macros differ from ordinary Emacs commands in that they are | ||
| 28 | written in the Emacs command language rather than in Lisp. This makes it | ||
| 29 | easier for the novice to write them, and makes them more convenient as | ||
| 30 | temporary hacks. However, the Emacs command language is not powerful | ||
| 31 | enough as a programming language to be useful for writing anything | ||
| 32 | intelligent or general. For such things, Lisp must be used. | ||
| 33 | |||
| 34 | @menu | ||
| 35 | * Basic Keyboard Macro:: Defining and running keyboard macros. | ||
| 36 | * Keyboard Macro Ring:: Where previous keyboard macros are saved. | ||
| 37 | * Keyboard Macro Counter:: Inserting incrementing numbers in macros. | ||
| 38 | * Keyboard Macro Query:: Making keyboard macros do different things each time. | ||
| 39 | * Save Keyboard Macro:: Giving keyboard macros names; saving them in files. | ||
| 40 | * Edit Keyboard Macro:: Editing keyboard macros. | ||
| 41 | * Keyboard Macro Step-Edit:: Interactively executing and editing a keyboard | ||
| 42 | macro. | ||
| 43 | @end menu | ||
| 44 | |||
| 45 | @node Basic Keyboard Macro | ||
| 46 | @section Basic Use | ||
| 47 | |||
| 48 | @table @kbd | ||
| 49 | @item @key{F3} | ||
| 50 | @itemx C-x ( | ||
| 51 | Start defining a keyboard macro (@code{kmacro-start-macro}). | ||
| 52 | @item @key{F4} | ||
| 53 | If a keyboard macro is being defined, end the definition; otherwise, | ||
| 54 | execute the most recent keyboard macro | ||
| 55 | (@code{kmacro-end-or-call-macro}). | ||
| 56 | @item C-x ) | ||
| 57 | End the definition of a keyboard macro (@code{kmacro-end-macro}). | ||
| 58 | @item C-x e | ||
| 59 | Execute the most recent keyboard macro (@code{kmacro-end-and-call-macro}). | ||
| 60 | First end the definition of the keyboard macro, if currently defining it. | ||
| 61 | To immediately execute the keyboard macro again, just repeat the @kbd{e}. | ||
| 62 | @item C-u C-x ( | ||
| 63 | Re-execute last keyboard macro, then add more keys to its definition. | ||
| 64 | @item C-u C-u C-x ( | ||
| 65 | Add more keys to the last keyboard macro without re-executing it. | ||
| 66 | @item C-x C-k r | ||
| 67 | Run the last keyboard macro on each line that begins in the region | ||
| 68 | (@code{apply-macro-to-region-lines}). | ||
| 69 | @end table | ||
| 70 | |||
| 71 | @kindex F3 | ||
| 72 | @kindex F4 | ||
| 73 | @kindex C-x ( | ||
| 74 | @kindex C-x ) | ||
| 75 | @kindex C-x e | ||
| 76 | @findex kmacro-start-macro | ||
| 77 | @findex kmacro-end-macro | ||
| 78 | @findex kmacro-end-and-call-macro | ||
| 79 | To start defining a keyboard macro, type the @kbd{F3} or @kbd{C-x (} command | ||
| 80 | (@code{kmacro-start-macro}). From then on, your keys continue to be | ||
| 81 | executed, but also become part of the definition of the macro. @samp{Def} | ||
| 82 | appears in the mode line to remind you of what is going on. When you are | ||
| 83 | finished, the @kbd{F4} or @kbd{C-x )} command (@code{kmacro-end-macro}) terminates the | ||
| 84 | definition (without becoming part of it!). For example, | ||
| 85 | |||
| 86 | @example | ||
| 87 | C-x ( M-f foo C-x ) | ||
| 88 | @end example | ||
| 89 | |||
| 90 | @noindent | ||
| 91 | defines a macro to move forward a word and then insert @samp{foo}. | ||
| 92 | |||
| 93 | The macro thus defined can be invoked again with the @kbd{C-x e} | ||
| 94 | command (@code{kmacro-end-and-call-macro}), which may be given a | ||
| 95 | repeat count as a numeric argument to execute the macro many times. | ||
| 96 | If you enter @kbd{C-x e} while defining a macro, the macro is | ||
| 97 | terminated and executed immediately. | ||
| 98 | |||
| 99 | After executing the macro with @kbd{C-x e}, you can use @kbd{e} | ||
| 100 | repeatedly to immediately repeat the macro one or more times. For example, | ||
| 101 | |||
| 102 | @example | ||
| 103 | C-x ( xyz C-x e e e | ||
| 104 | @end example | ||
| 105 | |||
| 106 | @noindent | ||
| 107 | inserts @samp{xyzxyzxyzxyz} in the current buffer. | ||
| 108 | |||
| 109 | @kbd{C-x )} can also be given a repeat count as an argument, in | ||
| 110 | which case it repeats the macro that many times right after defining | ||
| 111 | it, but defining the macro counts as the first repetition (since it is | ||
| 112 | executed as you define it). Therefore, giving @kbd{C-x )} an argument | ||
| 113 | of 4 executes the macro immediately 3 additional times. An argument | ||
| 114 | of zero to @kbd{C-x e} or @kbd{C-x )} means repeat the macro | ||
| 115 | indefinitely (until it gets an error or you type @kbd{C-g} or, on | ||
| 116 | MS-DOS, @kbd{C-@key{BREAK}}). | ||
| 117 | |||
| 118 | The key @key{F4} is like a combination of @kbd{C-x )} and @kbd{C-x | ||
| 119 | e}. If you're defining a macro, @key{F4} ends the definition. | ||
| 120 | Otherwise it executes the last macro. For example, | ||
| 121 | |||
| 122 | @example | ||
| 123 | F3 xyz F4 F4 F4 | ||
| 124 | @end example | ||
| 125 | |||
| 126 | @noindent | ||
| 127 | inserts @samp{xyzxyzxyz} in the current buffer. | ||
| 128 | |||
| 129 | If you wish to repeat an operation at regularly spaced places in the | ||
| 130 | text, define a macro and include as part of the macro the commands to move | ||
| 131 | to the next place you want to use it. For example, if you want to change | ||
| 132 | each line, you should position point at the start of a line, and define a | ||
| 133 | macro to change that line and leave point at the start of the next line. | ||
| 134 | Then repeating the macro will operate on successive lines. | ||
| 135 | |||
| 136 | When a command reads an argument with the minibuffer, your | ||
| 137 | minibuffer input becomes part of the macro along with the command. So | ||
| 138 | when you replay the macro, the command gets the same argument as | ||
| 139 | when you entered the macro. For example, | ||
| 140 | |||
| 141 | @example | ||
| 142 | C-x ( C-a C-@key{SPC} C-n M-w C-x b f o o @key{RET} C-y C-x b @key{RET} C-x ) | ||
| 143 | @end example | ||
| 144 | |||
| 145 | @noindent | ||
| 146 | defines a macro that copies the current line into the buffer | ||
| 147 | @samp{foo}, then returns to the original buffer. | ||
| 148 | |||
| 149 | You can use function keys in a keyboard macro, just like keyboard | ||
| 150 | keys. You can even use mouse events, but be careful about that: when | ||
| 151 | the macro replays the mouse event, it uses the original mouse position | ||
| 152 | of that event, the position that the mouse had while you were defining | ||
| 153 | the macro. The effect of this may be hard to predict. (Using the | ||
| 154 | current mouse position would be even less predictable.) | ||
| 155 | |||
| 156 | One thing that sometimes works badly in a keyboard macro is the | ||
| 157 | command @kbd{C-M-c} (@code{exit-recursive-edit}). When this command | ||
| 158 | exits a recursive edit that started within the macro, it works as | ||
| 159 | you'd expect. But if it exits a recursive edit that started before | ||
| 160 | you invoked the keyboard macro, it also necessarily exits the keyboard | ||
| 161 | macro as part of the process. | ||
| 162 | |||
| 163 | After you have terminated the definition of a keyboard macro, you can add | ||
| 164 | to the end of its definition by typing @kbd{C-u F3} or @kbd{C-u C-x (}. | ||
| 165 | This is equivalent | ||
| 166 | to plain @kbd{C-x (} followed by retyping the whole definition so far. As | ||
| 167 | a consequence it re-executes the macro as previously defined. | ||
| 168 | |||
| 169 | You can also add to the end of the definition of the last keyboard | ||
| 170 | macro without re-executing it by typing @kbd{C-u C-u C-x (}. | ||
| 171 | |||
| 172 | The variable @code{kmacro-execute-before-append} specifies whether | ||
| 173 | a single @kbd{C-u} prefix causes the existing macro to be re-executed | ||
| 174 | before appending to it. | ||
| 175 | |||
| 176 | @findex apply-macro-to-region-lines | ||
| 177 | @kindex C-x C-k r | ||
| 178 | The command @kbd{C-x C-k r} (@code{apply-macro-to-region-lines}) | ||
| 179 | repeats the last defined keyboard macro on each line that begins in | ||
| 180 | the region. It does this line by line, by moving point to the | ||
| 181 | beginning of the line and then executing the macro. | ||
| 182 | |||
| 183 | @node Keyboard Macro Ring | ||
| 184 | @section The Keyboard Macro Ring | ||
| 185 | |||
| 186 | All defined keyboard macros are recorded in the ``keyboard macro ring,'' | ||
| 187 | a list of sequences of keys. There is only one keyboard macro ring, | ||
| 188 | shared by all buffers. | ||
| 189 | |||
| 190 | @table @kbd | ||
| 191 | @item C-x C-k C-k | ||
| 192 | Execute the keyboard macro at the head of the ring (@code{kmacro-end-or-call-macro-repeat}). | ||
| 193 | @item C-x C-k C-n | ||
| 194 | Rotate the keyboard macro ring to the next macro (defined earlier) | ||
| 195 | (@code{kmacro-cycle-ring-next}). | ||
| 196 | @item C-x C-k C-p | ||
| 197 | Rotate the keyboard macro ring to the previous macro (defined later) | ||
| 198 | (@code{kmacro-cycle-ring-previous}). | ||
| 199 | @end table | ||
| 200 | |||
| 201 | All commands which operate on the keyboard macro ring use the | ||
| 202 | same @kbd{C-x C-k} prefix. Most of these commands can be executed and | ||
| 203 | repeated immediately after each other without repeating the @kbd{C-x | ||
| 204 | C-k} prefix. For example, | ||
| 205 | |||
| 206 | @example | ||
| 207 | C-x C-k C-p C-p C-k C-k C-k C-n C-n C-k C-p C-k C-d | ||
| 208 | @end example | ||
| 209 | |||
| 210 | @noindent | ||
| 211 | will rotate the keyboard macro ring to the ``second previous'' macro, | ||
| 212 | execute the resulting head macro three times, rotate back to the | ||
| 213 | original head macro, execute that once, rotate to the ``previous'' | ||
| 214 | macro, execute that, and finally delete it from the macro ring. | ||
| 215 | |||
| 216 | @findex kmacro-end-or-call-macro-repeat | ||
| 217 | @kindex C-x C-k C-k | ||
| 218 | The command @kbd{C-x C-k C-k} (@code{kmacro-end-or-call-macro-repeat}) | ||
| 219 | executes the keyboard macro at the head of the macro ring. You can | ||
| 220 | repeat the macro immediately by typing another @kbd{C-k}, or you can | ||
| 221 | rotate the macro ring immediately by typing @kbd{C-n} or @kbd{C-p}. | ||
| 222 | |||
| 223 | When a keyboard macro is being defined, @kbd{C-x C-k C-k} behaves like | ||
| 224 | @kbd{C-x )} except that, immediately afterward, you can use most key | ||
| 225 | bindings of this section without the @kbd{C-x C-k} prefix. For | ||
| 226 | instance, another @kbd{C-k} will re-execute the macro. | ||
| 227 | |||
| 228 | @findex kmacro-cycle-ring-next | ||
| 229 | @kindex C-x C-k C-n | ||
| 230 | @findex kmacro-cycle-ring-previous | ||
| 231 | @kindex C-x C-k C-p | ||
| 232 | The commands @kbd{C-x C-k C-n} (@code{kmacro-cycle-ring-next}) and | ||
| 233 | @kbd{C-x C-k C-p} (@code{kmacro-cycle-ring-previous}) rotate the | ||
| 234 | macro ring, bringing the next or previous keyboard macro to the head | ||
| 235 | of the macro ring. The definition of the new head macro is displayed | ||
| 236 | in the echo area. You can continue to rotate the macro ring | ||
| 237 | immediately by repeating just @kbd{C-n} and @kbd{C-p} until the | ||
| 238 | desired macro is at the head of the ring. To execute the new macro | ||
| 239 | ring head immediately, just type @kbd{C-k}. | ||
| 240 | |||
| 241 | Note that Emacs treats the head of the macro ring as the ``last | ||
| 242 | defined keyboard macro.'' For instance, @kbd{C-x e} will execute that | ||
| 243 | macro, and @kbd{C-x C-k n} will give it a name. | ||
| 244 | |||
| 245 | @ignore @c This interface is too kludgy | ||
| 246 | @c and the functionality duplicates the functionality above -- rms. | ||
| 247 | @findex kmacro-view-macro-repeat | ||
| 248 | @kindex C-x C-k C-v | ||
| 249 | The command @kbd{C-x C-k C-v} (@code{kmacro-view-macro-repeat}) | ||
| 250 | displays the last keyboard macro, or when repeated (with @kbd{C-v}), | ||
| 251 | it displays the previous macro on the macro ring, just like @kbd{C-x | ||
| 252 | C-k C-p}, but without actually rotating the macro ring. If you enter | ||
| 253 | @kbd{C-k} immediately after displaying a macro from the ring, that | ||
| 254 | macro is executed, but still without altering the macro ring. | ||
| 255 | |||
| 256 | So while e.g. @kbd{C-x C-k C-p C-p C-p C-k C-k} makes the 3rd previous | ||
| 257 | macro the current macro and executes it twice, @kbd{C-x C-k C-v C-v | ||
| 258 | C-v C-k C-k} will display and execute the 3rd previous macro once and | ||
| 259 | then the current macro once. | ||
| 260 | @end ignore | ||
| 261 | |||
| 262 | @ignore @c This is just too much feeping creaturism. | ||
| 263 | @c If you are reusing certain macros enough to want these, | ||
| 264 | @c you should give then names. -- rms | ||
| 265 | @findex kmacro-delete-ring-head | ||
| 266 | @kindex C-x C-k C-d | ||
| 267 | |||
| 268 | The command @kbd{C-x C-k C-d} (@code{kmacro-delete-ring-head}) | ||
| 269 | removes and deletes the macro currently at the head of the macro | ||
| 270 | ring. You can use this to delete a macro that didn't work as | ||
| 271 | expected, or which you don't need anymore. | ||
| 272 | |||
| 273 | @findex kmacro-swap-ring | ||
| 274 | @kindex C-x C-k C-t | ||
| 275 | |||
| 276 | The command @kbd{C-x C-k C-t} (@code{kmacro-swap-ring}) | ||
| 277 | interchanges the head of the macro ring with the previous element on | ||
| 278 | the macro ring. | ||
| 279 | |||
| 280 | @findex kmacro-call-ring-2nd-repeat | ||
| 281 | @kindex C-x C-k C-l | ||
| 282 | |||
| 283 | The command @kbd{C-x C-k C-l} (@code{kmacro-call-ring-2nd-repeat}) | ||
| 284 | executes the previous (rather than the head) element on the macro ring. | ||
| 285 | @end ignore | ||
| 286 | |||
| 287 | @vindex kmacro-ring-max | ||
| 288 | The maximum number of macros stored in the keyboard macro ring is | ||
| 289 | determined by the customizable variable @code{kmacro-ring-max}. | ||
| 290 | |||
| 291 | @node Keyboard Macro Counter | ||
| 292 | @section The Keyboard Macro Counter | ||
| 293 | |||
| 294 | @table @kbd | ||
| 295 | @item C-x C-k C-i | ||
| 296 | Insert the keyboard macro counter value in the buffer | ||
| 297 | (@code{kmacro-insert-counter}). | ||
| 298 | @item C-x C-k C-c | ||
| 299 | Set the keyboard macro counter (@code{kmacro-set-counter}). | ||
| 300 | @item C-x C-k C-a | ||
| 301 | Add the prefix arg to the keyboard macro counter (@code{kmacro-add-counter}). | ||
| 302 | @item C-x C-k C-f | ||
| 303 | Specify the format for inserting the keyboard macro counter | ||
| 304 | (@code{kmacro-set-format}). | ||
| 305 | @end table | ||
| 306 | |||
| 307 | Each keyboard macro has an associated counter. Normally, the | ||
| 308 | macro counter is initialized to 0 when you start defining the macro, | ||
| 309 | and incremented by 1 after each insertion of the counter value; | ||
| 310 | that is, if you insert the macro counter twice while defining the | ||
| 311 | macro, the counter will increase by 2 on each repetition of the macro. | ||
| 312 | |||
| 313 | @findex kmacro-insert-counter | ||
| 314 | @kindex C-x C-k C-i | ||
| 315 | The command @kbd{C-x C-k C-i} (@code{kmacro-insert-counter}) inserts | ||
| 316 | the current value of the current keyboard macro's counter, and | ||
| 317 | increments the counter by 1. You can use a numeric prefix argument to | ||
| 318 | specify a different increment. If you just specify a @kbd{C-u} | ||
| 319 | prefix, then the increment is zero, so it repeats the last inserted | ||
| 320 | counter value. For example, if you enter the following sequence while | ||
| 321 | defining a macro | ||
| 322 | |||
| 323 | @example | ||
| 324 | C-x C-k C-i C-x C-k C-i C-u C-x C-k C-i C-x C-k C-i | ||
| 325 | @end example | ||
| 326 | |||
| 327 | @noindent | ||
| 328 | it inserts @samp{0112} in the buffer. The next two iterations | ||
| 329 | of the macro will insert @samp{3445} and @samp{6778}. | ||
| 330 | |||
| 331 | This command usually only makes sense while defining a keyboard | ||
| 332 | macro. But its behavior when no keyboard macro is being defined or | ||
| 333 | executed is predictable: it inserts and increments the counter of the | ||
| 334 | macro at the head of the keyboard macro ring. | ||
| 335 | |||
| 336 | @findex kmacro-set-counter | ||
| 337 | @kindex C-x C-k C-c | ||
| 338 | The command @kbd{C-x C-k C-c} (@code{kmacro-set-counter}) sets the | ||
| 339 | current macro counter to the value of the numeric argument. If you use | ||
| 340 | it inside the macro, it operates on each repetition of the macro. If | ||
| 341 | you specify just @kbd{C-u} as the prefix, while executing the macro, | ||
| 342 | that resets the counter to the value it had at the beginning of the | ||
| 343 | current repetition of the macro (undoing any increments so far in this | ||
| 344 | repetition). | ||
| 345 | |||
| 346 | @findex kmacro-add-counter | ||
| 347 | @kindex C-x C-k C-a | ||
| 348 | The command @kbd{C-x C-k C-a} (@code{kmacro-add-counter}) adds the | ||
| 349 | prefix argument to the current macro counter. With just @kbd{C-u} as | ||
| 350 | argument, it resets the counter to the last value inserted by any | ||
| 351 | keyboard macro. (Normally, when you use this, the last insertion | ||
| 352 | will be in the same macro and it will be the same counter.) | ||
| 353 | |||
| 354 | @findex kmacro-set-format | ||
| 355 | @kindex C-x C-k C-f | ||
| 356 | The command @kbd{C-x C-k C-f} (@code{kmacro-set-format}) prompts for | ||
| 357 | the format to use when inserting the macro counter. The default | ||
| 358 | format is @samp{%d}, which means to insert the number in decimal | ||
| 359 | without any padding. You can exit with empty minibuffer to reset the | ||
| 360 | format to this default. You can specify any format string that the | ||
| 361 | @code{format} function accepts and that makes sense with a single | ||
| 362 | integer extra argument (@pxref{Formatting Strings,,, elisp, The Emacs | ||
| 363 | Lisp Reference Manual}). Do not put the format string inside double | ||
| 364 | quotes when you insert it in the minibuffer. | ||
| 365 | |||
| 366 | If you use this command while no keyboard macro is being defined or | ||
| 367 | executed, the new format affects all subsequent macro definitions. | ||
| 368 | Existing macros continue to use the format in effect when they were | ||
| 369 | defined. If you set the format while defining a keyboard macro, this | ||
| 370 | affects the macro being defined from that point on, but it does not | ||
| 371 | affect subsequent macros. Execution of the macro will, at each step, | ||
| 372 | use the format in effect at that step during its definition. Changes | ||
| 373 | to the macro format during execution of a macro, like the | ||
| 374 | corresponding changes during its definition, have no effect on | ||
| 375 | subsequent macros. | ||
| 376 | |||
| 377 | The format set by @kbd{C-x C-k C-f} does not affect insertion of | ||
| 378 | numbers stored in registers. | ||
| 379 | |||
| 380 | @node Keyboard Macro Query | ||
| 381 | @section Executing Macros with Variations | ||
| 382 | |||
| 383 | @table @kbd | ||
| 384 | @item C-x q | ||
| 385 | When this point is reached during macro execution, ask for confirmation | ||
| 386 | (@code{kbd-macro-query}). | ||
| 387 | @end table | ||
| 388 | |||
| 389 | @kindex C-x q | ||
| 390 | @findex kbd-macro-query | ||
| 391 | Using @kbd{C-x q} (@code{kbd-macro-query}), you can get an effect | ||
| 392 | similar to that of @code{query-replace}, where the macro asks you each | ||
| 393 | time around whether to make a change. While defining the macro, | ||
| 394 | type @kbd{C-x q} at the point where you want the query to occur. During | ||
| 395 | macro definition, the @kbd{C-x q} does nothing, but when you run the | ||
| 396 | macro later, @kbd{C-x q} asks you interactively whether to continue. | ||
| 397 | |||
| 398 | The valid responses when @kbd{C-x q} asks are @key{SPC} (or @kbd{y}), | ||
| 399 | @key{DEL} (or @kbd{n}), @key{RET} (or @kbd{q}), @kbd{C-l} and @kbd{C-r}. | ||
| 400 | The answers are the same as in @code{query-replace}, though not all of | ||
| 401 | the @code{query-replace} options are meaningful. | ||
| 402 | |||
| 403 | These responses include @key{SPC} to continue, and @key{DEL} to skip | ||
| 404 | the remainder of this repetition of the macro and start right away with | ||
| 405 | the next repetition. @key{RET} means to skip the remainder of this | ||
| 406 | repetition and cancel further repetitions. @kbd{C-l} redraws the screen | ||
| 407 | and asks you again for a character to say what to do. | ||
| 408 | |||
| 409 | @kbd{C-r} enters a recursive editing level, in which you can perform | ||
| 410 | editing which is not part of the macro. When you exit the recursive | ||
| 411 | edit using @kbd{C-M-c}, you are asked again how to continue with the | ||
| 412 | keyboard macro. If you type a @key{SPC} at this time, the rest of the | ||
| 413 | macro definition is executed. It is up to you to leave point and the | ||
| 414 | text in a state such that the rest of the macro will do what you | ||
| 415 | want.@refill | ||
| 416 | |||
| 417 | @kbd{C-u C-x q}, which is @kbd{C-x q} with a numeric argument, | ||
| 418 | performs a completely different function. It enters a recursive edit | ||
| 419 | reading input from the keyboard, both when you type it during the | ||
| 420 | definition of the macro, and when it is executed from the macro. During | ||
| 421 | definition, the editing you do inside the recursive edit does not become | ||
| 422 | part of the macro. During macro execution, the recursive edit gives you | ||
| 423 | a chance to do some particularized editing on each repetition. | ||
| 424 | @xref{Recursive Edit}. | ||
| 425 | |||
| 426 | Another way to vary the behavior of a keyboard macro is to use a | ||
| 427 | register as a counter, incrementing it on each repetition of the macro. | ||
| 428 | @xref{RegNumbers}. | ||
| 429 | |||
| 430 | @node Save Keyboard Macro | ||
| 431 | @section Naming and Saving Keyboard Macros | ||
| 432 | |||
| 433 | @table @kbd | ||
| 434 | @item C-x C-k n | ||
| 435 | Give a command name (for the duration of the Emacs session) to the most | ||
| 436 | recently defined keyboard macro (@code{kmacro-name-last-macro}). | ||
| 437 | @item C-x C-k b | ||
| 438 | Bind the most recently defined keyboard macro to a key sequence (for | ||
| 439 | the duration of the session) (@code{kmacro-bind-to-key}). | ||
| 440 | @item M-x insert-kbd-macro | ||
| 441 | Insert in the buffer a keyboard macro's definition, as Lisp code. | ||
| 442 | @end table | ||
| 443 | |||
| 444 | @cindex saving keyboard macros | ||
| 445 | @findex kmacro-name-last-macro | ||
| 446 | @kindex C-x C-k n | ||
| 447 | If you wish to save a keyboard macro for later use, you can give it | ||
| 448 | a name using @kbd{C-x C-k n} (@code{kmacro-name-last-macro}). | ||
| 449 | This reads a name as an argument using the minibuffer and defines that | ||
| 450 | name to execute the last keyboard macro, in its current form. (If you | ||
| 451 | later add to the definition of this macro, that does not alter the | ||
| 452 | name's definition as a macro.) The macro name is a Lisp symbol, and | ||
| 453 | defining it in this way makes it a valid command name for calling with | ||
| 454 | @kbd{M-x} or for binding a key to with @code{global-set-key} | ||
| 455 | (@pxref{Keymaps}). If you specify a name that has a prior definition | ||
| 456 | other than a keyboard macro, an error message is shown and nothing is | ||
| 457 | changed. | ||
| 458 | |||
| 459 | @cindex binding keyboard macros | ||
| 460 | @findex kmacro-bind-to-key | ||
| 461 | @kindex C-x C-k b | ||
| 462 | You can also bind the last keyboard macro (in its current form) to a | ||
| 463 | key, using @kbd{C-x C-k b} (@code{kmacro-bind-to-key}) followed by the | ||
| 464 | key sequence you want to bind. You can bind to any key sequence in | ||
| 465 | the global keymap, but since most key sequences already have other | ||
| 466 | bindings, you should select the key sequence carefully. If you try to | ||
| 467 | bind to a key sequence with an existing binding (in any keymap), this | ||
| 468 | command asks you for confirmation before replacing the existing binding. | ||
| 469 | |||
| 470 | To avoid problems caused by overriding existing bindings, the key | ||
| 471 | sequences @kbd{C-x C-k 0} through @kbd{C-x C-k 9} and @kbd{C-x C-k A} | ||
| 472 | through @kbd{C-x C-k Z} are reserved for your own keyboard macro | ||
| 473 | bindings. In fact, to bind to one of these key sequences, you only | ||
| 474 | need to type the digit or letter rather than the whole key sequences. | ||
| 475 | For example, | ||
| 476 | |||
| 477 | @example | ||
| 478 | C-x C-k b 4 | ||
| 479 | @end example | ||
| 480 | |||
| 481 | @noindent | ||
| 482 | will bind the last keyboard macro to the key sequence @kbd{C-x C-k 4}. | ||
| 483 | |||
| 484 | @findex insert-kbd-macro | ||
| 485 | Once a macro has a command name, you can save its definition in a file. | ||
| 486 | Then it can be used in another editing session. First, visit the file | ||
| 487 | you want to save the definition in. Then use this command: | ||
| 488 | |||
| 489 | @example | ||
| 490 | M-x insert-kbd-macro @key{RET} @var{macroname} @key{RET} | ||
| 491 | @end example | ||
| 492 | |||
| 493 | @noindent | ||
| 494 | This inserts some Lisp code that, when executed later, will define the | ||
| 495 | same macro with the same definition it has now. (You need not | ||
| 496 | understand Lisp code to do this, because @code{insert-kbd-macro} writes | ||
| 497 | the Lisp code for you.) Then save the file. You can load the file | ||
| 498 | later with @code{load-file} (@pxref{Lisp Libraries}). If the file you | ||
| 499 | save in is your init file @file{~/.emacs} (@pxref{Init File}) then the | ||
| 500 | macro will be defined each time you run Emacs. | ||
| 501 | |||
| 502 | If you give @code{insert-kbd-macro} a numeric argument, it makes | ||
| 503 | additional Lisp code to record the keys (if any) that you have bound | ||
| 504 | to @var{macroname}, so that the macro will be reassigned the same keys | ||
| 505 | when you load the file. | ||
| 506 | |||
| 507 | @node Edit Keyboard Macro | ||
| 508 | @section Editing a Keyboard Macro | ||
| 509 | |||
| 510 | @table @kbd | ||
| 511 | @item C-x C-k C-e | ||
| 512 | Edit the last defined keyboard macro (@code{kmacro-edit-macro}). | ||
| 513 | @item C-x C-k e @var{name} @key{RET} | ||
| 514 | Edit a previously defined keyboard macro @var{name} (@code{edit-kbd-macro}). | ||
| 515 | @item C-x C-k l | ||
| 516 | Edit the last 100 keystrokes as a keyboard macro | ||
| 517 | (@code{kmacro-edit-lossage}). | ||
| 518 | @end table | ||
| 519 | |||
| 520 | @findex kmacro-edit-macro | ||
| 521 | @kindex C-x C-k C-e | ||
| 522 | @kindex C-x C-k RET | ||
| 523 | You can edit the last keyboard macro by typing @kbd{C-x C-k C-e} or | ||
| 524 | @kbd{C-x C-k RET} (@code{kmacro-edit-macro}). This formats the macro | ||
| 525 | definition in a buffer and enters a specialized major mode for editing | ||
| 526 | it. Type @kbd{C-h m} once in that buffer to display details of how to | ||
| 527 | edit the macro. When you are finished editing, type @kbd{C-c C-c}. | ||
| 528 | |||
| 529 | @findex edit-kbd-macro | ||
| 530 | @kindex C-x C-k e | ||
| 531 | You can edit a named keyboard macro or a macro bound to a key by typing | ||
| 532 | @kbd{C-x C-k e} (@code{edit-kbd-macro}). Follow that with the | ||
| 533 | keyboard input that you would use to invoke the macro---@kbd{C-x e} or | ||
| 534 | @kbd{M-x @var{name}} or some other key sequence. | ||
| 535 | |||
| 536 | @findex kmacro-edit-lossage | ||
| 537 | @kindex C-x C-k l | ||
| 538 | You can edit the last 100 keystrokes as a macro by typing | ||
| 539 | @kbd{C-x C-k l} (@code{kmacro-edit-lossage}). | ||
| 540 | |||
| 541 | @node Keyboard Macro Step-Edit | ||
| 542 | @section Stepwise Editing a Keyboard Macro | ||
| 543 | |||
| 544 | @findex kmacro-step-edit-macro | ||
| 545 | @kindex C-x C-k SPC | ||
| 546 | You can interactively replay and edit the last keyboard | ||
| 547 | macro, one command at a time, by typing @kbd{C-x C-k SPC} | ||
| 548 | (@code{kmacro-step-edit-macro}). Unless you quit the macro using | ||
| 549 | @kbd{q} or @kbd{C-g}, the edited macro replaces the last macro on the | ||
| 550 | macro ring. | ||
| 551 | |||
| 552 | This macro editing feature shows the last macro in the minibuffer | ||
| 553 | together with the first (or next) command to be executed, and prompts | ||
| 554 | you for an action. You can enter @kbd{?} to get a summary of your | ||
| 555 | options. These actions are available: | ||
| 556 | |||
| 557 | @itemize @bullet{} | ||
| 558 | @item | ||
| 559 | @kbd{SPC} and @kbd{y} execute the current command, and advance to the | ||
| 560 | next command in the keyboard macro. | ||
| 561 | @item | ||
| 562 | @kbd{n}, @kbd{d}, and @kbd{DEL} skip and delete the current command. | ||
| 563 | @item | ||
| 564 | @kbd{f} skips the current command in this execution of the keyboard | ||
| 565 | macro, but doesn't delete it from the macro. | ||
| 566 | @item | ||
| 567 | @kbd{@key{TAB}} executes the current command, as well as all similar | ||
| 568 | commands immediately following the current command; for example, @key{TAB} | ||
| 569 | may be used to insert a sequence of characters (corresponding to a | ||
| 570 | sequence of @code{self-insert-command} commands). | ||
| 571 | @item | ||
| 572 | @kbd{c} continues execution (without further editing) until the end of | ||
| 573 | the keyboard macro. If execution terminates normally, the edited | ||
| 574 | macro replaces the original keyboard macro. | ||
| 575 | @item | ||
| 576 | @kbd{C-k} skips and deletes the rest of the keyboard macro, | ||
| 577 | terminates step-editing, and replaces the original keyboard macro | ||
| 578 | with the edited macro. | ||
| 579 | @item | ||
| 580 | @kbd{q} and @kbd{C-g} cancels the step-editing of the keyboard macro; | ||
| 581 | discarding any changes made to the keyboard macro. | ||
| 582 | @item | ||
| 583 | @kbd{i KEY... C-j} reads and executes a series of key sequences (not | ||
| 584 | including the final @kbd{C-j}), and inserts them before the current | ||
| 585 | command in the keyboard macro, without advancing over the current | ||
| 586 | command. | ||
| 587 | @item | ||
| 588 | @kbd{I KEY...} reads one key sequence, executes it, and inserts it | ||
| 589 | before the current command in the keyboard macro, without advancing | ||
| 590 | over the current command. | ||
| 591 | @item | ||
| 592 | @kbd{r KEY... C-j} reads and executes a series of key sequences (not | ||
| 593 | including the final @kbd{C-j}), and replaces the current command in | ||
| 594 | the keyboard macro with them, advancing over the inserted key | ||
| 595 | sequences. | ||
| 596 | @item | ||
| 597 | @kbd{R KEY...} reads one key sequence, executes it, and replaces the | ||
| 598 | current command in the keyboard macro with that key sequence, | ||
| 599 | advancing over the inserted key sequence. | ||
| 600 | @item | ||
| 601 | @kbd{a KEY... C-j} executes the current command, then reads and | ||
| 602 | executes a series of key sequences (not including the final | ||
| 603 | @kbd{C-j}), and inserts them after the current command in the keyboard | ||
| 604 | macro; it then advances over the current command and the inserted key | ||
| 605 | sequences. | ||
| 606 | @item | ||
| 607 | @kbd{A KEY... C-j} executes the rest of the commands in the keyboard | ||
| 608 | macro, then reads and executes a series of key sequences (not | ||
| 609 | including the final @kbd{C-j}), and appends them at the end of the | ||
| 610 | keyboard macro; it then terminates the step-editing and replaces the | ||
| 611 | original keyboard macro with the edited macro. | ||
| 612 | @end itemize | ||
| 613 | |||
| 614 | @ignore | ||
| 615 | arch-tag: c1b0dd3b-3159-4c08-928f-52e763953e9c | ||
| 616 | @end ignore | ||
diff --git a/doc/emacs/m-x.texi b/doc/emacs/m-x.texi new file mode 100644 index 00000000000..7a5b80fd348 --- /dev/null +++ b/doc/emacs/m-x.texi | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node M-x, Help, Minibuffer, Top | ||
| 6 | @chapter Running Commands by Name | ||
| 7 | |||
| 8 | Every Emacs command has a name that you can use to run it. For | ||
| 9 | convenience, many commands also have key bindings. You can run those | ||
| 10 | commands by typing the keys, or run them by name. Most Emacs commands | ||
| 11 | have no key bindings, so the only way to run them is by name. | ||
| 12 | (@xref{Key Bindings}, for how to set up key bindings.) | ||
| 13 | |||
| 14 | By convention, a command name consists of one or more words, | ||
| 15 | separated by hyphens; for example, @code{auto-fill-mode} or | ||
| 16 | @code{manual-entry}. Command names mostly use complete English words | ||
| 17 | to make them easier to remember. | ||
| 18 | |||
| 19 | @kindex M-x | ||
| 20 | To run a command by name, start with @kbd{M-x}, type the command | ||
| 21 | name, then terminate it with @key{RET}. @kbd{M-x} uses the minibuffer | ||
| 22 | to read the command name. The string @samp{M-x} appears at the | ||
| 23 | beginning of the minibuffer as a @dfn{prompt} to remind you to enter a | ||
| 24 | command name to be run. @key{RET} exits the minibuffer and runs the | ||
| 25 | command. @xref{Minibuffer}, for more information on the minibuffer. | ||
| 26 | |||
| 27 | You can use completion to enter the command name. For example, | ||
| 28 | to invoke the command @code{forward-char}, you can type | ||
| 29 | |||
| 30 | @example | ||
| 31 | M-x forward-char @key{RET} | ||
| 32 | @end example | ||
| 33 | |||
| 34 | @noindent | ||
| 35 | or | ||
| 36 | |||
| 37 | @example | ||
| 38 | M-x forw @key{TAB} c @key{RET} | ||
| 39 | @end example | ||
| 40 | |||
| 41 | @noindent | ||
| 42 | Note that @code{forward-char} is the same command that you invoke with | ||
| 43 | the key @kbd{C-f}. The existence of a key binding does not stop you | ||
| 44 | from running the command by name. | ||
| 45 | |||
| 46 | To cancel the @kbd{M-x} and not run a command, type @kbd{C-g} instead | ||
| 47 | of entering the command name. This takes you back to command level. | ||
| 48 | |||
| 49 | To pass a numeric argument to the command you are invoking with | ||
| 50 | @kbd{M-x}, specify the numeric argument before @kbd{M-x}. The | ||
| 51 | argument value appears in the prompt while the command name is being | ||
| 52 | read, and finally @kbd{M-x} passes the argument to that command. | ||
| 53 | |||
| 54 | @vindex suggest-key-bindings | ||
| 55 | When the command you run with @kbd{M-x} has a key binding, Emacs | ||
| 56 | mentions this in the echo area after running the command. For | ||
| 57 | example, if you type @kbd{M-x forward-word}, the message says that you | ||
| 58 | can run the same command by typing @kbd{M-f}. You can turn off these | ||
| 59 | messages by setting the variable @code{suggest-key-bindings} to | ||
| 60 | @code{nil}. | ||
| 61 | |||
| 62 | In this manual, when we speak of running a command by name, we often | ||
| 63 | omit the @key{RET} that terminates the name. Thus we might say | ||
| 64 | @kbd{M-x auto-fill-mode} rather than @kbd{M-x auto-fill-mode | ||
| 65 | @key{RET}}. We mention the @key{RET} only for emphasis, such as when | ||
| 66 | the command is followed by arguments. | ||
| 67 | |||
| 68 | @findex execute-extended-command | ||
| 69 | @kbd{M-x} works by running the command | ||
| 70 | @code{execute-extended-command}, which is responsible for reading the | ||
| 71 | name of another command and invoking it. | ||
| 72 | |||
| 73 | @ignore | ||
| 74 | arch-tag: b67bff53-9628-4666-b94e-eda972a7ba56 | ||
| 75 | @end ignore | ||
diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi new file mode 100644 index 00000000000..28d7f43df8e --- /dev/null +++ b/doc/emacs/macos.texi | |||
| @@ -0,0 +1,429 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2000, 2001, 2002, 2003, 2004, | ||
| 3 | @c 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Mac OS, Microsoft Windows, Antinews, Top | ||
| 6 | @appendix Emacs and Mac OS | ||
| 7 | @cindex Mac OS | ||
| 8 | @cindex Macintosh | ||
| 9 | |||
| 10 | This section briefly describes the peculiarities of using Emacs | ||
| 11 | under Mac OS with native window system support. For Mac OS X, Emacs | ||
| 12 | can be built either without window system support, with X11, or with | ||
| 13 | Carbon API. This section only applies to the Carbon build. For Mac | ||
| 14 | OS Classic, Emacs can be built with or without Carbon API, and this | ||
| 15 | section applies to either of them because they run on the native | ||
| 16 | window system. | ||
| 17 | |||
| 18 | Emacs built on Mac OS X supports most of its major features except | ||
| 19 | display support of PostScript images. The following features of Emacs | ||
| 20 | are not supported on Mac OS Classic: unexec (@code{dump-emacs}), | ||
| 21 | asynchronous subprocesses (@code{start-process}), and networking | ||
| 22 | (@code{open-network-stream}). As a result, packages such as Gnus, | ||
| 23 | GUD, and Comint do not work. Synchronous subprocesses | ||
| 24 | (@code{call-process}) are supported on non-Carbon build, but | ||
| 25 | specially-crafted external programs are needed. Since external | ||
| 26 | programs to handle commands such as @code{print-buffer} and | ||
| 27 | @code{diff} are not available on Mac OS Classic, they are not | ||
| 28 | supported. Non-Carbon build on Mac OS Classic does not support some | ||
| 29 | features such as file dialogs, drag-and-drop, and Unicode menus. | ||
| 30 | |||
| 31 | @menu | ||
| 32 | * Input: Mac Input. Keyboard and mouse input on Mac. | ||
| 33 | * Intl: Mac International. International character sets on Mac. | ||
| 34 | * Env: Mac Environment Variables. Setting environment variables for Emacs. | ||
| 35 | * Directories: Mac Directories. Volumes and directories on Mac. | ||
| 36 | * Font: Mac Font Specs. Specifying fonts on Mac. | ||
| 37 | * Functions: Mac Functions. Mac-specific Lisp functions. | ||
| 38 | @end menu | ||
| 39 | |||
| 40 | @node Mac Input | ||
| 41 | @section Keyboard and Mouse Input on Mac | ||
| 42 | @cindex Meta (Mac OS) | ||
| 43 | @cindex keyboard coding (Mac OS) | ||
| 44 | |||
| 45 | @vindex mac-control-modifier | ||
| 46 | @vindex mac-command-modifier | ||
| 47 | @vindex mac-option-modifier | ||
| 48 | @vindex mac-function-modifier | ||
| 49 | On Mac, Emacs can use @key{control}, @key{command}, @key{option}, and | ||
| 50 | laptop @key{function} keys as any of Emacs modifier keys except | ||
| 51 | @key{SHIFT} (i.e., @key{ALT}, @key{CTRL}, @key{HYPER}, @key{META}, and | ||
| 52 | @key{SUPER}). The assignment is controlled by the variables | ||
| 53 | @code{mac-control-modifier}, @code{mac-command-modifier}, | ||
| 54 | @code{mac-option-modifier}, and @code{mac-function-modifier}. The value | ||
| 55 | for each of these variables can be one of the following symbols: | ||
| 56 | @code{alt}, @code{control}, @code{hyper}, @code{meta}, @code{super}, and | ||
| 57 | @code{nil} (no particular assignment). By default, the @key{control} | ||
| 58 | key works as @key{CTRL}, and the @key{command} key as @key{META}. | ||
| 59 | |||
| 60 | For the @key{option} key, if @code{mac-option-modifier} is set to | ||
| 61 | @code{nil}, which is the default, the key works as the normal | ||
| 62 | @key{option} key, i.e., dead-key processing will work. This is useful | ||
| 63 | for entering non-@acronym{ASCII} Latin characters directly from the | ||
| 64 | Mac keyboard, for example. | ||
| 65 | |||
| 66 | Emacs recognizes the setting in the Keyboard control panel (Mac OS | ||
| 67 | Classic) or the International system preference pane (Mac OS X) and | ||
| 68 | supports international and alternative keyboard layouts (e.g., Dvorak). | ||
| 69 | Selecting one of the layouts from the keyboard layout pull-down menu | ||
| 70 | will affect how the keys typed on the keyboard are interpreted. | ||
| 71 | |||
| 72 | @vindex mac-pass-command-to-system | ||
| 73 | @vindex mac-pass-control-to-system | ||
| 74 | Mac OS intercepts and handles certain key combinations (e.g., | ||
| 75 | @key{command}-@key{SPC} for switching input languages). These will not | ||
| 76 | be passed to Emacs. One can disable this interception by setting | ||
| 77 | @code{mac-pass-command-to-system} or @code{mac-pass-control-to-system} | ||
| 78 | to @code{nil}. | ||
| 79 | |||
| 80 | @vindex mac-emulate-three-button-mouse | ||
| 81 | Especially for one-button mice, the multiple button feature can be | ||
| 82 | emulated by setting @code{mac-emulate-three-button-mouse} to @code{t} | ||
| 83 | or @code{reverse}. If set to @code{t} (@code{reverse}, respectively), | ||
| 84 | pressing the mouse button with the @key{option} key is recognized as | ||
| 85 | the second (third) button, and that with the @key{command} key is | ||
| 86 | recognized as the third (second) button. | ||
| 87 | |||
| 88 | @vindex mac-wheel-button-is-mouse-2 | ||
| 89 | For multi-button mice, the wheel button and the secondary button are | ||
| 90 | recognized as the second and the third button, respectively. If | ||
| 91 | @code{mac-wheel-button-is-mouse-2} is set to @code{nil}, their roles | ||
| 92 | are exchanged. | ||
| 93 | |||
| 94 | @node Mac International | ||
| 95 | @section International Character Set Support on Mac | ||
| 96 | @cindex Mac Roman coding system | ||
| 97 | @cindex clipboard support (Mac OS) | ||
| 98 | |||
| 99 | Mac uses non-standard encodings for the upper 128 single-byte | ||
| 100 | characters. They also deviate from the ISO 2022 standard by using | ||
| 101 | character codes in the range 128-159. The coding systems | ||
| 102 | @code{mac-roman}, @code{mac-centraleurroman}, and @code{mac-cyrillic} | ||
| 103 | are used to represent these Mac encodings. | ||
| 104 | |||
| 105 | You can use input methods provided either by LEIM (@pxref{Input | ||
| 106 | Methods}) or Mac OS to enter international characters. To use the | ||
| 107 | former, see the International Character Set Support section of the | ||
| 108 | manual (@pxref{International}). | ||
| 109 | |||
| 110 | Emacs on Mac OS automatically changes the value of | ||
| 111 | @code{keyboard-coding-system} according to the current keyboard | ||
| 112 | layout. So users don't need to set it manually, and even if set, it | ||
| 113 | will be changed when the keyboard layout change is detected next time. | ||
| 114 | |||
| 115 | The Mac clipboard and the Emacs kill ring (@pxref{Killing}) are | ||
| 116 | synchronized by default: you can yank a piece of text and paste it | ||
| 117 | into another Mac application, or cut or copy one in another Mac | ||
| 118 | application and yank it into a Emacs buffer. This feature can be | ||
| 119 | disabled by setting @code{x-select-enable-clipboard} to @code{nil}. | ||
| 120 | One can still do copy and paste with another application from the Edit | ||
| 121 | menu. | ||
| 122 | |||
| 123 | On Mac, the role of the coding system for selection that is set by | ||
| 124 | @code{set-selection-coding-system} (@pxref{Communication Coding}) is | ||
| 125 | two-fold. First, it is used as a preferred coding system for the | ||
| 126 | traditional text flavor that does not specify any particular encodings | ||
| 127 | and is mainly used by applications on Mac OS Classic. Second, it | ||
| 128 | specifies the intermediate encoding for the UTF-16 text flavor that is | ||
| 129 | mainly used by applications on Mac OS X. | ||
| 130 | |||
| 131 | When pasting UTF-16 text data from the clipboard, it is first | ||
| 132 | converted to the encoding specified by the selection coding system | ||
| 133 | using the converter in the Mac OS system, and then decoded into the | ||
| 134 | Emacs internal encoding using the converter in Emacs. If the first | ||
| 135 | conversion failed, then the UTF-16 data is directly converted to Emacs | ||
| 136 | internal encoding using the converter in Emacs. Copying UTF-16 text | ||
| 137 | to the clipboard goes through the inverse path. The reason for this | ||
| 138 | two-pass decoding is to avoid subtle differences in Unicode mappings | ||
| 139 | between the Mac OS system and Emacs such as various kinds of hyphens, | ||
| 140 | and to minimize users' customization. For example, users that mainly | ||
| 141 | use Latin characters would prefer Greek characters to be decoded into | ||
| 142 | the @code{mule-unicode-0100-24ff} charset, but Japanese users would | ||
| 143 | prefer them to be decoded into the @code{japanese-jisx0208} charset. | ||
| 144 | Since the coding system for selection is automatically set according | ||
| 145 | to the system locale setting, users usually don't have to set it | ||
| 146 | manually. | ||
| 147 | |||
| 148 | The default language environment (@pxref{Language Environments}) is | ||
| 149 | set according to the locale setting at the startup time. On Mac OS, | ||
| 150 | the locale setting is consulted in the following order: | ||
| 151 | |||
| 152 | @enumerate | ||
| 153 | @item | ||
| 154 | Environment variables @env{LC_ALL}, @env{LC_CTYPE} and @env{LANG} as | ||
| 155 | in other systems. | ||
| 156 | |||
| 157 | @item | ||
| 158 | Preference @code{AppleLocale} that is set by default on Mac OS X 10.3 | ||
| 159 | and later. | ||
| 160 | |||
| 161 | @item | ||
| 162 | Preference @code{AppleLanguages} that is set by default on Mac OS X | ||
| 163 | 10.1 and later. | ||
| 164 | |||
| 165 | @item | ||
| 166 | Variable @code{mac-system-locale} that is derived from the system | ||
| 167 | language and region codes. This variable is available on all | ||
| 168 | supported Mac OS versions including Mac OS Classic. | ||
| 169 | @end enumerate | ||
| 170 | |||
| 171 | The default values of almost all variables about coding systems are | ||
| 172 | also set according to the language environment. So usually you don't | ||
| 173 | have to customize these variables manually. | ||
| 174 | |||
| 175 | @node Mac Environment Variables | ||
| 176 | @section Environment Variables and Command Line Arguments. | ||
| 177 | @cindex environment variables (Mac OS) | ||
| 178 | |||
| 179 | On Mac OS X, when Emacs is run in a terminal, it inherits the values | ||
| 180 | of environment variables from the shell from which it is invoked. | ||
| 181 | However, when it is run from the Finder as a GUI application, it only | ||
| 182 | inherits environment variable values defined in the file | ||
| 183 | @file{~/.MacOSX/environment.plist} that affects all the applications | ||
| 184 | invoked from the Finder or the @command{open} command. | ||
| 185 | |||
| 186 | Command line arguments are specified like | ||
| 187 | |||
| 188 | @example | ||
| 189 | /Applications/Emacs.app/Contents/MacOS/Emacs -g 80x25 & | ||
| 190 | @end example | ||
| 191 | |||
| 192 | @noindent | ||
| 193 | if Emacs is installed at @file{/Applications/Emacs.app}. If Emacs is | ||
| 194 | invoked like this, then it also inherits the values of environment | ||
| 195 | variables from the shell from which it is invoked. | ||
| 196 | |||
| 197 | On Mac OS Classic, environment variables and command line arguments | ||
| 198 | for Emacs can be set by modifying the @samp{STR#} resources 128 and | ||
| 199 | 129, respectively. A common environment variable that one may want to | ||
| 200 | set is @samp{HOME}. | ||
| 201 | |||
| 202 | The way to set an environment variable is by adding a string of the | ||
| 203 | form | ||
| 204 | |||
| 205 | @example | ||
| 206 | ENV_VAR=VALUE | ||
| 207 | @end example | ||
| 208 | |||
| 209 | @noindent | ||
| 210 | to resource @samp{STR#} number 128 using @code{ResEdit}. To set up the | ||
| 211 | program to use unibyte characters exclusively, for example, add the | ||
| 212 | string | ||
| 213 | |||
| 214 | @example | ||
| 215 | EMACS_UNIBYTE=1 | ||
| 216 | @end example | ||
| 217 | |||
| 218 | @cindex Mac Preferences | ||
| 219 | Although Emacs on Mac does not support X resources (@pxref{X | ||
| 220 | Resources}) directly, one can use the Preferences system in place of X | ||
| 221 | resources. For example, adding the line | ||
| 222 | |||
| 223 | @example | ||
| 224 | Emacs.cursorType: bar | ||
| 225 | @end example | ||
| 226 | |||
| 227 | @noindent | ||
| 228 | to @file{~/.Xresources} in X11 corresponds to the execution of | ||
| 229 | |||
| 230 | @example | ||
| 231 | defaults write org.gnu.Emacs Emacs.cursorType bar | ||
| 232 | @end example | ||
| 233 | |||
| 234 | @noindent | ||
| 235 | on Mac OS X. One can use boolean or numeric values as well as string | ||
| 236 | values as follows: | ||
| 237 | |||
| 238 | @example | ||
| 239 | defaults write org.gnu.Emacs Emacs.toolBar -bool false | ||
| 240 | defaults write org.gnu.Emacs Emacs.lineSpacing -int 3 | ||
| 241 | @end example | ||
| 242 | |||
| 243 | @noindent | ||
| 244 | Try @kbd{M-x man RET defaults RET} for the usage of the | ||
| 245 | @command{defaults} command. Alternatively, if you have Developer | ||
| 246 | Tools installed on Mac OS X, you can use Property List Editor to edit | ||
| 247 | the file @file{~/Library/Preferences/org.gnu.Emacs.plist}. | ||
| 248 | |||
| 249 | |||
| 250 | @node Mac Directories | ||
| 251 | @section Volumes and Directories on Mac | ||
| 252 | @cindex file names (Mac OS) | ||
| 253 | |||
| 254 | This node applies to Mac OS Classic only. | ||
| 255 | |||
| 256 | The directory structure in Mac OS Classic is seen by Emacs as | ||
| 257 | |||
| 258 | @example | ||
| 259 | /@var{volumename}/@var{filename} | ||
| 260 | @end example | ||
| 261 | |||
| 262 | So when Emacs requests a file name, doing file name completion on | ||
| 263 | @file{/} will display all volumes on the system. You can use @file{..} | ||
| 264 | to go up a directory level. | ||
| 265 | |||
| 266 | On Mac OS Classic, to access files and folders on the desktop, look | ||
| 267 | in the folder @file{Desktop Folder} in your boot volume (this folder | ||
| 268 | is usually invisible in the Mac @code{Finder}). | ||
| 269 | |||
| 270 | On Mac OS Classic, Emacs creates the Mac folder | ||
| 271 | @file{:Preferences:Emacs:} in the @file{System Folder} and uses it as | ||
| 272 | the temporary directory. Emacs maps the directory name @file{/tmp/} | ||
| 273 | to that. Therefore it is best to avoid naming a volume @file{tmp}. | ||
| 274 | If everything works correctly, the program should leave no files in it | ||
| 275 | when it exits. You should be able to set the environment variable | ||
| 276 | @code{TMPDIR} to use another directory but this folder will still be | ||
| 277 | created. | ||
| 278 | |||
| 279 | |||
| 280 | @node Mac Font Specs | ||
| 281 | @section Specifying Fonts on Mac | ||
| 282 | @cindex font names (Mac OS) | ||
| 283 | |||
| 284 | It is rare that you need to specify a font name in Emacs; usually | ||
| 285 | you specify face attributes instead. For example, you can use 14pt | ||
| 286 | Courier by customizing the default face attributes for all frames: | ||
| 287 | |||
| 288 | @lisp | ||
| 289 | (set-face-attribute 'default nil | ||
| 290 | :family "courier" :height 140) | ||
| 291 | @end lisp | ||
| 292 | |||
| 293 | @noindent | ||
| 294 | Alternatively, an interactive one is also available | ||
| 295 | (@pxref{Face Customization}). | ||
| 296 | |||
| 297 | But when you do need to specify a font name in Emacs on Mac, use a | ||
| 298 | standard X font name: | ||
| 299 | |||
| 300 | @smallexample | ||
| 301 | -@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{} | ||
| 302 | @dots{}-@var{pixels}-@var{height}-@var{horiz}-@var{vert}-@var{spacing}-@var{width}-@var{charset} | ||
| 303 | @end smallexample | ||
| 304 | |||
| 305 | @noindent | ||
| 306 | @xref{Font X}. Wildcards are supported as they are on X. | ||
| 307 | |||
| 308 | Emacs on Mac OS Classic uses QuickDraw Text routines for drawing texts | ||
| 309 | by default. Emacs on Mac OS X uses @acronym{ATSUI, Apple Type Services | ||
| 310 | for Unicode Imaging} as well as QuickDraw Text, and most of the | ||
| 311 | characters other than Chinese, Japanese, and Korean ones are drawn using | ||
| 312 | the former by default. | ||
| 313 | |||
| 314 | @acronym{ATSUI}-compatible fonts have maker name @code{apple} and | ||
| 315 | charset @code{iso10646-1}. For example, 12-point Monaco can be specified | ||
| 316 | by the name: | ||
| 317 | |||
| 318 | @example | ||
| 319 | -apple-monaco-medium-r-normal--12-*-*-*-*-*-iso10646-1 | ||
| 320 | @end example | ||
| 321 | |||
| 322 | Note that these names must be specified using a format containing all | ||
| 323 | 14 @samp{-}s (not by | ||
| 324 | @samp{-apple-monaco-medium-r-normal--12-*-iso10646-1}, for instance), | ||
| 325 | because every @acronym{ATSUI}-compatible font is a scalable one. | ||
| 326 | |||
| 327 | QuickDraw Text fonts have maker name @code{apple} and various charset | ||
| 328 | names other than @code{iso10646-1}. Native Apple fonts in Mac Roman | ||
| 329 | encoding has charset @code{mac-roman}. You can specify a | ||
| 330 | @code{mac-roman} font for @acronym{ASCII} characters like | ||
| 331 | |||
| 332 | @smalllisp | ||
| 333 | (add-to-list | ||
| 334 | 'default-frame-alist | ||
| 335 | '(font . "-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman")) | ||
| 336 | @end smalllisp | ||
| 337 | |||
| 338 | @noindent | ||
| 339 | but that does not extend to ISO-8859-1: specifying a @code{mac-roman} | ||
| 340 | font for Latin-1 characters introduces wrong glyphs. | ||
| 341 | |||
| 342 | Native Apple Traditional Chinese, Simplified Chinese, Japanese, | ||
| 343 | Korean, Central European, Cyrillic, Symbol, and Dingbats fonts have | ||
| 344 | the charsets @samp{big5-0}, @samp{gb2312.1980-0}, | ||
| 345 | @samp{jisx0208.1983-sjis} and @samp{jisx0201.1976-0}, | ||
| 346 | @samp{ksc5601.1989-0}, @samp{mac-centraleurroman}, | ||
| 347 | @samp{mac-cyrillic}, @samp{mac-symbol}, and @samp{mac-dingbats}, | ||
| 348 | respectively. | ||
| 349 | |||
| 350 | The use of @code{create-fontset-from-fontset-spec} (@pxref{Defining | ||
| 351 | Fontsets}) for defining fontsets often results in wrong ones especially | ||
| 352 | when using only OS-bundled QuickDraw Text fonts. The recommended way to | ||
| 353 | use them is to create a fontset using | ||
| 354 | @code{create-fontset-from-mac-roman-font}: | ||
| 355 | |||
| 356 | @lisp | ||
| 357 | (create-fontset-from-mac-roman-font | ||
| 358 | "-apple-courier-medium-r-normal--13-*-*-*-*-*-mac-roman" | ||
| 359 | nil "foo") | ||
| 360 | @end lisp | ||
| 361 | |||
| 362 | @noindent | ||
| 363 | and then optionally specifying Chinese, Japanese, or Korean font | ||
| 364 | families using @code{set-fontset-font}: | ||
| 365 | |||
| 366 | @lisp | ||
| 367 | (set-fontset-font "fontset-foo" | ||
| 368 | 'chinese-gb2312 '("song" . "gb2312.1980-0")) | ||
| 369 | @end lisp | ||
| 370 | |||
| 371 | Single-byte fonts converted from GNU fonts in BDF format, which are not | ||
| 372 | in the Mac Roman encoding, have foundry, family, and character sets | ||
| 373 | encoded in the names of their font suitcases. E.g., the font suitcase | ||
| 374 | @samp{ETL-Fixed-ISO8859-1} contains fonts which can be referred to by | ||
| 375 | the name @samp{-ETL-fixed-*-iso8859-1}. | ||
| 376 | |||
| 377 | @vindex mac-allow-anti-aliasing | ||
| 378 | Mac OS X 10.2 or later can use two types of text renderings: Quartz 2D | ||
| 379 | (aka Core Graphics) and QuickDraw. By default, Emacs uses the former on | ||
| 380 | such versions. It can be changed by setting | ||
| 381 | @code{mac-allow-anti-aliasing} to @code{t} (Quartz 2D) or @code{nil} | ||
| 382 | (QuickDraw). Both @acronym{ATSUI} and QuickDraw Text drawings are | ||
| 383 | affected by the value of this variable. | ||
| 384 | |||
| 385 | Appearance of text in small sizes will also be affected by the ``Turn | ||
| 386 | off text smoothing for font sizes @var{n} and smaller'' setting in the | ||
| 387 | General pane (Mac OS X 10.1 or 10.2) or in the Appearance pane (10.3 or | ||
| 388 | later) of the System Preferences. This threshold can alternatively be | ||
| 389 | set just for Emacs (i.e., not as the system-wide setting) using the | ||
| 390 | @command{defaults} command: | ||
| 391 | |||
| 392 | @example | ||
| 393 | defaults write org.gnu.Emacs AppleAntiAliasingThreshold @var{n} | ||
| 394 | @end example | ||
| 395 | |||
| 396 | |||
| 397 | @node Mac Functions | ||
| 398 | @section Mac-Specific Lisp Functions | ||
| 399 | @cindex Lisp functions specific to Mac OS | ||
| 400 | |||
| 401 | @findex do-applescript | ||
| 402 | The function @code{do-applescript} takes a string argument, | ||
| 403 | executes it as an AppleScript command, and returns the result as a | ||
| 404 | string. | ||
| 405 | |||
| 406 | @findex mac-file-name-to-posix | ||
| 407 | @findex posix-file-name-to-mac | ||
| 408 | The function @code{mac-file-name-to-posix} takes a Mac file name and | ||
| 409 | returns the GNU or Unix equivalent. The function | ||
| 410 | @code{posix-file-name-to-mac} performs the opposite conversion. They | ||
| 411 | are useful for constructing AppleScript commands to be passed to | ||
| 412 | @code{do-applescript}. | ||
| 413 | |||
| 414 | @findex mac-set-file-creator | ||
| 415 | @findex mac-get-file-creator | ||
| 416 | @findex mac-set-file-type | ||
| 417 | @findex mac-get-file-type | ||
| 418 | The functions @code{mac-set-file-creator}, | ||
| 419 | @code{mac-get-file-creator}, @code{mac-set-file-type}, and | ||
| 420 | @code{mac-get-file-type} can be used to set and get creator and file | ||
| 421 | codes. | ||
| 422 | |||
| 423 | @findex mac-get-preference | ||
| 424 | The function @code{mac-get-preference} returns the preferences value | ||
| 425 | converted to a Lisp object for a specified key and application. | ||
| 426 | |||
| 427 | @ignore | ||
| 428 | arch-tag: a822c2ab-4273-4997-927e-c153bb71dcf6 | ||
| 429 | @end ignore | ||
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi new file mode 100644 index 00000000000..988d5890b8c --- /dev/null +++ b/doc/emacs/maintaining.texi | |||
| @@ -0,0 +1,862 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000, | ||
| 3 | @c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Maintaining, Abbrevs, Building, Top | ||
| 6 | @chapter Maintaining Large Programs | ||
| 7 | |||
| 8 | This chapter describes Emacs features for maintaining large | ||
| 9 | programs. The version control features (@pxref{Version Control}) are | ||
| 10 | also particularly useful for this purpose. | ||
| 11 | |||
| 12 | @menu | ||
| 13 | * Change Log:: Maintaining a change history for your program. | ||
| 14 | * Format of ChangeLog:: What the change log file looks like. | ||
| 15 | * Tags:: Go direct to any function in your program in one | ||
| 16 | command. Tags remembers which file it is in. | ||
| 17 | @ifnottex | ||
| 18 | * Emerge:: A convenient way of merging two versions of a program. | ||
| 19 | @end ifnottex | ||
| 20 | @end menu | ||
| 21 | |||
| 22 | @node Change Log | ||
| 23 | @section Change Logs | ||
| 24 | |||
| 25 | A change log file contains a chronological record of when and why you | ||
| 26 | have changed a program, consisting of a sequence of entries describing | ||
| 27 | individual changes. Normally it is kept in a file called | ||
| 28 | @file{ChangeLog} in the same directory as the file you are editing, or | ||
| 29 | one of its parent directories. A single @file{ChangeLog} file can | ||
| 30 | record changes for all the files in its directory and all its | ||
| 31 | subdirectories. | ||
| 32 | |||
| 33 | @cindex change log | ||
| 34 | @kindex C-x 4 a | ||
| 35 | @findex add-change-log-entry-other-window | ||
| 36 | The Emacs command @kbd{C-x 4 a} adds a new entry to the change log | ||
| 37 | file for the file you are editing | ||
| 38 | (@code{add-change-log-entry-other-window}). If that file is actually | ||
| 39 | a backup file, it makes an entry appropriate for the file's | ||
| 40 | parent---that is useful for making log entries for functions that | ||
| 41 | have been deleted in the current version. | ||
| 42 | |||
| 43 | @kbd{C-x 4 a} visits the change log file and creates a new entry | ||
| 44 | unless the most recent entry is for today's date and your name. It | ||
| 45 | also creates a new item for the current file. For many languages, it | ||
| 46 | can even guess the name of the function or other object that was | ||
| 47 | changed. | ||
| 48 | |||
| 49 | @vindex add-log-keep-changes-together | ||
| 50 | When the variable @code{add-log-keep-changes-together} is | ||
| 51 | non-@code{nil}, @kbd{C-x 4 a} adds to any existing item for the file | ||
| 52 | rather than starting a new item. | ||
| 53 | |||
| 54 | @vindex add-log-always-start-new-record | ||
| 55 | If @code{add-log-always-start-new-record} is non-@code{nil}, | ||
| 56 | @kbd{C-x 4 a} always makes a new entry, even if the last entry | ||
| 57 | was made by you and on the same date. | ||
| 58 | |||
| 59 | @vindex change-log-version-info-enabled | ||
| 60 | @vindex change-log-version-number-regexp-list | ||
| 61 | @cindex file version in change log entries | ||
| 62 | If the value of the variable @code{change-log-version-info-enabled} | ||
| 63 | is non-@code{nil}, @kbd{C-x 4 a} adds the file's version number to the | ||
| 64 | change log entry. It finds the version number by searching the first | ||
| 65 | ten percent of the file, using regular expressions from the variable | ||
| 66 | @code{change-log-version-number-regexp-list}. | ||
| 67 | |||
| 68 | @cindex Change Log mode | ||
| 69 | @findex change-log-mode | ||
| 70 | The change log file is visited in Change Log mode. In this major | ||
| 71 | mode, each bunch of grouped items counts as one paragraph, and each | ||
| 72 | entry is considered a page. This facilitates editing the entries. | ||
| 73 | @kbd{C-j} and auto-fill indent each new line like the previous line; | ||
| 74 | this is convenient for entering the contents of an entry. | ||
| 75 | |||
| 76 | @findex change-log-merge | ||
| 77 | You can use the command @kbd{M-x change-log-merge} to merge other | ||
| 78 | log files into a buffer in Change Log Mode, preserving the date | ||
| 79 | ordering of entries. | ||
| 80 | |||
| 81 | Version control systems are another way to keep track of changes in your | ||
| 82 | program and keep a change log. @xref{Log Buffer}. | ||
| 83 | |||
| 84 | @node Format of ChangeLog | ||
| 85 | @section Format of ChangeLog | ||
| 86 | |||
| 87 | A change log entry starts with a header line that contains the current | ||
| 88 | date, your name, and your email address (taken from the variable | ||
| 89 | @code{add-log-mailing-address}). Aside from these header lines, every | ||
| 90 | line in the change log starts with a space or a tab. The bulk of the | ||
| 91 | entry consists of @dfn{items}, each of which starts with a line starting | ||
| 92 | with whitespace and a star. Here are two entries, both dated in May | ||
| 93 | 1993, with two items and one item respectively. | ||
| 94 | |||
| 95 | @iftex | ||
| 96 | @medbreak | ||
| 97 | @end iftex | ||
| 98 | @smallexample | ||
| 99 | 1993-05-25 Richard Stallman <rms@@gnu.org> | ||
| 100 | |||
| 101 | * man.el: Rename symbols `man-*' to `Man-*'. | ||
| 102 | (manual-entry): Make prompt string clearer. | ||
| 103 | |||
| 104 | * simple.el (blink-matching-paren-distance): | ||
| 105 | Change default to 12,000. | ||
| 106 | |||
| 107 | 1993-05-24 Richard Stallman <rms@@gnu.org> | ||
| 108 | |||
| 109 | * vc.el (minor-mode-map-alist): Don't use it if it's void. | ||
| 110 | (vc-cancel-version): Doc fix. | ||
| 111 | @end smallexample | ||
| 112 | |||
| 113 | One entry can describe several changes; each change should have its | ||
| 114 | own item, or its own line in an item. Normally there should be a | ||
| 115 | blank line between items. When items are related (parts of the same | ||
| 116 | change, in different places), group them by leaving no blank line | ||
| 117 | between them. | ||
| 118 | |||
| 119 | You should put a copyright notice and permission notice at the | ||
| 120 | end of the change log file. Here is an example: | ||
| 121 | |||
| 122 | @smallexample | ||
| 123 | Copyright 1997, 1998 Free Software Foundation, Inc. | ||
| 124 | Copying and distribution of this file, with or without modification, are | ||
| 125 | permitted provided the copyright notice and this notice are preserved. | ||
| 126 | @end smallexample | ||
| 127 | |||
| 128 | @noindent | ||
| 129 | Of course, you should substitute the proper years and copyright holder. | ||
| 130 | |||
| 131 | @node Tags | ||
| 132 | @section Tags Tables | ||
| 133 | @cindex tags table | ||
| 134 | |||
| 135 | A @dfn{tags table} is a description of how a multi-file program is | ||
| 136 | broken up into files. It lists the names of the component files and the | ||
| 137 | names and positions of the functions (or other named subunits) in each | ||
| 138 | file. Grouping the related files makes it possible to search or replace | ||
| 139 | through all the files with one command. Recording the function names | ||
| 140 | and positions makes possible the @kbd{M-.} command which finds the | ||
| 141 | definition of a function by looking up which of the files it is in. | ||
| 142 | |||
| 143 | Tags tables are stored in files called @dfn{tags table files}. The | ||
| 144 | conventional name for a tags table file is @file{TAGS}. | ||
| 145 | |||
| 146 | Each entry in the tags table records the name of one tag, the name of the | ||
| 147 | file that the tag is defined in (implicitly), and the position in that | ||
| 148 | file of the tag's definition. When a file parsed by @code{etags} is | ||
| 149 | generated from a different source file, like a C file generated from a | ||
| 150 | Cweb source file, the tags of the parsed file reference the source | ||
| 151 | file. | ||
| 152 | |||
| 153 | Just what names from the described files are recorded in the tags table | ||
| 154 | depends on the programming language of the described file. They | ||
| 155 | normally include all file names, functions and subroutines, and may | ||
| 156 | also include global variables, data types, and anything else | ||
| 157 | convenient. Each name recorded is called a @dfn{tag}. | ||
| 158 | |||
| 159 | @cindex C++ class browser, tags | ||
| 160 | @cindex tags, C++ | ||
| 161 | @cindex class browser, C++ | ||
| 162 | @cindex Ebrowse | ||
| 163 | See also the Ebrowse facility, which is tailored for C++. | ||
| 164 | @xref{Top,, Ebrowse, ebrowse, Ebrowse User's Manual}. | ||
| 165 | |||
| 166 | @menu | ||
| 167 | * Tag Syntax:: Tag syntax for various types of code and text files. | ||
| 168 | * Create Tags Table:: Creating a tags table with @code{etags}. | ||
| 169 | * Etags Regexps:: Create arbitrary tags using regular expressions. | ||
| 170 | * Select Tags Table:: How to visit a tags table. | ||
| 171 | * Find Tag:: Commands to find the definition of a specific tag. | ||
| 172 | * Tags Search:: Using a tags table for searching and replacing. | ||
| 173 | * List Tags:: Listing and finding tags defined in a file. | ||
| 174 | @end menu | ||
| 175 | |||
| 176 | @node Tag Syntax | ||
| 177 | @subsection Source File Tag Syntax | ||
| 178 | |||
| 179 | Here is how tag syntax is defined for the most popular languages: | ||
| 180 | |||
| 181 | @itemize @bullet | ||
| 182 | @item | ||
| 183 | In C code, any C function or typedef is a tag, and so are definitions of | ||
| 184 | @code{struct}, @code{union} and @code{enum}. | ||
| 185 | @code{#define} macro definitions, @code{#undef} and @code{enum} | ||
| 186 | constants are also | ||
| 187 | tags, unless you specify @samp{--no-defines} when making the tags table. | ||
| 188 | Similarly, global variables are tags, unless you specify | ||
| 189 | @samp{--no-globals}, and so are struct members, unless you specify | ||
| 190 | @samp{--no-members}. Use of @samp{--no-globals}, @samp{--no-defines} | ||
| 191 | and @samp{--no-members} can make the tags table file much smaller. | ||
| 192 | |||
| 193 | You can tag function declarations and external variables in addition | ||
| 194 | to function definitions by giving the @samp{--declarations} option to | ||
| 195 | @code{etags}. | ||
| 196 | |||
| 197 | @item | ||
| 198 | In C++ code, in addition to all the tag constructs of C code, member | ||
| 199 | functions are also recognized; member variables are also recognized, | ||
| 200 | unless you use the @samp{--no-members} option. Tags for variables and | ||
| 201 | functions in classes are named @samp{@var{class}::@var{variable}} and | ||
| 202 | @samp{@var{class}::@var{function}}. @code{operator} definitions have | ||
| 203 | tag names like @samp{operator+}. | ||
| 204 | |||
| 205 | @item | ||
| 206 | In Java code, tags include all the constructs recognized in C++, plus | ||
| 207 | the @code{interface}, @code{extends} and @code{implements} constructs. | ||
| 208 | Tags for variables and functions in classes are named | ||
| 209 | @samp{@var{class}.@var{variable}} and @samp{@var{class}.@var{function}}. | ||
| 210 | |||
| 211 | @item | ||
| 212 | In La@TeX{} text, the argument of any of the commands @code{\chapter}, | ||
| 213 | @code{\section}, @code{\subsection}, @code{\subsubsection}, | ||
| 214 | @code{\eqno}, @code{\label}, @code{\ref}, @code{\cite}, | ||
| 215 | @code{\bibitem}, @code{\part}, @code{\appendix}, @code{\entry}, | ||
| 216 | @code{\index}, @code{\def}, @code{\newcommand}, @code{\renewcommand}, | ||
| 217 | @code{\newenvironment} or @code{\renewenvironment} is a tag.@refill | ||
| 218 | |||
| 219 | Other commands can make tags as well, if you specify them in the | ||
| 220 | environment variable @env{TEXTAGS} before invoking @code{etags}. The | ||
| 221 | value of this environment variable should be a colon-separated list of | ||
| 222 | command names. For example, | ||
| 223 | |||
| 224 | @example | ||
| 225 | TEXTAGS="mycommand:myothercommand" | ||
| 226 | export TEXTAGS | ||
| 227 | @end example | ||
| 228 | |||
| 229 | @noindent | ||
| 230 | specifies (using Bourne shell syntax) that the commands | ||
| 231 | @samp{\mycommand} and @samp{\myothercommand} also define tags. | ||
| 232 | |||
| 233 | @item | ||
| 234 | In Lisp code, any function defined with @code{defun}, any variable | ||
| 235 | defined with @code{defvar} or @code{defconst}, and in general the first | ||
| 236 | argument of any expression that starts with @samp{(def} in column zero is | ||
| 237 | a tag. | ||
| 238 | |||
| 239 | @item | ||
| 240 | In Scheme code, tags include anything defined with @code{def} or with a | ||
| 241 | construct whose name starts with @samp{def}. They also include variables | ||
| 242 | set with @code{set!} at top level in the file. | ||
| 243 | @end itemize | ||
| 244 | |||
| 245 | Several other languages are also supported: | ||
| 246 | |||
| 247 | @itemize @bullet | ||
| 248 | |||
| 249 | @item | ||
| 250 | In Ada code, functions, procedures, packages, tasks and types are | ||
| 251 | tags. Use the @samp{--packages-only} option to create tags for | ||
| 252 | packages only. | ||
| 253 | |||
| 254 | In Ada, the same name can be used for different kinds of entity | ||
| 255 | (e.g.@:, for a procedure and for a function). Also, for things like | ||
| 256 | packages, procedures and functions, there is the spec (i.e.@: the | ||
| 257 | interface) and the body (i.e.@: the implementation). To make it | ||
| 258 | easier to pick the definition you want, Ada tag name have suffixes | ||
| 259 | indicating the type of entity: | ||
| 260 | |||
| 261 | @table @samp | ||
| 262 | @item /b | ||
| 263 | package body. | ||
| 264 | @item /f | ||
| 265 | function. | ||
| 266 | @item /k | ||
| 267 | task. | ||
| 268 | @item /p | ||
| 269 | procedure. | ||
| 270 | @item /s | ||
| 271 | package spec. | ||
| 272 | @item /t | ||
| 273 | type. | ||
| 274 | @end table | ||
| 275 | |||
| 276 | Thus, @kbd{M-x find-tag @key{RET} bidule/b @key{RET}} will go | ||
| 277 | directly to the body of the package @code{bidule}, while @kbd{M-x | ||
| 278 | find-tag @key{RET} bidule @key{RET}} will just search for any tag | ||
| 279 | @code{bidule}. | ||
| 280 | |||
| 281 | @item | ||
| 282 | In assembler code, labels appearing at the beginning of a line, | ||
| 283 | followed by a colon, are tags. | ||
| 284 | |||
| 285 | @item | ||
| 286 | In Bison or Yacc input files, each rule defines as a tag the nonterminal | ||
| 287 | it constructs. The portions of the file that contain C code are parsed | ||
| 288 | as C code. | ||
| 289 | |||
| 290 | @item | ||
| 291 | In Cobol code, tags are paragraph names; that is, any word starting in | ||
| 292 | column 8 and followed by a period. | ||
| 293 | |||
| 294 | @item | ||
| 295 | In Erlang code, the tags are the functions, records and macros defined | ||
| 296 | in the file. | ||
| 297 | |||
| 298 | @item | ||
| 299 | In Fortran code, functions, subroutines and block data are tags. | ||
| 300 | |||
| 301 | @item | ||
| 302 | In HTML input files, the tags are the @code{title} and the @code{h1}, | ||
| 303 | @code{h2}, @code{h3} headers. Also, tags are @code{name=} in anchors | ||
| 304 | and all occurrences of @code{id=}. | ||
| 305 | |||
| 306 | @item | ||
| 307 | In Lua input files, all functions are tags. | ||
| 308 | |||
| 309 | @item | ||
| 310 | In makefiles, targets are tags; additionally, variables are tags | ||
| 311 | unless you specify @samp{--no-globals}. | ||
| 312 | |||
| 313 | @item | ||
| 314 | In Objective C code, tags include Objective C definitions for classes, | ||
| 315 | class categories, methods and protocols. Tags for variables and | ||
| 316 | functions in classes are named @samp{@var{class}::@var{variable}} and | ||
| 317 | @samp{@var{class}::@var{function}}. | ||
| 318 | |||
| 319 | @item | ||
| 320 | In Pascal code, the tags are the functions and procedures defined in | ||
| 321 | the file. | ||
| 322 | |||
| 323 | @item | ||
| 324 | In Perl code, the tags are the packages, subroutines and variables | ||
| 325 | defined by the @code{package}, @code{sub}, @code{my} and @code{local} | ||
| 326 | keywords. Use @samp{--globals} if you want to tag global variables. | ||
| 327 | Tags for subroutines are named @samp{@var{package}::@var{sub}}. The | ||
| 328 | name for subroutines defined in the default package is | ||
| 329 | @samp{main::@var{sub}}. | ||
| 330 | |||
| 331 | @item | ||
| 332 | In PHP code, tags are functions, classes and defines. Vars are tags | ||
| 333 | too, unless you use the @samp{--no-members} option. | ||
| 334 | |||
| 335 | @item | ||
| 336 | In PostScript code, the tags are the functions. | ||
| 337 | |||
| 338 | @item | ||
| 339 | In Prolog code, tags are predicates and rules at the beginning of | ||
| 340 | line. | ||
| 341 | |||
| 342 | @item | ||
| 343 | In Python code, @code{def} or @code{class} at the beginning of a line | ||
| 344 | generate a tag. | ||
| 345 | @end itemize | ||
| 346 | |||
| 347 | You can also generate tags based on regexp matching (@pxref{Etags | ||
| 348 | Regexps}) to handle other formats and languages. | ||
| 349 | |||
| 350 | @node Create Tags Table | ||
| 351 | @subsection Creating Tags Tables | ||
| 352 | @cindex @code{etags} program | ||
| 353 | |||
| 354 | The @code{etags} program is used to create a tags table file. It knows | ||
| 355 | the syntax of several languages, as described in | ||
| 356 | @iftex | ||
| 357 | the previous section. | ||
| 358 | @end iftex | ||
| 359 | @ifnottex | ||
| 360 | @ref{Tag Syntax}. | ||
| 361 | @end ifnottex | ||
| 362 | Here is how to run @code{etags}: | ||
| 363 | |||
| 364 | @example | ||
| 365 | etags @var{inputfiles}@dots{} | ||
| 366 | @end example | ||
| 367 | |||
| 368 | @noindent | ||
| 369 | The @code{etags} program reads the specified files, and writes a tags | ||
| 370 | table named @file{TAGS} in the current working directory. | ||
| 371 | |||
| 372 | If the specified files don't exist, @code{etags} looks for | ||
| 373 | compressed versions of them and uncompresses them to read them. Under | ||
| 374 | MS-DOS, @code{etags} also looks for file names like @file{mycode.cgz} | ||
| 375 | if it is given @samp{mycode.c} on the command line and @file{mycode.c} | ||
| 376 | does not exist. | ||
| 377 | |||
| 378 | @code{etags} recognizes the language used in an input file based on | ||
| 379 | its file name and contents. You can specify the language with the | ||
| 380 | @samp{--language=@var{name}} option, described below. | ||
| 381 | |||
| 382 | If the tags table data become outdated due to changes in the files | ||
| 383 | described in the table, the way to update the tags table is the same | ||
| 384 | way it was made in the first place. If the tags table fails to record | ||
| 385 | a tag, or records it for the wrong file, then Emacs cannot possibly | ||
| 386 | find its definition until you update the tags table. However, if the | ||
| 387 | position recorded in the tags table becomes a little bit wrong (due to | ||
| 388 | other editing), the worst consequence is a slight delay in finding the | ||
| 389 | tag. Even if the stored position is very far wrong, Emacs will still | ||
| 390 | find the tag, after searching most of the file for it. That delay is | ||
| 391 | hardly noticeable with today's computers. | ||
| 392 | |||
| 393 | Thus, there is no need to update the tags table after each edit. | ||
| 394 | You should update a tags table when you define new tags that you want | ||
| 395 | to have listed, or when you move tag definitions from one file to | ||
| 396 | another, or when changes become substantial. | ||
| 397 | |||
| 398 | One tags table can virtually include another. Specify the included | ||
| 399 | tags file name with the @samp{--include=@var{file}} option when | ||
| 400 | creating the file that is to include it. The latter file then acts as | ||
| 401 | if it covered all the source files specified in the included file, as | ||
| 402 | well as the files it directly contains. | ||
| 403 | |||
| 404 | If you specify the source files with relative file names when you run | ||
| 405 | @code{etags}, the tags file will contain file names relative to the | ||
| 406 | directory where the tags file was initially written. This way, you can | ||
| 407 | move an entire directory tree containing both the tags file and the | ||
| 408 | source files, and the tags file will still refer correctly to the source | ||
| 409 | files. If the tags file is in @file{/dev}, however, the file names are | ||
| 410 | made relative to the current working directory. This is useful, for | ||
| 411 | example, when writing the tags to @file{/dev/stdout}. | ||
| 412 | |||
| 413 | When using a relative file name, it should not be a symbolic link | ||
| 414 | pointing to a tags file in a different directory, because this would | ||
| 415 | generally render the file names invalid. | ||
| 416 | |||
| 417 | If you specify absolute file names as arguments to @code{etags}, then | ||
| 418 | the tags file will contain absolute file names. This way, the tags file | ||
| 419 | will still refer to the same files even if you move it, as long as the | ||
| 420 | source files remain in the same place. Absolute file names start with | ||
| 421 | @samp{/}, or with @samp{@var{device}:/} on MS-DOS and MS-Windows. | ||
| 422 | |||
| 423 | When you want to make a tags table from a great number of files, you | ||
| 424 | may have problems listing them on the command line, because some systems | ||
| 425 | have a limit on its length. The simplest way to circumvent this limit | ||
| 426 | is to tell @code{etags} to read the file names from its standard input, | ||
| 427 | by typing a dash in place of the file names, like this: | ||
| 428 | |||
| 429 | @smallexample | ||
| 430 | find . -name "*.[chCH]" -print | etags - | ||
| 431 | @end smallexample | ||
| 432 | |||
| 433 | Use the option @samp{--language=@var{name}} to specify the language | ||
| 434 | explicitly. You can intermix these options with file names; each one | ||
| 435 | applies to the file names that follow it. Specify | ||
| 436 | @samp{--language=auto} to tell @code{etags} to resume guessing the | ||
| 437 | language from the file names and file contents. Specify | ||
| 438 | @samp{--language=none} to turn off language-specific processing | ||
| 439 | entirely; then @code{etags} recognizes tags by regexp matching alone | ||
| 440 | (@pxref{Etags Regexps}). | ||
| 441 | |||
| 442 | The option @samp{--parse-stdin=@var{file}} is mostly useful when | ||
| 443 | calling @code{etags} from programs. It can be used (only once) in | ||
| 444 | place of a file name on the command line. @code{Etags} will read from | ||
| 445 | standard input and mark the produced tags as belonging to the file | ||
| 446 | @var{file}. | ||
| 447 | |||
| 448 | @samp{etags --help} outputs the list of the languages @code{etags} | ||
| 449 | knows, and the file name rules for guessing the language. It also prints | ||
| 450 | a list of all the available @code{etags} options, together with a short | ||
| 451 | explanation. If followed by one or more @samp{--language=@var{lang}} | ||
| 452 | options, it outputs detailed information about how tags are generated for | ||
| 453 | @var{lang}. | ||
| 454 | |||
| 455 | @node Etags Regexps | ||
| 456 | @subsection Etags Regexps | ||
| 457 | |||
| 458 | The @samp{--regex} option provides a general way of recognizing tags | ||
| 459 | based on regexp matching. You can freely intermix this option with | ||
| 460 | file names, and each one applies to the source files that follow it. | ||
| 461 | If you specify multiple @samp{--regex} options, all of them are used | ||
| 462 | in parallel. The syntax is: | ||
| 463 | |||
| 464 | @smallexample | ||
| 465 | --regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers} | ||
| 466 | @end smallexample | ||
| 467 | |||
| 468 | The essential part of the option value is @var{tagregexp}, the | ||
| 469 | regexp for matching tags. It is always used anchored, that is, it | ||
| 470 | only matches at the beginning of a line. If you want to allow | ||
| 471 | indented tags, use a regexp that matches initial whitespace; start it | ||
| 472 | with @samp{[ \t]*}. | ||
| 473 | |||
| 474 | In these regular expressions, @samp{\} quotes the next character, and | ||
| 475 | all the GCC character escape sequences are supported (@samp{\a} for | ||
| 476 | bell, @samp{\b} for back space, @samp{\d} for delete, @samp{\e} for | ||
| 477 | escape, @samp{\f} for formfeed, @samp{\n} for newline, @samp{\r} for | ||
| 478 | carriage return, @samp{\t} for tab, and @samp{\v} for vertical tab). | ||
| 479 | |||
| 480 | Ideally, @var{tagregexp} should not match more characters than are | ||
| 481 | needed to recognize what you want to tag. If the syntax requires you | ||
| 482 | to write @var{tagregexp} so it matches more characters beyond the tag | ||
| 483 | itself, you should add a @var{nameregexp}, to pick out just the tag. | ||
| 484 | This will enable Emacs to find tags more accurately and to do | ||
| 485 | completion on tag names more reliably. You can find some examples | ||
| 486 | below. | ||
| 487 | |||
| 488 | The @var{modifiers} are a sequence of zero or more characters that | ||
| 489 | modify the way @code{etags} does the matching. A regexp with no | ||
| 490 | modifiers is applied sequentially to each line of the input file, in a | ||
| 491 | case-sensitive way. The modifiers and their meanings are: | ||
| 492 | |||
| 493 | @table @samp | ||
| 494 | @item i | ||
| 495 | Ignore case when matching this regexp. | ||
| 496 | @item m | ||
| 497 | Match this regular expression against the whole file, so that | ||
| 498 | multi-line matches are possible. | ||
| 499 | @item s | ||
| 500 | Match this regular expression against the whole file, and allow | ||
| 501 | @samp{.} in @var{tagregexp} to match newlines. | ||
| 502 | @end table | ||
| 503 | |||
| 504 | The @samp{-R} option cancels all the regexps defined by preceding | ||
| 505 | @samp{--regex} options. It too applies to the file names following | ||
| 506 | it. Here's an example: | ||
| 507 | |||
| 508 | @smallexample | ||
| 509 | etags --regex=/@var{reg1}/i voo.doo --regex=/@var{reg2}/m \ | ||
| 510 | bar.ber -R --lang=lisp los.er | ||
| 511 | @end smallexample | ||
| 512 | |||
| 513 | @noindent | ||
| 514 | Here @code{etags} chooses the parsing language for @file{voo.doo} and | ||
| 515 | @file{bar.ber} according to their contents. @code{etags} also uses | ||
| 516 | @var{reg1} to recognize additional tags in @file{voo.doo}, and both | ||
| 517 | @var{reg1} and @var{reg2} to recognize additional tags in | ||
| 518 | @file{bar.ber}. @var{reg1} is checked against each line of | ||
| 519 | @file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while | ||
| 520 | @var{reg2} is checked against the whole @file{bar.ber} file, | ||
| 521 | permitting multi-line matches, in a case-sensitive way. @code{etags} | ||
| 522 | uses only the Lisp tags rules, with no user-specified regexp matching, | ||
| 523 | to recognize tags in @file{los.er}. | ||
| 524 | |||
| 525 | You can restrict a @samp{--regex} option to match only files of a | ||
| 526 | given language by using the optional prefix @var{@{language@}}. | ||
| 527 | (@samp{etags --help} prints the list of languages recognized by | ||
| 528 | @code{etags}.) This is particularly useful when storing many | ||
| 529 | predefined regular expressions for @code{etags} in a file. The | ||
| 530 | following example tags the @code{DEFVAR} macros in the Emacs source | ||
| 531 | files, for the C language only: | ||
| 532 | |||
| 533 | @smallexample | ||
| 534 | --regex='@{c@}/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/' | ||
| 535 | @end smallexample | ||
| 536 | |||
| 537 | @noindent | ||
| 538 | When you have complex regular expressions, you can store the list of | ||
| 539 | them in a file. The following option syntax instructs @code{etags} to | ||
| 540 | read two files of regular expressions. The regular expressions | ||
| 541 | contained in the second file are matched without regard to case. | ||
| 542 | |||
| 543 | @smallexample | ||
| 544 | --regex=@@@var{case-sensitive-file} --ignore-case-regex=@@@var{ignore-case-file} | ||
| 545 | @end smallexample | ||
| 546 | |||
| 547 | @noindent | ||
| 548 | A regex file for @code{etags} contains one regular expression per | ||
| 549 | line. Empty lines, and lines beginning with space or tab are ignored. | ||
| 550 | When the first character in a line is @samp{@@}, @code{etags} assumes | ||
| 551 | that the rest of the line is the name of another file of regular | ||
| 552 | expressions; thus, one such file can include another file. All the | ||
| 553 | other lines are taken to be regular expressions. If the first | ||
| 554 | non-whitespace text on the line is @samp{--}, that line is a comment. | ||
| 555 | |||
| 556 | For example, we can create a file called @samp{emacs.tags} with the | ||
| 557 | following contents: | ||
| 558 | |||
| 559 | @smallexample | ||
| 560 | -- This is for GNU Emacs C source files | ||
| 561 | @{c@}/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/\1/ | ||
| 562 | @end smallexample | ||
| 563 | |||
| 564 | @noindent | ||
| 565 | and then use it like this: | ||
| 566 | |||
| 567 | @smallexample | ||
| 568 | etags --regex=@@emacs.tags *.[ch] */*.[ch] | ||
| 569 | @end smallexample | ||
| 570 | |||
| 571 | Here are some more examples. The regexps are quoted to protect them | ||
| 572 | from shell interpretation. | ||
| 573 | |||
| 574 | @itemize @bullet | ||
| 575 | |||
| 576 | @item | ||
| 577 | Tag Octave files: | ||
| 578 | |||
| 579 | @smallexample | ||
| 580 | etags --language=none \ | ||
| 581 | --regex='/[ \t]*function.*=[ \t]*\([^ \t]*\)[ \t]*(/\1/' \ | ||
| 582 | --regex='/###key \(.*\)/\1/' \ | ||
| 583 | --regex='/[ \t]*global[ \t].*/' \ | ||
| 584 | *.m | ||
| 585 | @end smallexample | ||
| 586 | |||
| 587 | @noindent | ||
| 588 | Note that tags are not generated for scripts, so that you have to add | ||
| 589 | a line by yourself of the form @samp{###key @var{scriptname}} if you | ||
| 590 | want to jump to it. | ||
| 591 | |||
| 592 | @item | ||
| 593 | Tag Tcl files: | ||
| 594 | |||
| 595 | @smallexample | ||
| 596 | etags --language=none --regex='/proc[ \t]+\([^ \t]+\)/\1/' *.tcl | ||
| 597 | @end smallexample | ||
| 598 | |||
| 599 | @item | ||
| 600 | Tag VHDL files: | ||
| 601 | |||
| 602 | @smallexample | ||
| 603 | etags --language=none \ | ||
| 604 | --regex='/[ \t]*\(ARCHITECTURE\|CONFIGURATION\) +[^ ]* +OF/' \ | ||
| 605 | --regex='/[ \t]*\(ATTRIBUTE\|ENTITY\|FUNCTION\|PACKAGE\ | ||
| 606 | \( BODY\)?\|PROCEDURE\|PROCESS\|TYPE\)[ \t]+\([^ \t(]+\)/\3/' | ||
| 607 | @end smallexample | ||
| 608 | @end itemize | ||
| 609 | |||
| 610 | @node Select Tags Table | ||
| 611 | @subsection Selecting a Tags Table | ||
| 612 | |||
| 613 | @vindex tags-file-name | ||
| 614 | @findex visit-tags-table | ||
| 615 | Emacs has at any time one @dfn{selected} tags table, and all the | ||
| 616 | commands for working with tags tables use the selected one. To select | ||
| 617 | a tags table, type @kbd{M-x visit-tags-table}, which reads the tags | ||
| 618 | table file name as an argument, with @file{TAGS} in the default | ||
| 619 | directory as the default. | ||
| 620 | |||
| 621 | Emacs does not actually read in the tags table contents until you | ||
| 622 | try to use them; all @code{visit-tags-table} does is store the file | ||
| 623 | name in the variable @code{tags-file-name}, and setting the variable | ||
| 624 | yourself is just as good. The variable's initial value is @code{nil}; | ||
| 625 | that value tells all the commands for working with tags tables that | ||
| 626 | they must ask for a tags table file name to use. | ||
| 627 | |||
| 628 | Using @code{visit-tags-table} when a tags table is already loaded | ||
| 629 | gives you a choice: you can add the new tags table to the current list | ||
| 630 | of tags tables, or start a new list. The tags commands use all the tags | ||
| 631 | tables in the current list. If you start a new list, the new tags table | ||
| 632 | is used @emph{instead} of others. If you add the new table to the | ||
| 633 | current list, it is used @emph{as well as} the others. | ||
| 634 | |||
| 635 | @vindex tags-table-list | ||
| 636 | You can specify a precise list of tags tables by setting the variable | ||
| 637 | @code{tags-table-list} to a list of strings, like this: | ||
| 638 | |||
| 639 | @c keep this on two lines for formatting in smallbook | ||
| 640 | @example | ||
| 641 | @group | ||
| 642 | (setq tags-table-list | ||
| 643 | '("~/emacs" "/usr/local/lib/emacs/src")) | ||
| 644 | @end group | ||
| 645 | @end example | ||
| 646 | |||
| 647 | @noindent | ||
| 648 | This tells the tags commands to look at the @file{TAGS} files in your | ||
| 649 | @file{~/emacs} directory and in the @file{/usr/local/lib/emacs/src} | ||
| 650 | directory. The order depends on which file you are in and which tags | ||
| 651 | table mentions that file, as explained above. | ||
| 652 | |||
| 653 | Do not set both @code{tags-file-name} and @code{tags-table-list}. | ||
| 654 | |||
| 655 | @node Find Tag | ||
| 656 | @subsection Finding a Tag | ||
| 657 | |||
| 658 | The most important thing that a tags table enables you to do is to find | ||
| 659 | the definition of a specific tag. | ||
| 660 | |||
| 661 | @table @kbd | ||
| 662 | @item M-.@: @var{tag} @key{RET} | ||
| 663 | Find first definition of @var{tag} (@code{find-tag}). | ||
| 664 | @item C-u M-. | ||
| 665 | Find next alternate definition of last tag specified. | ||
| 666 | @item C-u - M-. | ||
| 667 | Go back to previous tag found. | ||
| 668 | @item C-M-. @var{pattern} @key{RET} | ||
| 669 | Find a tag whose name matches @var{pattern} (@code{find-tag-regexp}). | ||
| 670 | @item C-u C-M-. | ||
| 671 | Find the next tag whose name matches the last pattern used. | ||
| 672 | @item C-x 4 .@: @var{tag} @key{RET} | ||
| 673 | Find first definition of @var{tag}, but display it in another window | ||
| 674 | (@code{find-tag-other-window}). | ||
| 675 | @item C-x 5 .@: @var{tag} @key{RET} | ||
| 676 | Find first definition of @var{tag}, and create a new frame to select the | ||
| 677 | buffer (@code{find-tag-other-frame}). | ||
| 678 | @item M-* | ||
| 679 | Pop back to where you previously invoked @kbd{M-.} and friends. | ||
| 680 | @end table | ||
| 681 | |||
| 682 | @kindex M-. | ||
| 683 | @findex find-tag | ||
| 684 | @kbd{M-.}@: (@code{find-tag}) is the command to find the definition of | ||
| 685 | a specified tag. It searches through the tags table for that tag, as a | ||
| 686 | string, and then uses the tags table info to determine the file that the | ||
| 687 | definition is in and the approximate character position in the file of | ||
| 688 | the definition. Then @code{find-tag} visits that file, moves point to | ||
| 689 | the approximate character position, and searches ever-increasing | ||
| 690 | distances away to find the tag definition. | ||
| 691 | |||
| 692 | If an empty argument is given (just type @key{RET}), the balanced | ||
| 693 | expression in the buffer before or around point is used as the | ||
| 694 | @var{tag} argument. @xref{Expressions}. | ||
| 695 | |||
| 696 | You don't need to give @kbd{M-.} the full name of the tag; a part | ||
| 697 | will do. This is because @kbd{M-.} finds tags in the table which | ||
| 698 | contain @var{tag} as a substring. However, it prefers an exact match | ||
| 699 | to a substring match. To find other tags that match the same | ||
| 700 | substring, give @code{find-tag} a numeric argument, as in @kbd{C-u | ||
| 701 | M-.}; this does not read a tag name, but continues searching the tags | ||
| 702 | table's text for another tag containing the same substring last used. | ||
| 703 | If you have a real @key{META} key, @kbd{M-0 M-.}@: is an easier | ||
| 704 | alternative to @kbd{C-u M-.}. | ||
| 705 | |||
| 706 | @kindex C-x 4 . | ||
| 707 | @findex find-tag-other-window | ||
| 708 | @kindex C-x 5 . | ||
| 709 | @findex find-tag-other-frame | ||
| 710 | Like most commands that can switch buffers, @code{find-tag} has a | ||
| 711 | variant that displays the new buffer in another window, and one that | ||
| 712 | makes a new frame for it. The former is @w{@kbd{C-x 4 .}}, which invokes | ||
| 713 | the command @code{find-tag-other-window}. The latter is @w{@kbd{C-x 5 .}}, | ||
| 714 | which invokes @code{find-tag-other-frame}. | ||
| 715 | |||
| 716 | To move back to places you've found tags recently, use @kbd{C-u - | ||
| 717 | M-.}; more generally, @kbd{M-.} with a negative numeric argument. This | ||
| 718 | command can take you to another buffer. @w{@kbd{C-x 4 .}} with a negative | ||
| 719 | argument finds the previous tag location in another window. | ||
| 720 | |||
| 721 | @kindex M-* | ||
| 722 | @findex pop-tag-mark | ||
| 723 | @vindex find-tag-marker-ring-length | ||
| 724 | As well as going back to places you've found tags recently, you can go | ||
| 725 | back to places @emph{from where} you found them. Use @kbd{M-*}, which | ||
| 726 | invokes the command @code{pop-tag-mark}, for this. Typically you would | ||
| 727 | find and study the definition of something with @kbd{M-.} and then | ||
| 728 | return to where you were with @kbd{M-*}. | ||
| 729 | |||
| 730 | Both @kbd{C-u - M-.} and @kbd{M-*} allow you to retrace your steps to | ||
| 731 | a depth determined by the variable @code{find-tag-marker-ring-length}. | ||
| 732 | |||
| 733 | @findex find-tag-regexp | ||
| 734 | @kindex C-M-. | ||
| 735 | The command @kbd{C-M-.} (@code{find-tag-regexp}) visits the tags that | ||
| 736 | match a specified regular expression. It is just like @kbd{M-.} except | ||
| 737 | that it does regexp matching instead of substring matching. | ||
| 738 | |||
| 739 | @node Tags Search | ||
| 740 | @subsection Searching and Replacing with Tags Tables | ||
| 741 | @cindex search and replace in multiple files | ||
| 742 | @cindex multiple-file search and replace | ||
| 743 | |||
| 744 | The commands in this section visit and search all the files listed | ||
| 745 | in the selected tags table, one by one. For these commands, the tags | ||
| 746 | table serves only to specify a sequence of files to search. These | ||
| 747 | commands scan the list of tags tables starting with the first tags | ||
| 748 | table (if any) that describes the current file, proceed from there to | ||
| 749 | the end of the list, and then scan from the beginning of the list | ||
| 750 | until they have covered all the tables in the list. | ||
| 751 | |||
| 752 | @table @kbd | ||
| 753 | @item M-x tags-search @key{RET} @var{regexp} @key{RET} | ||
| 754 | Search for @var{regexp} through the files in the selected tags | ||
| 755 | table. | ||
| 756 | @item M-x tags-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET} | ||
| 757 | Perform a @code{query-replace-regexp} on each file in the selected tags table. | ||
| 758 | @item M-, | ||
| 759 | Restart one of the commands above, from the current location of point | ||
| 760 | (@code{tags-loop-continue}). | ||
| 761 | @end table | ||
| 762 | |||
| 763 | @findex tags-search | ||
| 764 | @kbd{M-x tags-search} reads a regexp using the minibuffer, then | ||
| 765 | searches for matches in all the files in the selected tags table, one | ||
| 766 | file at a time. It displays the name of the file being searched so you | ||
| 767 | can follow its progress. As soon as it finds an occurrence, | ||
| 768 | @code{tags-search} returns. | ||
| 769 | |||
| 770 | @kindex M-, | ||
| 771 | @findex tags-loop-continue | ||
| 772 | Having found one match, you probably want to find all the rest. To find | ||
| 773 | one more match, type @kbd{M-,} (@code{tags-loop-continue}) to resume the | ||
| 774 | @code{tags-search}. This searches the rest of the current buffer, followed | ||
| 775 | by the remaining files of the tags table.@refill | ||
| 776 | |||
| 777 | @findex tags-query-replace | ||
| 778 | @kbd{M-x tags-query-replace} performs a single | ||
| 779 | @code{query-replace-regexp} through all the files in the tags table. It | ||
| 780 | reads a regexp to search for and a string to replace with, just like | ||
| 781 | ordinary @kbd{M-x query-replace-regexp}. It searches much like @kbd{M-x | ||
| 782 | tags-search}, but repeatedly, processing matches according to your | ||
| 783 | input. @xref{Replace}, for more information on query replace. | ||
| 784 | |||
| 785 | @vindex tags-case-fold-search | ||
| 786 | @cindex case-sensitivity and tags search | ||
| 787 | You can control the case-sensitivity of tags search commands by | ||
| 788 | customizing the value of the variable @code{tags-case-fold-search}. The | ||
| 789 | default is to use the same setting as the value of | ||
| 790 | @code{case-fold-search} (@pxref{Search Case}). | ||
| 791 | |||
| 792 | It is possible to get through all the files in the tags table with a | ||
| 793 | single invocation of @kbd{M-x tags-query-replace}. But often it is | ||
| 794 | useful to exit temporarily, which you can do with any input event that | ||
| 795 | has no special query replace meaning. You can resume the query replace | ||
| 796 | subsequently by typing @kbd{M-,}; this command resumes the last tags | ||
| 797 | search or replace command that you did. | ||
| 798 | |||
| 799 | The commands in this section carry out much broader searches than the | ||
| 800 | @code{find-tag} family. The @code{find-tag} commands search only for | ||
| 801 | definitions of tags that match your substring or regexp. The commands | ||
| 802 | @code{tags-search} and @code{tags-query-replace} find every occurrence | ||
| 803 | of the regexp, as ordinary search commands and replace commands do in | ||
| 804 | the current buffer. | ||
| 805 | |||
| 806 | These commands create buffers only temporarily for the files that they | ||
| 807 | have to search (those which are not already visited in Emacs buffers). | ||
| 808 | Buffers in which no match is found are quickly killed; the others | ||
| 809 | continue to exist. | ||
| 810 | |||
| 811 | It may have struck you that @code{tags-search} is a lot like | ||
| 812 | @code{grep}. You can also run @code{grep} itself as an inferior of | ||
| 813 | Emacs and have Emacs show you the matching lines one by one. | ||
| 814 | @xref{Grep Searching}. | ||
| 815 | |||
| 816 | @node List Tags | ||
| 817 | @subsection Tags Table Inquiries | ||
| 818 | |||
| 819 | @table @kbd | ||
| 820 | @item M-x list-tags @key{RET} @var{file} @key{RET} | ||
| 821 | Display a list of the tags defined in the program file @var{file}. | ||
| 822 | @item M-x tags-apropos @key{RET} @var{regexp} @key{RET} | ||
| 823 | Display a list of all tags matching @var{regexp}. | ||
| 824 | @end table | ||
| 825 | |||
| 826 | @findex list-tags | ||
| 827 | @kbd{M-x list-tags} reads the name of one of the files described by | ||
| 828 | the selected tags table, and displays a list of all the tags defined in | ||
| 829 | that file. The ``file name'' argument is really just a string to | ||
| 830 | compare against the file names recorded in the tags table; it is read as | ||
| 831 | a string rather than as a file name. Therefore, completion and | ||
| 832 | defaulting are not available, and you must enter the file name the same | ||
| 833 | way it appears in the tags table. Do not include a directory as part of | ||
| 834 | the file name unless the file name recorded in the tags table includes a | ||
| 835 | directory. | ||
| 836 | |||
| 837 | @findex tags-apropos | ||
| 838 | @vindex tags-apropos-verbose | ||
| 839 | @kbd{M-x tags-apropos} is like @code{apropos} for tags | ||
| 840 | (@pxref{Apropos}). It finds all the tags in the selected tags table | ||
| 841 | whose entries match @var{regexp}, and displays them. If the variable | ||
| 842 | @code{tags-apropos-verbose} is non-@code{nil}, it displays the names | ||
| 843 | of the tags files together with the tag names. | ||
| 844 | |||
| 845 | @vindex tags-tag-face | ||
| 846 | @vindex tags-apropos-additional-actions | ||
| 847 | You can customize the appearance of the output by setting the | ||
| 848 | variable @code{tags-tag-face} to a face. You can display additional | ||
| 849 | output with @kbd{M-x tags-apropos} by customizing the variable | ||
| 850 | @code{tags-apropos-additional-actions}---see its documentation for | ||
| 851 | details. | ||
| 852 | |||
| 853 | You can also use the collection of tag names to complete a symbol | ||
| 854 | name in the buffer. @xref{Symbol Completion}. | ||
| 855 | |||
| 856 | @ifnottex | ||
| 857 | @include emerge-xtra.texi | ||
| 858 | @end ifnottex | ||
| 859 | |||
| 860 | @ignore | ||
| 861 | arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb | ||
| 862 | @end ignore | ||
diff --git a/doc/emacs/major.texi b/doc/emacs/major.texi new file mode 100644 index 00000000000..1cb76ee5fdf --- /dev/null +++ b/doc/emacs/major.texi | |||
| @@ -0,0 +1,206 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Major Modes, Indentation, International, Top | ||
| 6 | @chapter Major Modes | ||
| 7 | @cindex major modes | ||
| 8 | @cindex mode, major | ||
| 9 | @kindex TAB @r{(and major modes)} | ||
| 10 | @kindex DEL @r{(and major modes)} | ||
| 11 | @kindex C-j @r{(and major modes)} | ||
| 12 | |||
| 13 | Emacs provides many alternative @dfn{major modes}, each of which | ||
| 14 | customizes Emacs for editing text of a particular sort. The major modes | ||
| 15 | are mutually exclusive, and each buffer has one major mode at any time. | ||
| 16 | The mode line normally shows the name of the current major mode, in | ||
| 17 | parentheses (@pxref{Mode Line}). | ||
| 18 | |||
| 19 | The least specialized major mode is called @dfn{Fundamental mode}. | ||
| 20 | This mode has no mode-specific redefinitions or variable settings, so | ||
| 21 | that each Emacs command behaves in its most general manner, and each | ||
| 22 | user option variable is in its default state. For editing text of a | ||
| 23 | specific type that Emacs knows about, such as Lisp code or English | ||
| 24 | text, you should switch to the appropriate major mode, such as Lisp | ||
| 25 | mode or Text mode. | ||
| 26 | |||
| 27 | Selecting a major mode changes the meanings of a few keys to become | ||
| 28 | more specifically adapted to the language being edited. The ones that | ||
| 29 | are changed frequently are @key{TAB}, @key{DEL}, and @kbd{C-j}. The | ||
| 30 | prefix key @kbd{C-c} normally contains mode-specific commands. In | ||
| 31 | addition, the commands which handle comments use the mode to determine | ||
| 32 | how comments are to be delimited. Many major modes redefine the | ||
| 33 | syntactical properties of characters appearing in the buffer. | ||
| 34 | @xref{Syntax}. | ||
| 35 | |||
| 36 | The major modes fall into three major groups. The first group | ||
| 37 | contains modes for normal text, either plain or with mark-up. It | ||
| 38 | includes Text mode, HTML mode, SGML mode, @TeX{} mode and Outline | ||
| 39 | mode. The second group contains modes for specific programming | ||
| 40 | languages. These include Lisp mode (which has several variants), C | ||
| 41 | mode, Fortran mode, and others. The remaining major modes are not | ||
| 42 | intended for use on users' files; they are used in buffers created for | ||
| 43 | specific purposes by Emacs, such as Dired mode for buffers made by | ||
| 44 | Dired (@pxref{Dired}), Mail mode for buffers made by @kbd{C-x m} | ||
| 45 | (@pxref{Sending Mail}), and Shell mode for buffers used for | ||
| 46 | communicating with an inferior shell process (@pxref{Interactive | ||
| 47 | Shell}). | ||
| 48 | |||
| 49 | Most programming-language major modes specify that only blank lines | ||
| 50 | separate paragraphs. This is to make the paragraph commands useful. | ||
| 51 | (@xref{Paragraphs}.) They also cause Auto Fill mode to use the | ||
| 52 | definition of @key{TAB} to indent the new lines it creates. This is | ||
| 53 | because most lines in a program are usually indented | ||
| 54 | (@pxref{Indentation}). | ||
| 55 | |||
| 56 | @menu | ||
| 57 | * Choosing Modes:: How major modes are specified or chosen. | ||
| 58 | @end menu | ||
| 59 | |||
| 60 | @node Choosing Modes,,Major Modes,Major Modes | ||
| 61 | @section How Major Modes are Chosen | ||
| 62 | |||
| 63 | @cindex choosing a major mode | ||
| 64 | You can select a major mode explicitly for the current buffer, but | ||
| 65 | most of the time Emacs determines which mode to use based on the file | ||
| 66 | name or on special text in the file. | ||
| 67 | |||
| 68 | To explicitly select a new major, you use an @kbd{M-x} command. | ||
| 69 | Take the name of a major mode and add @code{-mode} to get the name of | ||
| 70 | the command to select that mode. Thus, you can enter Lisp mode by | ||
| 71 | executing @kbd{M-x lisp-mode}. | ||
| 72 | |||
| 73 | @vindex auto-mode-alist | ||
| 74 | When you visit a file, Emacs usually chooses the right major mode based | ||
| 75 | on the file's name. For example, files whose names end in @samp{.c} are | ||
| 76 | edited in C mode. The correspondence between file names and major modes is | ||
| 77 | controlled by the variable @code{auto-mode-alist}. Its value is a list in | ||
| 78 | which each element has this form, | ||
| 79 | |||
| 80 | @example | ||
| 81 | (@var{regexp} . @var{mode-function}) | ||
| 82 | @end example | ||
| 83 | |||
| 84 | @noindent | ||
| 85 | or this form, | ||
| 86 | |||
| 87 | @example | ||
| 88 | (@var{regexp} @var{mode-function} @var{flag}) | ||
| 89 | @end example | ||
| 90 | |||
| 91 | @noindent | ||
| 92 | For example, one element normally found in the list has the form | ||
| 93 | @code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C | ||
| 94 | mode for files whose names end in @file{.c}. (Note that @samp{\\} is | ||
| 95 | needed in Lisp syntax to include a @samp{\} in the string, which must | ||
| 96 | be used to suppress the special meaning of @samp{.} in regexps.) If | ||
| 97 | the element has the form @code{(@var{regexp} @var{mode-function} | ||
| 98 | @var{flag})} and @var{flag} is non-@code{nil}, then after calling | ||
| 99 | @var{mode-function}, Emacs discards the suffix that matched | ||
| 100 | @var{regexp} and searches the list again for another match. | ||
| 101 | |||
| 102 | @vindex magic-mode-alist | ||
| 103 | Sometimes the major mode is determined from the way the file's text | ||
| 104 | begins. The variable @code{magic-mode-alist} controls this. Its value | ||
| 105 | is a list of elements of these forms: | ||
| 106 | |||
| 107 | @example | ||
| 108 | (@var{regexp} . @var{mode-function}) | ||
| 109 | (@var{match-function} . @var{mode-function}) | ||
| 110 | @end example | ||
| 111 | |||
| 112 | @noindent | ||
| 113 | The first form looks like an element of @code{auto-mode-alist}, but it | ||
| 114 | doesn't work the same: this @var{regexp} is matched against the text | ||
| 115 | at the start of the buffer, not against the file name. Likewise, the | ||
| 116 | second form calls @var{match-function} at the beginning of the buffer, | ||
| 117 | and if the function returns non-@code{nil}, the @var{mode-function} is | ||
| 118 | called. @code{magic-mode-alist} takes priority over | ||
| 119 | @code{auto-mode-alist}. | ||
| 120 | |||
| 121 | You can specify the major mode to use for editing a certain file by | ||
| 122 | special text in the first nonblank line of the file. The | ||
| 123 | mode name should appear in this line both preceded and followed by | ||
| 124 | @samp{-*-}. Other text may appear on the line as well. For example, | ||
| 125 | |||
| 126 | @example | ||
| 127 | ;-*-Lisp-*- | ||
| 128 | @end example | ||
| 129 | |||
| 130 | @noindent | ||
| 131 | tells Emacs to use Lisp mode. Such an explicit specification overrides | ||
| 132 | any defaults based on the file name. Note how the semicolon is used | ||
| 133 | to make Lisp treat this line as a comment. | ||
| 134 | |||
| 135 | Another format of mode specification is | ||
| 136 | |||
| 137 | @example | ||
| 138 | -*- mode: @var{modename};-*- | ||
| 139 | @end example | ||
| 140 | |||
| 141 | @noindent | ||
| 142 | which allows you to specify local variables as well, like this: | ||
| 143 | |||
| 144 | @example | ||
| 145 | -*- mode: @var{modename}; @var{var}: @var{value}; @dots{} -*- | ||
| 146 | @end example | ||
| 147 | |||
| 148 | @noindent | ||
| 149 | @xref{File Variables}, for more information about this. | ||
| 150 | |||
| 151 | @vindex auto-mode-case-fold | ||
| 152 | On systems with case-insensitive file names, only a single | ||
| 153 | case-insensitive search through the @code{auto-mode-alist} is made. | ||
| 154 | On other systems, Emacs normally performs a single case-sensitive | ||
| 155 | search through the alist, but if you set this variable to a | ||
| 156 | non-@code{nil} value, Emacs will perform a second case-insensitive | ||
| 157 | search if the first search fails. | ||
| 158 | |||
| 159 | @vindex interpreter-mode-alist | ||
| 160 | When a file's contents begin with @samp{#!}, it can serve as an | ||
| 161 | executable shell command, which works by running an interpreter named on | ||
| 162 | the file's first line. The rest of the file is used as input to the | ||
| 163 | interpreter. | ||
| 164 | |||
| 165 | When you visit such a file in Emacs, if the file's name does not | ||
| 166 | specify a major mode, Emacs uses the interpreter name on the first line | ||
| 167 | to choose a mode. If the first line is the name of a recognized | ||
| 168 | interpreter program, such as @samp{perl} or @samp{tcl}, Emacs uses a | ||
| 169 | mode appropriate for programs for that interpreter. The variable | ||
| 170 | @code{interpreter-mode-alist} specifies the correspondence between | ||
| 171 | interpreter program names and major modes. | ||
| 172 | |||
| 173 | When the first line starts with @samp{#!}, you cannot (on many | ||
| 174 | systems) use the @samp{-*-} feature on the first line, because the | ||
| 175 | system would get confused when running the interpreter. So Emacs looks | ||
| 176 | for @samp{-*-} on the second line in such files as well as on the | ||
| 177 | first line. | ||
| 178 | |||
| 179 | @vindex default-major-mode | ||
| 180 | When you visit a file that does not specify a major mode to use, or | ||
| 181 | when you create a new buffer with @kbd{C-x b}, the variable | ||
| 182 | @code{default-major-mode} specifies which major mode to use. Normally | ||
| 183 | its value is the symbol @code{fundamental-mode}, which specifies | ||
| 184 | Fundamental mode. If @code{default-major-mode} is @code{nil}, the major | ||
| 185 | mode is taken from the previously current buffer. | ||
| 186 | |||
| 187 | @findex normal-mode | ||
| 188 | If you change the major mode of a buffer, you can go back to the major | ||
| 189 | mode Emacs would choose automatically: use the command @kbd{M-x | ||
| 190 | normal-mode} to do this. This is the same function that | ||
| 191 | @code{find-file} calls to choose the major mode. It also processes | ||
| 192 | the file's @samp{-*-} line or local variables list (if any). | ||
| 193 | @xref{File Variables}. | ||
| 194 | |||
| 195 | @vindex change-major-mode-with-file-name | ||
| 196 | The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to | ||
| 197 | a new major mode if the new file name implies a mode (@pxref{Saving}). | ||
| 198 | (@kbd{C-x C-s} does this too, if the buffer wasn't visiting a file.) | ||
| 199 | However, this does not happen if the buffer contents specify a major | ||
| 200 | mode, and certain ``special'' major modes do not allow the mode to | ||
| 201 | change. You can turn off this mode-changing feature by setting | ||
| 202 | @code{change-major-mode-with-file-name} to @code{nil}. | ||
| 203 | |||
| 204 | @ignore | ||
| 205 | arch-tag: f2558800-cf32-4839-8acb-7d3b4df2a155 | ||
| 206 | @end ignore | ||
diff --git a/doc/emacs/makefile.w32-in b/doc/emacs/makefile.w32-in new file mode 100644 index 00000000000..e7185cd9c03 --- /dev/null +++ b/doc/emacs/makefile.w32-in | |||
| @@ -0,0 +1,144 @@ | |||
| 1 | #### -*- Makefile -*- for the Emacs Manual and other documentation. | ||
| 2 | |||
| 3 | # Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | # This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | # GNU Emacs is free software; you can redistribute it and/or modify | ||
| 8 | # it under the terms of the GNU General Public License as published by | ||
| 9 | # the Free Software Foundation; either version 3, or (at your option) | ||
| 10 | # any later version. | ||
| 11 | |||
| 12 | # GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | # GNU General Public License for more details. | ||
| 16 | |||
| 17 | # You should have received a copy of the GNU General Public License | ||
| 18 | # along with GNU Emacs; see the file COPYING. If not, write to | ||
| 19 | # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 20 | # Boston, MA 02110-1301, USA. | ||
| 21 | |||
| 22 | # Where to find the source code. The source code for Emacs's C kernel is | ||
| 23 | # expected to be in $(srcdir)/src, and the source code for Emacs's | ||
| 24 | # utility programs is expected to be in $(srcdir)/lib-src. This is | ||
| 25 | # set by the configure script's `--srcdir' option. | ||
| 26 | srcdir=. | ||
| 27 | |||
| 28 | infodir = $(srcdir)/../info | ||
| 29 | |||
| 30 | # The makeinfo program is part of the Texinfo distribution. | ||
| 31 | MAKEINFO = makeinfo --force | ||
| 32 | MULTI_INSTALL_INFO = $(srcdir)\..\..\nt\multi-install-info.bat | ||
| 33 | INFO_TARGETS = $(infodir)/emacs | ||
| 34 | DVI_TARGETS = emacs.dvi | ||
| 35 | INFOSOURCES = info.texi | ||
| 36 | |||
| 37 | # The following rule does not work with all versions of `make'. | ||
| 38 | .SUFFIXES: .texi .dvi | ||
| 39 | .texi.dvi: | ||
| 40 | texi2dvi $< | ||
| 41 | |||
| 42 | TEXI2DVI = texi2dvi | ||
| 43 | ENVADD = $(srcdir)\..\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" \ | ||
| 44 | "MAKEINFO=$(MAKEINFO) -I$(srcdir)" /C | ||
| 45 | |||
| 46 | EMACS_XTRA=\ | ||
| 47 | $(srcdir)/arevert-xtra.texi \ | ||
| 48 | $(srcdir)/cal-xtra.texi \ | ||
| 49 | $(srcdir)/dired-xtra.texi \ | ||
| 50 | $(srcdir)/picture-xtra.texi \ | ||
| 51 | $(srcdir)/emerge-xtra.texi \ | ||
| 52 | $(srcdir)/vc-xtra.texi \ | ||
| 53 | $(srcdir)/vc1-xtra.texi \ | ||
| 54 | $(srcdir)/vc2-xtra.texi \ | ||
| 55 | $(srcdir)/fortran-xtra.texi \ | ||
| 56 | $(srcdir)/msdog-xtra.texi | ||
| 57 | |||
| 58 | EMACSSOURCES= \ | ||
| 59 | $(srcdir)/emacs.texi \ | ||
| 60 | $(srcdir)/doclicense.texi \ | ||
| 61 | $(srcdir)/screen.texi \ | ||
| 62 | $(srcdir)/commands.texi \ | ||
| 63 | $(srcdir)/entering.texi \ | ||
| 64 | $(srcdir)/basic.texi \ | ||
| 65 | $(srcdir)/mini.texi \ | ||
| 66 | $(srcdir)/m-x.texi \ | ||
| 67 | $(srcdir)/help.texi \ | ||
| 68 | $(srcdir)/mark.texi \ | ||
| 69 | $(srcdir)/killing.texi \ | ||
| 70 | $(srcdir)/regs.texi \ | ||
| 71 | $(srcdir)/display.texi \ | ||
| 72 | $(srcdir)/search.texi \ | ||
| 73 | $(srcdir)/fixit.texi \ | ||
| 74 | $(srcdir)/files.texi \ | ||
| 75 | $(srcdir)/buffers.texi \ | ||
| 76 | $(srcdir)/windows.texi \ | ||
| 77 | $(srcdir)/frames.texi \ | ||
| 78 | $(srcdir)/mule.texi \ | ||
| 79 | $(srcdir)/major.texi \ | ||
| 80 | $(srcdir)/indent.texi \ | ||
| 81 | $(srcdir)/text.texi \ | ||
| 82 | $(srcdir)/programs.texi \ | ||
| 83 | $(srcdir)/building.texi \ | ||
| 84 | $(srcdir)/maintaining.texi \ | ||
| 85 | $(srcdir)/abbrevs.texi \ | ||
| 86 | $(srcdir)/sending.texi \ | ||
| 87 | $(srcdir)/rmail.texi \ | ||
| 88 | $(srcdir)/dired.texi \ | ||
| 89 | $(srcdir)/calendar.texi \ | ||
| 90 | $(srcdir)/misc.texi \ | ||
| 91 | $(srcdir)/custom.texi \ | ||
| 92 | $(srcdir)/trouble.texi \ | ||
| 93 | $(srcdir)/cmdargs.texi \ | ||
| 94 | $(srcdir)/xresources.texi \ | ||
| 95 | $(srcdir)/anti.texi \ | ||
| 96 | $(srcdir)/macos.texi \ | ||
| 97 | $(srcdir)/msdog.texi \ | ||
| 98 | $(srcdir)/gnu.texi \ | ||
| 99 | $(srcdir)/glossary.texi \ | ||
| 100 | $(srcdir)/ack.texi \ | ||
| 101 | $(srcdir)/kmacro.texi \ | ||
| 102 | $(EMACS_XTRA) | ||
| 103 | |||
| 104 | info: $(INFO_TARGETS) | ||
| 105 | |||
| 106 | dvi: $(DVI_TARGETS) | ||
| 107 | |||
| 108 | # Note that all the Info targets build the Info files | ||
| 109 | # in srcdir. There is no provision for Info files | ||
| 110 | # to exist in the build directory. | ||
| 111 | # In a distribution of Emacs, the Info files should be up to date. | ||
| 112 | |||
| 113 | $(infodir)/dir: | ||
| 114 | $(MULTI_INSTALL_INFO) --info-dir=$(infodir) $(INFO_TARGETS) | ||
| 115 | |||
| 116 | $(infodir)/emacs: $(EMACSSOURCES) | ||
| 117 | $(MAKEINFO) emacs.texi | ||
| 118 | |||
| 119 | emacs.dvi: $(EMACSSOURCES) | ||
| 120 | $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs.texi | ||
| 121 | |||
| 122 | emacs-xtra.dvi: emacs-xtra.texi $(EMACS_XTRA) | ||
| 123 | $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi | ||
| 124 | |||
| 125 | mostlyclean: | ||
| 126 | - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.* | ||
| 127 | |||
| 128 | clean: mostlyclean | ||
| 129 | - $(DEL) *.dvi | ||
| 130 | - $(DEL) $(infodir)/emacs* | ||
| 131 | |||
| 132 | distclean: clean | ||
| 133 | |||
| 134 | maintainer-clean: distclean | ||
| 135 | - $(DEL) *.aux *.cps *.fns *.kys *.pgs *.vrs *.toc | ||
| 136 | # Don't delete these, because they are outside the current directory. | ||
| 137 | # for file in $(INFO_TARGETS); do rm -f $${file}*; done | ||
| 138 | |||
| 139 | |||
| 140 | # Formerly this directory had texindex.c and getopt.c in it | ||
| 141 | # and this makefile built them to make texindex. | ||
| 142 | # That caused trouble because this is run entirely in the source directory. | ||
| 143 | # Since we expect to get texi2dvi from elsewhere, | ||
| 144 | # it is ok to expect texindex from elsewhere also. | ||
diff --git a/doc/emacs/mark.texi b/doc/emacs/mark.texi new file mode 100644 index 00000000000..be446ab6bfc --- /dev/null +++ b/doc/emacs/mark.texi | |||
| @@ -0,0 +1,452 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Mark, Killing, Help, Top | ||
| 6 | @chapter The Mark and the Region | ||
| 7 | @cindex mark | ||
| 8 | @cindex setting a mark | ||
| 9 | @cindex region | ||
| 10 | |||
| 11 | Many Emacs commands operate on an arbitrary contiguous part of the | ||
| 12 | current buffer. To specify the text for such a command to operate on, | ||
| 13 | you set @dfn{the mark} at one end of it, and move point to the other | ||
| 14 | end. The text between point and the mark is called @dfn{the region}. | ||
| 15 | Emacs highlights the region whenever there is one, if you enable | ||
| 16 | Transient Mark mode (@pxref{Transient Mark}). | ||
| 17 | |||
| 18 | Certain Emacs commands set the mark; other editing commands do not | ||
| 19 | affect it, so the mark remains where you set it last. Each Emacs | ||
| 20 | buffer has its own mark, and setting the mark in one buffer has no | ||
| 21 | effect on other buffers' marks. When you return to a buffer that was | ||
| 22 | current earlier, its mark is at the same place as before. | ||
| 23 | |||
| 24 | The ends of the region are always point and the mark. It doesn't | ||
| 25 | matter which of them was put in its current place first, or which one | ||
| 26 | comes earlier in the text---the region starts from point or the mark | ||
| 27 | (whichever comes first), and ends at point or the mark (whichever | ||
| 28 | comes last). Every time you move point, or set the mark in a new | ||
| 29 | place, the region changes. | ||
| 30 | |||
| 31 | Many commands that insert text, such as @kbd{C-y} (@code{yank}) and | ||
| 32 | @kbd{M-x insert-buffer}, position point and the mark at opposite ends | ||
| 33 | of the inserted text, so that the region consists of the text just | ||
| 34 | inserted. | ||
| 35 | |||
| 36 | Aside from delimiting the region, the mark is also useful for | ||
| 37 | remembering a spot that you may want to go back to. To make this | ||
| 38 | feature more useful, each buffer remembers 16 previous locations of the | ||
| 39 | mark in the @dfn{mark ring}. | ||
| 40 | |||
| 41 | @menu | ||
| 42 | * Setting Mark:: Commands to set the mark. | ||
| 43 | * Transient Mark:: How to make Emacs highlight the region-- | ||
| 44 | when there is one. | ||
| 45 | * Momentary Mark:: Enabling Transient Mark mode momentarily. | ||
| 46 | * Using Region:: Summary of ways to operate on contents of the region. | ||
| 47 | * Marking Objects:: Commands to put region around textual units. | ||
| 48 | * Mark Ring:: Previous mark positions saved so you can go back there. | ||
| 49 | * Global Mark Ring:: Previous mark positions in various buffers. | ||
| 50 | @end menu | ||
| 51 | |||
| 52 | @node Setting Mark | ||
| 53 | @section Setting the Mark | ||
| 54 | |||
| 55 | Here are some commands for setting the mark: | ||
| 56 | |||
| 57 | @table @kbd | ||
| 58 | @item C-@key{SPC} | ||
| 59 | Set the mark where point is (@code{set-mark-command}). | ||
| 60 | @item C-@@ | ||
| 61 | The same. | ||
| 62 | @item C-x C-x | ||
| 63 | Interchange mark and point (@code{exchange-point-and-mark}). | ||
| 64 | @item Drag-Mouse-1 | ||
| 65 | Set point and the mark around the text you drag across. | ||
| 66 | @item Mouse-3 | ||
| 67 | Set the mark where point is, then move point to where you click | ||
| 68 | (@code{mouse-save-then-kill}). | ||
| 69 | @end table | ||
| 70 | |||
| 71 | For example, suppose you wish to convert part of the buffer to | ||
| 72 | upper case, using the @kbd{C-x C-u} (@code{upcase-region}) command, | ||
| 73 | which operates on the text in the region. You can first go to the | ||
| 74 | beginning of the text to be capitalized, type @kbd{C-@key{SPC}} to put | ||
| 75 | the mark there, move to the end, and then type @kbd{C-x C-u}. Or, you | ||
| 76 | can set the mark at the end of the text, move to the beginning, and then | ||
| 77 | type @kbd{C-x C-u}. | ||
| 78 | |||
| 79 | @kindex C-SPC | ||
| 80 | @findex set-mark-command | ||
| 81 | The most common way to set the mark is with the @kbd{C-@key{SPC}} command | ||
| 82 | (@code{set-mark-command}). This sets the mark where point is. Then you | ||
| 83 | can move point away, leaving the mark behind. | ||
| 84 | |||
| 85 | There are two ways to set the mark with the mouse. You can drag mouse | ||
| 86 | button one across a range of text; that puts point where you release the | ||
| 87 | mouse button, and sets the mark at the other end of that range. Or you | ||
| 88 | can click mouse button three, which sets the mark at point (like | ||
| 89 | @kbd{C-@key{SPC}}) and then moves point where you clicked (like | ||
| 90 | @kbd{Mouse-1}). | ||
| 91 | |||
| 92 | Using the mouse to mark a region copies the region into the kill | ||
| 93 | ring in addition to setting the mark; that gives behavior consistent | ||
| 94 | with other window-driven applications. If you don't want to modify | ||
| 95 | the kill ring, you must use keyboard commands to set the mark. | ||
| 96 | @xref{Mouse Commands}. | ||
| 97 | |||
| 98 | @kindex C-x C-x | ||
| 99 | @findex exchange-point-and-mark | ||
| 100 | When Emacs was developed, terminals had only one cursor, so Emacs | ||
| 101 | does not show where the mark is located--you have to remember. If you | ||
| 102 | enable Transient Mark mode (see below), then the region is highlighted | ||
| 103 | when it is active; you can tell mark is at the other end of the | ||
| 104 | highlighted region. But this only applies when the mark is active. | ||
| 105 | |||
| 106 | The usual solution to this problem is to set the mark and then use | ||
| 107 | it soon, before you forget where it is. Alternatively, you can see | ||
| 108 | where the mark is with the command @kbd{C-x C-x} | ||
| 109 | (@code{exchange-point-and-mark}) which puts the mark where point was | ||
| 110 | and point where the mark was. The extent of the region is unchanged, | ||
| 111 | but the cursor and point are now at the previous position of the mark. | ||
| 112 | In Transient Mark mode, this command also reactivates the mark. | ||
| 113 | |||
| 114 | @kbd{C-x C-x} is also useful when you are satisfied with the position | ||
| 115 | of point but want to move the other end of the region (where the mark | ||
| 116 | is); do @kbd{C-x C-x} to put point at that end of the region, and then | ||
| 117 | move it. Using @kbd{C-x C-x} a second time, if necessary, puts the mark at | ||
| 118 | the new position with point back at its original position. | ||
| 119 | |||
| 120 | For more facilities that allow you to go to previously set marks, see | ||
| 121 | @ref{Mark Ring}. | ||
| 122 | |||
| 123 | @kindex C-@@ | ||
| 124 | There is no such character as @kbd{C-@key{SPC}} in @acronym{ASCII}; | ||
| 125 | when you type @key{SPC} while holding down @key{CTRL} on a text | ||
| 126 | terminal, what you get is the character @kbd{C-@@}. This key is also | ||
| 127 | bound to @code{set-mark-command}--so unless you are unlucky enough to | ||
| 128 | have a text terminal where typing @kbd{C-@key{SPC}} does not produce | ||
| 129 | @kbd{C-@@}, you might as well think of this character as | ||
| 130 | @kbd{C-@key{SPC}}. | ||
| 131 | |||
| 132 | @node Transient Mark | ||
| 133 | @section Transient Mark Mode | ||
| 134 | @cindex mode, Transient Mark | ||
| 135 | @cindex Transient Mark mode | ||
| 136 | @cindex highlighting region | ||
| 137 | @cindex region highlighting | ||
| 138 | |||
| 139 | On a terminal that supports colors, Emacs has the ability to | ||
| 140 | highlight the current region. But normally it does not. Why not? | ||
| 141 | |||
| 142 | In the normal mode of use, every command that sets the mark also | ||
| 143 | activates it, and nothing ever deactivates it. Thus, once you have | ||
| 144 | set the mark in a buffer, there is @emph{always} a region in that | ||
| 145 | buffer. Highlighting the region all the time would be a nuisance. So | ||
| 146 | normally Emacs highlights the region only immediately after you have | ||
| 147 | selected one with the mouse. | ||
| 148 | |||
| 149 | If you want region highlighting, you can use Transient Mark mode. | ||
| 150 | This is a more rigid mode of operation in which the region ``lasts'' | ||
| 151 | only until you use it; operating on the region text deactivates the | ||
| 152 | mark, so there is no region any more. Therefore, you must explicitly | ||
| 153 | set up a region for each command that uses one. | ||
| 154 | |||
| 155 | When Transient Mark mode is enabled, Emacs highlights the region, | ||
| 156 | whenever there is a region. In Transient Mark mode, most of the time | ||
| 157 | there is no region; therefore, highlighting the region when it exists | ||
| 158 | is useful and not annoying. | ||
| 159 | |||
| 160 | @findex transient-mark-mode | ||
| 161 | To enable Transient Mark mode, type @kbd{M-x transient-mark-mode}. | ||
| 162 | This command toggles the mode; you can use the same command to turn | ||
| 163 | the mode off again. | ||
| 164 | |||
| 165 | Here are the details of Transient Mark mode: | ||
| 166 | |||
| 167 | @itemize @bullet | ||
| 168 | @item | ||
| 169 | To set the mark, type @kbd{C-@key{SPC}} (@code{set-mark-command}). | ||
| 170 | This makes the mark active and thus begins highlighting of the region. | ||
| 171 | As you move point, you will see the highlighted region grow and | ||
| 172 | shrink. | ||
| 173 | |||
| 174 | @item | ||
| 175 | The mouse commands for specifying the mark also make it active. So do | ||
| 176 | keyboard commands whose purpose is to specify a region, including | ||
| 177 | @kbd{M-@@}, @kbd{C-M-@@}, @kbd{M-h}, @kbd{C-M-h}, @kbd{C-x C-p}, and | ||
| 178 | @kbd{C-x h}. | ||
| 179 | |||
| 180 | @item | ||
| 181 | You can tell that the mark is active because the region is highlighted. | ||
| 182 | |||
| 183 | @item | ||
| 184 | When the mark is active, you can execute commands that operate on the | ||
| 185 | region, such as killing, indenting, or writing to a file. | ||
| 186 | |||
| 187 | @item | ||
| 188 | Any change to the buffer, such as inserting or deleting a character, | ||
| 189 | deactivates the mark. This means any subsequent command that operates | ||
| 190 | on a region will get an error and refuse to operate. You can make the | ||
| 191 | region active again by typing @kbd{C-x C-x}. | ||
| 192 | |||
| 193 | @item | ||
| 194 | If Delete Selection mode is also enabled, some commands delete the | ||
| 195 | region when used while the mark is active. @xref{Mouse Commands}. | ||
| 196 | |||
| 197 | @item | ||
| 198 | Quitting with @kbd{C-g} deactivates the mark. | ||
| 199 | |||
| 200 | @item | ||
| 201 | Commands like @kbd{M->} and @kbd{C-s}, that ``leave the mark behind'' in | ||
| 202 | addition to some other primary purpose, do not activate the new mark. | ||
| 203 | You can activate the new region by executing @kbd{C-x C-x} | ||
| 204 | (@code{exchange-point-and-mark}). | ||
| 205 | |||
| 206 | @item | ||
| 207 | Commands that normally set the mark before moving long distances (like | ||
| 208 | @kbd{M-<} and @kbd{C-s}) do not alter the mark in Transient Mark mode | ||
| 209 | when the mark is active. | ||
| 210 | |||
| 211 | @item | ||
| 212 | Some commands operate on the region if a region is active. For | ||
| 213 | instance, @kbd{C-x u} in Transient Mark mode operates on the region, | ||
| 214 | when there is a region. (Outside Transient Mark mode, you must type | ||
| 215 | @kbd{C-u C-x u} if you want it to operate on the region.) | ||
| 216 | @xref{Undo}. Other commands that act this way are identified in their | ||
| 217 | own documentation. | ||
| 218 | @end itemize | ||
| 219 | |||
| 220 | The highlighting of the region uses the @code{region} face; you can | ||
| 221 | customize the appearance of the highlighted region by changing this | ||
| 222 | face. @xref{Face Customization}. | ||
| 223 | |||
| 224 | @vindex highlight-nonselected-windows | ||
| 225 | When multiple windows show the same buffer, they can have different | ||
| 226 | regions, because they can have different values of point (though they | ||
| 227 | all share one common mark position). Ordinarily, only the selected | ||
| 228 | window highlights its region (@pxref{Windows}). However, if the | ||
| 229 | variable @code{highlight-nonselected-windows} is non-@code{nil}, then | ||
| 230 | each window highlights its own region (provided that Transient Mark mode | ||
| 231 | is enabled and the mark in the window's buffer is active). | ||
| 232 | |||
| 233 | @vindex mark-even-if-inactive | ||
| 234 | If the variable @code{mark-even-if-inactive} is non-@code{nil} in | ||
| 235 | Transient Mark mode, then commands can use the mark and the region | ||
| 236 | even when it is inactive. Region highlighting appears and disappears | ||
| 237 | just as it normally does in Transient Mark mode, but the mark doesn't | ||
| 238 | really go away when the highlighting disappears, so you can still use | ||
| 239 | region commands. | ||
| 240 | |||
| 241 | @cindex Zmacs mode | ||
| 242 | Transient Mark mode is also sometimes known as ``Zmacs mode'' | ||
| 243 | because the Zmacs editor on the MIT Lisp Machine handled the mark in a | ||
| 244 | similar way. | ||
| 245 | |||
| 246 | @node Momentary Mark | ||
| 247 | @section Using Transient Mark Mode Momentarily | ||
| 248 | |||
| 249 | If you don't like Transient Mark mode in general, you might still | ||
| 250 | want to use it once in a while. To do this, type @kbd{C-@key{SPC} | ||
| 251 | C-@key{SPC}} or @kbd{C-u C-x C-x}. These commands set or activate the | ||
| 252 | mark, and enable Transient Mark mode only until the mark is | ||
| 253 | deactivated. | ||
| 254 | |||
| 255 | @table @kbd | ||
| 256 | @item C-@key{SPC} C-@key{SPC} | ||
| 257 | @kindex C-@key{SPC} C-@key{SPC} | ||
| 258 | Set the mark at point (like plain @kbd{C-@key{SPC}}), and enable | ||
| 259 | Transient Mark mode just once until the mark is deactivated. (This is | ||
| 260 | not really a separate command; you are using the @kbd{C-@key{SPC}} | ||
| 261 | command twice.) | ||
| 262 | |||
| 263 | @item C-u C-x C-x | ||
| 264 | @kindex C-u C-x C-x | ||
| 265 | Activate the mark without changing it; enable Transient Mark mode just | ||
| 266 | once, until the mark is deactivated. (This is the @kbd{C-x C-x} | ||
| 267 | command, @code{exchange-point-and-mark}, with a prefix argument.) | ||
| 268 | @end table | ||
| 269 | |||
| 270 | One of the secondary features of Transient Mark mode is that certain | ||
| 271 | commands operate only on the region, when there is an active region. | ||
| 272 | If you don't use Transient Mark mode, the region once set never | ||
| 273 | becomes inactive, so there is no way for these commands to make such a | ||
| 274 | distinction. Enabling Transient Mark mode momentarily gives you a way | ||
| 275 | to use these commands on the region. | ||
| 276 | |||
| 277 | Momentary use of Transient Mark mode is also a way to highlight the | ||
| 278 | region for the time being. | ||
| 279 | |||
| 280 | @node Using Region | ||
| 281 | @section Operating on the Region | ||
| 282 | |||
| 283 | @cindex operations on a marked region | ||
| 284 | Once you have a region and the mark is active, here are some of the | ||
| 285 | ways you can operate on the region: | ||
| 286 | |||
| 287 | @itemize @bullet | ||
| 288 | @item | ||
| 289 | Kill it with @kbd{C-w} (@pxref{Killing}). | ||
| 290 | @item | ||
| 291 | Save it in a register with @kbd{C-x r s} (@pxref{Registers}). | ||
| 292 | @item | ||
| 293 | Save it in a buffer or a file (@pxref{Accumulating Text}). | ||
| 294 | @item | ||
| 295 | Convert case with @kbd{C-x C-l} or @kbd{C-x C-u} (@pxref{Case}). | ||
| 296 | @item | ||
| 297 | Indent it with @kbd{C-x @key{TAB}} or @kbd{C-M-\} (@pxref{Indentation}). | ||
| 298 | @item | ||
| 299 | Fill it as text with @kbd{M-x fill-region} (@pxref{Filling}). | ||
| 300 | @item | ||
| 301 | Print hardcopy with @kbd{M-x print-region} (@pxref{Printing}). | ||
| 302 | @item | ||
| 303 | Evaluate it as Lisp code with @kbd{M-x eval-region} (@pxref{Lisp Eval}). | ||
| 304 | @item | ||
| 305 | Undo changes within it using @kbd{C-u C-x u} (@pxref{Undo}). | ||
| 306 | @end itemize | ||
| 307 | |||
| 308 | Most commands that operate on the text in the region have the word | ||
| 309 | @code{region} in their names. | ||
| 310 | |||
| 311 | @node Marking Objects | ||
| 312 | @section Commands to Mark Textual Objects | ||
| 313 | |||
| 314 | @cindex marking sections of text | ||
| 315 | Here are the commands for placing point and the mark around a textual | ||
| 316 | object such as a word, list, paragraph or page. | ||
| 317 | |||
| 318 | @table @kbd | ||
| 319 | @item M-@@ | ||
| 320 | Set mark after end of next word (@code{mark-word}). This command and | ||
| 321 | the following one do not move point. | ||
| 322 | @item C-M-@@ | ||
| 323 | Set mark after end of following balanced expression (@code{mark-sexp}). | ||
| 324 | @item M-h | ||
| 325 | Put region around current paragraph (@code{mark-paragraph}). | ||
| 326 | @item C-M-h | ||
| 327 | Put region around current defun (@code{mark-defun}). | ||
| 328 | @item C-x h | ||
| 329 | Put region around the entire buffer (@code{mark-whole-buffer}). | ||
| 330 | @item C-x C-p | ||
| 331 | Put region around current page (@code{mark-page}). | ||
| 332 | @end table | ||
| 333 | |||
| 334 | @kbd{M-@@} (@code{mark-word}) puts the mark at the end of the next | ||
| 335 | word, while @kbd{C-M-@@} (@code{mark-sexp}) puts it at the end of the | ||
| 336 | next balanced expression (@pxref{Expressions}). These commands handle | ||
| 337 | arguments just like @kbd{M-f} and @kbd{C-M-f}. Repeating these | ||
| 338 | commands extends the region. For example, you can type either | ||
| 339 | @kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words. These | ||
| 340 | commands also extend the region in Transient Mark mode, regardless of | ||
| 341 | the last command. | ||
| 342 | |||
| 343 | @kindex C-x h | ||
| 344 | @findex mark-whole-buffer | ||
| 345 | Other commands set both point and mark, to delimit an object in the | ||
| 346 | buffer. For example, @kbd{M-h} (@code{mark-paragraph}) moves point to | ||
| 347 | the beginning of the paragraph that surrounds or follows point, and | ||
| 348 | puts the mark at the end of that paragraph (@pxref{Paragraphs}). It | ||
| 349 | prepares the region so you can indent, case-convert, or kill a whole | ||
| 350 | paragraph. With a prefix argument, if the argument's value is positive, | ||
| 351 | @kbd{M-h} marks that many paragraphs starting with the one surrounding | ||
| 352 | point. If the prefix argument is @minus{}@var{n}, @kbd{M-h} also | ||
| 353 | marks @var{n} paragraphs, running back form the one surrounding point. | ||
| 354 | In that last case, point moves forward to the end of that paragraph, | ||
| 355 | and the mark goes at the start of the region. Repeating the @kbd{M-h} | ||
| 356 | command extends the region to subsequent paragraphs. | ||
| 357 | |||
| 358 | @kbd{C-M-h} (@code{mark-defun}) similarly puts point before, and the | ||
| 359 | mark after, the current (or following) major top-level definition, or | ||
| 360 | defun (@pxref{Moving by Defuns}). Repeating @kbd{C-M-h} extends | ||
| 361 | the region to subsequent defuns. | ||
| 362 | |||
| 363 | @kbd{C-x C-p} (@code{mark-page}) puts point before the current page, | ||
| 364 | and mark at the end (@pxref{Pages}). The mark goes after the | ||
| 365 | terminating page delimiter (to include it in the region), while point | ||
| 366 | goes after the preceding page delimiter (to exclude it). A numeric | ||
| 367 | argument specifies a later page (if positive) or an earlier page (if | ||
| 368 | negative) instead of the current page. | ||
| 369 | |||
| 370 | Finally, @kbd{C-x h} (@code{mark-whole-buffer}) sets up the entire | ||
| 371 | buffer as the region, by putting point at the beginning and the mark at | ||
| 372 | the end. (In some programs this is called ``select all.'') | ||
| 373 | |||
| 374 | In Transient Mark mode, all of these commands activate the mark. | ||
| 375 | |||
| 376 | @node Mark Ring | ||
| 377 | @section The Mark Ring | ||
| 378 | |||
| 379 | @kindex C-u C-SPC | ||
| 380 | @cindex mark ring | ||
| 381 | @kindex C-u C-@@ | ||
| 382 | Aside from delimiting the region, the mark is also useful for | ||
| 383 | remembering a spot that you may want to go back to. To make this | ||
| 384 | feature more useful, each buffer remembers 16 previous locations of the | ||
| 385 | mark, in the @dfn{mark ring}. Commands that set the mark also push the | ||
| 386 | old mark onto this ring. To return to a marked location, use @kbd{C-u | ||
| 387 | C-@key{SPC}} (or @kbd{C-u C-@@}); this is the command | ||
| 388 | @code{set-mark-command} given a numeric argument. It moves point to | ||
| 389 | where the mark was, and restores the mark from the ring of former | ||
| 390 | marks. | ||
| 391 | |||
| 392 | @vindex set-mark-command-repeat-pop | ||
| 393 | If you set @code{set-mark-command-repeat-pop} to non-@code{nil}, | ||
| 394 | then when you repeat the character @kbd{C-@key{SPC}} after typing | ||
| 395 | @kbd{C-u C-@key{SPC}}, each repetition moves point to a previous mark | ||
| 396 | position from the ring. The mark positions you move through in this | ||
| 397 | way are not lost; they go to the end of the ring. | ||
| 398 | |||
| 399 | Each buffer has its own mark ring. All editing commands use the current | ||
| 400 | buffer's mark ring. In particular, @kbd{C-u C-@key{SPC}} always stays in | ||
| 401 | the same buffer. | ||
| 402 | |||
| 403 | Many commands that can move long distances, such as @kbd{M-<} | ||
| 404 | (@code{beginning-of-buffer}), start by setting the mark and saving the | ||
| 405 | old mark on the mark ring. This is to make it easier for you to move | ||
| 406 | back later. Searches set the mark if they move point. However, in | ||
| 407 | Transient Mark mode, these commands do not set the mark when the mark | ||
| 408 | is already active. You can tell when a command sets the mark because | ||
| 409 | it displays @samp{Mark set} in the echo area. | ||
| 410 | |||
| 411 | If you want to move back to the same place over and over, the mark | ||
| 412 | ring may not be convenient enough. If so, you can record the position | ||
| 413 | in a register for later retrieval (@pxref{RegPos,, Saving Positions in | ||
| 414 | Registers}). | ||
| 415 | |||
| 416 | @vindex mark-ring-max | ||
| 417 | The variable @code{mark-ring-max} specifies the maximum number of | ||
| 418 | entries to keep in the mark ring. If that many entries exist and | ||
| 419 | another one is pushed, the earliest one in the list is discarded. Repeating | ||
| 420 | @kbd{C-u C-@key{SPC}} cycles through the positions currently in the | ||
| 421 | ring. | ||
| 422 | |||
| 423 | @vindex mark-ring | ||
| 424 | The variable @code{mark-ring} holds the mark ring itself, as a list of | ||
| 425 | marker objects, with the most recent first. This variable is local in | ||
| 426 | every buffer. | ||
| 427 | |||
| 428 | @node Global Mark Ring | ||
| 429 | @section The Global Mark Ring | ||
| 430 | @cindex global mark ring | ||
| 431 | |||
| 432 | In addition to the ordinary mark ring that belongs to each buffer, | ||
| 433 | Emacs has a single @dfn{global mark ring}. It records a sequence of | ||
| 434 | buffers in which you have recently set the mark, so you can go back | ||
| 435 | to those buffers. | ||
| 436 | |||
| 437 | Setting the mark always makes an entry on the current buffer's mark | ||
| 438 | ring. If you have switched buffers since the previous mark setting, the | ||
| 439 | new mark position makes an entry on the global mark ring also. The | ||
| 440 | result is that the global mark ring records a sequence of buffers that | ||
| 441 | you have been in, and, for each buffer, a place where you set the mark. | ||
| 442 | |||
| 443 | @kindex C-x C-@key{SPC} | ||
| 444 | @findex pop-global-mark | ||
| 445 | The command @kbd{C-x C-@key{SPC}} (@code{pop-global-mark}) jumps to | ||
| 446 | the buffer and position of the latest entry in the global ring. It also | ||
| 447 | rotates the ring, so that successive uses of @kbd{C-x C-@key{SPC}} take | ||
| 448 | you to earlier and earlier buffers. | ||
| 449 | |||
| 450 | @ignore | ||
| 451 | arch-tag: f35e4d82-911b-4cfc-a3d7-3c87b2abba20 | ||
| 452 | @end ignore | ||
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi new file mode 100644 index 00000000000..b57e79420b6 --- /dev/null +++ b/doc/emacs/mini.texi | |||
| @@ -0,0 +1,580 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Minibuffer, M-x, Basic, Top | ||
| 6 | @chapter The Minibuffer | ||
| 7 | @cindex minibuffer | ||
| 8 | |||
| 9 | The @dfn{minibuffer} is where Emacs commands read complicated | ||
| 10 | arguments (anything more a single number). We call it the | ||
| 11 | ``minibuffer'' because it's a special-purpose buffer with a small | ||
| 12 | amount of screen space. Minibuffer arguments can be file names, | ||
| 13 | buffer names, Lisp function names, Emacs command names, Lisp | ||
| 14 | expressions, and many other things---whatever the command wants to | ||
| 15 | read. You can use the usual Emacs editing commands in the minibuffer | ||
| 16 | to edit the argument text. | ||
| 17 | |||
| 18 | @cindex prompt | ||
| 19 | When the minibuffer is in use, it appears in the echo area, with a | ||
| 20 | cursor. The minibuffer display starts with a @dfn{prompt} in a | ||
| 21 | distinct color; it says what kind of input is expected and how it will | ||
| 22 | be used. Often the prompt is derived from the name of the command | ||
| 23 | that is reading the argument. The prompt normally ends with a colon. | ||
| 24 | |||
| 25 | @cindex default argument | ||
| 26 | Sometimes a @dfn{default argument} appears in the prompt, inside | ||
| 27 | parentheses before the colon. The default will be used as the | ||
| 28 | argument value if you just type @key{RET}. For example, commands that | ||
| 29 | read buffer names show a buffer name as the default. You can type | ||
| 30 | @key{RET} to operate on that default buffer. | ||
| 31 | |||
| 32 | The simplest way to enter a minibuffer argument is to type the text, | ||
| 33 | then @key{RET} to exit the minibuffer. You can cancel the minibuffer, | ||
| 34 | and the command that wants the argument, by typing @kbd{C-g}. | ||
| 35 | |||
| 36 | Since the minibuffer appears in the echo area, it can conflict with | ||
| 37 | other uses of the echo area. Here is how Emacs handles such | ||
| 38 | conflicts: | ||
| 39 | |||
| 40 | @itemize @bullet | ||
| 41 | @item | ||
| 42 | An error occurs while the minibuffer is active. | ||
| 43 | |||
| 44 | The error message hides the minibuffer for a few seconds, or until you | ||
| 45 | type something. Then the minibuffer comes back. | ||
| 46 | |||
| 47 | @item | ||
| 48 | A command such as @kbd{C-x =} needs to display a message in the echo | ||
| 49 | area. | ||
| 50 | |||
| 51 | The message hides the minibuffer for a few seconds, or until you type | ||
| 52 | something. Then the minibuffer comes back. | ||
| 53 | |||
| 54 | @item | ||
| 55 | Keystrokes don't echo while the minibuffer is in use. | ||
| 56 | @end itemize | ||
| 57 | |||
| 58 | @menu | ||
| 59 | * File: Minibuffer File. Entering file names with the minibuffer. | ||
| 60 | * Edit: Minibuffer Edit. How to edit in the minibuffer. | ||
| 61 | * Completion:: An abbreviation facility for minibuffer input. | ||
| 62 | * Minibuffer History:: Reusing recent minibuffer arguments. | ||
| 63 | * Repetition:: Re-executing commands that used the minibuffer. | ||
| 64 | @end menu | ||
| 65 | |||
| 66 | @node Minibuffer File | ||
| 67 | @section Minibuffers for File Names | ||
| 68 | |||
| 69 | When you use the minibuffer to enter a file name, it starts out with | ||
| 70 | some initial text---the @dfn{default directory}, ending in a slash. | ||
| 71 | The file you specify will be in this directory unless you alter or | ||
| 72 | replace it. | ||
| 73 | |||
| 74 | @c Separate paragraph to clean up ugly page break--rms | ||
| 75 | @need 1500 | ||
| 76 | For example, if the minibuffer starts out with these contents: | ||
| 77 | |||
| 78 | @example | ||
| 79 | Find File: /u2/emacs/src/ | ||
| 80 | @end example | ||
| 81 | |||
| 82 | @noindent | ||
| 83 | (where @samp{Find File:@: } is the prompt), and you type | ||
| 84 | @kbd{buffer.c} as input, that specifies the file | ||
| 85 | @file{/u2/emacs/src/buffer.c}. You can specify the parent directory | ||
| 86 | by adding @file{..}; thus, if you type @kbd{../lisp/simple.el}, you | ||
| 87 | will get @file{/u2/emacs/lisp/simple.el}. Alternatively, you can use | ||
| 88 | @kbd{M-@key{DEL}} to kill the directory names you don't want | ||
| 89 | (@pxref{Words}). | ||
| 90 | |||
| 91 | You can kill the entire default with @kbd{C-a C-k}, but there's no | ||
| 92 | need to do that. It's easier to ignore the default, and enter an | ||
| 93 | absolute file name starting with a slash or a tilde after the default | ||
| 94 | directory. For example, to specify @file{/etc/termcap}, just type | ||
| 95 | that name: | ||
| 96 | |||
| 97 | @example | ||
| 98 | Find File: /u2/emacs/src//etc/termcap | ||
| 99 | @end example | ||
| 100 | |||
| 101 | @noindent | ||
| 102 | @cindex // in file name | ||
| 103 | @cindex double slash in file name | ||
| 104 | @cindex slashes repeated in file name | ||
| 105 | @findex file-name-shadow-mode | ||
| 106 | GNU Emacs interprets a double slash (which is not normally useful in | ||
| 107 | file names) as, ``ignore everything before the second slash in the | ||
| 108 | pair.'' In the example above. @samp{/u2/emacs/src/} is ignored, so | ||
| 109 | you get @file{/etc/termcap}. The ignored part of the file name is | ||
| 110 | dimmed if the terminal allows it; to disable this dimming, turn off | ||
| 111 | File Name Shadow mode (a minor mode) with the command | ||
| 112 | @kbd{M-x file-name-shadow-mode}. | ||
| 113 | |||
| 114 | If the variable @code{insert-default-directory} is @code{nil}, the | ||
| 115 | default directory is never inserted in the minibuffer---so the | ||
| 116 | minibuffer starts out empty. Nonetheless, relative file name | ||
| 117 | arguments are still interpreted based on the same default directory. | ||
| 118 | |||
| 119 | @node Minibuffer Edit | ||
| 120 | @section Editing in the Minibuffer | ||
| 121 | |||
| 122 | The minibuffer is an Emacs buffer (albeit a peculiar one), and the | ||
| 123 | usual Emacs commands are available for editing the argument text. | ||
| 124 | |||
| 125 | Since @key{RET} in the minibuffer is defined to exit the minibuffer, | ||
| 126 | you can't use it to insert a newline in the minibuffer. To do that, | ||
| 127 | type @kbd{C-o} or @kbd{C-q C-j}. (The newline character is really the | ||
| 128 | @acronym{ASCII} character control-J.) | ||
| 129 | |||
| 130 | The minibuffer has its own window, which normally has space in the | ||
| 131 | frame at all times, but it only acts like an Emacs window when the | ||
| 132 | minibuffer is active. When active, this window is much like any other | ||
| 133 | Emacs window; for instance, you can switch to another window (with | ||
| 134 | @kbd{C-x o}), edit text there, then return to the minibuffer window to | ||
| 135 | finish the argument. You can even kill text in another window, return | ||
| 136 | to the minibuffer window, and then yank the text into the argument. | ||
| 137 | @xref{Windows}. | ||
| 138 | |||
| 139 | @cindex height of minibuffer | ||
| 140 | @cindex size of minibuffer | ||
| 141 | @cindex growing minibuffer | ||
| 142 | @cindex resizing minibuffer | ||
| 143 | There are some restrictions on the minibuffer window, however: you | ||
| 144 | cannot kill it, or split it, or switch buffers in it---the minibuffer | ||
| 145 | and its window are permanently attached. | ||
| 146 | |||
| 147 | @vindex resize-mini-windows | ||
| 148 | The minibuffer window expands vertically as necessary to hold the | ||
| 149 | text that you put in the minibuffer. If @code{resize-mini-windows} is | ||
| 150 | @code{t} (the default), the window always resizes as needed by its | ||
| 151 | contents. If its value is the symbol @code{grow-only}, the window | ||
| 152 | grows automatically as needed, but shrinks (back to the normal size) | ||
| 153 | only when the minibuffer becomes inactive. If its value is | ||
| 154 | @code{nil}, you have to adjust the height yourself. | ||
| 155 | |||
| 156 | @vindex max-mini-window-height | ||
| 157 | The variable @code{max-mini-window-height} controls the maximum | ||
| 158 | height for resizing the minibuffer window: a floating-point number | ||
| 159 | specifies a fraction of the frame's height; an integer specifies the | ||
| 160 | maximum number of lines; @code{nil} means do not resize the minibuffer | ||
| 161 | window automatically. The default value is 0.25. | ||
| 162 | |||
| 163 | The @kbd{C-M-v} command in the minibuffer scrolls the help text from | ||
| 164 | commands that display help text of any sort in another window. | ||
| 165 | @kbd{M-@key{PAGEUP}} and @kbd{M-@key{PAGEDOWN}} also operate on that | ||
| 166 | help text. This is especially useful with long lists of possible | ||
| 167 | completions. @xref{Other Window}. | ||
| 168 | |||
| 169 | @vindex enable-recursive-minibuffers | ||
| 170 | Emacs normally disallows most commands that use the minibuffer while | ||
| 171 | the minibuffer is active. (Entering the minibuffer from the | ||
| 172 | minibuffer can be confusing.) To allow such commands in the | ||
| 173 | minibuffer, set the variable @code{enable-recursive-minibuffers} to | ||
| 174 | @code{t}. | ||
| 175 | |||
| 176 | @node Completion | ||
| 177 | @section Completion | ||
| 178 | @cindex completion | ||
| 179 | |||
| 180 | Some arguments allow @dfn{completion} to enter their value. This | ||
| 181 | means that after you type part of the argument, Emacs can fill in the | ||
| 182 | rest, or some of it, based on what you have typed so far. | ||
| 183 | |||
| 184 | When completion is available, certain keys---@key{TAB}, @key{RET}, | ||
| 185 | and @key{SPC}---are rebound to complete the text in the minibuffer | ||
| 186 | before point into a longer string chosen from a set of @dfn{completion | ||
| 187 | alternatives} provided by the command that requested the argument. | ||
| 188 | (@key{SPC} does not do completion in reading file names, because it is | ||
| 189 | common to use spaces in file names on some systems.) @kbd{?} displays | ||
| 190 | a list of the possible completions at any time. | ||
| 191 | |||
| 192 | For example, @kbd{M-x} uses the minibuffer to read the name of a | ||
| 193 | command, so it provides a list of all Emacs command names for | ||
| 194 | completion candidates. The completion keys match the minibuffer text | ||
| 195 | against these candidates, find any additional name characters implied | ||
| 196 | by the text already present in the minibuffer, and add those | ||
| 197 | characters. This makes it possible to type @kbd{M-x ins @key{SPC} b | ||
| 198 | @key{RET}} instead of @kbd{M-x insert-buffer @key{RET}}, for example. | ||
| 199 | |||
| 200 | Case is significant in completion when it is significant in the | ||
| 201 | argument you are entering (buffer names, file names, command names, | ||
| 202 | for instance). Thus, @samp{fo} does not complete to @samp{Foo}. | ||
| 203 | Completion ignores case distinctions for certain arguments in which | ||
| 204 | case does not matter. | ||
| 205 | |||
| 206 | Completion acts only on the text before point. If there is text in | ||
| 207 | the minibuffer after point---i.e., if you move point backward after | ||
| 208 | typing some text into the minibuffer---it remains unchanged. | ||
| 209 | |||
| 210 | @menu | ||
| 211 | * Example: Completion Example. Examples of using completion. | ||
| 212 | * Commands: Completion Commands. A list of completion commands. | ||
| 213 | * Strict Completion:: Different types of completion. | ||
| 214 | * Options: Completion Options. Options for completion. | ||
| 215 | @end menu | ||
| 216 | |||
| 217 | @node Completion Example | ||
| 218 | @subsection Completion Example | ||
| 219 | |||
| 220 | @kindex TAB @r{(completion)} | ||
| 221 | A concrete example may help here. If you type @kbd{M-x au | ||
| 222 | @key{TAB}}, the @key{TAB} looks for alternatives (in this case, | ||
| 223 | command names) that start with @samp{au}. There are several, | ||
| 224 | including @code{auto-fill-mode} and @code{auto-save-mode}, but they | ||
| 225 | all begin with @code{auto-}, so the @samp{au} in the minibuffer | ||
| 226 | completes to @samp{auto-}. | ||
| 227 | |||
| 228 | If you type @key{TAB} again immediately, it cannot determine the | ||
| 229 | next character; it could be any of @samp{cfilrs}. So it does not add | ||
| 230 | any characters; instead, @key{TAB} displays a list of all possible | ||
| 231 | completions in another window. | ||
| 232 | |||
| 233 | Now type @kbd{f @key{TAB}}. This @key{TAB} sees @samp{auto-f}. The | ||
| 234 | only command name starting with that is @code{auto-fill-mode}, so | ||
| 235 | completion fills in the rest of that. You have been able to enter | ||
| 236 | @samp{auto-fill-mode} by typing just @kbd{au @key{TAB} f @key{TAB}}. | ||
| 237 | |||
| 238 | @node Completion Commands | ||
| 239 | @subsection Completion Commands | ||
| 240 | |||
| 241 | Here is a list of the completion commands defined in the minibuffer | ||
| 242 | when completion is allowed. | ||
| 243 | |||
| 244 | @table @kbd | ||
| 245 | @item @key{TAB} | ||
| 246 | @findex minibuffer-complete | ||
| 247 | Complete the text before point in the minibuffer as much as possible | ||
| 248 | (@code{minibuffer-complete}). | ||
| 249 | @item @key{SPC} | ||
| 250 | Complete up to one word from the minibuffer text before point | ||
| 251 | (@code{minibuffer-complete-word}). @key{SPC} for completion is not | ||
| 252 | available when entering a file name, since file names often include | ||
| 253 | spaces. | ||
| 254 | @item @key{RET} | ||
| 255 | Submit the text in the minibuffer as the argument, possibly completing | ||
| 256 | first as described | ||
| 257 | @iftex | ||
| 258 | in the next subsection (@code{minibuffer-complete-and-exit}). | ||
| 259 | @end iftex | ||
| 260 | @ifnottex | ||
| 261 | in the next node (@code{minibuffer-complete-and-exit}). @xref{Strict | ||
| 262 | Completion}. | ||
| 263 | @end ifnottex | ||
| 264 | @item ? | ||
| 265 | Display a list of possible completions of the text before point | ||
| 266 | (@code{minibuffer-completion-help}). | ||
| 267 | @end table | ||
| 268 | |||
| 269 | @kindex SPC | ||
| 270 | @findex minibuffer-complete-word | ||
| 271 | @key{SPC} completes like @key{TAB}, but only up to the next hyphen | ||
| 272 | or space. If you have @samp{auto-f} in the minibuffer and type | ||
| 273 | @key{SPC}, it finds that the completion is @samp{auto-fill-mode}, but | ||
| 274 | it only inserts @samp{ill-}, giving @samp{auto-fill-}. Another | ||
| 275 | @key{SPC} at this point completes all the way to | ||
| 276 | @samp{auto-fill-mode}. The command that implements this behavior is | ||
| 277 | called @code{minibuffer-complete-word}. | ||
| 278 | |||
| 279 | When you display a list of possible completions, you can choose | ||
| 280 | one from it: | ||
| 281 | |||
| 282 | @table @kbd | ||
| 283 | @findex mouse-choose-completion | ||
| 284 | @item Mouse-1 | ||
| 285 | @itemx Mouse-2 | ||
| 286 | Clicking mouse button 1 or 2 on a completion possibility chooses that | ||
| 287 | completion (@code{mouse-choose-completion}). You must click in the | ||
| 288 | list of completions, not in the minibuffer. | ||
| 289 | |||
| 290 | @findex switch-to-completions | ||
| 291 | @item @key{PRIOR} | ||
| 292 | @itemx M-v | ||
| 293 | Typing @key{PRIOR} or @key{PAGE-UP}, or @kbd{M-v}, while in the | ||
| 294 | minibuffer, selects the window showing the completion list buffer | ||
| 295 | (@code{switch-to-completions}). This paves the way for using the | ||
| 296 | commands below. (Selecting that window in other ways has the same | ||
| 297 | effect.) | ||
| 298 | |||
| 299 | @findex choose-completion | ||
| 300 | @item @key{RET} | ||
| 301 | Typing @key{RET} @emph{in the completion list buffer} chooses the | ||
| 302 | completion that point is in or next to (@code{choose-completion}). To | ||
| 303 | use this command, you must first switch to the completion list window. | ||
| 304 | |||
| 305 | @findex next-completion | ||
| 306 | @item @key{RIGHT} | ||
| 307 | Typing the right-arrow key @key{RIGHT} @emph{in the completion list | ||
| 308 | buffer} moves point to the following completion possibility | ||
| 309 | (@code{next-completion}). | ||
| 310 | |||
| 311 | @findex previous-completion | ||
| 312 | @item @key{LEFT} | ||
| 313 | Typing the left-arrow key @key{LEFT} @emph{in the completion list | ||
| 314 | buffer} moves point to the previous completion possibility | ||
| 315 | (@code{previous-completion}). | ||
| 316 | @end table | ||
| 317 | |||
| 318 | @node Strict Completion | ||
| 319 | @subsection Strict Completion | ||
| 320 | |||
| 321 | There are three different ways that @key{RET} can do completion, | ||
| 322 | depending on how the argument will be used. | ||
| 323 | |||
| 324 | @itemize @bullet | ||
| 325 | @item | ||
| 326 | @dfn{Strict} completion accepts only known completion candidates. For | ||
| 327 | example, when @kbd{C-x k} reads the name of a buffer to kill, only the | ||
| 328 | name of an existing buffer makes sense. In strict completion, | ||
| 329 | @key{RET} refuses to exit if the text in the minibuffer does not | ||
| 330 | complete to an exact match. | ||
| 331 | |||
| 332 | @item | ||
| 333 | @dfn{Cautious} completion is similar to strict completion, except that | ||
| 334 | @key{RET} exits only if the text is an already exact match. | ||
| 335 | Otherwise, @key{RET} does not exit, but it does complete the text. If | ||
| 336 | that completes to an exact match, a second @key{RET} will exit. | ||
| 337 | |||
| 338 | Cautious completion is used for reading file names for files that must | ||
| 339 | already exist, for example. | ||
| 340 | |||
| 341 | @item | ||
| 342 | @dfn{Permissive} completion allows any input; the completion | ||
| 343 | candidates are just suggestions. For example, when @kbd{C-x C-f} | ||
| 344 | reads the name of a file to visit, any file name is allowed, including | ||
| 345 | nonexistent file (in case you want to create a file). In permissive | ||
| 346 | completion, @key{RET} does not complete, it just submits the argument | ||
| 347 | as you have entered it. | ||
| 348 | @end itemize | ||
| 349 | |||
| 350 | The completion commands display a list of all possible completions | ||
| 351 | whenever they can't determine even one more character by completion. | ||
| 352 | Also, typing @kbd{?} explicitly requests such a list. You can scroll | ||
| 353 | the list with @kbd{C-M-v} (@pxref{Other Window}). | ||
| 354 | |||
| 355 | @node Completion Options | ||
| 356 | @subsection Completion Options | ||
| 357 | |||
| 358 | @vindex completion-ignored-extensions | ||
| 359 | @cindex ignored file names, in completion | ||
| 360 | When completing file names, certain file names are usually ignored. | ||
| 361 | The variable @code{completion-ignored-extensions} contains a list of | ||
| 362 | strings; a file name ending in any of those strings is ignored as a | ||
| 363 | completion candidate. The standard value of this variable has several | ||
| 364 | elements including @code{".o"}, @code{".elc"}, @code{".dvi"} and | ||
| 365 | @code{"~"}. The effect is that, for example, @samp{foo} can complete | ||
| 366 | to @samp{foo.c} even though @samp{foo.o} exists as well. However, if | ||
| 367 | @emph{all} the possible completions end in ``ignored'' strings, then | ||
| 368 | they are not ignored. Displaying a list of possible completions | ||
| 369 | disregards @code{completion-ignored-extensions}; it shows them all. | ||
| 370 | |||
| 371 | If an element of @code{completion-ignored-extensions} ends in a | ||
| 372 | slash (@file{/}), it's a subdirectory name; then that directory and | ||
| 373 | its contents are ignored. Elements of | ||
| 374 | @code{completion-ignored-extensions} which do not end in a slash are | ||
| 375 | ordinary file names, and do not apply to names of directories. | ||
| 376 | |||
| 377 | @vindex completion-auto-help | ||
| 378 | If @code{completion-auto-help} is set to @code{nil}, the completion | ||
| 379 | commands never display a list of possibilities; you must type @kbd{?} | ||
| 380 | to display the list. | ||
| 381 | |||
| 382 | @cindex Partial Completion mode | ||
| 383 | @vindex partial-completion-mode | ||
| 384 | @findex partial-completion-mode | ||
| 385 | Partial Completion mode implements a more powerful kind of | ||
| 386 | completion that can complete multiple words in parallel. For example, | ||
| 387 | it can complete the command name abbreviation @code{p-b} into | ||
| 388 | @code{print-buffer} if no other command starts with two words whose | ||
| 389 | initials are @samp{p} and @samp{b}. | ||
| 390 | |||
| 391 | To enable this mode, use @kbd{M-x partial-completion-mode}, or | ||
| 392 | customize the variable @code{partial-completion-mode}. This mode | ||
| 393 | binds special partial completion commands to @key{TAB}, @key{SPC}, | ||
| 394 | @key{RET}, and @kbd{?} in the minibuffer. The usual completion | ||
| 395 | commands are available on @kbd{M-@key{TAB}} (or @kbd{C-M-i}), | ||
| 396 | @kbd{M-@key{SPC}}, @kbd{M-@key{RET}} and @kbd{M-?}. | ||
| 397 | |||
| 398 | Partial completion of directories in file names uses @samp{*} to | ||
| 399 | indicate the places for completion; thus, @file{/u*/b*/f*} might | ||
| 400 | complete to @file{/usr/bin/foo}. For remote files, partial completion | ||
| 401 | enables completion of methods, user names and host names. | ||
| 402 | @xref{Remote Files}. | ||
| 403 | |||
| 404 | @vindex PC-include-file-path | ||
| 405 | @vindex PC-disable-includes | ||
| 406 | Partial Completion mode also extends @code{find-file} so that | ||
| 407 | @samp{<@var{include}>} looks for the file named @var{include} in the | ||
| 408 | directories in the path @code{PC-include-file-path}. If you set | ||
| 409 | @code{PC-disable-includes} to non-@code{nil}, this feature is | ||
| 410 | disabled. | ||
| 411 | |||
| 412 | @cindex Icomplete mode | ||
| 413 | @findex icomplete-mode | ||
| 414 | Icomplete mode presents a constantly-updated display that tells you | ||
| 415 | what completions are available for the text you've entered so far. The | ||
| 416 | command to enable or disable this minor mode is @kbd{M-x | ||
| 417 | icomplete-mode}. | ||
| 418 | |||
| 419 | @node Minibuffer History | ||
| 420 | @section Minibuffer History | ||
| 421 | @cindex minibuffer history | ||
| 422 | @cindex history of minibuffer input | ||
| 423 | |||
| 424 | Every argument that you enter with the minibuffer is saved on a | ||
| 425 | @dfn{minibuffer history list} so you can easily use it again later. | ||
| 426 | Special commands fetch the text of an earlier argument into the | ||
| 427 | minibuffer, replacing the old minibuffer contents. You can think of | ||
| 428 | them as moving through the history of previous arguments. | ||
| 429 | |||
| 430 | @table @kbd | ||
| 431 | @item @key{UP} | ||
| 432 | @itemx M-p | ||
| 433 | Move to the previous item in the minibuffer history, an earlier argument | ||
| 434 | (@code{previous-history-element}). | ||
| 435 | @item @key{DOWN} | ||
| 436 | @itemx M-n | ||
| 437 | Move to the next item in the minibuffer history | ||
| 438 | (@code{next-history-element}). | ||
| 439 | @item M-r @var{regexp} @key{RET} | ||
| 440 | Move to an earlier item in the minibuffer history that | ||
| 441 | matches @var{regexp} (@code{previous-matching-history-element}). | ||
| 442 | @item M-s @var{regexp} @key{RET} | ||
| 443 | Move to a later item in the minibuffer history that matches | ||
| 444 | @var{regexp} (@code{next-matching-history-element}). | ||
| 445 | @end table | ||
| 446 | |||
| 447 | @kindex M-p @r{(minibuffer history)} | ||
| 448 | @kindex M-n @r{(minibuffer history)} | ||
| 449 | @findex next-history-element | ||
| 450 | @findex previous-history-element | ||
| 451 | To move through the minibuffer history list one item at a time, use | ||
| 452 | @kbd{M-p} or up-arrow (@code{previous-history-element}) to fetch the | ||
| 453 | next earlier minibuffer input, and use @kbd{M-n} or down-arrow | ||
| 454 | (@code{next-history-element}) to fetch the next later input. These | ||
| 455 | commands don't move the cursor, they pull different saved strings into | ||
| 456 | the minibuffer. But you can think of them as ``moving'' through the | ||
| 457 | history list. | ||
| 458 | |||
| 459 | The input that you fetch from the history entirely replaces the | ||
| 460 | contents of the minibuffer. To use it again unchanged, just type | ||
| 461 | @key{RET}. You can also edit the text before you reuse it; this does | ||
| 462 | not change the history element that you ``moved'' to, but your new | ||
| 463 | argument does go at the end of the history list in its own right. | ||
| 464 | |||
| 465 | For many minibuffer arguments there is a ``default'' value. You can | ||
| 466 | insert the default value into the minibuffer as text by using | ||
| 467 | @kbd{M-n}. You can think of this as moving ``into the future'' in the | ||
| 468 | history. | ||
| 469 | |||
| 470 | @findex previous-matching-history-element | ||
| 471 | @findex next-matching-history-element | ||
| 472 | @kindex M-r @r{(minibuffer history)} | ||
| 473 | @kindex M-s @r{(minibuffer history)} | ||
| 474 | There are also commands to search forward or backward through the | ||
| 475 | history; they search for history elements that match a regular | ||
| 476 | expression. @kbd{M-r} (@code{previous-matching-history-element}) | ||
| 477 | searches older elements in the history, while @kbd{M-s} | ||
| 478 | (@code{next-matching-history-element}) searches newer elements. These | ||
| 479 | commands are unusual; they use the minibuffer to read the regular | ||
| 480 | expression even though they are invoked from the minibuffer. As with | ||
| 481 | incremental searching, an upper-case letter in the regular expression | ||
| 482 | makes the search case-sensitive (@pxref{Search Case}). | ||
| 483 | |||
| 484 | @ignore | ||
| 485 | We may change the precise way these commands read their arguments. | ||
| 486 | Perhaps they will search for a match for the string given so far in the | ||
| 487 | minibuffer; perhaps they will search for a literal match rather than a | ||
| 488 | regular expression match; perhaps they will only accept matches at the | ||
| 489 | beginning of a history element; perhaps they will read the string to | ||
| 490 | search for incrementally like @kbd{C-s}. To find out what interface is | ||
| 491 | actually available, type @kbd{C-h f previous-matching-history-element}. | ||
| 492 | @end ignore | ||
| 493 | |||
| 494 | All uses of the minibuffer record your input on a history list, but | ||
| 495 | there are separate history lists for different kinds of arguments. | ||
| 496 | For example, there is a list for file names, used by all the commands | ||
| 497 | that read file names. (As a special feature, this history list | ||
| 498 | records the absolute file name, even if the name you entered was not | ||
| 499 | absolute.) | ||
| 500 | |||
| 501 | There are several other specific history lists, including one for | ||
| 502 | buffer names, one for arguments of commands like @code{query-replace}, | ||
| 503 | one used by @kbd{M-x} for command names, and one used by | ||
| 504 | @code{compile} for compilation commands. Finally, there is one | ||
| 505 | ``miscellaneous'' history list that most minibuffer arguments use. | ||
| 506 | |||
| 507 | @vindex history-length | ||
| 508 | The variable @code{history-length} specifies the maximum length of a | ||
| 509 | minibuffer history list; adding a new element deletes the oldest | ||
| 510 | element if the list gets too long. If the value of | ||
| 511 | @code{history-length} is @code{t}, though, there is no maximum length. | ||
| 512 | |||
| 513 | @vindex history-delete-duplicates | ||
| 514 | The variable @code{history-delete-duplicates} specifies whether to | ||
| 515 | delete duplicates in history. If it is @code{t}, adding a new element | ||
| 516 | deletes from the list all other elements that are equal to it. | ||
| 517 | |||
| 518 | @node Repetition | ||
| 519 | @section Repeating Minibuffer Commands | ||
| 520 | @cindex command history | ||
| 521 | @cindex history of commands | ||
| 522 | |||
| 523 | Every command that uses the minibuffer once is recorded on a special | ||
| 524 | history list, the @dfn{command history}, together with the values of | ||
| 525 | its arguments, so that you can repeat the entire command. In | ||
| 526 | particular, every use of @kbd{M-x} is recorded there, since @kbd{M-x} | ||
| 527 | uses the minibuffer to read the command name. | ||
| 528 | |||
| 529 | @findex list-command-history | ||
| 530 | @table @kbd | ||
| 531 | @item C-x @key{ESC} @key{ESC} | ||
| 532 | Re-execute a recent minibuffer command from the command history | ||
| 533 | (@code{repeat-complex-command}). | ||
| 534 | @item M-x list-command-history | ||
| 535 | Display the entire command history, showing all the commands | ||
| 536 | @kbd{C-x @key{ESC} @key{ESC}} can repeat, most recent first. | ||
| 537 | @end table | ||
| 538 | |||
| 539 | @kindex C-x ESC ESC | ||
| 540 | @findex repeat-complex-command | ||
| 541 | @kbd{C-x @key{ESC} @key{ESC}} is used to re-execute a recent command | ||
| 542 | that used the minibuffer. With no argument, it repeats the last such | ||
| 543 | command. A numeric argument specifies which command to repeat; 1 | ||
| 544 | means the last one, 2 the previous, and so on. | ||
| 545 | |||
| 546 | @kbd{C-x @key{ESC} @key{ESC}} works by turning the previous command | ||
| 547 | into a Lisp expression and then entering a minibuffer initialized with | ||
| 548 | the text for that expression. Even if you don't understand Lisp | ||
| 549 | syntax, it will probably be obvious which command is displayed for | ||
| 550 | repetition. If you type just @key{RET}, that repeats the command | ||
| 551 | unchanged. You can also change the command by editing the Lisp | ||
| 552 | expression before you execute it. The repeated command is added to | ||
| 553 | the front of the command history unless it is identical to the most | ||
| 554 | recently item. | ||
| 555 | |||
| 556 | Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you can | ||
| 557 | use the minibuffer history commands (@kbd{M-p}, @kbd{M-n}, @kbd{M-r}, | ||
| 558 | @kbd{M-s}; @pxref{Minibuffer History}) to move through the history list | ||
| 559 | of saved entire commands. After finding the desired previous command, | ||
| 560 | you can edit its expression as usual and then repeat it by typing | ||
| 561 | @key{RET}. | ||
| 562 | |||
| 563 | @vindex isearch-resume-in-command-history | ||
| 564 | Incremental search does not, strictly speaking, use the minibuffer. | ||
| 565 | Therefore, although it behaves like a complex command, it normally | ||
| 566 | does not appear in the history list for @kbd{C-x @key{ESC} @key{ESC}}. | ||
| 567 | You can make incremental search commands appear in the history by | ||
| 568 | setting @code{isearch-resume-in-command-history} to a non-@code{nil} | ||
| 569 | value. @xref{Incremental Search}. | ||
| 570 | |||
| 571 | @vindex command-history | ||
| 572 | The list of previous minibuffer-using commands is stored as a Lisp | ||
| 573 | list in the variable @code{command-history}. Each element is a Lisp | ||
| 574 | expression which describes one command and its arguments. Lisp programs | ||
| 575 | can re-execute a command by calling @code{eval} with the | ||
| 576 | @code{command-history} element. | ||
| 577 | |||
| 578 | @ignore | ||
| 579 | arch-tag: ba913cfd-b70e-400f-b663-22b2c309227f | ||
| 580 | @end ignore | ||
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi new file mode 100644 index 00000000000..c4cdea4359d --- /dev/null +++ b/doc/emacs/misc.texi | |||
| @@ -0,0 +1,2559 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @iftex | ||
| 6 | @chapter Miscellaneous Commands | ||
| 7 | |||
| 8 | This chapter contains several brief topics that do not fit anywhere | ||
| 9 | else: reading netnews, running shell commands and shell subprocesses, | ||
| 10 | using a single shared Emacs for utilities that expect to run an editor | ||
| 11 | as a subprocess, printing hardcopy, sorting text, narrowing display to | ||
| 12 | part of the buffer, editing double-column files and binary files, | ||
| 13 | saving an Emacs session for later resumption, following hyperlinks, | ||
| 14 | browsing images, emulating other editors, and various diversions and | ||
| 15 | amusements. | ||
| 16 | |||
| 17 | @end iftex | ||
| 18 | |||
| 19 | @ifnottex | ||
| 20 | @raisesections | ||
| 21 | @end ifnottex | ||
| 22 | |||
| 23 | @node Gnus, Shell, Calendar/Diary, Top | ||
| 24 | @section Gnus | ||
| 25 | @cindex Gnus | ||
| 26 | @cindex reading netnews | ||
| 27 | |||
| 28 | Gnus is an Emacs package primarily designed for reading and posting | ||
| 29 | Usenet news. It can also be used to read and respond to messages from a | ||
| 30 | number of other sources---mail, remote directories, digests, and so on. | ||
| 31 | |||
| 32 | Here we introduce Gnus and describe several basic features. | ||
| 33 | @ifnottex | ||
| 34 | For full details, see @ref{Top, Gnus,, gnus, The Gnus Manual}. | ||
| 35 | @end ifnottex | ||
| 36 | @iftex | ||
| 37 | For full details on Gnus, type @kbd{M-x info} and then select the Gnus | ||
| 38 | manual. | ||
| 39 | @end iftex | ||
| 40 | |||
| 41 | @findex gnus | ||
| 42 | To start Gnus, type @kbd{M-x gnus @key{RET}}. | ||
| 43 | |||
| 44 | @menu | ||
| 45 | * Buffers of Gnus:: The group, summary, and article buffers. | ||
| 46 | * Gnus Startup:: What you should know about starting Gnus. | ||
| 47 | * Summary of Gnus:: A short description of the basic Gnus commands. | ||
| 48 | @end menu | ||
| 49 | |||
| 50 | @node Buffers of Gnus | ||
| 51 | @subsection Gnus Buffers | ||
| 52 | |||
| 53 | Unlike most Emacs packages, Gnus uses several buffers to display | ||
| 54 | information and to receive commands. The three Gnus buffers users use | ||
| 55 | most are the @dfn{group buffer}, the @dfn{summary buffer} and the | ||
| 56 | @dfn{article buffer}. | ||
| 57 | |||
| 58 | The @dfn{group buffer} contains a list of newsgroups. This is the | ||
| 59 | first buffer Gnus displays when it starts up. It normally displays | ||
| 60 | only the groups to which you subscribe and that contain unread | ||
| 61 | articles. Use this buffer to select a specific group. | ||
| 62 | |||
| 63 | The @dfn{summary buffer} lists one line for each article in a single | ||
| 64 | group. By default, the author, the subject and the line number are | ||
| 65 | displayed for each article, but this is customizable, like most aspects | ||
| 66 | of Gnus display. The summary buffer is created when you select a group | ||
| 67 | in the group buffer, and is killed when you exit the group. Use this | ||
| 68 | buffer to select an article. | ||
| 69 | |||
| 70 | The @dfn{article buffer} displays the article. In normal Gnus usage, | ||
| 71 | you see this buffer but you don't select it---all useful | ||
| 72 | article-oriented commands work in the summary buffer. But you can | ||
| 73 | select the article buffer, and execute all Gnus commands from that | ||
| 74 | buffer, if you want to. | ||
| 75 | |||
| 76 | @node Gnus Startup | ||
| 77 | @subsection When Gnus Starts Up | ||
| 78 | |||
| 79 | At startup, Gnus reads your @file{.newsrc} news initialization file | ||
| 80 | and attempts to communicate with the local news server, which is a | ||
| 81 | repository of news articles. The news server need not be the same | ||
| 82 | computer you are logged in on. | ||
| 83 | |||
| 84 | If you start Gnus and connect to the server, but do not see any | ||
| 85 | newsgroups listed in the group buffer, type @kbd{L} or @kbd{A k} to get | ||
| 86 | a listing of all the groups. Then type @kbd{u} to toggle | ||
| 87 | subscription to groups. | ||
| 88 | |||
| 89 | The first time you start Gnus, Gnus subscribes you to a few selected | ||
| 90 | groups. All other groups start out as @dfn{killed groups} for you; you | ||
| 91 | can list them with @kbd{A k}. All new groups that subsequently come to | ||
| 92 | exist at the news server become @dfn{zombie groups} for you; type @kbd{A | ||
| 93 | z} to list them. You can subscribe to a group shown in these lists | ||
| 94 | using the @kbd{u} command. | ||
| 95 | |||
| 96 | When you quit Gnus with @kbd{q}, it automatically records in your | ||
| 97 | @file{.newsrc} and @file{.newsrc.eld} initialization files the | ||
| 98 | subscribed or unsubscribed status of all groups. You should normally | ||
| 99 | not edit these files manually, but you may if you know how. | ||
| 100 | |||
| 101 | @node Summary of Gnus | ||
| 102 | @subsection Summary of Gnus Commands | ||
| 103 | |||
| 104 | Reading news is a two-step process: | ||
| 105 | |||
| 106 | @enumerate | ||
| 107 | @item | ||
| 108 | Choose a group in the group buffer. | ||
| 109 | |||
| 110 | @item | ||
| 111 | Select articles from the summary buffer. Each article selected is | ||
| 112 | displayed in the article buffer in a large window, below the summary | ||
| 113 | buffer in its small window. | ||
| 114 | @end enumerate | ||
| 115 | |||
| 116 | Each Gnus buffer has its own special commands; the meanings of any | ||
| 117 | given key in the various Gnus buffers are usually analogous, even if | ||
| 118 | not identical. Here are commands for the group and summary buffers: | ||
| 119 | |||
| 120 | @table @kbd | ||
| 121 | @kindex q @r{(Gnus Group mode)} | ||
| 122 | @findex gnus-group-exit | ||
| 123 | @item q | ||
| 124 | In the group buffer, update your @file{.newsrc} initialization file | ||
| 125 | and quit Gnus. | ||
| 126 | |||
| 127 | In the summary buffer, exit the current group and return to the | ||
| 128 | group buffer. Thus, typing @kbd{q} twice quits Gnus. | ||
| 129 | |||
| 130 | @kindex L @r{(Gnus Group mode)} | ||
| 131 | @findex gnus-group-list-all-groups | ||
| 132 | @item L | ||
| 133 | In the group buffer, list all the groups available on your news | ||
| 134 | server (except those you have killed). This may be a long list! | ||
| 135 | |||
| 136 | @kindex l @r{(Gnus Group mode)} | ||
| 137 | @findex gnus-group-list-groups | ||
| 138 | @item l | ||
| 139 | In the group buffer, list only the groups to which you subscribe and | ||
| 140 | which contain unread articles. | ||
| 141 | |||
| 142 | @kindex u @r{(Gnus Group mode)} | ||
| 143 | @findex gnus-group-unsubscribe-current-group | ||
| 144 | @cindex subscribe groups | ||
| 145 | @cindex unsubscribe groups | ||
| 146 | @item u | ||
| 147 | In the group buffer, unsubscribe from (or subscribe to) the group listed | ||
| 148 | in the line that point is on. When you quit Gnus by typing @kbd{q}, | ||
| 149 | Gnus lists in your @file{.newsrc} file which groups you have subscribed | ||
| 150 | to. The next time you start Gnus, you won't see this group, | ||
| 151 | because Gnus normally displays only subscribed-to groups. | ||
| 152 | |||
| 153 | @kindex C-k @r{(Gnus)} | ||
| 154 | @findex gnus-group-kill-group | ||
| 155 | @item C-k | ||
| 156 | In the group buffer, ``kill'' the current line's group---don't | ||
| 157 | even list it in @file{.newsrc} from now on. This affects future | ||
| 158 | Gnus sessions as well as the present session. | ||
| 159 | |||
| 160 | When you quit Gnus by typing @kbd{q}, Gnus writes information | ||
| 161 | in the file @file{.newsrc} describing all newsgroups except those you | ||
| 162 | have ``killed.'' | ||
| 163 | |||
| 164 | @kindex SPC @r{(Gnus)} | ||
| 165 | @findex gnus-group-read-group | ||
| 166 | @item @key{SPC} | ||
| 167 | In the group buffer, select the group on the line under the cursor | ||
| 168 | and display the first unread article in that group. | ||
| 169 | |||
| 170 | @need 1000 | ||
| 171 | In the summary buffer, | ||
| 172 | |||
| 173 | @itemize @bullet | ||
| 174 | @item | ||
| 175 | Select the article on the line under the cursor if none is selected. | ||
| 176 | |||
| 177 | @item | ||
| 178 | Scroll the text of the selected article (if there is one). | ||
| 179 | |||
| 180 | @item | ||
| 181 | Select the next unread article if at the end of the current article. | ||
| 182 | @end itemize | ||
| 183 | |||
| 184 | Thus, you can move through all the articles by repeatedly typing @key{SPC}. | ||
| 185 | |||
| 186 | @kindex DEL @r{(Gnus)} | ||
| 187 | @item @key{DEL} | ||
| 188 | In the group buffer, move point to the previous group containing | ||
| 189 | unread articles. | ||
| 190 | |||
| 191 | @findex gnus-summary-prev-page | ||
| 192 | In the summary buffer, scroll the text of the article backwards. | ||
| 193 | |||
| 194 | @kindex n @r{(Gnus)} | ||
| 195 | @findex gnus-group-next-unread-group | ||
| 196 | @findex gnus-summary-next-unread-article | ||
| 197 | @item n | ||
| 198 | Move point to the next unread group, or select the next unread article. | ||
| 199 | |||
| 200 | @kindex p @r{(Gnus)} | ||
| 201 | @findex gnus-group-prev-unread-group | ||
| 202 | @findex gnus-summary-prev-unread-article | ||
| 203 | @item p | ||
| 204 | Move point to the previous unread group, or select the previous | ||
| 205 | unread article. | ||
| 206 | |||
| 207 | @kindex C-n @r{(Gnus Group mode)} | ||
| 208 | @findex gnus-group-next-group | ||
| 209 | @kindex C-p @r{(Gnus Group mode)} | ||
| 210 | @findex gnus-group-prev-group | ||
| 211 | @kindex C-n @r{(Gnus Summary mode)} | ||
| 212 | @findex gnus-summary-next-subject | ||
| 213 | @kindex C-p @r{(Gnus Summary mode)} | ||
| 214 | @findex gnus-summary-prev-subject | ||
| 215 | @item C-n | ||
| 216 | @itemx C-p | ||
| 217 | Move point to the next or previous item, even if it is marked as read. | ||
| 218 | This does not select the article or group on that line. | ||
| 219 | |||
| 220 | @kindex s @r{(Gnus Summary mode)} | ||
| 221 | @findex gnus-summary-isearch-article | ||
| 222 | @item s | ||
| 223 | In the summary buffer, do an incremental search of the current text in | ||
| 224 | the article buffer, just as if you switched to the article buffer and | ||
| 225 | typed @kbd{C-s}. | ||
| 226 | |||
| 227 | @kindex M-s @r{(Gnus Summary mode)} | ||
| 228 | @findex gnus-summary-search-article-forward | ||
| 229 | @item M-s @var{regexp} @key{RET} | ||
| 230 | In the summary buffer, search forward for articles containing a match | ||
| 231 | for @var{regexp}. | ||
| 232 | |||
| 233 | @end table | ||
| 234 | |||
| 235 | @ignore | ||
| 236 | @node Where to Look | ||
| 237 | @subsection Where to Look Further | ||
| 238 | |||
| 239 | @c Too many references to the name of the manual if done with xref in TeX! | ||
| 240 | Gnus is powerful and customizable. Here are references to a few | ||
| 241 | @ifnottex | ||
| 242 | additional topics: | ||
| 243 | |||
| 244 | @end ifnottex | ||
| 245 | @iftex | ||
| 246 | additional topics in @cite{The Gnus Manual}: | ||
| 247 | |||
| 248 | @itemize @bullet | ||
| 249 | @item | ||
| 250 | Follow discussions on specific topics.@* | ||
| 251 | See section ``Threading.'' | ||
| 252 | |||
| 253 | @item | ||
| 254 | Read digests. See section ``Document Groups.'' | ||
| 255 | |||
| 256 | @item | ||
| 257 | Refer to and jump to the parent of the current article.@* | ||
| 258 | See section ``Finding the Parent.'' | ||
| 259 | |||
| 260 | @item | ||
| 261 | Refer to articles by using Message-IDs included in the messages.@* | ||
| 262 | See section ``Article Keymap.'' | ||
| 263 | |||
| 264 | @item | ||
| 265 | Save articles. See section ``Saving Articles.'' | ||
| 266 | |||
| 267 | @item | ||
| 268 | Have Gnus score articles according to various criteria, like author | ||
| 269 | name, subject, or string in the body of the articles.@* | ||
| 270 | See section ``Scoring.'' | ||
| 271 | |||
| 272 | @item | ||
| 273 | Send an article to a newsgroup.@* | ||
| 274 | See section ``Composing Messages.'' | ||
| 275 | @end itemize | ||
| 276 | @end iftex | ||
| 277 | @ifnottex | ||
| 278 | @itemize @bullet | ||
| 279 | @item | ||
| 280 | Follow discussions on specific topics.@* | ||
| 281 | @xref{Threading, , Reading Based on Conversation Threads, | ||
| 282 | gnus, The Gnus Manual}. | ||
| 283 | |||
| 284 | @item | ||
| 285 | Read digests. @xref{Document Groups, , , gnus, The Gnus Manual}. | ||
| 286 | |||
| 287 | @item | ||
| 288 | Refer to and jump to the parent of the current article.@* | ||
| 289 | @xref{Finding the Parent, , , gnus, The Gnus Manual}. | ||
| 290 | |||
| 291 | @item | ||
| 292 | Refer to articles by using Message-IDs included in the messages.@* | ||
| 293 | @xref{Article Keymap, , , gnus, The Gnus Manual}. | ||
| 294 | |||
| 295 | @item | ||
| 296 | Save articles. @xref{Saving Articles, , , gnus, The Gnus Manual}. | ||
| 297 | |||
| 298 | @item | ||
| 299 | Have Gnus score articles according to various criteria, like author | ||
| 300 | name, subject, or string in the body of the articles.@* | ||
| 301 | @xref{Scoring, , , gnus, The Gnus Manual}. | ||
| 302 | |||
| 303 | @item | ||
| 304 | Send an article to a newsgroup.@* | ||
| 305 | @xref{Composing Messages, , , gnus, The Gnus Manual}. | ||
| 306 | @end itemize | ||
| 307 | @end ifnottex | ||
| 308 | @end ignore | ||
| 309 | |||
| 310 | @node Shell, Emacs Server, Gnus, Top | ||
| 311 | @section Running Shell Commands from Emacs | ||
| 312 | @cindex subshell | ||
| 313 | @cindex shell commands | ||
| 314 | |||
| 315 | Emacs has commands for passing single command lines to inferior shell | ||
| 316 | processes; it can also run a shell interactively with input and output | ||
| 317 | to an Emacs buffer named @samp{*shell*} or run a shell inside a terminal | ||
| 318 | emulator window. | ||
| 319 | |||
| 320 | @table @kbd | ||
| 321 | @item M-! @var{cmd} @key{RET} | ||
| 322 | Run the shell command line @var{cmd} and display the output | ||
| 323 | (@code{shell-command}). | ||
| 324 | @item M-| @var{cmd} @key{RET} | ||
| 325 | Run the shell command line @var{cmd} with region contents as input; | ||
| 326 | optionally replace the region with the output | ||
| 327 | (@code{shell-command-on-region}). | ||
| 328 | @item M-x shell | ||
| 329 | Run a subshell with input and output through an Emacs buffer. | ||
| 330 | You can then give commands interactively. | ||
| 331 | @item M-x term | ||
| 332 | Run a subshell with input and output through an Emacs buffer. | ||
| 333 | You can then give commands interactively. | ||
| 334 | Full terminal emulation is available. | ||
| 335 | @end table | ||
| 336 | |||
| 337 | @kbd{M-x eshell} invokes a shell implemented entirely in Emacs. It | ||
| 338 | is documented in a separate manual. @xref{Top,Eshell,Eshell, eshell, | ||
| 339 | Eshell: The Emacs Shell}. | ||
| 340 | |||
| 341 | @menu | ||
| 342 | * Single Shell:: How to run one shell command and return. | ||
| 343 | * Interactive Shell:: Permanent shell taking input via Emacs. | ||
| 344 | * Shell Mode:: Special Emacs commands used with permanent shell. | ||
| 345 | * Shell Prompts:: Two ways to recognize shell prompts. | ||
| 346 | * History: Shell History. Repeating previous commands in a shell buffer. | ||
| 347 | * Directory Tracking:: Keeping track when the subshell changes directory. | ||
| 348 | * Options: Shell Options. Options for customizing Shell mode. | ||
| 349 | * Terminal emulator:: An Emacs window as a terminal emulator. | ||
| 350 | * Term Mode:: Special Emacs commands used in Term mode. | ||
| 351 | * Paging in Term:: Paging in the terminal emulator. | ||
| 352 | * Remote Host:: Connecting to another computer. | ||
| 353 | @end menu | ||
| 354 | |||
| 355 | @node Single Shell | ||
| 356 | @subsection Single Shell Commands | ||
| 357 | |||
| 358 | @kindex M-! | ||
| 359 | @findex shell-command | ||
| 360 | @kbd{M-!} (@code{shell-command}) reads a line of text using the | ||
| 361 | minibuffer and executes it as a shell command in a subshell made just | ||
| 362 | for that command. Standard input for the command comes from the null | ||
| 363 | device. If the shell command produces any output, the output appears | ||
| 364 | either in the echo area (if it is short), or in an Emacs buffer named | ||
| 365 | @samp{*Shell Command Output*}, which is displayed in another window | ||
| 366 | but not selected (if the output is long). | ||
| 367 | |||
| 368 | For instance, one way to decompress a file @file{foo.gz} from Emacs | ||
| 369 | is to type @kbd{M-! gunzip foo.gz @key{RET}}. That shell command | ||
| 370 | normally creates the file @file{foo} and produces no terminal output. | ||
| 371 | |||
| 372 | A numeric argument, as in @kbd{M-1 M-!}, says to insert terminal | ||
| 373 | output into the current buffer instead of a separate buffer. It puts | ||
| 374 | point before the output, and sets the mark after the output. For | ||
| 375 | instance, @kbd{M-1 M-! gunzip < foo.gz @key{RET}} would insert the | ||
| 376 | uncompressed equivalent of @file{foo.gz} into the current buffer. | ||
| 377 | |||
| 378 | If the shell command line ends in @samp{&}, it runs asynchronously. | ||
| 379 | For a synchronous shell command, @code{shell-command} returns the | ||
| 380 | command's exit status (0 means success), when it is called from a Lisp | ||
| 381 | program. You do not get any status information for an asynchronous | ||
| 382 | command, since it hasn't finished yet when @code{shell-command} returns. | ||
| 383 | |||
| 384 | @kindex M-| | ||
| 385 | @findex shell-command-on-region | ||
| 386 | @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!} but | ||
| 387 | passes the contents of the region as the standard input to the shell | ||
| 388 | command, instead of no input. With a numeric argument, meaning insert | ||
| 389 | the output in the current buffer, it deletes the old region and the | ||
| 390 | output replaces it as the contents of the region. It returns the | ||
| 391 | command's exit status, like @kbd{M-!}. | ||
| 392 | |||
| 393 | One use for @kbd{M-|} is to run @code{gpg} to see what keys are in | ||
| 394 | the buffer. For instance, if the buffer contains a GPG key, type | ||
| 395 | @kbd{C-x h M-| gpg @key{RET}} to feed the entire buffer contents to | ||
| 396 | the @code{gpg} program. That program will ignore everything except | ||
| 397 | the encoded keys, and will output a list of the keys the buffer | ||
| 398 | contains. | ||
| 399 | |||
| 400 | @vindex shell-file-name | ||
| 401 | Both @kbd{M-!} and @kbd{M-|} use @code{shell-file-name} to specify | ||
| 402 | the shell to use. This variable is initialized based on your | ||
| 403 | @env{SHELL} environment variable when Emacs is started. If the file | ||
| 404 | name is relative, Emacs searches the directories in the list | ||
| 405 | @code{exec-path}; this list is initialized based on the environment | ||
| 406 | variable @env{PATH} when Emacs is started. Your @file{.emacs} file | ||
| 407 | can override either or both of these default initializations. | ||
| 408 | |||
| 409 | Both @kbd{M-!} and @kbd{M-|} wait for the shell command to complete, | ||
| 410 | unless you end the command with @samp{&} to make it asynchronous. To | ||
| 411 | stop waiting, type @kbd{C-g} to quit; that terminates the shell | ||
| 412 | command with the signal @code{SIGINT}---the same signal that @kbd{C-c} | ||
| 413 | normally generates in the shell. Emacs then waits until the command | ||
| 414 | actually terminates. If the shell command doesn't stop (because it | ||
| 415 | ignores the @code{SIGINT} signal), type @kbd{C-g} again; this sends | ||
| 416 | the command a @code{SIGKILL} signal which is impossible to ignore. | ||
| 417 | |||
| 418 | Asynchronous commands ending in @samp{&} feed their output into | ||
| 419 | the buffer @samp{*Async Shell Command*}. Output arrives in that | ||
| 420 | buffer regardless of whether it is visible in a window. | ||
| 421 | |||
| 422 | To specify a coding system for @kbd{M-!} or @kbd{M-|}, use the command | ||
| 423 | @kbd{C-x @key{RET} c} immediately beforehand. @xref{Communication Coding}. | ||
| 424 | |||
| 425 | @vindex shell-command-default-error-buffer | ||
| 426 | Error output from these commands is normally intermixed with the | ||
| 427 | regular output. But if the variable | ||
| 428 | @code{shell-command-default-error-buffer} has a string as value, and | ||
| 429 | it's the name of a buffer, @kbd{M-!} and @kbd{M-|} insert error output | ||
| 430 | before point in that buffer. | ||
| 431 | |||
| 432 | @node Interactive Shell | ||
| 433 | @subsection Interactive Inferior Shell | ||
| 434 | |||
| 435 | @findex shell | ||
| 436 | To run a subshell interactively, putting its typescript in an Emacs | ||
| 437 | buffer, use @kbd{M-x shell}. This creates (or reuses) a buffer named | ||
| 438 | @samp{*shell*} and runs a subshell with input coming from and output going | ||
| 439 | to that buffer. That is to say, any ``terminal output'' from the subshell | ||
| 440 | goes into the buffer, advancing point, and any ``terminal input'' for | ||
| 441 | the subshell comes from text in the buffer. To give input to the subshell, | ||
| 442 | go to the end of the buffer and type the input, terminated by @key{RET}. | ||
| 443 | |||
| 444 | Emacs does not wait for the subshell to do anything. You can switch | ||
| 445 | windows or buffers and edit them while the shell is waiting, or while it is | ||
| 446 | running a command. Output from the subshell waits until Emacs has time to | ||
| 447 | process it; this happens whenever Emacs is waiting for keyboard input or | ||
| 448 | for time to elapse. | ||
| 449 | |||
| 450 | @cindex @code{comint-highlight-input} face | ||
| 451 | @cindex @code{comint-highlight-prompt} face | ||
| 452 | Input lines, once you submit them, are displayed using the face | ||
| 453 | @code{comint-highlight-input}, and prompts are displayed using the | ||
| 454 | face @code{comint-highlight-prompt}. This makes it easier to see | ||
| 455 | previous input lines in the buffer. @xref{Faces}. | ||
| 456 | |||
| 457 | To make multiple subshells, you can invoke @kbd{M-x shell} with a | ||
| 458 | prefix argument (e.g. @kbd{C-u M-x shell}), which will read a buffer | ||
| 459 | name and create (or reuse) a subshell in that buffer. You can also | ||
| 460 | rename the @samp{*shell*} buffer using @kbd{M-x rename-uniquely}, then | ||
| 461 | create a new @samp{*shell*} buffer using plain @kbd{M-x shell}. | ||
| 462 | Subshells in different buffers run independently and in parallel. | ||
| 463 | |||
| 464 | @vindex explicit-shell-file-name | ||
| 465 | @cindex environment variables for subshells | ||
| 466 | @cindex @env{ESHELL} environment variable | ||
| 467 | @cindex @env{SHELL} environment variable | ||
| 468 | The file name used to load the subshell is the value of the variable | ||
| 469 | @code{explicit-shell-file-name}, if that is non-@code{nil}. Otherwise, | ||
| 470 | the environment variable @env{ESHELL} is used, or the environment | ||
| 471 | variable @env{SHELL} if there is no @env{ESHELL}. If the file name | ||
| 472 | specified is relative, the directories in the list @code{exec-path} are | ||
| 473 | searched; this list is initialized based on the environment variable | ||
| 474 | @env{PATH} when Emacs is started. Your @file{.emacs} file can override | ||
| 475 | either or both of these default initializations. | ||
| 476 | |||
| 477 | Emacs sends the new shell the contents of the file | ||
| 478 | @file{~/.emacs_@var{shellname}} as input, if it exists, where | ||
| 479 | @var{shellname} is the name of the file that the shell was loaded | ||
| 480 | from. For example, if you use bash, the file sent to it is | ||
| 481 | @file{~/.emacs_bash}. If this file is not found, Emacs tries to fallback | ||
| 482 | on @file{~/.emacs.d/init_@var{shellname}.sh}. | ||
| 483 | |||
| 484 | To specify a coding system for the shell, you can use the command | ||
| 485 | @kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}. You can | ||
| 486 | also change the coding system for a running subshell by typing | ||
| 487 | @kbd{C-x @key{RET} p} in the shell buffer. @xref{Communication | ||
| 488 | Coding}. | ||
| 489 | |||
| 490 | @cindex @env{INSIDE_EMACS} environment variable | ||
| 491 | Emacs sets the envitonment variable @env{INSIDE_EMACS} to @code{t} | ||
| 492 | in the subshell. Programs can check this variable to determine | ||
| 493 | whether they are running inside an Emacs subshell. | ||
| 494 | |||
| 495 | @cindex @env{EMACS} environment variable | ||
| 496 | Emacs also sets the @env{EMACS} environment variable to @code{t} if | ||
| 497 | it is not already defined. @strong{Warning:} This environment | ||
| 498 | variable is deprecated. Programs that check this variable should be | ||
| 499 | changed to check @env{INSIDE_EMACS} instead. | ||
| 500 | |||
| 501 | @node Shell Mode | ||
| 502 | @subsection Shell Mode | ||
| 503 | @cindex Shell mode | ||
| 504 | @cindex mode, Shell | ||
| 505 | |||
| 506 | Shell buffers use Shell mode, which defines several special keys | ||
| 507 | attached to the @kbd{C-c} prefix. They are chosen to resemble the usual | ||
| 508 | editing and job control characters present in shells that are not under | ||
| 509 | Emacs, except that you must type @kbd{C-c} first. Here is a complete list | ||
| 510 | of the special key bindings of Shell mode: | ||
| 511 | |||
| 512 | @table @kbd | ||
| 513 | @item @key{RET} | ||
| 514 | @kindex RET @r{(Shell mode)} | ||
| 515 | @findex comint-send-input | ||
| 516 | At end of buffer send line as input; otherwise, copy current line to | ||
| 517 | end of buffer and send it (@code{comint-send-input}). Copying a line | ||
| 518 | in this way omits any prompt at the beginning of the line (text output | ||
| 519 | by programs preceding your input). @xref{Shell Prompts}, for how | ||
| 520 | Shell mode recognizes prompts. | ||
| 521 | |||
| 522 | @item @key{TAB} | ||
| 523 | @kindex TAB @r{(Shell mode)} | ||
| 524 | @findex comint-dynamic-complete | ||
| 525 | Complete the command name or file name before point in the shell buffer | ||
| 526 | (@code{comint-dynamic-complete}). @key{TAB} also completes history | ||
| 527 | references (@pxref{History References}) and environment variable names. | ||
| 528 | |||
| 529 | @vindex shell-completion-fignore | ||
| 530 | @vindex comint-completion-fignore | ||
| 531 | The variable @code{shell-completion-fignore} specifies a list of file | ||
| 532 | name extensions to ignore in Shell mode completion. The default | ||
| 533 | setting is @code{nil}, but some users prefer @code{("~" "#" "%")} to | ||
| 534 | ignore file names ending in @samp{~}, @samp{#} or @samp{%}. Other | ||
| 535 | related Comint modes use the variable @code{comint-completion-fignore} | ||
| 536 | instead. | ||
| 537 | |||
| 538 | @item M-? | ||
| 539 | @kindex M-? @r{(Shell mode)} | ||
| 540 | @findex comint-dynamic-list-filename@dots{} | ||
| 541 | Display temporarily a list of the possible completions of the file name | ||
| 542 | before point in the shell buffer | ||
| 543 | (@code{comint-dynamic-list-filename-completions}). | ||
| 544 | |||
| 545 | @item C-d | ||
| 546 | @kindex C-d @r{(Shell mode)} | ||
| 547 | @findex comint-delchar-or-maybe-eof | ||
| 548 | Either delete a character or send @acronym{EOF} | ||
| 549 | (@code{comint-delchar-or-maybe-eof}). Typed at the end of the shell | ||
| 550 | buffer, @kbd{C-d} sends @acronym{EOF} to the subshell. Typed at any other | ||
| 551 | position in the buffer, @kbd{C-d} deletes a character as usual. | ||
| 552 | |||
| 553 | @item C-c C-a | ||
| 554 | @kindex C-c C-a @r{(Shell mode)} | ||
| 555 | @findex comint-bol-or-process-mark | ||
| 556 | Move to the beginning of the line, but after the prompt if any | ||
| 557 | (@code{comint-bol-or-process-mark}). If you repeat this command twice | ||
| 558 | in a row, the second time it moves back to the process mark, which is | ||
| 559 | the beginning of the input that you have not yet sent to the subshell. | ||
| 560 | (Normally that is the same place---the end of the prompt on this | ||
| 561 | line---but after @kbd{C-c @key{SPC}} the process mark may be in a | ||
| 562 | previous line.) | ||
| 563 | |||
| 564 | @item C-c @key{SPC} | ||
| 565 | Accumulate multiple lines of input, then send them together. This | ||
| 566 | command inserts a newline before point, but does not send the preceding | ||
| 567 | text as input to the subshell---at least, not yet. Both lines, the one | ||
| 568 | before this newline and the one after, will be sent together (along with | ||
| 569 | the newline that separates them), when you type @key{RET}. | ||
| 570 | |||
| 571 | @item C-c C-u | ||
| 572 | @kindex C-c C-u @r{(Shell mode)} | ||
| 573 | @findex comint-kill-input | ||
| 574 | Kill all text pending at end of buffer to be sent as input | ||
| 575 | (@code{comint-kill-input}). If point is not at end of buffer, | ||
| 576 | this only kills the part of this text that precedes point. | ||
| 577 | |||
| 578 | @item C-c C-w | ||
| 579 | @kindex C-c C-w @r{(Shell mode)} | ||
| 580 | Kill a word before point (@code{backward-kill-word}). | ||
| 581 | |||
| 582 | @item C-c C-c | ||
| 583 | @kindex C-c C-c @r{(Shell mode)} | ||
| 584 | @findex comint-interrupt-subjob | ||
| 585 | Interrupt the shell or its current subjob if any | ||
| 586 | (@code{comint-interrupt-subjob}). This command also kills | ||
| 587 | any shell input pending in the shell buffer and not yet sent. | ||
| 588 | |||
| 589 | @item C-c C-z | ||
| 590 | @kindex C-c C-z @r{(Shell mode)} | ||
| 591 | @findex comint-stop-subjob | ||
| 592 | Stop the shell or its current subjob if any (@code{comint-stop-subjob}). | ||
| 593 | This command also kills any shell input pending in the shell buffer and | ||
| 594 | not yet sent. | ||
| 595 | |||
| 596 | @item C-c C-\ | ||
| 597 | @findex comint-quit-subjob | ||
| 598 | @kindex C-c C-\ @r{(Shell mode)} | ||
| 599 | Send quit signal to the shell or its current subjob if any | ||
| 600 | (@code{comint-quit-subjob}). This command also kills any shell input | ||
| 601 | pending in the shell buffer and not yet sent. | ||
| 602 | |||
| 603 | @item C-c C-o | ||
| 604 | @kindex C-c C-o @r{(Shell mode)} | ||
| 605 | @findex comint-delete-output | ||
| 606 | Delete the last batch of output from a shell command | ||
| 607 | (@code{comint-delete-output}). This is useful if a shell command spews | ||
| 608 | out lots of output that just gets in the way. This command used to be | ||
| 609 | called @code{comint-kill-output}. | ||
| 610 | |||
| 611 | @item C-c C-s | ||
| 612 | @kindex C-c C-s @r{(Shell mode)} | ||
| 613 | @findex comint-write-output | ||
| 614 | Write the last batch of output from a shell command to a file | ||
| 615 | (@code{comint-write-output}). With a prefix argument, the file is | ||
| 616 | appended to instead. Any prompt at the end of the output is not | ||
| 617 | written. | ||
| 618 | |||
| 619 | @item C-c C-r | ||
| 620 | @itemx C-M-l | ||
| 621 | @kindex C-c C-r @r{(Shell mode)} | ||
| 622 | @kindex C-M-l @r{(Shell mode)} | ||
| 623 | @findex comint-show-output | ||
| 624 | Scroll to display the beginning of the last batch of output at the top | ||
| 625 | of the window; also move the cursor there (@code{comint-show-output}). | ||
| 626 | |||
| 627 | @item C-c C-e | ||
| 628 | @kindex C-c C-e @r{(Shell mode)} | ||
| 629 | @findex comint-show-maximum-output | ||
| 630 | Scroll to put the end of the buffer at the bottom of the window | ||
| 631 | (@code{comint-show-maximum-output}). | ||
| 632 | |||
| 633 | @item C-c C-f | ||
| 634 | @kindex C-c C-f @r{(Shell mode)} | ||
| 635 | @findex shell-forward-command | ||
| 636 | @vindex shell-command-regexp | ||
| 637 | Move forward across one shell command, but not beyond the current line | ||
| 638 | (@code{shell-forward-command}). The variable @code{shell-command-regexp} | ||
| 639 | specifies how to recognize the end of a command. | ||
| 640 | |||
| 641 | @item C-c C-b | ||
| 642 | @kindex C-c C-b @r{(Shell mode)} | ||
| 643 | @findex shell-backward-command | ||
| 644 | Move backward across one shell command, but not beyond the current line | ||
| 645 | (@code{shell-backward-command}). | ||
| 646 | |||
| 647 | @item M-x dirs | ||
| 648 | Ask the shell what its current directory is, so that Emacs can agree | ||
| 649 | with the shell. | ||
| 650 | |||
| 651 | @item M-x send-invisible @key{RET} @var{text} @key{RET} | ||
| 652 | @findex send-invisible | ||
| 653 | Send @var{text} as input to the shell, after reading it without | ||
| 654 | echoing. This is useful when a shell command runs a program that asks | ||
| 655 | for a password. | ||
| 656 | |||
| 657 | Please note that Emacs will not echo passwords by default. If you | ||
| 658 | really want them to be echoed, evaluate the following Lisp | ||
| 659 | expression: | ||
| 660 | |||
| 661 | @example | ||
| 662 | (remove-hook 'comint-output-filter-functions | ||
| 663 | 'comint-watch-for-password-prompt) | ||
| 664 | @end example | ||
| 665 | |||
| 666 | @item M-x comint-continue-subjob | ||
| 667 | @findex comint-continue-subjob | ||
| 668 | Continue the shell process. This is useful if you accidentally suspend | ||
| 669 | the shell process.@footnote{You should not suspend the shell process. | ||
| 670 | Suspending a subjob of the shell is a completely different matter---that | ||
| 671 | is normal practice, but you must use the shell to continue the subjob; | ||
| 672 | this command won't do it.} | ||
| 673 | |||
| 674 | @item M-x comint-strip-ctrl-m | ||
| 675 | @findex comint-strip-ctrl-m | ||
| 676 | Discard all control-M characters from the current group of shell output. | ||
| 677 | The most convenient way to use this command is to make it run | ||
| 678 | automatically when you get output from the subshell. To do that, | ||
| 679 | evaluate this Lisp expression: | ||
| 680 | |||
| 681 | @example | ||
| 682 | (add-hook 'comint-output-filter-functions | ||
| 683 | 'comint-strip-ctrl-m) | ||
| 684 | @end example | ||
| 685 | |||
| 686 | @item M-x comint-truncate-buffer | ||
| 687 | @findex comint-truncate-buffer | ||
| 688 | This command truncates the shell buffer to a certain maximum number of | ||
| 689 | lines, specified by the variable @code{comint-buffer-maximum-size}. | ||
| 690 | Here's how to do this automatically each time you get output from the | ||
| 691 | subshell: | ||
| 692 | |||
| 693 | @example | ||
| 694 | (add-hook 'comint-output-filter-functions | ||
| 695 | 'comint-truncate-buffer) | ||
| 696 | @end example | ||
| 697 | @end table | ||
| 698 | |||
| 699 | @cindex Comint mode | ||
| 700 | @cindex mode, Comint | ||
| 701 | Shell mode is a derivative of Comint mode, a general-purpose mode for | ||
| 702 | communicating with interactive subprocesses. Most of the features of | ||
| 703 | Shell mode actually come from Comint mode, as you can see from the | ||
| 704 | command names listed above. The special features of Shell mode include | ||
| 705 | the directory tracking feature, and a few user commands. | ||
| 706 | |||
| 707 | Other Emacs features that use variants of Comint mode include GUD | ||
| 708 | (@pxref{Debuggers}) and @kbd{M-x run-lisp} (@pxref{External Lisp}). | ||
| 709 | |||
| 710 | @findex comint-run | ||
| 711 | You can use @kbd{M-x comint-run} to execute any program of your choice | ||
| 712 | in a subprocess using unmodified Comint mode---without the | ||
| 713 | specializations of Shell mode. | ||
| 714 | |||
| 715 | @node Shell Prompts | ||
| 716 | @subsection Shell Prompts | ||
| 717 | |||
| 718 | @vindex shell-prompt-pattern | ||
| 719 | @vindex comint-prompt-regexp | ||
| 720 | @vindex comint-use-prompt-regexp | ||
| 721 | @cindex prompt, shell | ||
| 722 | A prompt is text output by a program to show that it is ready to | ||
| 723 | accept new user input. Normally, Comint mode (and thus Shell mode) | ||
| 724 | considers the prompt to be any text output by a program at the | ||
| 725 | beginning of an input line. However, if the variable | ||
| 726 | @code{comint-use-prompt-regexp} is non-@code{nil}, then Comint mode | ||
| 727 | uses a regular expression to recognize prompts. In Shell mode, | ||
| 728 | @code{shell-prompt-pattern} specifies the regular expression. | ||
| 729 | |||
| 730 | The value of @code{comint-use-prompt-regexp} also affects many | ||
| 731 | motion and paragraph commands. If the value is non-@code{nil}, the | ||
| 732 | general Emacs motion commands behave as they normally do in buffers | ||
| 733 | without special text properties. However, if the value is @code{nil}, | ||
| 734 | the default, then Comint mode divides the buffer into two types of | ||
| 735 | ``fields'' (ranges of consecutive characters having the same | ||
| 736 | @code{field} text property): input and output. Prompts are part of | ||
| 737 | the output. Most Emacs motion commands do not cross field boundaries, | ||
| 738 | unless they move over multiple lines. For instance, when point is in | ||
| 739 | input on the same line as a prompt, @kbd{C-a} puts point at the | ||
| 740 | beginning of the input if @code{comint-use-prompt-regexp} is | ||
| 741 | @code{nil} and at the beginning of the line otherwise. | ||
| 742 | |||
| 743 | In Shell mode, only shell prompts start new paragraphs. Thus, a | ||
| 744 | paragraph consists of a prompt and the input and output that follow | ||
| 745 | it. However, if @code{comint-use-prompt-regexp} is @code{nil}, the | ||
| 746 | default, most paragraph commands do not cross field boundaries. This | ||
| 747 | means that prompts, ranges of input, and ranges of non-prompt output | ||
| 748 | behave mostly like separate paragraphs; with this setting, numeric | ||
| 749 | arguments to most paragraph commands yield essentially undefined | ||
| 750 | behavior. For the purpose of finding paragraph boundaries, Shell mode | ||
| 751 | uses @code{shell-prompt-pattern}, regardless of | ||
| 752 | @code{comint-use-prompt-regexp}. | ||
| 753 | |||
| 754 | @node Shell History | ||
| 755 | @subsection Shell Command History | ||
| 756 | |||
| 757 | Shell buffers support three ways of repeating earlier commands. You | ||
| 758 | can use keys like those used for the minibuffer history; these work | ||
| 759 | much as they do in the minibuffer, inserting text from prior commands | ||
| 760 | while point remains always at the end of the buffer. You can move | ||
| 761 | through the buffer to previous inputs in their original place, then | ||
| 762 | resubmit them or copy them to the end. Or you can use a | ||
| 763 | @samp{!}-style history reference. | ||
| 764 | |||
| 765 | @menu | ||
| 766 | * Ring: Shell Ring. Fetching commands from the history list. | ||
| 767 | * Copy: Shell History Copying. Moving to a command and then copying it. | ||
| 768 | * History References:: Expanding @samp{!}-style history references. | ||
| 769 | @end menu | ||
| 770 | |||
| 771 | @node Shell Ring | ||
| 772 | @subsubsection Shell History Ring | ||
| 773 | |||
| 774 | @table @kbd | ||
| 775 | @findex comint-previous-input | ||
| 776 | @kindex M-p @r{(Shell mode)} | ||
| 777 | @item M-p | ||
| 778 | @itemx C-@key{UP} | ||
| 779 | Fetch the next earlier old shell command. | ||
| 780 | |||
| 781 | @kindex M-n @r{(Shell mode)} | ||
| 782 | @findex comint-next-input | ||
| 783 | @item M-n | ||
| 784 | @itemx C-@key{DOWN} | ||
| 785 | Fetch the next later old shell command. | ||
| 786 | |||
| 787 | @kindex M-r @r{(Shell mode)} | ||
| 788 | @kindex M-s @r{(Shell mode)} | ||
| 789 | @findex comint-previous-matching-input | ||
| 790 | @findex comint-next-matching-input | ||
| 791 | @item M-r @var{regexp} @key{RET} | ||
| 792 | @itemx M-s @var{regexp} @key{RET} | ||
| 793 | Search backwards or forwards for old shell commands that match @var{regexp}. | ||
| 794 | |||
| 795 | @item C-c C-x | ||
| 796 | @kindex C-c C-x @r{(Shell mode)} | ||
| 797 | @findex comint-get-next-from-history | ||
| 798 | Fetch the next subsequent command from the history. | ||
| 799 | |||
| 800 | @item C-c . | ||
| 801 | @kindex C-c . @r{(Shell mode)} | ||
| 802 | @findex comint-input-previous-argument | ||
| 803 | Fetch one argument from an old shell command. | ||
| 804 | |||
| 805 | @item C-c C-l | ||
| 806 | @kindex C-c C-l @r{(Shell mode)} | ||
| 807 | @findex comint-dynamic-list-input-ring | ||
| 808 | Display the buffer's history of shell commands in another window | ||
| 809 | (@code{comint-dynamic-list-input-ring}). | ||
| 810 | @end table | ||
| 811 | |||
| 812 | Shell buffers provide a history of previously entered shell commands. To | ||
| 813 | reuse shell commands from the history, use the editing commands @kbd{M-p}, | ||
| 814 | @kbd{M-n}, @kbd{M-r} and @kbd{M-s}. These work just like the minibuffer | ||
| 815 | history commands except that they operate on the text at the end of the | ||
| 816 | shell buffer, where you would normally insert text to send to the shell. | ||
| 817 | |||
| 818 | @kbd{M-p} fetches an earlier shell command to the end of the shell | ||
| 819 | buffer. Successive use of @kbd{M-p} fetches successively earlier | ||
| 820 | shell commands, each replacing any text that was already present as | ||
| 821 | potential shell input. @kbd{M-n} does likewise except that it finds | ||
| 822 | successively more recent shell commands from the buffer. | ||
| 823 | @kbd{C-@key{UP}} works like @kbd{M-p}, and @kbd{C-@key{DOWN}} like | ||
| 824 | @kbd{M-n}. | ||
| 825 | |||
| 826 | The history search commands @kbd{M-r} and @kbd{M-s} read a regular | ||
| 827 | expression and search through the history for a matching command. Aside | ||
| 828 | from the choice of which command to fetch, they work just like @kbd{M-p} | ||
| 829 | and @kbd{M-n}. If you enter an empty regexp, these commands reuse the | ||
| 830 | same regexp used last time. | ||
| 831 | |||
| 832 | When you find the previous input you want, you can resubmit it by | ||
| 833 | typing @key{RET}, or you can edit it first and then resubmit it if you | ||
| 834 | wish. Any partial input you were composing before navigating the | ||
| 835 | history list is restored when you go to the beginning or end of the | ||
| 836 | history ring. | ||
| 837 | |||
| 838 | Often it is useful to reexecute several successive shell commands that | ||
| 839 | were previously executed in sequence. To do this, first find and | ||
| 840 | reexecute the first command of the sequence. Then type @kbd{C-c C-x}; | ||
| 841 | that will fetch the following command---the one that follows the command | ||
| 842 | you just repeated. Then type @key{RET} to reexecute this command. You | ||
| 843 | can reexecute several successive commands by typing @kbd{C-c C-x | ||
| 844 | @key{RET}} over and over. | ||
| 845 | |||
| 846 | The command @kbd{C-c .}@: (@code{comint-input-previous-argument}) | ||
| 847 | copies an individual argument from a previous command, like @kbd{ESC | ||
| 848 | .} in Bash. The simplest use copies the last argument from the | ||
| 849 | previous shell command. With a prefix argument @var{n}, it copies the | ||
| 850 | @var{n}th argument instead. Repeating @kbd{C-c .} copies from an | ||
| 851 | earlier shell command instead, always using the same value of @var{n} | ||
| 852 | (don't give a prefix argument when you repeat the @kbd{C-c .} | ||
| 853 | command). | ||
| 854 | |||
| 855 | These commands get the text of previous shell commands from a special | ||
| 856 | history list, not from the shell buffer itself. Thus, editing the shell | ||
| 857 | buffer, or even killing large parts of it, does not affect the history | ||
| 858 | that these commands access. | ||
| 859 | |||
| 860 | @vindex shell-input-ring-file-name | ||
| 861 | Some shells store their command histories in files so that you can | ||
| 862 | refer to commands from previous shell sessions. Emacs reads | ||
| 863 | the command history file for your chosen shell, to initialize its own | ||
| 864 | command history. The file name is @file{~/.bash_history} for bash, | ||
| 865 | @file{~/.sh_history} for ksh, and @file{~/.history} for other shells. | ||
| 866 | |||
| 867 | @node Shell History Copying | ||
| 868 | @subsubsection Shell History Copying | ||
| 869 | |||
| 870 | @table @kbd | ||
| 871 | @kindex C-c C-p @r{(Shell mode)} | ||
| 872 | @findex comint-previous-prompt | ||
| 873 | @item C-c C-p | ||
| 874 | Move point to the previous prompt (@code{comint-previous-prompt}). | ||
| 875 | |||
| 876 | @kindex C-c C-n @r{(Shell mode)} | ||
| 877 | @findex comint-next-prompt | ||
| 878 | @item C-c C-n | ||
| 879 | Move point to the following prompt (@code{comint-next-prompt}). | ||
| 880 | |||
| 881 | @kindex C-c RET @r{(Shell mode)} | ||
| 882 | @findex comint-copy-old-input | ||
| 883 | @item C-c @key{RET} | ||
| 884 | Copy the input command which point is in, inserting the copy at the end | ||
| 885 | of the buffer (@code{comint-copy-old-input}). This is useful if you | ||
| 886 | move point back to a previous command. After you copy the command, you | ||
| 887 | can submit the copy as input with @key{RET}. If you wish, you can | ||
| 888 | edit the copy before resubmitting it. If you use this command on an | ||
| 889 | output line, it copies that line to the end of the buffer. | ||
| 890 | |||
| 891 | @item Mouse-2 | ||
| 892 | If @code{comint-use-prompt-regexp} is @code{nil} (the default), copy | ||
| 893 | the old input command that you click on, inserting the copy at the end | ||
| 894 | of the buffer (@code{comint-insert-input}). If | ||
| 895 | @code{comint-use-prompt-regexp} is non-@code{nil}, or if the click is | ||
| 896 | not over old input, just yank as usual. | ||
| 897 | @end table | ||
| 898 | |||
| 899 | Moving to a previous input and then copying it with @kbd{C-c | ||
| 900 | @key{RET}} or @kbd{Mouse-2} produces the same results---the same | ||
| 901 | buffer contents---that you would get by using @kbd{M-p} enough times | ||
| 902 | to fetch that previous input from the history list. However, @kbd{C-c | ||
| 903 | @key{RET}} copies the text from the buffer, which can be different | ||
| 904 | from what is in the history list if you edit the input text in the | ||
| 905 | buffer after it has been sent. | ||
| 906 | |||
| 907 | @node History References | ||
| 908 | @subsubsection Shell History References | ||
| 909 | @cindex history reference | ||
| 910 | |||
| 911 | Various shells including csh and bash support @dfn{history | ||
| 912 | references} that begin with @samp{!} and @samp{^}. Shell mode | ||
| 913 | recognizes these constructs, and can perform the history substitution | ||
| 914 | for you. | ||
| 915 | |||
| 916 | If you insert a history reference and type @key{TAB}, this searches | ||
| 917 | the input history for a matching command, performs substitution if | ||
| 918 | necessary, and places the result in the buffer in place of the history | ||
| 919 | reference. For example, you can fetch the most recent command | ||
| 920 | beginning with @samp{mv} with @kbd{! m v @key{TAB}}. You can edit the | ||
| 921 | command if you wish, and then resubmit the command to the shell by | ||
| 922 | typing @key{RET}. | ||
| 923 | |||
| 924 | @vindex comint-input-autoexpand | ||
| 925 | @findex comint-magic-space | ||
| 926 | Shell mode can optionally expand history references in the buffer | ||
| 927 | when you send them to the shell. To request this, set the variable | ||
| 928 | @code{comint-input-autoexpand} to @code{input}. You can make | ||
| 929 | @key{SPC} perform history expansion by binding @key{SPC} to the | ||
| 930 | command @code{comint-magic-space}. | ||
| 931 | |||
| 932 | Shell mode recognizes history references when they follow a prompt. | ||
| 933 | @xref{Shell Prompts}, for how Shell mode recognizes prompts. | ||
| 934 | |||
| 935 | @node Directory Tracking | ||
| 936 | @subsection Directory Tracking | ||
| 937 | @cindex directory tracking | ||
| 938 | |||
| 939 | @vindex shell-pushd-regexp | ||
| 940 | @vindex shell-popd-regexp | ||
| 941 | @vindex shell-cd-regexp | ||
| 942 | Shell mode keeps track of @samp{cd}, @samp{pushd} and @samp{popd} | ||
| 943 | commands given to the inferior shell, so it can keep the | ||
| 944 | @samp{*shell*} buffer's default directory the same as the shell's | ||
| 945 | working directory. It recognizes these commands syntactically, by | ||
| 946 | examining lines of input that are sent. | ||
| 947 | |||
| 948 | If you use aliases for these commands, you can tell Emacs to | ||
| 949 | recognize them also. For example, if the value of the variable | ||
| 950 | @code{shell-pushd-regexp} matches the beginning of a shell command | ||
| 951 | line, that line is regarded as a @code{pushd} command. Change this | ||
| 952 | variable when you add aliases for @samp{pushd}. Likewise, | ||
| 953 | @code{shell-popd-regexp} and @code{shell-cd-regexp} are used to | ||
| 954 | recognize commands with the meaning of @samp{popd} and @samp{cd}. | ||
| 955 | These commands are recognized only at the beginning of a shell command | ||
| 956 | line. | ||
| 957 | |||
| 958 | @ignore @c This seems to have been deleted long ago. | ||
| 959 | @vindex shell-set-directory-error-hook | ||
| 960 | If Emacs gets an error while trying to handle what it believes is a | ||
| 961 | @samp{cd}, @samp{pushd} or @samp{popd} command, it runs the hook | ||
| 962 | @code{shell-set-directory-error-hook} (@pxref{Hooks}). | ||
| 963 | @end ignore | ||
| 964 | |||
| 965 | @findex dirs | ||
| 966 | If Emacs gets confused about changes in the current directory of the | ||
| 967 | subshell, use the command @kbd{M-x dirs} to ask the shell what its | ||
| 968 | current directory is. This command works for shells that support the | ||
| 969 | most common command syntax; it may not work for unusual shells. | ||
| 970 | |||
| 971 | @findex dirtrack-mode | ||
| 972 | You can also use @kbd{M-x dirtrack-mode} to enable (or disable) an | ||
| 973 | alternative and more aggressive method of tracking changes in the | ||
| 974 | current directory. | ||
| 975 | |||
| 976 | @node Shell Options | ||
| 977 | @subsection Shell Mode Options | ||
| 978 | |||
| 979 | @vindex comint-scroll-to-bottom-on-input | ||
| 980 | If the variable @code{comint-scroll-to-bottom-on-input} is | ||
| 981 | non-@code{nil}, insertion and yank commands scroll the selected window | ||
| 982 | to the bottom before inserting. The default is @code{nil}. | ||
| 983 | |||
| 984 | @vindex comint-scroll-show-maximum-output | ||
| 985 | If @code{comint-scroll-show-maximum-output} is non-@code{nil}, then | ||
| 986 | arrival of output when point is at the end tries to scroll the last | ||
| 987 | line of text to the bottom line of the window, showing as much useful | ||
| 988 | text as possible. (This mimics the scrolling behavior of most | ||
| 989 | terminals.) The default is @code{t}. | ||
| 990 | |||
| 991 | @vindex comint-move-point-for-output | ||
| 992 | By setting @code{comint-move-point-for-output}, you can opt for | ||
| 993 | having point jump to the end of the buffer whenever output arrives---no | ||
| 994 | matter where in the buffer point was before. If the value is | ||
| 995 | @code{this}, point jumps in the selected window. If the value is | ||
| 996 | @code{all}, point jumps in each window that shows the Comint buffer. If | ||
| 997 | the value is @code{other}, point jumps in all nonselected windows that | ||
| 998 | show the current buffer. The default value is @code{nil}, which means | ||
| 999 | point does not jump to the end. | ||
| 1000 | |||
| 1001 | @vindex comint-prompt-read-only | ||
| 1002 | If you set @code{comint-prompt-read-only}, the prompts in the Comint | ||
| 1003 | buffer are read-only. | ||
| 1004 | |||
| 1005 | @vindex comint-input-ignoredups | ||
| 1006 | The variable @code{comint-input-ignoredups} controls whether successive | ||
| 1007 | identical inputs are stored in the input history. A non-@code{nil} | ||
| 1008 | value means to omit an input that is the same as the previous input. | ||
| 1009 | The default is @code{nil}, which means to store each input even if it is | ||
| 1010 | equal to the previous input. | ||
| 1011 | |||
| 1012 | @vindex comint-completion-addsuffix | ||
| 1013 | @vindex comint-completion-recexact | ||
| 1014 | @vindex comint-completion-autolist | ||
| 1015 | Three variables customize file name completion. The variable | ||
| 1016 | @code{comint-completion-addsuffix} controls whether completion inserts a | ||
| 1017 | space or a slash to indicate a fully completed file or directory name | ||
| 1018 | (non-@code{nil} means do insert a space or slash). | ||
| 1019 | @code{comint-completion-recexact}, if non-@code{nil}, directs @key{TAB} | ||
| 1020 | to choose the shortest possible completion if the usual Emacs completion | ||
| 1021 | algorithm cannot add even a single character. | ||
| 1022 | @code{comint-completion-autolist}, if non-@code{nil}, says to list all | ||
| 1023 | the possible completions whenever completion is not exact. | ||
| 1024 | |||
| 1025 | @vindex shell-completion-execonly | ||
| 1026 | Command completion normally considers only executable files. | ||
| 1027 | If you set @code{shell-completion-execonly} to @code{nil}, | ||
| 1028 | it considers nonexecutable files as well. | ||
| 1029 | |||
| 1030 | @findex shell-pushd-tohome | ||
| 1031 | @findex shell-pushd-dextract | ||
| 1032 | @findex shell-pushd-dunique | ||
| 1033 | You can configure the behavior of @samp{pushd}. Variables control | ||
| 1034 | whether @samp{pushd} behaves like @samp{cd} if no argument is given | ||
| 1035 | (@code{shell-pushd-tohome}), pop rather than rotate with a numeric | ||
| 1036 | argument (@code{shell-pushd-dextract}), and only add directories to the | ||
| 1037 | directory stack if they are not already on it | ||
| 1038 | (@code{shell-pushd-dunique}). The values you choose should match the | ||
| 1039 | underlying shell, of course. | ||
| 1040 | |||
| 1041 | If you want Shell mode to handle color output from shell commands, | ||
| 1042 | you can enable ANSI Color mode. Here is how to do this: | ||
| 1043 | |||
| 1044 | @example | ||
| 1045 | (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) | ||
| 1046 | @end example | ||
| 1047 | |||
| 1048 | @node Terminal emulator | ||
| 1049 | @subsection Emacs Terminal Emulator | ||
| 1050 | @findex term | ||
| 1051 | |||
| 1052 | To run a subshell in a terminal emulator, putting its typescript in | ||
| 1053 | an Emacs buffer, use @kbd{M-x term}. This creates (or reuses) a | ||
| 1054 | buffer named @samp{*terminal*}, and runs a subshell with input coming | ||
| 1055 | from your keyboard, and output going to that buffer. | ||
| 1056 | |||
| 1057 | The terminal emulator uses Term mode, which has two input modes. In | ||
| 1058 | line mode, Term basically acts like Shell mode; see @ref{Shell Mode}. | ||
| 1059 | |||
| 1060 | In char mode, each character is sent directly to the inferior | ||
| 1061 | subshell, as ``terminal input.'' Any ``echoing'' of your input is the | ||
| 1062 | responsibility of the subshell. The sole exception is the terminal | ||
| 1063 | escape character, which by default is @kbd{C-c} (@pxref{Term Mode}). | ||
| 1064 | Any ``terminal output'' from the subshell goes into the buffer, | ||
| 1065 | advancing point. | ||
| 1066 | |||
| 1067 | Some programs (such as Emacs itself) need to control the appearance | ||
| 1068 | on the terminal screen in detail. They do this by sending special | ||
| 1069 | control codes. The exact control codes needed vary from terminal to | ||
| 1070 | terminal, but nowadays most terminals and terminal emulators | ||
| 1071 | (including @code{xterm}) understand the ANSI-standard (VT100-style) | ||
| 1072 | escape sequences. Term mode recognizes these escape sequences, and | ||
| 1073 | handles each one appropriately, changing the buffer so that the | ||
| 1074 | appearance of the window matches what it would be on a real terminal. | ||
| 1075 | You can actually run Emacs inside an Emacs Term window. | ||
| 1076 | |||
| 1077 | The file name used to load the subshell is determined the same way | ||
| 1078 | as for Shell mode. To make multiple terminal emulators, rename the | ||
| 1079 | buffer @samp{*terminal*} to something different using @kbd{M-x | ||
| 1080 | rename-uniquely}, just as with Shell mode. | ||
| 1081 | |||
| 1082 | Unlike Shell mode, Term mode does not track the current directory by | ||
| 1083 | examining your input. But some shells can tell Term what the current | ||
| 1084 | directory is. This is done automatically by @code{bash} version 1.15 | ||
| 1085 | and later. | ||
| 1086 | |||
| 1087 | @node Term Mode | ||
| 1088 | @subsection Term Mode | ||
| 1089 | @cindex Term mode | ||
| 1090 | @cindex mode, Term | ||
| 1091 | |||
| 1092 | The terminal emulator uses Term mode, which has two input modes. In | ||
| 1093 | line mode, Term basically acts like Shell mode; see @ref{Shell Mode}. | ||
| 1094 | In char mode, each character is sent directly to the inferior | ||
| 1095 | subshell, except for the Term escape character, normally @kbd{C-c}. | ||
| 1096 | |||
| 1097 | To switch between line and char mode, use these commands: | ||
| 1098 | |||
| 1099 | @table @kbd | ||
| 1100 | @kindex C-c C-j @r{(Term mode)} | ||
| 1101 | @findex term-char-mode | ||
| 1102 | @item C-c C-j | ||
| 1103 | Switch to line mode. Do nothing if already in line mode. | ||
| 1104 | |||
| 1105 | @kindex C-c C-k @r{(Term mode)} | ||
| 1106 | @findex term-line-mode | ||
| 1107 | @item C-c C-k | ||
| 1108 | Switch to char mode. Do nothing if already in char mode. | ||
| 1109 | @end table | ||
| 1110 | |||
| 1111 | The following commands are only available in char mode: | ||
| 1112 | |||
| 1113 | @table @kbd | ||
| 1114 | @item C-c C-c | ||
| 1115 | Send a literal @key{C-c} to the sub-shell. | ||
| 1116 | |||
| 1117 | @item C-c @var{char} | ||
| 1118 | This is equivalent to @kbd{C-x @var{char}} in normal Emacs. For | ||
| 1119 | example, @kbd{C-c o} invokes the global binding of @kbd{C-x o}, which | ||
| 1120 | is normally @samp{other-window}. | ||
| 1121 | @end table | ||
| 1122 | |||
| 1123 | @node Paging in Term | ||
| 1124 | @subsection Page-At-A-Time Output | ||
| 1125 | @cindex page-at-a-time | ||
| 1126 | |||
| 1127 | Term mode has a page-at-a-time feature. When enabled it makes | ||
| 1128 | output pause at the end of each screenful. | ||
| 1129 | |||
| 1130 | @table @kbd | ||
| 1131 | @kindex C-c C-q @r{(Term mode)} | ||
| 1132 | @findex term-pager-toggle | ||
| 1133 | @item C-c C-q | ||
| 1134 | Toggle the page-at-a-time feature. This command works in both line | ||
| 1135 | and char modes. When page-at-a-time is enabled, the mode-line | ||
| 1136 | displays the word @samp{page}. | ||
| 1137 | @end table | ||
| 1138 | |||
| 1139 | With page-at-a-time enabled, whenever Term receives more than a | ||
| 1140 | screenful of output since your last input, it pauses, displaying | ||
| 1141 | @samp{**MORE**} in the mode-line. Type @key{SPC} to display the next | ||
| 1142 | screenful of output. Type @kbd{?} to see your other options. The | ||
| 1143 | interface is similar to the @code{more} program. | ||
| 1144 | |||
| 1145 | @node Remote Host | ||
| 1146 | @subsection Remote Host Shell | ||
| 1147 | @cindex remote host | ||
| 1148 | @cindex connecting to remote host | ||
| 1149 | @cindex Telnet | ||
| 1150 | @cindex Rlogin | ||
| 1151 | |||
| 1152 | You can login to a remote computer, using whatever commands you | ||
| 1153 | would from a regular terminal (e.g.@: using the @code{telnet} or | ||
| 1154 | @code{rlogin} commands), from a Term window. | ||
| 1155 | |||
| 1156 | A program that asks you for a password will normally suppress | ||
| 1157 | echoing of the password, so the password will not show up in the | ||
| 1158 | buffer. This will happen just as if you were using a real terminal, | ||
| 1159 | if the buffer is in char mode. If it is in line mode, the password is | ||
| 1160 | temporarily visible, but will be erased when you hit return. (This | ||
| 1161 | happens automatically; there is no special password processing.) | ||
| 1162 | |||
| 1163 | When you log in to a different machine, you need to specify the type | ||
| 1164 | of terminal you're using, by setting the @env{TERM} environment | ||
| 1165 | variable in the environment for the remote login command. (If you use | ||
| 1166 | bash, you do that by writing the variable assignment before the remote | ||
| 1167 | login command, without separating comma.) Terminal types @samp{ansi} | ||
| 1168 | or @samp{vt100} will work on most systems. | ||
| 1169 | |||
| 1170 | @c If you are talking to a Bourne-compatible | ||
| 1171 | @c shell, and your system understands the @env{TERMCAP} variable, | ||
| 1172 | @c you can use the command @kbd{M-x shell-send-termcap}, which | ||
| 1173 | @c sends a string specifying the terminal type and size. | ||
| 1174 | @c (This command is also useful after the window has changed size.) | ||
| 1175 | |||
| 1176 | @c You can of course run @samp{gdb} on that remote computer. One useful | ||
| 1177 | @c trick: If you invoke gdb with the @code{--fullname} option, | ||
| 1178 | @c it will send special commands to Emacs that will cause Emacs to | ||
| 1179 | @c pop up the source files you're debugging. This will work | ||
| 1180 | @c whether or not gdb is running on a different computer than Emacs, | ||
| 1181 | @c as long as Emacs can access the source files specified by gdb. | ||
| 1182 | |||
| 1183 | @ignore | ||
| 1184 | You cannot log in to a remote computer using the Shell mode. | ||
| 1185 | @c (This will change when Shell is re-written to use Term.) | ||
| 1186 | Instead, Emacs provides two commands for logging in to another computer | ||
| 1187 | and communicating with it through an Emacs buffer using Comint mode: | ||
| 1188 | |||
| 1189 | @table @kbd | ||
| 1190 | @item M-x telnet @key{RET} @var{hostname} @key{RET} | ||
| 1191 | Set up a Telnet connection to the computer named @var{hostname}. | ||
| 1192 | @item M-x rlogin @key{RET} @var{hostname} @key{RET} | ||
| 1193 | Set up an Rlogin connection to the computer named @var{hostname}. | ||
| 1194 | @end table | ||
| 1195 | |||
| 1196 | @findex telnet | ||
| 1197 | Use @kbd{M-x telnet} to set up a Telnet connection to another | ||
| 1198 | computer. (Telnet is the standard Internet protocol for remote login.) | ||
| 1199 | It reads the host name of the other computer as an argument with the | ||
| 1200 | minibuffer. Once the connection is established, talking to the other | ||
| 1201 | computer works like talking to a subshell: you can edit input with the | ||
| 1202 | usual Emacs commands, and send it a line at a time by typing @key{RET}. | ||
| 1203 | The output is inserted in the Telnet buffer interspersed with the input. | ||
| 1204 | |||
| 1205 | @findex rlogin | ||
| 1206 | @vindex rlogin-explicit-args | ||
| 1207 | Use @kbd{M-x rlogin} to set up an Rlogin connection. Rlogin is | ||
| 1208 | another remote login communication protocol, essentially much like the | ||
| 1209 | Telnet protocol but incompatible with it, and supported only by certain | ||
| 1210 | systems. Rlogin's advantages are that you can arrange not to have to | ||
| 1211 | give your user name and password when communicating between two machines | ||
| 1212 | you frequently use, and that you can make an 8-bit-clean connection. | ||
| 1213 | (To do that in Emacs, set @code{rlogin-explicit-args} to @code{("-8")} | ||
| 1214 | before you run Rlogin.) | ||
| 1215 | |||
| 1216 | @kbd{M-x rlogin} sets up the default file directory of the Emacs | ||
| 1217 | buffer to access the remote host via FTP (@pxref{File Names}), and it | ||
| 1218 | tracks the shell commands that change the current directory, just like | ||
| 1219 | Shell mode. | ||
| 1220 | |||
| 1221 | @findex rlogin-directory-tracking-mode | ||
| 1222 | There are two ways of doing directory tracking in an Rlogin | ||
| 1223 | buffer---either with remote directory names | ||
| 1224 | @file{/@var{host}:@var{dir}/} or with local names (that works if the | ||
| 1225 | ``remote'' machine shares file systems with your machine of origin). | ||
| 1226 | You can use the command @code{rlogin-directory-tracking-mode} to switch | ||
| 1227 | modes. No argument means use remote directory names, a positive | ||
| 1228 | argument means use local names, and a negative argument means turn | ||
| 1229 | off directory tracking. | ||
| 1230 | |||
| 1231 | @end ignore | ||
| 1232 | |||
| 1233 | @node Emacs Server, Printing, Shell, Top | ||
| 1234 | @section Using Emacs as a Server | ||
| 1235 | @pindex emacsclient | ||
| 1236 | @cindex Emacs as a server | ||
| 1237 | @cindex server, using Emacs as | ||
| 1238 | @cindex @env{EDITOR} environment variable | ||
| 1239 | |||
| 1240 | Various programs such as @code{mail} can invoke your choice of editor | ||
| 1241 | to edit a particular piece of text, such as a message that you are | ||
| 1242 | sending. By convention, most of these programs use the environment | ||
| 1243 | variable @env{EDITOR} to specify which editor to run. If you set | ||
| 1244 | @env{EDITOR} to @samp{emacs}, they invoke Emacs---but in an | ||
| 1245 | inconvenient fashion, by starting a new, separate Emacs process. This | ||
| 1246 | is inconvenient because it takes time and because the new Emacs process | ||
| 1247 | doesn't share the buffers with any existing Emacs process. | ||
| 1248 | |||
| 1249 | You can arrange to use your existing Emacs process as the editor for | ||
| 1250 | programs like @code{mail} by using the Emacs client program and the | ||
| 1251 | server that is part of Emacs. Here is how. | ||
| 1252 | |||
| 1253 | @cindex @env{TEXEDIT} environment variable | ||
| 1254 | @findex server-start | ||
| 1255 | First, the preparations. Within Emacs, call the function | ||
| 1256 | @code{server-start}. (Your @file{.emacs} init file can do this | ||
| 1257 | automatically if you add the expression @code{(server-start)} to it, | ||
| 1258 | see @ref{Init File}.) Then, outside Emacs, set the @env{EDITOR} | ||
| 1259 | environment variable to @samp{emacsclient}. (Note that some programs | ||
| 1260 | use a different environment variable; for example, to make @TeX{} use | ||
| 1261 | @samp{emacsclient}, you should set the @env{TEXEDIT} environment | ||
| 1262 | variable to @samp{emacsclient +%d %s}.) | ||
| 1263 | |||
| 1264 | @pindex emacs.bash | ||
| 1265 | @cindex Bash command to use Emacs server | ||
| 1266 | As an alternative to using @code{emacsclient}, the file | ||
| 1267 | @file{etc/emacs.bash} defines a Bash command @code{edit} which will | ||
| 1268 | communicate with a running Emacs session, or start one if none exist. | ||
| 1269 | |||
| 1270 | @kindex C-x # | ||
| 1271 | @findex server-edit | ||
| 1272 | Now, whenever any program invokes your specified @env{EDITOR} | ||
| 1273 | program, the effect is to send a message to your principal Emacs telling | ||
| 1274 | it to visit a file. (That's what the program @code{emacsclient} does.) | ||
| 1275 | Emacs displays the buffer immediately and you can immediately begin | ||
| 1276 | editing it in the already running Emacs session. | ||
| 1277 | |||
| 1278 | When you've finished editing that buffer, type @kbd{C-x #} | ||
| 1279 | (@code{server-edit}). This saves the file and sends a message back to | ||
| 1280 | the @code{emacsclient} program telling it to exit. The programs that | ||
| 1281 | use @env{EDITOR} wait for the ``editor'' (actually, @code{emacsclient}) | ||
| 1282 | to exit. @kbd{C-x #} also checks for other pending external requests | ||
| 1283 | to edit various files, and selects the next such file. | ||
| 1284 | |||
| 1285 | You can switch to a server buffer manually if you wish; you don't | ||
| 1286 | have to arrive at it with @kbd{C-x #}. But @kbd{C-x #} is the way to | ||
| 1287 | say that you are finished with one. | ||
| 1288 | |||
| 1289 | @vindex server-kill-new-buffers | ||
| 1290 | @vindex server-temp-file-regexp | ||
| 1291 | Finishing with a server buffer also kills the buffer, unless it | ||
| 1292 | already existed in the Emacs session before the server asked to create | ||
| 1293 | it. However, if you set @code{server-kill-new-buffers} to @code{nil}, | ||
| 1294 | then a different criterion is used: finishing with a server buffer | ||
| 1295 | kills it if the file name matches the regular expression | ||
| 1296 | @code{server-temp-file-regexp}. This is set up to distinguish certain | ||
| 1297 | ``temporary'' files. | ||
| 1298 | |||
| 1299 | @vindex server-window | ||
| 1300 | If you set the variable @code{server-window} to a window or a frame, | ||
| 1301 | @kbd{C-x #} displays the server buffer in that window or in that frame. | ||
| 1302 | |||
| 1303 | @vindex server-name | ||
| 1304 | You can run multiple Emacs servers on the same machine by giving | ||
| 1305 | each one a unique ``server name'', using the variable | ||
| 1306 | @code{server-name}. For example, @kbd{M-x set-variable @key{RET} | ||
| 1307 | server-name @key{RET} foo @key{RET}} sets the server name to | ||
| 1308 | @samp{foo}. The @code{emacsclient} program can specify a server by | ||
| 1309 | name using the @samp{-s} option. @xref{Invoking emacsclient}. | ||
| 1310 | |||
| 1311 | While @code{mail} or another application is waiting for | ||
| 1312 | @code{emacsclient} to finish, @code{emacsclient} does not read terminal | ||
| 1313 | input. So the terminal that @code{mail} was using is effectively | ||
| 1314 | blocked for the duration. In order to edit with your principal Emacs, | ||
| 1315 | you need to be able to use it without using that terminal. There are | ||
| 1316 | three ways to do this: | ||
| 1317 | |||
| 1318 | @itemize @bullet | ||
| 1319 | @item | ||
| 1320 | Using a window system, run @code{mail} and the principal Emacs in two | ||
| 1321 | separate windows. While @code{mail} is waiting for @code{emacsclient}, | ||
| 1322 | the window where it was running is blocked, but you can use Emacs by | ||
| 1323 | switching windows. | ||
| 1324 | |||
| 1325 | @item | ||
| 1326 | Using virtual terminals, run @code{mail} in one virtual terminal | ||
| 1327 | and run Emacs in another. | ||
| 1328 | |||
| 1329 | @item | ||
| 1330 | Use Shell mode or Term mode in Emacs to run the other program such as | ||
| 1331 | @code{mail}; then, @code{emacsclient} blocks only the subshell under | ||
| 1332 | Emacs, and you can still use Emacs to edit the file. | ||
| 1333 | @end itemize | ||
| 1334 | |||
| 1335 | If you run @code{emacsclient} with the option @samp{--no-wait}, it | ||
| 1336 | returns immediately without waiting for you to ``finish'' the buffer | ||
| 1337 | in Emacs. Note that server buffers created in this way are not killed | ||
| 1338 | automatically when you finish with them. | ||
| 1339 | |||
| 1340 | @menu | ||
| 1341 | * Invoking emacsclient:: Emacs client startup options. | ||
| 1342 | @end menu | ||
| 1343 | |||
| 1344 | @node Invoking emacsclient,, Emacs Server, Emacs Server | ||
| 1345 | @subsection Invoking @code{emacsclient} | ||
| 1346 | @cindex @code{emacsclient} invocation and options | ||
| 1347 | |||
| 1348 | To run the @code{emacsclient} program, specify file names as arguments, | ||
| 1349 | and optionally line numbers as well, like this: | ||
| 1350 | |||
| 1351 | @example | ||
| 1352 | emacsclient @r{@{}@r{[}+@var{line}@r{[}@var{column}@r{]}@r{]} @var{filename}@r{@}}@dots{} | ||
| 1353 | @end example | ||
| 1354 | |||
| 1355 | @noindent | ||
| 1356 | This tells Emacs to visit each of the specified files; if you specify a | ||
| 1357 | line number for a certain file, Emacs moves to that line in the file. | ||
| 1358 | If you specify a column number as well, Emacs puts point on that column | ||
| 1359 | in the line. | ||
| 1360 | |||
| 1361 | Ordinarily, @code{emacsclient} does not return until you use the | ||
| 1362 | @kbd{C-x #} command on each of these buffers. When that happens, | ||
| 1363 | Emacs sends a message to the @code{emacsclient} program telling it to | ||
| 1364 | return. | ||
| 1365 | |||
| 1366 | If you invoke @code{emacsclient} for more than one file, the | ||
| 1367 | additional client buffers are buried at the bottom of the buffer list | ||
| 1368 | (@pxref{Buffers}). If you call @kbd{C-x #} after you are done editing | ||
| 1369 | a client buffer, the next client buffer is automatically selected. | ||
| 1370 | |||
| 1371 | But if you use the option @samp{-n} or @samp{--no-wait} when running | ||
| 1372 | @code{emacsclient}, then it returns immediately. (You can take as | ||
| 1373 | long as you like to edit the files in Emacs.) | ||
| 1374 | |||
| 1375 | The option @samp{-a @var{command}} or | ||
| 1376 | @samp{--alternate-editor=@var{command}} specifies a command to run if | ||
| 1377 | @code{emacsclient} fails to contact Emacs. This is useful when | ||
| 1378 | running @code{emacsclient} in a script. For example, the following | ||
| 1379 | setting for the @env{EDITOR} environment variable will always give you | ||
| 1380 | an editor, even if no Emacs server is running: | ||
| 1381 | |||
| 1382 | @example | ||
| 1383 | EDITOR="emacsclient --alternate-editor emacs +%d %s" | ||
| 1384 | @end example | ||
| 1385 | |||
| 1386 | @noindent | ||
| 1387 | @cindex @env{ALTERNATE_EDITOR} environment variable | ||
| 1388 | The environment variable @env{ALTERNATE_EDITOR} has the same effect, with | ||
| 1389 | the value of the @samp{--alternate-editor} option taking precedence. | ||
| 1390 | |||
| 1391 | If you use several displays, you can tell Emacs on which display to | ||
| 1392 | open the given files with the @samp{-d @var{display}} or | ||
| 1393 | @samp{--display=@var{display}} option to @code{emacsclient}. This is | ||
| 1394 | handy when connecting from home to an Emacs session running on your | ||
| 1395 | machine at your workplace. | ||
| 1396 | |||
| 1397 | If there is more than one Emacs server running, you can specify a | ||
| 1398 | server name with the @samp{-s @var{name}} or | ||
| 1399 | @samp{--socket-name=@var{name}} option to @code{emacsclient}. (This | ||
| 1400 | option is not supported on MS-Windows.) | ||
| 1401 | |||
| 1402 | You can also use @code{emacsclient} to execute any piece of Emacs Lisp | ||
| 1403 | code, using the @samp{-e} or @samp{--eval} option. When this option | ||
| 1404 | is given, the rest of the arguments is interpreted as a list of | ||
| 1405 | expressions to evaluate, not a list of files to visit. | ||
| 1406 | |||
| 1407 | @cindex @env{EMACS_SERVER_FILE} environment variable | ||
| 1408 | When you start the Emacs server (by calling @code{server-start}), | ||
| 1409 | Emacs creates a file with information about TCP connection to the | ||
| 1410 | server: the host where Emacs is running, the port where it is | ||
| 1411 | listening, and an authentication string. @code{emacsclient} uses this | ||
| 1412 | information if it needs to connect to the server via TCP. By default, | ||
| 1413 | the file goes in the @file{~/.emacs.d/server/} directory@footnote{On | ||
| 1414 | MS-Windows, if @env{HOME} is not set or the TCP configuration file | ||
| 1415 | cannot be found there, Emacs also looks for the file in the | ||
| 1416 | @file{.emacs.d/server/} subdirectory of the directory pointed to by | ||
| 1417 | the @env{APPDATA} environment variable.}. You can specify the file | ||
| 1418 | name to use with the @samp{-f @var{file}} or | ||
| 1419 | @samp{--server-file=@var{file}} options, or by setting | ||
| 1420 | @env{EMACS_SERVER_FILE} environment variable to the file name. | ||
| 1421 | |||
| 1422 | @node Printing, Sorting, Emacs Server, Top | ||
| 1423 | @section Printing Hard Copies | ||
| 1424 | @cindex hardcopy | ||
| 1425 | @cindex printing | ||
| 1426 | |||
| 1427 | Emacs provides commands for printing hard copies of either an entire | ||
| 1428 | buffer or just part of one, with or without page headers. You can | ||
| 1429 | invoke the printing commands directly, as detailed in the following | ||
| 1430 | section, or using the @samp{File} menu on the menu bar. See also the | ||
| 1431 | hardcopy commands of Dired (@pxref{Misc File Ops}) and the diary | ||
| 1432 | (@pxref{Displaying the Diary}). | ||
| 1433 | |||
| 1434 | @table @kbd | ||
| 1435 | @item M-x print-buffer | ||
| 1436 | Print hardcopy of current buffer with page headings containing the file | ||
| 1437 | name and page number. | ||
| 1438 | @item M-x lpr-buffer | ||
| 1439 | Print hardcopy of current buffer without page headings. | ||
| 1440 | @item M-x print-region | ||
| 1441 | Like @code{print-buffer} but print only the current region. | ||
| 1442 | @item M-x lpr-region | ||
| 1443 | Like @code{lpr-buffer} but print only the current region. | ||
| 1444 | @end table | ||
| 1445 | |||
| 1446 | @findex print-buffer | ||
| 1447 | @findex print-region | ||
| 1448 | @findex lpr-buffer | ||
| 1449 | @findex lpr-region | ||
| 1450 | @vindex lpr-switches | ||
| 1451 | The hardcopy commands (aside from the PostScript commands) pass extra | ||
| 1452 | switches to the @code{lpr} program based on the value of the variable | ||
| 1453 | @code{lpr-switches}. Its value should be a list of strings, each string | ||
| 1454 | an option starting with @samp{-}. For example, to specify a line width | ||
| 1455 | of 80 columns for all the printing you do in Emacs, set | ||
| 1456 | @code{lpr-switches} like this: | ||
| 1457 | |||
| 1458 | @example | ||
| 1459 | (setq lpr-switches '("-w80")) | ||
| 1460 | @end example | ||
| 1461 | |||
| 1462 | @vindex printer-name | ||
| 1463 | You can specify the printer to use by setting the variable | ||
| 1464 | @code{printer-name}. | ||
| 1465 | |||
| 1466 | @vindex lpr-headers-switches | ||
| 1467 | @vindex lpr-commands | ||
| 1468 | @vindex lpr-add-switches | ||
| 1469 | The variable @code{lpr-command} specifies the name of the printer | ||
| 1470 | program to run; the default value depends on your operating system type. | ||
| 1471 | On most systems, the default is @code{"lpr"}. The variable | ||
| 1472 | @code{lpr-headers-switches} similarly specifies the extra switches to | ||
| 1473 | use to make page headers. The variable @code{lpr-add-switches} controls | ||
| 1474 | whether to supply @samp{-T} and @samp{-J} options (suitable for | ||
| 1475 | @code{lpr}) to the printer program: @code{nil} means don't add them. | ||
| 1476 | @code{lpr-add-switches} should be @code{nil} if your printer program is | ||
| 1477 | not compatible with @code{lpr}. | ||
| 1478 | |||
| 1479 | @menu | ||
| 1480 | * PostScript:: Printing buffers or regions as PostScript. | ||
| 1481 | * PostScript Variables:: Customizing the PostScript printing commands. | ||
| 1482 | * Printing Package:: An optional advanced printing interface. | ||
| 1483 | @end menu | ||
| 1484 | |||
| 1485 | @node PostScript, PostScript Variables,, Printing | ||
| 1486 | @section PostScript Hardcopy | ||
| 1487 | |||
| 1488 | These commands convert buffer contents to PostScript, | ||
| 1489 | either printing it or leaving it in another Emacs buffer. | ||
| 1490 | |||
| 1491 | @table @kbd | ||
| 1492 | @item M-x ps-print-buffer | ||
| 1493 | Print hardcopy of the current buffer in PostScript form. | ||
| 1494 | @item M-x ps-print-region | ||
| 1495 | Print hardcopy of the current region in PostScript form. | ||
| 1496 | @item M-x ps-print-buffer-with-faces | ||
| 1497 | Print hardcopy of the current buffer in PostScript form, showing the | ||
| 1498 | faces used in the text by means of PostScript features. | ||
| 1499 | @item M-x ps-print-region-with-faces | ||
| 1500 | Print hardcopy of the current region in PostScript form, showing the | ||
| 1501 | faces used in the text. | ||
| 1502 | @item M-x ps-spool-buffer | ||
| 1503 | Generate PostScript for the current buffer text. | ||
| 1504 | @item M-x ps-spool-region | ||
| 1505 | Generate PostScript for the current region. | ||
| 1506 | @item M-x ps-spool-buffer-with-faces | ||
| 1507 | Generate PostScript for the current buffer, showing the faces used. | ||
| 1508 | @item M-x ps-spool-region-with-faces | ||
| 1509 | Generate PostScript for the current region, showing the faces used. | ||
| 1510 | @item M-x handwrite | ||
| 1511 | Generates/prints PostScript for the current buffer as if handwritten. | ||
| 1512 | @end table | ||
| 1513 | |||
| 1514 | @findex ps-print-region | ||
| 1515 | @findex ps-print-buffer | ||
| 1516 | @findex ps-print-region-with-faces | ||
| 1517 | @findex ps-print-buffer-with-faces | ||
| 1518 | The PostScript commands, @code{ps-print-buffer} and | ||
| 1519 | @code{ps-print-region}, print buffer contents in PostScript form. One | ||
| 1520 | command prints the entire buffer; the other, just the region. The | ||
| 1521 | corresponding @samp{-with-faces} commands, | ||
| 1522 | @code{ps-print-buffer-with-faces} and @code{ps-print-region-with-faces}, | ||
| 1523 | use PostScript features to show the faces (fonts and colors) in the text | ||
| 1524 | properties of the text being printed. | ||
| 1525 | |||
| 1526 | If you are using a color display, you can print a buffer of program | ||
| 1527 | code with color highlighting by turning on Font-Lock mode in that | ||
| 1528 | buffer, and using @code{ps-print-buffer-with-faces}. | ||
| 1529 | |||
| 1530 | @findex ps-spool-region | ||
| 1531 | @findex ps-spool-buffer | ||
| 1532 | @findex ps-spool-region-with-faces | ||
| 1533 | @findex ps-spool-buffer-with-faces | ||
| 1534 | The commands whose names have @samp{spool} instead of @samp{print} | ||
| 1535 | generate the PostScript output in an Emacs buffer instead of sending | ||
| 1536 | it to the printer. | ||
| 1537 | |||
| 1538 | @findex handwrite | ||
| 1539 | @cindex handwriting | ||
| 1540 | @kbd{M-x handwrite} is more frivolous. It generates a PostScript | ||
| 1541 | rendition of the current buffer as a cursive handwritten document. It | ||
| 1542 | can be customized in group @code{handwrite}. This function only | ||
| 1543 | supports ISO 8859-1 characters. | ||
| 1544 | |||
| 1545 | @ifnottex | ||
| 1546 | The following section describes variables for customizing these commands. | ||
| 1547 | @end ifnottex | ||
| 1548 | |||
| 1549 | @node PostScript Variables, Printing Package, PostScript, Printing | ||
| 1550 | @section Variables for PostScript Hardcopy | ||
| 1551 | |||
| 1552 | @vindex ps-lpr-command | ||
| 1553 | @vindex ps-lpr-switches | ||
| 1554 | @vindex ps-printer-name | ||
| 1555 | All the PostScript hardcopy commands use the variables | ||
| 1556 | @code{ps-lpr-command} and @code{ps-lpr-switches} to specify how to print | ||
| 1557 | the output. @code{ps-lpr-command} specifies the command name to run, | ||
| 1558 | @code{ps-lpr-switches} specifies command line options to use, and | ||
| 1559 | @code{ps-printer-name} specifies the printer. If you don't set the | ||
| 1560 | first two variables yourself, they take their initial values from | ||
| 1561 | @code{lpr-command} and @code{lpr-switches}. If @code{ps-printer-name} | ||
| 1562 | is @code{nil}, @code{printer-name} is used. | ||
| 1563 | |||
| 1564 | @vindex ps-print-header | ||
| 1565 | The variable @code{ps-print-header} controls whether these commands | ||
| 1566 | add header lines to each page---set it to @code{nil} to turn headers | ||
| 1567 | off. | ||
| 1568 | |||
| 1569 | @cindex color emulation on black-and-white printers | ||
| 1570 | @vindex ps-print-color-p | ||
| 1571 | If your printer doesn't support colors, you should turn off color | ||
| 1572 | processing by setting @code{ps-print-color-p} to @code{nil}. By | ||
| 1573 | default, if the display supports colors, Emacs produces hardcopy output | ||
| 1574 | with color information; on black-and-white printers, colors are emulated | ||
| 1575 | with shades of gray. This might produce illegible output, even if your | ||
| 1576 | screen colors only use shades of gray. | ||
| 1577 | |||
| 1578 | @vindex ps-use-face-background | ||
| 1579 | By default, PostScript printing ignores the background colors of the | ||
| 1580 | faces, unless the variable @code{ps-use-face-background} is | ||
| 1581 | non-@code{nil}. This is to avoid unwanted interference with the zebra | ||
| 1582 | stripes and background image/text. | ||
| 1583 | |||
| 1584 | @vindex ps-paper-type | ||
| 1585 | @vindex ps-page-dimensions-database | ||
| 1586 | The variable @code{ps-paper-type} specifies which size of paper to | ||
| 1587 | format for; legitimate values include @code{a4}, @code{a3}, | ||
| 1588 | @code{a4small}, @code{b4}, @code{b5}, @code{executive}, @code{ledger}, | ||
| 1589 | @code{legal}, @code{letter}, @code{letter-small}, @code{statement}, | ||
| 1590 | @code{tabloid}. The default is @code{letter}. You can define | ||
| 1591 | additional paper sizes by changing the variable | ||
| 1592 | @code{ps-page-dimensions-database}. | ||
| 1593 | |||
| 1594 | @vindex ps-landscape-mode | ||
| 1595 | The variable @code{ps-landscape-mode} specifies the orientation of | ||
| 1596 | printing on the page. The default is @code{nil}, which stands for | ||
| 1597 | ``portrait'' mode. Any non-@code{nil} value specifies ``landscape'' | ||
| 1598 | mode. | ||
| 1599 | |||
| 1600 | @vindex ps-number-of-columns | ||
| 1601 | The variable @code{ps-number-of-columns} specifies the number of | ||
| 1602 | columns; it takes effect in both landscape and portrait mode. The | ||
| 1603 | default is 1. | ||
| 1604 | |||
| 1605 | @vindex ps-font-family | ||
| 1606 | @vindex ps-font-size | ||
| 1607 | @vindex ps-font-info-database | ||
| 1608 | The variable @code{ps-font-family} specifies which font family to use | ||
| 1609 | for printing ordinary text. Legitimate values include @code{Courier}, | ||
| 1610 | @code{Helvetica}, @code{NewCenturySchlbk}, @code{Palatino} and | ||
| 1611 | @code{Times}. The variable @code{ps-font-size} specifies the size of | ||
| 1612 | the font for ordinary text. It defaults to 8.5 points. | ||
| 1613 | |||
| 1614 | @vindex ps-multibyte-buffer | ||
| 1615 | @cindex Intlfonts for PostScript printing | ||
| 1616 | @cindex fonts for PostScript printing | ||
| 1617 | Emacs supports more scripts and characters than a typical PostScript | ||
| 1618 | printer. Thus, some of the characters in your buffer might not be | ||
| 1619 | printable using the fonts built into your printer. You can augment | ||
| 1620 | the fonts supplied with the printer with those from the GNU Intlfonts | ||
| 1621 | package, or you can instruct Emacs to use Intlfonts exclusively. The | ||
| 1622 | variable @code{ps-multibyte-buffer} controls this: the default value, | ||
| 1623 | @code{nil}, is appropriate for printing @acronym{ASCII} and Latin-1 | ||
| 1624 | characters; a value of @code{non-latin-printer} is for printers which | ||
| 1625 | have the fonts for @acronym{ASCII}, Latin-1, Japanese, and Korean | ||
| 1626 | characters built into them. A value of @code{bdf-font} arranges for | ||
| 1627 | the BDF fonts from the Intlfonts package to be used for @emph{all} | ||
| 1628 | characters. Finally, a value of @code{bdf-font-except-latin} | ||
| 1629 | instructs the printer to use built-in fonts for @acronym{ASCII} and Latin-1 | ||
| 1630 | characters, and Intlfonts BDF fonts for the rest. | ||
| 1631 | |||
| 1632 | @vindex bdf-directory-list | ||
| 1633 | To be able to use the BDF fonts, Emacs needs to know where to find | ||
| 1634 | them. The variable @code{bdf-directory-list} holds the list of | ||
| 1635 | directories where Emacs should look for the fonts; the default value | ||
| 1636 | includes a single directory @file{/usr/local/share/emacs/fonts/bdf}. | ||
| 1637 | |||
| 1638 | Many other customization variables for these commands are defined and | ||
| 1639 | described in the Lisp files @file{ps-print.el} and @file{ps-mule.el}. | ||
| 1640 | |||
| 1641 | @node Printing Package,, PostScript Variables, Printing | ||
| 1642 | @section Printing Package | ||
| 1643 | @cindex Printing package | ||
| 1644 | |||
| 1645 | The basic Emacs facilities for printing hardcopy can be extended | ||
| 1646 | using the Printing package. This provides an easy-to-use interface | ||
| 1647 | for choosing what to print, previewing PostScript files before | ||
| 1648 | printing, and setting various printing options such as print headers, | ||
| 1649 | landscape or portrait modes, duplex modes, and so forth. On GNU/Linux | ||
| 1650 | or Unix systems, the Printing package relies on the @file{gs} and | ||
| 1651 | @file{gv} utilities, which are distributed as part of the GhostScript | ||
| 1652 | program. On MS-Windows, the @file{gstools} port of Ghostscript can be | ||
| 1653 | used. | ||
| 1654 | |||
| 1655 | @findex pr-interface | ||
| 1656 | To use the Printing package, add @code{(require 'printing)} to your | ||
| 1657 | init file (@pxref{Init File}), followed by @code{(pr-update-menus)}. | ||
| 1658 | This function replaces the usual printing commands in the menu bar | ||
| 1659 | with a @samp{Printing} submenu that contains various printing options. | ||
| 1660 | You can also type @kbd{M-x pr-interface RET}; this creates a | ||
| 1661 | @samp{*Printing Interface*} buffer, similar to a customization buffer, | ||
| 1662 | where you can set the printing options. After selecting what and how | ||
| 1663 | to print, you start the print job using the @samp{Print} button (click | ||
| 1664 | @kbd{mouse-2} on it, or move point over it and type @kbd{RET}). For | ||
| 1665 | further information on the various options, use the @samp{Interface | ||
| 1666 | Help} button. | ||
| 1667 | |||
| 1668 | @node Sorting, Narrowing, Printing, Top | ||
| 1669 | @section Sorting Text | ||
| 1670 | @cindex sorting | ||
| 1671 | |||
| 1672 | Emacs provides several commands for sorting text in the buffer. All | ||
| 1673 | operate on the contents of the region. | ||
| 1674 | They divide the text of the region into many @dfn{sort records}, | ||
| 1675 | identify a @dfn{sort key} for each record, and then reorder the records | ||
| 1676 | into the order determined by the sort keys. The records are ordered so | ||
| 1677 | that their keys are in alphabetical order, or, for numeric sorting, in | ||
| 1678 | numeric order. In alphabetic sorting, all upper-case letters `A' through | ||
| 1679 | `Z' come before lower-case `a', in accord with the @acronym{ASCII} character | ||
| 1680 | sequence. | ||
| 1681 | |||
| 1682 | The various sort commands differ in how they divide the text into sort | ||
| 1683 | records and in which part of each record is used as the sort key. Most of | ||
| 1684 | the commands make each line a separate sort record, but some commands use | ||
| 1685 | paragraphs or pages as sort records. Most of the sort commands use each | ||
| 1686 | entire sort record as its own sort key, but some use only a portion of the | ||
| 1687 | record as the sort key. | ||
| 1688 | |||
| 1689 | @findex sort-lines | ||
| 1690 | @findex sort-paragraphs | ||
| 1691 | @findex sort-pages | ||
| 1692 | @findex sort-fields | ||
| 1693 | @findex sort-numeric-fields | ||
| 1694 | @vindex sort-numeric-base | ||
| 1695 | @table @kbd | ||
| 1696 | @item M-x sort-lines | ||
| 1697 | Divide the region into lines, and sort by comparing the entire | ||
| 1698 | text of a line. A numeric argument means sort into descending order. | ||
| 1699 | |||
| 1700 | @item M-x sort-paragraphs | ||
| 1701 | Divide the region into paragraphs, and sort by comparing the entire | ||
| 1702 | text of a paragraph (except for leading blank lines). A numeric | ||
| 1703 | argument means sort into descending order. | ||
| 1704 | |||
| 1705 | @item M-x sort-pages | ||
| 1706 | Divide the region into pages, and sort by comparing the entire | ||
| 1707 | text of a page (except for leading blank lines). A numeric | ||
| 1708 | argument means sort into descending order. | ||
| 1709 | |||
| 1710 | @item M-x sort-fields | ||
| 1711 | Divide the region into lines, and sort by comparing the contents of | ||
| 1712 | one field in each line. Fields are defined as separated by | ||
| 1713 | whitespace, so the first run of consecutive non-whitespace characters | ||
| 1714 | in a line constitutes field 1, the second such run constitutes field | ||
| 1715 | 2, etc. | ||
| 1716 | |||
| 1717 | Specify which field to sort by with a numeric argument: 1 to sort by | ||
| 1718 | field 1, etc. A negative argument means count fields from the right | ||
| 1719 | instead of from the left; thus, minus 1 means sort by the last field. | ||
| 1720 | If several lines have identical contents in the field being sorted, they | ||
| 1721 | keep the same relative order that they had in the original buffer. | ||
| 1722 | |||
| 1723 | @item M-x sort-numeric-fields | ||
| 1724 | Like @kbd{M-x sort-fields} except the specified field is converted | ||
| 1725 | to an integer for each line, and the numbers are compared. @samp{10} | ||
| 1726 | comes before @samp{2} when considered as text, but after it when | ||
| 1727 | considered as a number. By default, numbers are interpreted according | ||
| 1728 | to @code{sort-numeric-base}, but numbers beginning with @samp{0x} or | ||
| 1729 | @samp{0} are interpreted as hexadecimal and octal, respectively. | ||
| 1730 | |||
| 1731 | @item M-x sort-columns | ||
| 1732 | Like @kbd{M-x sort-fields} except that the text within each line | ||
| 1733 | used for comparison comes from a fixed range of columns. See below | ||
| 1734 | for an explanation. | ||
| 1735 | |||
| 1736 | @item M-x reverse-region | ||
| 1737 | Reverse the order of the lines in the region. This is useful for | ||
| 1738 | sorting into descending order by fields or columns, since those sort | ||
| 1739 | commands do not have a feature for doing that. | ||
| 1740 | @end table | ||
| 1741 | |||
| 1742 | For example, if the buffer contains this: | ||
| 1743 | |||
| 1744 | @smallexample | ||
| 1745 | On systems where clash detection (locking of files being edited) is | ||
| 1746 | implemented, Emacs also checks the first time you modify a buffer | ||
| 1747 | whether the file has changed on disk since it was last visited or | ||
| 1748 | saved. If it has, you are asked to confirm that you want to change | ||
| 1749 | the buffer. | ||
| 1750 | @end smallexample | ||
| 1751 | |||
| 1752 | @noindent | ||
| 1753 | applying @kbd{M-x sort-lines} to the entire buffer produces this: | ||
| 1754 | |||
| 1755 | @smallexample | ||
| 1756 | On systems where clash detection (locking of files being edited) is | ||
| 1757 | implemented, Emacs also checks the first time you modify a buffer | ||
| 1758 | saved. If it has, you are asked to confirm that you want to change | ||
| 1759 | the buffer. | ||
| 1760 | whether the file has changed on disk since it was last visited or | ||
| 1761 | @end smallexample | ||
| 1762 | |||
| 1763 | @noindent | ||
| 1764 | where the upper-case @samp{O} sorts before all lower-case letters. If | ||
| 1765 | you use @kbd{C-u 2 M-x sort-fields} instead, you get this: | ||
| 1766 | |||
| 1767 | @smallexample | ||
| 1768 | implemented, Emacs also checks the first time you modify a buffer | ||
| 1769 | saved. If it has, you are asked to confirm that you want to change | ||
| 1770 | the buffer. | ||
| 1771 | On systems where clash detection (locking of files being edited) is | ||
| 1772 | whether the file has changed on disk since it was last visited or | ||
| 1773 | @end smallexample | ||
| 1774 | |||
| 1775 | @noindent | ||
| 1776 | where the sort keys were @samp{Emacs}, @samp{If}, @samp{buffer}, | ||
| 1777 | @samp{systems} and @samp{the}. | ||
| 1778 | |||
| 1779 | @findex sort-columns | ||
| 1780 | @kbd{M-x sort-columns} requires more explanation. You specify the | ||
| 1781 | columns by putting point at one of the columns and the mark at the other | ||
| 1782 | column. Because this means you cannot put point or the mark at the | ||
| 1783 | beginning of the first line of the text you want to sort, this command | ||
| 1784 | uses an unusual definition of ``region'': all of the line point is in is | ||
| 1785 | considered part of the region, and so is all of the line the mark is in, | ||
| 1786 | as well as all the lines in between. | ||
| 1787 | |||
| 1788 | For example, to sort a table by information found in columns 10 to 15, | ||
| 1789 | you could put the mark on column 10 in the first line of the table, and | ||
| 1790 | point on column 15 in the last line of the table, and then run | ||
| 1791 | @code{sort-columns}. Equivalently, you could run it with the mark on | ||
| 1792 | column 15 in the first line and point on column 10 in the last line. | ||
| 1793 | |||
| 1794 | This can be thought of as sorting the rectangle specified by point and | ||
| 1795 | the mark, except that the text on each line to the left or right of the | ||
| 1796 | rectangle moves along with the text inside the rectangle. | ||
| 1797 | @xref{Rectangles}. | ||
| 1798 | |||
| 1799 | @vindex sort-fold-case | ||
| 1800 | Many of the sort commands ignore case differences when comparing, if | ||
| 1801 | @code{sort-fold-case} is non-@code{nil}. | ||
| 1802 | |||
| 1803 | @node Narrowing, Two-Column, Sorting, Top | ||
| 1804 | @section Narrowing | ||
| 1805 | @cindex widening | ||
| 1806 | @cindex restriction | ||
| 1807 | @cindex narrowing | ||
| 1808 | @cindex accessible portion | ||
| 1809 | |||
| 1810 | @dfn{Narrowing} means focusing in on some portion of the buffer, | ||
| 1811 | making the rest temporarily inaccessible. The portion which you can | ||
| 1812 | still get to is called the @dfn{accessible portion}. Canceling the | ||
| 1813 | narrowing, which makes the entire buffer once again accessible, is | ||
| 1814 | called @dfn{widening}. The bounds of narrowing in effect in a buffer | ||
| 1815 | are called the buffer's @dfn{restriction}. | ||
| 1816 | |||
| 1817 | Narrowing can make it easier to concentrate on a single subroutine or | ||
| 1818 | paragraph by eliminating clutter. It can also be used to limit the | ||
| 1819 | range of operation of a replace command or repeating keyboard macro. | ||
| 1820 | |||
| 1821 | @table @kbd | ||
| 1822 | @item C-x n n | ||
| 1823 | Narrow down to between point and mark (@code{narrow-to-region}). | ||
| 1824 | @item C-x n w | ||
| 1825 | Widen to make the entire buffer accessible again (@code{widen}). | ||
| 1826 | @item C-x n p | ||
| 1827 | Narrow down to the current page (@code{narrow-to-page}). | ||
| 1828 | @item C-x n d | ||
| 1829 | Narrow down to the current defun (@code{narrow-to-defun}). | ||
| 1830 | @end table | ||
| 1831 | |||
| 1832 | When you have narrowed down to a part of the buffer, that part appears | ||
| 1833 | to be all there is. You can't see the rest, you can't move into it | ||
| 1834 | (motion commands won't go outside the accessible part), you can't change | ||
| 1835 | it in any way. However, it is not gone, and if you save the file all | ||
| 1836 | the inaccessible text will be saved. The word @samp{Narrow} appears in | ||
| 1837 | the mode line whenever narrowing is in effect. | ||
| 1838 | |||
| 1839 | @kindex C-x n n | ||
| 1840 | @findex narrow-to-region | ||
| 1841 | The primary narrowing command is @kbd{C-x n n} (@code{narrow-to-region}). | ||
| 1842 | It sets the current buffer's restrictions so that the text in the current | ||
| 1843 | region remains accessible, but all text before the region or after the | ||
| 1844 | region is inaccessible. Point and mark do not change. | ||
| 1845 | |||
| 1846 | @kindex C-x n p | ||
| 1847 | @findex narrow-to-page | ||
| 1848 | @kindex C-x n d | ||
| 1849 | @findex narrow-to-defun | ||
| 1850 | Alternatively, use @kbd{C-x n p} (@code{narrow-to-page}) to narrow | ||
| 1851 | down to the current page. @xref{Pages}, for the definition of a page. | ||
| 1852 | @kbd{C-x n d} (@code{narrow-to-defun}) narrows down to the defun | ||
| 1853 | containing point (@pxref{Defuns}). | ||
| 1854 | |||
| 1855 | @kindex C-x n w | ||
| 1856 | @findex widen | ||
| 1857 | The way to cancel narrowing is to widen with @kbd{C-x n w} | ||
| 1858 | (@code{widen}). This makes all text in the buffer accessible again. | ||
| 1859 | |||
| 1860 | You can get information on what part of the buffer you are narrowed down | ||
| 1861 | to using the @kbd{C-x =} command. @xref{Position Info}. | ||
| 1862 | |||
| 1863 | Because narrowing can easily confuse users who do not understand it, | ||
| 1864 | @code{narrow-to-region} is normally a disabled command. Attempting to use | ||
| 1865 | this command asks for confirmation and gives you the option of enabling it; | ||
| 1866 | if you enable the command, confirmation will no longer be required for | ||
| 1867 | it. @xref{Disabling}. | ||
| 1868 | |||
| 1869 | @node Two-Column, Editing Binary Files, Narrowing, Top | ||
| 1870 | @section Two-Column Editing | ||
| 1871 | @cindex two-column editing | ||
| 1872 | @cindex splitting columns | ||
| 1873 | @cindex columns, splitting | ||
| 1874 | |||
| 1875 | Two-column mode lets you conveniently edit two side-by-side columns of | ||
| 1876 | text. It uses two side-by-side windows, each showing its own | ||
| 1877 | buffer. | ||
| 1878 | |||
| 1879 | There are three ways to enter two-column mode: | ||
| 1880 | |||
| 1881 | @table @asis | ||
| 1882 | @item @kbd{@key{F2} 2} or @kbd{C-x 6 2} | ||
| 1883 | @kindex F2 2 | ||
| 1884 | @kindex C-x 6 2 | ||
| 1885 | @findex 2C-two-columns | ||
| 1886 | Enter two-column mode with the current buffer on the left, and on the | ||
| 1887 | right, a buffer whose name is based on the current buffer's name | ||
| 1888 | (@code{2C-two-columns}). If the right-hand buffer doesn't already | ||
| 1889 | exist, it starts out empty; the current buffer's contents are not | ||
| 1890 | changed. | ||
| 1891 | |||
| 1892 | This command is appropriate when the current buffer is empty or contains | ||
| 1893 | just one column and you want to add another column. | ||
| 1894 | |||
| 1895 | @item @kbd{@key{F2} s} or @kbd{C-x 6 s} | ||
| 1896 | @kindex F2 s | ||
| 1897 | @kindex C-x 6 s | ||
| 1898 | @findex 2C-split | ||
| 1899 | Split the current buffer, which contains two-column text, into two | ||
| 1900 | buffers, and display them side by side (@code{2C-split}). The current | ||
| 1901 | buffer becomes the left-hand buffer, but the text in the right-hand | ||
| 1902 | column is moved into the right-hand buffer. The current column | ||
| 1903 | specifies the split point. Splitting starts with the current line and | ||
| 1904 | continues to the end of the buffer. | ||
| 1905 | |||
| 1906 | This command is appropriate when you have a buffer that already contains | ||
| 1907 | two-column text, and you wish to separate the columns temporarily. | ||
| 1908 | |||
| 1909 | @item @kbd{@key{F2} b @var{buffer} @key{RET}} | ||
| 1910 | @itemx @kbd{C-x 6 b @var{buffer} @key{RET}} | ||
| 1911 | @kindex F2 b | ||
| 1912 | @kindex C-x 6 b | ||
| 1913 | @findex 2C-associate-buffer | ||
| 1914 | Enter two-column mode using the current buffer as the left-hand buffer, | ||
| 1915 | and using buffer @var{buffer} as the right-hand buffer | ||
| 1916 | (@code{2C-associate-buffer}). | ||
| 1917 | @end table | ||
| 1918 | |||
| 1919 | @kbd{@key{F2} s} or @kbd{C-x 6 s} looks for a column separator, which | ||
| 1920 | is a string that appears on each line between the two columns. You can | ||
| 1921 | specify the width of the separator with a numeric argument to | ||
| 1922 | @kbd{@key{F2} s}; that many characters, before point, constitute the | ||
| 1923 | separator string. By default, the width is 1, so the column separator | ||
| 1924 | is the character before point. | ||
| 1925 | |||
| 1926 | When a line has the separator at the proper place, @kbd{@key{F2} s} | ||
| 1927 | puts the text after the separator into the right-hand buffer, and | ||
| 1928 | deletes the separator. Lines that don't have the column separator at | ||
| 1929 | the proper place remain unsplit; they stay in the left-hand buffer, and | ||
| 1930 | the right-hand buffer gets an empty line to correspond. (This is the | ||
| 1931 | way to write a line that ``spans both columns while in two-column | ||
| 1932 | mode'': write it in the left-hand buffer, and put an empty line in the | ||
| 1933 | right-hand buffer.) | ||
| 1934 | |||
| 1935 | @kindex F2 RET | ||
| 1936 | @kindex C-x 6 RET | ||
| 1937 | @findex 2C-newline | ||
| 1938 | The command @kbd{C-x 6 @key{RET}} or @kbd{@key{F2} @key{RET}} | ||
| 1939 | (@code{2C-newline}) inserts a newline in each of the two buffers at | ||
| 1940 | corresponding positions. This is the easiest way to add a new line to | ||
| 1941 | the two-column text while editing it in split buffers. | ||
| 1942 | |||
| 1943 | @kindex F2 1 | ||
| 1944 | @kindex C-x 6 1 | ||
| 1945 | @findex 2C-merge | ||
| 1946 | When you have edited both buffers as you wish, merge them with | ||
| 1947 | @kbd{@key{F2} 1} or @kbd{C-x 6 1} (@code{2C-merge}). This copies the | ||
| 1948 | text from the right-hand buffer as a second column in the other buffer. | ||
| 1949 | To go back to two-column editing, use @kbd{@key{F2} s}. | ||
| 1950 | |||
| 1951 | @kindex F2 d | ||
| 1952 | @kindex C-x 6 d | ||
| 1953 | @findex 2C-dissociate | ||
| 1954 | Use @kbd{@key{F2} d} or @kbd{C-x 6 d} to dissociate the two buffers, | ||
| 1955 | leaving each as it stands (@code{2C-dissociate}). If the other buffer, | ||
| 1956 | the one not current when you type @kbd{@key{F2} d}, is empty, | ||
| 1957 | @kbd{@key{F2} d} kills it. | ||
| 1958 | |||
| 1959 | @node Editing Binary Files, Saving Emacs Sessions, Two-Column, Top | ||
| 1960 | @section Editing Binary Files | ||
| 1961 | |||
| 1962 | @cindex Hexl mode | ||
| 1963 | @cindex mode, Hexl | ||
| 1964 | @cindex editing binary files | ||
| 1965 | @cindex hex editing | ||
| 1966 | There is a special major mode for editing binary files: Hexl mode. To | ||
| 1967 | use it, use @kbd{M-x hexl-find-file} instead of @kbd{C-x C-f} to visit | ||
| 1968 | the file. This command converts the file's contents to hexadecimal and | ||
| 1969 | lets you edit the translation. When you save the file, it is converted | ||
| 1970 | automatically back to binary. | ||
| 1971 | |||
| 1972 | You can also use @kbd{M-x hexl-mode} to translate an existing buffer | ||
| 1973 | into hex. This is useful if you visit a file normally and then discover | ||
| 1974 | it is a binary file. | ||
| 1975 | |||
| 1976 | Ordinary text characters overwrite in Hexl mode. This is to reduce | ||
| 1977 | the risk of accidentally spoiling the alignment of data in the file. | ||
| 1978 | There are special commands for insertion. Here is a list of the | ||
| 1979 | commands of Hexl mode: | ||
| 1980 | |||
| 1981 | @c I don't think individual index entries for these commands are useful--RMS. | ||
| 1982 | @table @kbd | ||
| 1983 | @item C-M-d | ||
| 1984 | Insert a byte with a code typed in decimal. | ||
| 1985 | |||
| 1986 | @item C-M-o | ||
| 1987 | Insert a byte with a code typed in octal. | ||
| 1988 | |||
| 1989 | @item C-M-x | ||
| 1990 | Insert a byte with a code typed in hex. | ||
| 1991 | |||
| 1992 | @item C-x [ | ||
| 1993 | Move to the beginning of a 1k-byte ``page.'' | ||
| 1994 | |||
| 1995 | @item C-x ] | ||
| 1996 | Move to the end of a 1k-byte ``page.'' | ||
| 1997 | |||
| 1998 | @item M-g | ||
| 1999 | Move to an address specified in hex. | ||
| 2000 | |||
| 2001 | @item M-j | ||
| 2002 | Move to an address specified in decimal. | ||
| 2003 | |||
| 2004 | @item C-c C-c | ||
| 2005 | Leave Hexl mode, going back to the major mode this buffer had before you | ||
| 2006 | invoked @code{hexl-mode}. | ||
| 2007 | @end table | ||
| 2008 | |||
| 2009 | @noindent | ||
| 2010 | Other Hexl commands let you insert strings (sequences) of binary | ||
| 2011 | bytes, move by @code{short}s or @code{int}s, etc.; type @kbd{C-h a | ||
| 2012 | hexl-@key{RET}} for details. | ||
| 2013 | |||
| 2014 | |||
| 2015 | @node Saving Emacs Sessions, Recursive Edit, Editing Binary Files, Top | ||
| 2016 | @section Saving Emacs Sessions | ||
| 2017 | @cindex saving sessions | ||
| 2018 | @cindex restore session | ||
| 2019 | @cindex remember editing session | ||
| 2020 | @cindex reload files | ||
| 2021 | @cindex desktop | ||
| 2022 | |||
| 2023 | Use the desktop library to save the state of Emacs from one session | ||
| 2024 | to another. Once you save the Emacs @dfn{desktop}---the buffers, | ||
| 2025 | their file names, major modes, buffer positions, and so on---then | ||
| 2026 | subsequent Emacs sessions reload the saved desktop. | ||
| 2027 | |||
| 2028 | @findex desktop-save | ||
| 2029 | @vindex desktop-save-mode | ||
| 2030 | You can save the desktop manually with the command @kbd{M-x | ||
| 2031 | desktop-save}. You can also enable automatic saving of the desktop | ||
| 2032 | when you exit Emacs, and automatic restoration of the last saved | ||
| 2033 | desktop when Emacs starts: use the Customization buffer (@pxref{Easy | ||
| 2034 | Customization}) to set @code{desktop-save-mode} to @code{t} for future | ||
| 2035 | sessions, or add this line in your @file{~/.emacs} file: | ||
| 2036 | |||
| 2037 | @example | ||
| 2038 | (desktop-save-mode 1) | ||
| 2039 | @end example | ||
| 2040 | |||
| 2041 | @findex desktop-change-dir | ||
| 2042 | @findex desktop-revert | ||
| 2043 | If you turn on @code{desktop-save-mode} in your @file{~/.emacs}, | ||
| 2044 | then when Emacs starts, it looks for a saved desktop in the current | ||
| 2045 | directory. Thus, you can have separate saved desktops in different | ||
| 2046 | directories, and the starting directory determines which one Emacs | ||
| 2047 | reloads. You can save the current desktop and reload one saved in | ||
| 2048 | another directory by typing @kbd{M-x desktop-change-dir}. Typing | ||
| 2049 | @kbd{M-x desktop-revert} reverts to the desktop previously reloaded. | ||
| 2050 | |||
| 2051 | Specify the option @samp{--no-desktop} on the command line when you | ||
| 2052 | don't want it to reload any saved desktop. This turns off | ||
| 2053 | @code{desktop-save-mode} for the current session. Starting Emacs with | ||
| 2054 | the @samp{--no-init-file} option also disables desktop reloading, | ||
| 2055 | since it bypasses the @file{.emacs} init file, where | ||
| 2056 | @code{desktop-save-mode} is usually turned on. | ||
| 2057 | |||
| 2058 | @vindex desktop-restore-eager | ||
| 2059 | By default, all the buffers in the desktop are restored at one go. | ||
| 2060 | However, this may be slow if there are a lot of buffers in the | ||
| 2061 | desktop. You can specify the maximum number of buffers to restore | ||
| 2062 | immediately with the variable @code{desktop-restore-eager}; the | ||
| 2063 | remaining buffers are restored ``lazily,'' when Emacs is idle. | ||
| 2064 | |||
| 2065 | @findex desktop-clear | ||
| 2066 | @vindex desktop-globals-to-clear | ||
| 2067 | @vindex desktop-clear-preserve-buffers-regexp | ||
| 2068 | Type @kbd{M-x desktop-clear} to empty the Emacs desktop. This kills | ||
| 2069 | all buffers except for internal ones, and clears the global variables | ||
| 2070 | listed in @code{desktop-globals-to-clear}. If you want this to | ||
| 2071 | preserve certain buffers, customize the variable | ||
| 2072 | @code{desktop-clear-preserve-buffers-regexp}, whose value is a regular | ||
| 2073 | expression matching the names of buffers not to kill. | ||
| 2074 | |||
| 2075 | If you want to save minibuffer history from one session to | ||
| 2076 | another, use the @code{savehist} library. | ||
| 2077 | |||
| 2078 | @node Recursive Edit, Emulation, Saving Emacs Sessions, Top | ||
| 2079 | @section Recursive Editing Levels | ||
| 2080 | @cindex recursive editing level | ||
| 2081 | @cindex editing level, recursive | ||
| 2082 | |||
| 2083 | A @dfn{recursive edit} is a situation in which you are using Emacs | ||
| 2084 | commands to perform arbitrary editing while in the middle of another | ||
| 2085 | Emacs command. For example, when you type @kbd{C-r} inside of a | ||
| 2086 | @code{query-replace}, you enter a recursive edit in which you can change | ||
| 2087 | the current buffer. On exiting from the recursive edit, you go back to | ||
| 2088 | the @code{query-replace}. | ||
| 2089 | |||
| 2090 | @kindex C-M-c | ||
| 2091 | @findex exit-recursive-edit | ||
| 2092 | @cindex exiting recursive edit | ||
| 2093 | @dfn{Exiting} the recursive edit means returning to the unfinished | ||
| 2094 | command, which continues execution. The command to exit is @kbd{C-M-c} | ||
| 2095 | (@code{exit-recursive-edit}). | ||
| 2096 | |||
| 2097 | You can also @dfn{abort} the recursive edit. This is like exiting, | ||
| 2098 | but also quits the unfinished command immediately. Use the command | ||
| 2099 | @kbd{C-]} (@code{abort-recursive-edit}) to do this. @xref{Quitting}. | ||
| 2100 | |||
| 2101 | The mode line shows you when you are in a recursive edit by displaying | ||
| 2102 | square brackets around the parentheses that always surround the major and | ||
| 2103 | minor mode names. Every window's mode line shows this in the same way, | ||
| 2104 | since being in a recursive edit is true of Emacs as a whole rather than | ||
| 2105 | any particular window or buffer. | ||
| 2106 | |||
| 2107 | It is possible to be in recursive edits within recursive edits. For | ||
| 2108 | example, after typing @kbd{C-r} in a @code{query-replace}, you may type a | ||
| 2109 | command that enters the debugger. This begins a recursive editing level | ||
| 2110 | for the debugger, within the recursive editing level for @kbd{C-r}. | ||
| 2111 | Mode lines display a pair of square brackets for each recursive editing | ||
| 2112 | level currently in progress. | ||
| 2113 | |||
| 2114 | Exiting the inner recursive edit (such as with the debugger @kbd{c} | ||
| 2115 | command) resumes the command running in the next level up. When that | ||
| 2116 | command finishes, you can then use @kbd{C-M-c} to exit another recursive | ||
| 2117 | editing level, and so on. Exiting applies to the innermost level only. | ||
| 2118 | Aborting also gets out of only one level of recursive edit; it returns | ||
| 2119 | immediately to the command level of the previous recursive edit. If you | ||
| 2120 | wish, you can then abort the next recursive editing level. | ||
| 2121 | |||
| 2122 | Alternatively, the command @kbd{M-x top-level} aborts all levels of | ||
| 2123 | recursive edits, returning immediately to the top-level command reader. | ||
| 2124 | |||
| 2125 | The text being edited inside the recursive edit need not be the same text | ||
| 2126 | that you were editing at top level. It depends on what the recursive edit | ||
| 2127 | is for. If the command that invokes the recursive edit selects a different | ||
| 2128 | buffer first, that is the buffer you will edit recursively. In any case, | ||
| 2129 | you can switch buffers within the recursive edit in the normal manner (as | ||
| 2130 | long as the buffer-switching keys have not been rebound). You could | ||
| 2131 | probably do all the rest of your editing inside the recursive edit, | ||
| 2132 | visiting files and all. But this could have surprising effects (such as | ||
| 2133 | stack overflow) from time to time. So remember to exit or abort the | ||
| 2134 | recursive edit when you no longer need it. | ||
| 2135 | |||
| 2136 | In general, we try to minimize the use of recursive editing levels in | ||
| 2137 | GNU Emacs. This is because they constrain you to ``go back'' in a | ||
| 2138 | particular order---from the innermost level toward the top level. When | ||
| 2139 | possible, we present different activities in separate buffers so that | ||
| 2140 | you can switch between them as you please. Some commands switch to a | ||
| 2141 | new major mode which provides a command to switch back. These | ||
| 2142 | approaches give you more flexibility to go back to unfinished tasks in | ||
| 2143 | the order you choose. | ||
| 2144 | |||
| 2145 | @node Emulation, Hyperlinking, Recursive Edit, Top | ||
| 2146 | @section Emulation | ||
| 2147 | @cindex emulating other editors | ||
| 2148 | @cindex other editors | ||
| 2149 | @cindex EDT | ||
| 2150 | @cindex vi | ||
| 2151 | @cindex PC key bindings | ||
| 2152 | @cindex scrolling all windows | ||
| 2153 | @cindex PC selection | ||
| 2154 | @cindex Motif key bindings | ||
| 2155 | @cindex Macintosh key bindings | ||
| 2156 | @cindex WordStar | ||
| 2157 | |||
| 2158 | GNU Emacs can be programmed to emulate (more or less) most other | ||
| 2159 | editors. Standard facilities can emulate these: | ||
| 2160 | |||
| 2161 | @table @asis | ||
| 2162 | @item CRiSP/Brief (PC editor) | ||
| 2163 | @findex crisp-mode | ||
| 2164 | @vindex crisp-override-meta-x | ||
| 2165 | @findex scroll-all-mode | ||
| 2166 | @cindex CRiSP mode | ||
| 2167 | @cindex Brief emulation | ||
| 2168 | @cindex emulation of Brief | ||
| 2169 | @cindex mode, CRiSP | ||
| 2170 | You can turn on key bindings to emulate the CRiSP/Brief editor with | ||
| 2171 | @kbd{M-x crisp-mode}. Note that this rebinds @kbd{M-x} to exit Emacs | ||
| 2172 | unless you set the variable @code{crisp-override-meta-x}. You can | ||
| 2173 | also use the command @kbd{M-x scroll-all-mode} or set the variable | ||
| 2174 | @code{crisp-load-scroll-all} to emulate CRiSP's scroll-all feature | ||
| 2175 | (scrolling all windows together). | ||
| 2176 | |||
| 2177 | @item EDT (DEC VMS editor) | ||
| 2178 | @findex edt-emulation-on | ||
| 2179 | @findex edt-emulation-off | ||
| 2180 | Turn on EDT emulation with the command @kbd{M-x edt-emulation-on}, | ||
| 2181 | while @kbd{M-x edt-emulation-off} restores normal Emacs command | ||
| 2182 | bindings. | ||
| 2183 | |||
| 2184 | Most of the EDT emulation commands are keypad keys, and most standard | ||
| 2185 | Emacs key bindings are still available. The EDT emulation rebindings | ||
| 2186 | are done in the global keymap, so there is no problem switching | ||
| 2187 | buffers or major modes while in EDT emulation. | ||
| 2188 | |||
| 2189 | @item TPU (DEC VMS editor) | ||
| 2190 | @findex tpu-edt-on | ||
| 2191 | @cindex TPU | ||
| 2192 | @kbd{M-x tpu-edt-on} turns on emulation of the TPU editor emulating EDT. | ||
| 2193 | |||
| 2194 | @item vi (Berkeley editor) | ||
| 2195 | @findex viper-mode | ||
| 2196 | Viper is the newest emulator for vi. It implements several levels of | ||
| 2197 | emulation; level 1 is closest to vi itself, while level 5 departs | ||
| 2198 | somewhat from strict emulation to take advantage of the capabilities of | ||
| 2199 | Emacs. To invoke Viper, type @kbd{M-x viper-mode}; it will guide you | ||
| 2200 | the rest of the way and ask for the emulation level. @inforef{Top, | ||
| 2201 | Viper, viper}. | ||
| 2202 | |||
| 2203 | @item vi (another emulator) | ||
| 2204 | @findex vi-mode | ||
| 2205 | @kbd{M-x vi-mode} enters a major mode that replaces the previously | ||
| 2206 | established major mode. All of the vi commands that, in real vi, enter | ||
| 2207 | ``input'' mode are programmed instead to return to the previous major | ||
| 2208 | mode. Thus, ordinary Emacs serves as vi's ``input'' mode. | ||
| 2209 | |||
| 2210 | Because vi emulation works through major modes, it does not work | ||
| 2211 | to switch buffers during emulation. Return to normal Emacs first. | ||
| 2212 | |||
| 2213 | If you plan to use vi emulation much, you probably want to bind a key | ||
| 2214 | to the @code{vi-mode} command. | ||
| 2215 | |||
| 2216 | @item vi (alternate emulator) | ||
| 2217 | @findex vip-mode | ||
| 2218 | @kbd{M-x vip-mode} invokes another vi emulator, said to resemble real vi | ||
| 2219 | more thoroughly than @kbd{M-x vi-mode}. ``Input'' mode in this emulator | ||
| 2220 | is changed from ordinary Emacs so you can use @key{ESC} to go back to | ||
| 2221 | emulated vi command mode. To get from emulated vi command mode back to | ||
| 2222 | ordinary Emacs, type @kbd{C-z}. | ||
| 2223 | |||
| 2224 | This emulation does not work through major modes, and it is possible | ||
| 2225 | to switch buffers in various ways within the emulator. It is not | ||
| 2226 | so necessary to assign a key to the command @code{vip-mode} as | ||
| 2227 | it is with @code{vi-mode} because terminating insert mode does | ||
| 2228 | not use it. | ||
| 2229 | |||
| 2230 | @inforef{Top, VIP, vip}, for full information. | ||
| 2231 | |||
| 2232 | @item WordStar (old wordprocessor) | ||
| 2233 | @findex wordstar-mode | ||
| 2234 | @kbd{M-x wordstar-mode} provides a major mode with WordStar-like | ||
| 2235 | key bindings. | ||
| 2236 | @end table | ||
| 2237 | |||
| 2238 | @node Hyperlinking, Dissociated Press, Emulation, Top | ||
| 2239 | @section Hyperlinking and Navigation Features | ||
| 2240 | |||
| 2241 | @cindex hyperlinking | ||
| 2242 | @cindex navigation | ||
| 2243 | Various modes documented elsewhere have hypertext features so that | ||
| 2244 | you can follow links, usually by clicking @kbd{Mouse-2} on the link or | ||
| 2245 | typing @key{RET} while point is on the link. Clicking @kbd{Mouse-1} | ||
| 2246 | quickly on the link also follows it. (Hold @kbd{Mouse-1} for longer | ||
| 2247 | if you want to set point instead.) | ||
| 2248 | |||
| 2249 | Info mode, Help mode and the Dired-like modes are examples of modes | ||
| 2250 | that have links in the buffer. The Tags facility links between uses | ||
| 2251 | and definitions in source files, see @ref{Tags}. Imenu provides | ||
| 2252 | navigation amongst items indexed in the current buffer, see | ||
| 2253 | @ref{Imenu}. Info-lookup provides mode-specific lookup of definitions | ||
| 2254 | in Info indexes, see @ref{Documentation}. Speedbar maintains a frame | ||
| 2255 | in which links to files, and locations in files are displayed, see | ||
| 2256 | @ref{Speedbar}. | ||
| 2257 | |||
| 2258 | Other non-mode-specific facilities described in this section enable | ||
| 2259 | following links from the current buffer in a context-sensitive | ||
| 2260 | fashion. | ||
| 2261 | |||
| 2262 | @menu | ||
| 2263 | * Browse-URL:: Following URLs. | ||
| 2264 | * Goto-address:: Activating URLs. | ||
| 2265 | * FFAP:: Finding files etc. at point. | ||
| 2266 | @end menu | ||
| 2267 | |||
| 2268 | @node Browse-URL | ||
| 2269 | @subsection Following URLs | ||
| 2270 | @cindex World Wide Web | ||
| 2271 | @cindex Web | ||
| 2272 | @findex browse-url | ||
| 2273 | @findex browse-url-at-point | ||
| 2274 | @findex browse-url-at-mouse | ||
| 2275 | @cindex Browse-URL | ||
| 2276 | @cindex URLs | ||
| 2277 | |||
| 2278 | @table @kbd | ||
| 2279 | @item M-x browse-url @key{RET} @var{url} @key{RET} | ||
| 2280 | Load a URL into a Web browser. | ||
| 2281 | @end table | ||
| 2282 | |||
| 2283 | The Browse-URL package provides facilities for following URLs specifying | ||
| 2284 | links on the World Wide Web. Usually this works by invoking a web | ||
| 2285 | browser, but you can, for instance, arrange to invoke @code{compose-mail} | ||
| 2286 | from @samp{mailto:} URLs. | ||
| 2287 | |||
| 2288 | The general way to use this feature is to type @kbd{M-x browse-url}, | ||
| 2289 | which displays a specified URL. If point is located near a plausible | ||
| 2290 | URL, that URL is used as the default. Other commands are available | ||
| 2291 | which you might like to bind to keys, such as | ||
| 2292 | @code{browse-url-at-point} and @code{browse-url-at-mouse}. | ||
| 2293 | |||
| 2294 | @vindex browse-url-browser-function | ||
| 2295 | You can customize Browse-URL's behavior via various options in the | ||
| 2296 | @code{browse-url} Customize group, particularly | ||
| 2297 | @code{browse-url-browser-function}. You can invoke actions dependent | ||
| 2298 | on the type of URL by defining @code{browse-url-browser-function} as | ||
| 2299 | an association list. The package's commentary available via @kbd{C-h | ||
| 2300 | p} under the @samp{hypermedia} keyword provides more information. | ||
| 2301 | Packages with facilities for following URLs should always go through | ||
| 2302 | Browse-URL, so that the customization options for Browse-URL will | ||
| 2303 | affect all browsing in Emacs. | ||
| 2304 | |||
| 2305 | @node Goto-address | ||
| 2306 | @subsection Activating URLs | ||
| 2307 | @findex goto-address | ||
| 2308 | @cindex Goto-address | ||
| 2309 | @cindex URLs, activating | ||
| 2310 | |||
| 2311 | @table @kbd | ||
| 2312 | @item M-x goto-address | ||
| 2313 | Activate URLs and e-mail addresses in the current buffer. | ||
| 2314 | @end table | ||
| 2315 | |||
| 2316 | You can make URLs in the current buffer active with @kbd{M-x | ||
| 2317 | goto-address}. This finds all the URLs in the buffer, and establishes | ||
| 2318 | bindings for @kbd{Mouse-2} and @kbd{C-c @key{RET}} on them. After | ||
| 2319 | activation, if you click on a URL with @kbd{Mouse-2}, or move to a URL | ||
| 2320 | and type @kbd{C-c @key{RET}}, that will display the web page that the URL | ||
| 2321 | specifies. For a @samp{mailto} URL, it sends mail instead, using your | ||
| 2322 | selected mail-composition method (@pxref{Mail Methods}). | ||
| 2323 | |||
| 2324 | It can be useful to add @code{goto-address} to mode hooks and the | ||
| 2325 | hooks used to display an incoming message. | ||
| 2326 | @code{rmail-show-message-hook} is the appropriate hook for Rmail, and | ||
| 2327 | @code{mh-show-mode-hook} for MH-E. This is not needed for Gnus, | ||
| 2328 | which has a similar feature of its own. | ||
| 2329 | |||
| 2330 | |||
| 2331 | @node FFAP | ||
| 2332 | @subsection Finding Files and URLs at Point | ||
| 2333 | @findex find-file-at-point | ||
| 2334 | @findex ffap | ||
| 2335 | @findex dired-at-point | ||
| 2336 | @findex ffap-next | ||
| 2337 | @findex ffap-menu | ||
| 2338 | @cindex finding file at point | ||
| 2339 | |||
| 2340 | FFAP mode replaces certain key bindings for finding files, including | ||
| 2341 | @kbd{C-x C-f}, with commands that provide more sensitive defaults. | ||
| 2342 | These commands behave like the ordinary ones when given a prefix | ||
| 2343 | argument. Otherwise, they get the default file name or URL from the | ||
| 2344 | text around point. If what is found in the buffer has the form of a | ||
| 2345 | URL rather than a file name, the commands use @code{browse-url} to | ||
| 2346 | view it. | ||
| 2347 | |||
| 2348 | This feature is useful for following references in mail or news | ||
| 2349 | buffers, @file{README} files, @file{MANIFEST} files, and so on. The | ||
| 2350 | @samp{ffap} package's commentary available via @kbd{C-h p} under the | ||
| 2351 | @samp{files} keyword and the @code{ffap} Custom group provide details. | ||
| 2352 | |||
| 2353 | @cindex FFAP minor mode | ||
| 2354 | @findex ffap-mode | ||
| 2355 | You can turn on FFAP minor mode by calling @code{ffap-bindings} to | ||
| 2356 | make the following key bindings and to install hooks for using | ||
| 2357 | @code{ffap} in Rmail, Gnus and VM article buffers. | ||
| 2358 | |||
| 2359 | @table @kbd | ||
| 2360 | @item C-x C-f @var{filename} @key{RET} | ||
| 2361 | @kindex C-x C-f @r{(FFAP)} | ||
| 2362 | Find @var{filename}, guessing a default from text around point | ||
| 2363 | (@code{find-file-at-point}). | ||
| 2364 | @item C-x C-r | ||
| 2365 | @kindex C-x C-r @r{(FFAP)} | ||
| 2366 | @code{ffap-read-only}, analogous to @code{find-file-read-only}. | ||
| 2367 | @item C-x C-v | ||
| 2368 | @kindex C-x C-v @r{(FFAP)} | ||
| 2369 | @code{ffap-alternate-file}, analogous to @code{find-alternate-file}. | ||
| 2370 | @item C-x d @var{directory} @key{RET} | ||
| 2371 | @kindex C-x d @r{(FFAP)} | ||
| 2372 | Start Dired on @var{directory}, defaulting to the directory name at | ||
| 2373 | point (@code{dired-at-point}). | ||
| 2374 | @item C-x C-d | ||
| 2375 | @code{ffap-list-directory}, analogous to @code{list-directory}. | ||
| 2376 | @item C-x 4 f | ||
| 2377 | @kindex C-x 4 f @r{(FFAP)} | ||
| 2378 | @code{ffap-other-window}, analogous to @code{find-file-other-window}. | ||
| 2379 | @item C-x 4 r | ||
| 2380 | @code{ffap-read-only-other-window}, analogous to | ||
| 2381 | @code{find-file-read-only-other-window}. | ||
| 2382 | @item C-x 4 d | ||
| 2383 | @code{ffap-dired-other-window}, analogous to @code{dired-other-window}. | ||
| 2384 | @item C-x 5 f | ||
| 2385 | @kindex C-x 5 f @r{(FFAP)} | ||
| 2386 | @code{ffap-other-frame}, analogous to @code{find-file-other-frame}. | ||
| 2387 | @item C-x 5 r | ||
| 2388 | @code{ffap-read-only-other-frame}, analogous to | ||
| 2389 | @code{find-file-read-only-other-frame}. | ||
| 2390 | @item C-x 5 d | ||
| 2391 | @code{ffap-dired-other-frame}, analogous to @code{dired-other-frame}. | ||
| 2392 | @item M-x ffap-next | ||
| 2393 | Search buffer for next file name or URL, then find that file or URL. | ||
| 2394 | @item S-Mouse-3 | ||
| 2395 | @kindex S-Mouse-3 @r{(FFAP)} | ||
| 2396 | @code{ffap-at-mouse} finds the file guessed from text around the position | ||
| 2397 | of a mouse click. | ||
| 2398 | @item C-S-Mouse-3 | ||
| 2399 | @kindex C-S-Mouse-3 @r{(FFAP)} | ||
| 2400 | Display a menu of files and URLs mentioned in current buffer, then | ||
| 2401 | find the one you select (@code{ffap-menu}). | ||
| 2402 | @end table | ||
| 2403 | |||
| 2404 | @node Dissociated Press, Amusements, Hyperlinking, Top | ||
| 2405 | @section Dissociated Press | ||
| 2406 | |||
| 2407 | @findex dissociated-press | ||
| 2408 | @kbd{M-x dissociated-press} is a command for scrambling a file of text | ||
| 2409 | either word by word or character by character. Starting from a buffer of | ||
| 2410 | straight English, it produces extremely amusing output. The input comes | ||
| 2411 | from the current Emacs buffer. Dissociated Press writes its output in a | ||
| 2412 | buffer named @samp{*Dissociation*}, and redisplays that buffer after every | ||
| 2413 | couple of lines (approximately) so you can read the output as it comes out. | ||
| 2414 | |||
| 2415 | Dissociated Press asks every so often whether to continue generating | ||
| 2416 | output. Answer @kbd{n} to stop it. You can also stop at any time by | ||
| 2417 | typing @kbd{C-g}. The dissociation output remains in the | ||
| 2418 | @samp{*Dissociation*} buffer for you to copy elsewhere if you wish. | ||
| 2419 | |||
| 2420 | @cindex presidentagon | ||
| 2421 | Dissociated Press operates by jumping at random from one point in the | ||
| 2422 | buffer to another. In order to produce plausible output rather than | ||
| 2423 | gibberish, it insists on a certain amount of overlap between the end of | ||
| 2424 | one run of consecutive words or characters and the start of the next. | ||
| 2425 | That is, if it has just output `president' and then decides to jump | ||
| 2426 | to a different point in the file, it might spot the `ent' in `pentagon' | ||
| 2427 | and continue from there, producing `presidentagon'.@footnote{This | ||
| 2428 | dissociword actually appeared during the Vietnam War, when it was very | ||
| 2429 | appropriate. Bush has made it appropriate again.} Long sample texts | ||
| 2430 | produce the best results. | ||
| 2431 | |||
| 2432 | @cindex againformation | ||
| 2433 | A positive argument to @kbd{M-x dissociated-press} tells it to operate | ||
| 2434 | character by character, and specifies the number of overlap characters. A | ||
| 2435 | negative argument tells it to operate word by word, and specifies the number | ||
| 2436 | of overlap words. In this mode, whole words are treated as the elements to | ||
| 2437 | be permuted, rather than characters. No argument is equivalent to an | ||
| 2438 | argument of two. For your againformation, the output goes only into the | ||
| 2439 | buffer @samp{*Dissociation*}. The buffer you start with is not changed. | ||
| 2440 | |||
| 2441 | @cindex Markov chain | ||
| 2442 | @cindex ignoriginal | ||
| 2443 | @cindex techniquitous | ||
| 2444 | Dissociated Press produces results fairly like those of a Markov | ||
| 2445 | chain based on a frequency table constructed from the sample text. It | ||
| 2446 | is, however, an independent, ignoriginal invention. Dissociated Press | ||
| 2447 | techniquitously copies several consecutive characters from the sample | ||
| 2448 | between random choices, whereas a Markov chain would choose randomly | ||
| 2449 | for each word or character. This makes for more plausible sounding | ||
| 2450 | results, and runs faster. | ||
| 2451 | |||
| 2452 | @cindex outragedy | ||
| 2453 | @cindex buggestion | ||
| 2454 | @cindex properbose | ||
| 2455 | @cindex mustatement | ||
| 2456 | @cindex developediment | ||
| 2457 | @cindex userenced | ||
| 2458 | It is a mustatement that too much use of Dissociated Press can be a | ||
| 2459 | developediment to your real work, sometimes to the point of outragedy. | ||
| 2460 | And keep dissociwords out of your documentation, if you want it to be well | ||
| 2461 | userenced and properbose. Have fun. Your buggestions are welcome. | ||
| 2462 | |||
| 2463 | @node Amusements, Customization, Dissociated Press, Top | ||
| 2464 | @section Other Amusements | ||
| 2465 | @cindex boredom | ||
| 2466 | @findex hanoi | ||
| 2467 | @findex yow | ||
| 2468 | @findex gomoku | ||
| 2469 | @cindex tower of Hanoi | ||
| 2470 | |||
| 2471 | If you are a little bit bored, you can try @kbd{M-x hanoi}. If you are | ||
| 2472 | considerably bored, give it a numeric argument. If you are very, very | ||
| 2473 | bored, try an argument of 9. Sit back and watch. | ||
| 2474 | |||
| 2475 | @cindex Go Moku | ||
| 2476 | If you want a little more personal involvement, try @kbd{M-x gomoku}, | ||
| 2477 | which plays the game Go Moku with you. | ||
| 2478 | |||
| 2479 | @findex blackbox | ||
| 2480 | @findex mpuz | ||
| 2481 | @findex 5x5 | ||
| 2482 | @cindex puzzles | ||
| 2483 | @kbd{M-x blackbox}, @kbd{M-x mpuz} and @kbd{M-x 5x5} are puzzles. | ||
| 2484 | @code{blackbox} challenges you to determine the location of objects | ||
| 2485 | inside a box by tomography. @code{mpuz} displays a multiplication | ||
| 2486 | puzzle with letters standing for digits in a code that you must | ||
| 2487 | guess---to guess a value, type a letter and then the digit you think it | ||
| 2488 | stands for. The aim of @code{5x5} is to fill in all the squares. | ||
| 2489 | |||
| 2490 | @findex decipher | ||
| 2491 | @cindex ciphers | ||
| 2492 | @cindex cryptanalysis | ||
| 2493 | @kbd{M-x decipher} helps you to cryptanalyze a buffer which is encrypted | ||
| 2494 | in a simple monoalphabetic substitution cipher. | ||
| 2495 | |||
| 2496 | @findex dunnet | ||
| 2497 | @kbd{M-x dunnet} runs an adventure-style exploration game, which is | ||
| 2498 | a bigger sort of puzzle. | ||
| 2499 | |||
| 2500 | @findex lm | ||
| 2501 | @cindex landmark game | ||
| 2502 | @kbd{M-x lm} runs a relatively non-participatory game in which a robot | ||
| 2503 | attempts to maneuver towards a tree at the center of the window based on | ||
| 2504 | unique olfactory cues from each of the four directions. | ||
| 2505 | |||
| 2506 | @findex life | ||
| 2507 | @cindex Life | ||
| 2508 | @kbd{M-x life} runs Conway's ``Life'' cellular automaton. | ||
| 2509 | |||
| 2510 | @findex morse-region | ||
| 2511 | @findex unmorse-region | ||
| 2512 | @cindex Morse code | ||
| 2513 | @cindex --/---/.-./.../. | ||
| 2514 | @kbd{M-x morse-region} converts text in a region to Morse code and | ||
| 2515 | @kbd{M-x unmorse-region} converts it back. No cause for remorse. | ||
| 2516 | |||
| 2517 | @findex pong | ||
| 2518 | @cindex Pong game | ||
| 2519 | @kbd{M-x pong} plays a Pong-like game, bouncing the ball off opposing | ||
| 2520 | bats. | ||
| 2521 | |||
| 2522 | @findex solitaire | ||
| 2523 | @cindex solitaire | ||
| 2524 | @kbd{M-x solitaire} plays a game of solitaire in which you jump pegs | ||
| 2525 | across other pegs. | ||
| 2526 | |||
| 2527 | @findex studlify-region | ||
| 2528 | @cindex StudlyCaps | ||
| 2529 | @kbd{M-x studlify-region} studlify-cases the region, producing | ||
| 2530 | text like this: | ||
| 2531 | |||
| 2532 | @example | ||
| 2533 | M-x stUdlIfY-RegioN stUdlIfY-CaSeS thE region. | ||
| 2534 | @end example | ||
| 2535 | |||
| 2536 | @findex tetris | ||
| 2537 | @cindex Tetris | ||
| 2538 | @findex snake | ||
| 2539 | @cindex Snake | ||
| 2540 | @kbd{M-x tetris} runs an implementation of the well-known Tetris game. | ||
| 2541 | Likewise, @kbd{M-x snake} provides an implementation of Snake. | ||
| 2542 | |||
| 2543 | When you are frustrated, try the famous Eliza program. Just do | ||
| 2544 | @kbd{M-x doctor}. End each input by typing @key{RET} twice. | ||
| 2545 | |||
| 2546 | @cindex Zippy | ||
| 2547 | When you are feeling strange, type @kbd{M-x yow}. | ||
| 2548 | |||
| 2549 | @findex zone | ||
| 2550 | The command @kbd{M-x zone} plays games with the display when Emacs is | ||
| 2551 | idle. | ||
| 2552 | |||
| 2553 | @ifnottex | ||
| 2554 | @lowersections | ||
| 2555 | @end ifnottex | ||
| 2556 | |||
| 2557 | @ignore | ||
| 2558 | arch-tag: 8f094220-c0d5-4e9e-af7d-3e0da8187474 | ||
| 2559 | @end ignore | ||
diff --git a/doc/emacs/msdog-xtra.texi b/doc/emacs/msdog-xtra.texi new file mode 100644 index 00000000000..432f28888f6 --- /dev/null +++ b/doc/emacs/msdog-xtra.texi | |||
| @@ -0,0 +1,687 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | @c | ||
| 5 | @c This file is included either in emacs-xtra.texi (when producing the | ||
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | ||
| 7 | @node MS-DOS | ||
| 8 | @section Emacs and MS-DOS | ||
| 9 | @cindex MS-DOG | ||
| 10 | @cindex MS-DOS peculiarities | ||
| 11 | |||
| 12 | This section briefly describes the peculiarities of using Emacs on | ||
| 13 | the MS-DOS ``operating system'' (also known as ``MS-DOG''). | ||
| 14 | @iftex | ||
| 15 | Information about Emacs and Microsoft's current operating system | ||
| 16 | Windows (also known as ``Losedows) is in the main Emacs manual | ||
| 17 | (@pxref{Microsoft Systems,,, emacs, the Emacs Manual}). | ||
| 18 | @end iftex | ||
| 19 | @ifnottex | ||
| 20 | Information about peculiarities common to MS-DOS and Microsoft's | ||
| 21 | current operating systems Windows (also known as ``Losedows) is in | ||
| 22 | @ref{Microsoft Windows}. | ||
| 23 | @end ifnottex | ||
| 24 | |||
| 25 | If you build Emacs for MS-DOS, the binary will also run on Windows | ||
| 26 | 3.X, Windows NT, Windows 9X/ME, Windows 2000/XP, or OS/2 as a DOS | ||
| 27 | application; all of this chapter applies for all of those systems, if | ||
| 28 | you use an Emacs that was built for MS-DOS. | ||
| 29 | |||
| 30 | @iftex | ||
| 31 | @xref{Text and Binary,,,emacs, the Emacs Manual}, for information | ||
| 32 | @end iftex | ||
| 33 | @ifnottex | ||
| 34 | @xref{Text and Binary}, for information | ||
| 35 | @end ifnottex | ||
| 36 | about Emacs' special handling of text files under MS-DOS (and Windows). | ||
| 37 | |||
| 38 | @menu | ||
| 39 | * Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS. | ||
| 40 | * Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS. | ||
| 41 | * Display: MS-DOS Display. Fonts, frames and display size on MS-DOS. | ||
| 42 | * Files: MS-DOS File Names. File name conventions on MS-DOS. | ||
| 43 | * Printing: MS-DOS Printing. Printing specifics on MS-DOS. | ||
| 44 | * I18N: MS-DOS and MULE. Support for internationalization on MS-DOS. | ||
| 45 | * Processes: MS-DOS Processes. Running subprocesses on MS-DOS. | ||
| 46 | @end menu | ||
| 47 | |||
| 48 | @node MS-DOS Keyboard | ||
| 49 | @subsection Keyboard Usage on MS-DOS | ||
| 50 | |||
| 51 | @kindex DEL @r{(MS-DOS)} | ||
| 52 | @kindex BS @r{(MS-DOS)} | ||
| 53 | The key that is called @key{DEL} in Emacs (because that's how it is | ||
| 54 | designated on most workstations) is known as @key{BS} (backspace) on a | ||
| 55 | PC. That is why the PC-specific terminal initialization remaps the | ||
| 56 | @key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act | ||
| 57 | as @kbd{C-d} for the same reasons. | ||
| 58 | |||
| 59 | @kindex C-g @r{(MS-DOS)} | ||
| 60 | @kindex C-BREAK @r{(MS-DOS)} | ||
| 61 | @cindex quitting on MS-DOS | ||
| 62 | Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit | ||
| 63 | character, just like @kbd{C-g}. This is because Emacs cannot detect | ||
| 64 | that you have typed @kbd{C-g} until it is ready for more input. As a | ||
| 65 | consequence, you cannot use @kbd{C-g} to stop a running command | ||
| 66 | @iftex | ||
| 67 | (@pxref{Quitting,,,emacs, the Emacs Manual}). | ||
| 68 | @end iftex | ||
| 69 | @ifnottex | ||
| 70 | (@pxref{Quitting}). | ||
| 71 | @end ifnottex | ||
| 72 | By contrast, @kbd{C-@key{BREAK}} @emph{is} detected as soon as you | ||
| 73 | type it (as @kbd{C-g} is on other systems), so it can be used to stop | ||
| 74 | a running command and for emergency escape | ||
| 75 | @iftex | ||
| 76 | (@pxref{Emergency Escape,,,emacs, the Emacs Manual}). | ||
| 77 | @end iftex | ||
| 78 | @ifnottex | ||
| 79 | (@pxref{Emergency Escape}). | ||
| 80 | @end ifnottex | ||
| 81 | |||
| 82 | @cindex Meta (under MS-DOS) | ||
| 83 | @cindex Hyper (under MS-DOS) | ||
| 84 | @cindex Super (under MS-DOS) | ||
| 85 | @vindex dos-super-key | ||
| 86 | @vindex dos-hyper-key | ||
| 87 | The PC keyboard maps use the left @key{ALT} key as the @key{META} key. | ||
| 88 | You have two choices for emulating the @key{SUPER} and @key{HYPER} keys: | ||
| 89 | choose either the right @key{CTRL} key or the right @key{ALT} key by | ||
| 90 | setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1 | ||
| 91 | or 2 respectively. If neither @code{dos-super-key} nor | ||
| 92 | @code{dos-hyper-key} is 1, then by default the right @key{ALT} key is | ||
| 93 | also mapped to the @key{META} key. However, if the MS-DOS international | ||
| 94 | keyboard support program @file{KEYB.COM} is installed, Emacs will | ||
| 95 | @emph{not} map the right @key{ALT} to @key{META}, since it is used for | ||
| 96 | accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard | ||
| 97 | layouts; in this case, you may only use the left @key{ALT} as @key{META} | ||
| 98 | key. | ||
| 99 | |||
| 100 | @kindex C-j @r{(MS-DOS)} | ||
| 101 | @vindex dos-keypad-mode | ||
| 102 | The variable @code{dos-keypad-mode} is a flag variable that controls | ||
| 103 | what key codes are returned by keys in the numeric keypad. You can also | ||
| 104 | define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the | ||
| 105 | following line into your @file{_emacs} file: | ||
| 106 | |||
| 107 | @smallexample | ||
| 108 | ;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.} | ||
| 109 | (define-key function-key-map [kp-enter] [?\C-j]) | ||
| 110 | @end smallexample | ||
| 111 | |||
| 112 | @node MS-DOS Mouse | ||
| 113 | @subsection Mouse Usage on MS-DOS | ||
| 114 | |||
| 115 | @cindex mouse support under MS-DOS | ||
| 116 | Emacs on MS-DOS supports a mouse (on the default terminal only). | ||
| 117 | The mouse commands work as documented, including those that use menus | ||
| 118 | and the menu bar | ||
| 119 | @iftex | ||
| 120 | (@pxref{Menu Bar,,,emacs, the Emacs Manual}). | ||
| 121 | @end iftex | ||
| 122 | @ifnottex | ||
| 123 | (@pxref{Menu Bar}). | ||
| 124 | @end ifnottex | ||
| 125 | Scroll bars don't work in MS-DOS Emacs. PC mice usually have only | ||
| 126 | two buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you | ||
| 127 | press both of them together, that has the effect of @kbd{Mouse-3}. If | ||
| 128 | the mouse does have 3 buttons, Emacs detects that at startup, and all | ||
| 129 | the 3 buttons function normally, as on X. | ||
| 130 | |||
| 131 | Help strings for menu-bar and pop-up menus are displayed in the echo | ||
| 132 | area when the mouse pointer moves across the menu items. Highlighting | ||
| 133 | of mouse-sensitive text | ||
| 134 | @iftex | ||
| 135 | (@pxref{Mouse References,,,emacs, the Emacs Manual}) | ||
| 136 | @end iftex | ||
| 137 | @ifnottex | ||
| 138 | (@pxref{Mouse References}) | ||
| 139 | @end ifnottex | ||
| 140 | is also supported. | ||
| 141 | |||
| 142 | @cindex mouse, set number of buttons | ||
| 143 | @findex msdos-set-mouse-buttons | ||
| 144 | Some versions of mouse drivers don't report the number of mouse | ||
| 145 | buttons correctly. For example, mice with a wheel report that they | ||
| 146 | have 3 buttons, but only 2 of them are passed to Emacs; the clicks on | ||
| 147 | the wheel, which serves as the middle button, are not passed. In | ||
| 148 | these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command | ||
| 149 | to tell Emacs how many mouse buttons to expect. You could make such a | ||
| 150 | setting permanent by adding this fragment to your @file{_emacs} init | ||
| 151 | file: | ||
| 152 | |||
| 153 | @example | ||
| 154 | ;; @r{Treat the mouse like a 2-button mouse.} | ||
| 155 | (msdos-set-mouse-buttons 2) | ||
| 156 | @end example | ||
| 157 | |||
| 158 | @cindex Windows clipboard support | ||
| 159 | Emacs built for MS-DOS supports clipboard operations when it runs on | ||
| 160 | Windows. Commands that put text on the kill ring, or yank text from | ||
| 161 | the ring, check the Windows clipboard first, just as Emacs does on the | ||
| 162 | X Window System | ||
| 163 | @iftex | ||
| 164 | (@pxref{Mouse Commands,,,emacs, the Emacs Manual}). | ||
| 165 | @end iftex | ||
| 166 | @ifnottex | ||
| 167 | (@pxref{Mouse Commands}). | ||
| 168 | @end ifnottex | ||
| 169 | Only the primary selection and the cut buffer are supported by MS-DOS | ||
| 170 | Emacs on Windows; the secondary selection always appears as empty. | ||
| 171 | |||
| 172 | Due to the way clipboard access is implemented by Windows, the | ||
| 173 | length of text you can put into the clipboard is limited by the amount | ||
| 174 | of free DOS memory that is available to Emacs. Usually, up to 620KB of | ||
| 175 | text can be put into the clipboard, but this limit depends on the system | ||
| 176 | configuration and is lower if you run Emacs as a subprocess of | ||
| 177 | another program. If the killed text does not fit, Emacs outputs a | ||
| 178 | message saying so, and does not put the text into the clipboard. | ||
| 179 | |||
| 180 | Null characters also cannot be put into the Windows clipboard. If the | ||
| 181 | killed text includes null characters, Emacs does not put such text into | ||
| 182 | the clipboard, and displays in the echo area a message to that effect. | ||
| 183 | |||
| 184 | @vindex dos-display-scancodes | ||
| 185 | The variable @code{dos-display-scancodes}, when non-@code{nil}, | ||
| 186 | directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of | ||
| 187 | each keystroke; this feature serves as a complement to the | ||
| 188 | @code{view-lossage} command, for debugging. | ||
| 189 | |||
| 190 | @node MS-DOS Display | ||
| 191 | @subsection Display on MS-DOS | ||
| 192 | @cindex faces under MS-DOS | ||
| 193 | @cindex fonts, emulating under MS-DOS | ||
| 194 | |||
| 195 | Display on MS-DOS cannot use font variants, like bold or italic, but | ||
| 196 | it does support multiple faces, each of which can specify a foreground | ||
| 197 | and a background color. Therefore, you can get the full functionality | ||
| 198 | of Emacs packages that use fonts (such as @code{font-lock}, Enriched | ||
| 199 | Text mode, and others) by defining the relevant faces to use different | ||
| 200 | colors. Use the @code{list-colors-display} command | ||
| 201 | @iftex | ||
| 202 | (@pxref{Frame Parameters,,,emacs, the Emacs Manual}) | ||
| 203 | @end iftex | ||
| 204 | @ifnottex | ||
| 205 | (@pxref{Frame Parameters}) | ||
| 206 | @end ifnottex | ||
| 207 | and the @code{list-faces-display} command | ||
| 208 | @iftex | ||
| 209 | (@pxref{Faces,,,emacs, the Emacs Manual}) | ||
| 210 | @end iftex | ||
| 211 | @ifnottex | ||
| 212 | (@pxref{Faces}) | ||
| 213 | @end ifnottex | ||
| 214 | to see what colors and faces are available and what they look like. | ||
| 215 | |||
| 216 | @xref{MS-DOS and MULE}, later in this chapter, for information on | ||
| 217 | how Emacs displays glyphs and characters that aren't supported by the | ||
| 218 | native font built into the DOS display. | ||
| 219 | |||
| 220 | @cindex cursor shape on MS-DOS | ||
| 221 | When Emacs starts, it changes the cursor shape to a solid box. This | ||
| 222 | is for compatibility with other systems, where the box cursor is the | ||
| 223 | default in Emacs. This default shape can be changed to a bar by | ||
| 224 | specifying the @code{cursor-type} parameter in the variable | ||
| 225 | @code{default-frame-alist} | ||
| 226 | @iftex | ||
| 227 | (@pxref{Creating Frames,,,emacs, the Emacs Manual}). | ||
| 228 | @end iftex | ||
| 229 | @ifnottex | ||
| 230 | (@pxref{Creating Frames}). | ||
| 231 | @end ifnottex | ||
| 232 | The MS-DOS terminal doesn't support a vertical-bar cursor, | ||
| 233 | so the bar cursor is horizontal, and the @code{@var{width}} parameter, | ||
| 234 | if specified by the frame parameters, actually determines its height. | ||
| 235 | For this reason, the @code{bar} and @code{hbar} cursor types produce | ||
| 236 | the same effect on MS-DOS. As an extension, the bar cursor | ||
| 237 | specification can include the starting scan line of the cursor as well | ||
| 238 | as its width, like this: | ||
| 239 | |||
| 240 | @example | ||
| 241 | '(cursor-type bar @var{width} . @var{start}) | ||
| 242 | @end example | ||
| 243 | |||
| 244 | @noindent | ||
| 245 | In addition, if the @var{width} parameter is negative, the cursor bar | ||
| 246 | begins at the top of the character cell. | ||
| 247 | |||
| 248 | @cindex frames on MS-DOS | ||
| 249 | The MS-DOS terminal can only display a single frame at a time. The | ||
| 250 | Emacs frame facilities work on MS-DOS much as they do on text-only | ||
| 251 | terminals | ||
| 252 | @iftex | ||
| 253 | (@pxref{Frames,,,emacs, the Emacs Manual}). | ||
| 254 | @end iftex | ||
| 255 | @ifnottex | ||
| 256 | (@pxref{Frames}). | ||
| 257 | @end ifnottex | ||
| 258 | When you run Emacs from a DOS window on MS-Windows, you can make the | ||
| 259 | visible frame smaller than the full screen, but Emacs still cannot | ||
| 260 | display more than a single frame at a time. | ||
| 261 | |||
| 262 | @cindex frame size under MS-DOS | ||
| 263 | @findex mode4350 | ||
| 264 | @findex mode25 | ||
| 265 | The @code{mode4350} command switches the display to 43 or 50 | ||
| 266 | lines, depending on your hardware; the @code{mode25} command switches | ||
| 267 | to the default 80x25 screen size. | ||
| 268 | |||
| 269 | By default, Emacs only knows how to set screen sizes of 80 columns by | ||
| 270 | 25, 28, 35, 40, 43 or 50 rows. However, if your video adapter has | ||
| 271 | special video modes that will switch the display to other sizes, you can | ||
| 272 | have Emacs support those too. When you ask Emacs to switch the frame to | ||
| 273 | @var{n} rows by @var{m} columns dimensions, it checks if there is a | ||
| 274 | variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so, | ||
| 275 | uses its value (which must be an integer) as the video mode to switch | ||
| 276 | to. (Emacs switches to that video mode by calling the BIOS @code{Set | ||
| 277 | Video Mode} function with the value of | ||
| 278 | @code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.) | ||
| 279 | For example, suppose your adapter will switch to 66x80 dimensions when | ||
| 280 | put into video mode 85. Then you can make Emacs support this screen | ||
| 281 | size by putting the following into your @file{_emacs} file: | ||
| 282 | |||
| 283 | @example | ||
| 284 | (setq screen-dimensions-66x80 85) | ||
| 285 | @end example | ||
| 286 | |||
| 287 | Since Emacs on MS-DOS can only set the frame size to specific | ||
| 288 | supported dimensions, it cannot honor every possible frame resizing | ||
| 289 | request. When an unsupported size is requested, Emacs chooses the next | ||
| 290 | larger supported size beyond the specified size. For example, if you | ||
| 291 | ask for 36x80 frame, you will get 40x80 instead. | ||
| 292 | |||
| 293 | The variables @code{screen-dimensions-@var{n}x@var{m}} are used only | ||
| 294 | when they exactly match the specified size; the search for the next | ||
| 295 | larger supported size ignores them. In the above example, even if your | ||
| 296 | VGA supports 38x80 dimensions and you define a variable | ||
| 297 | @code{screen-dimensions-38x80} with a suitable value, you will still get | ||
| 298 | 40x80 screen when you ask for a 36x80 frame. If you want to get the | ||
| 299 | 38x80 size in this case, you can do it by setting the variable named | ||
| 300 | @code{screen-dimensions-36x80} with the same video mode value as | ||
| 301 | @code{screen-dimensions-38x80}. | ||
| 302 | |||
| 303 | Changing frame dimensions on MS-DOS has the effect of changing all the | ||
| 304 | other frames to the new dimensions. | ||
| 305 | |||
| 306 | @node MS-DOS File Names | ||
| 307 | @subsection File Names on MS-DOS | ||
| 308 | @cindex file names under MS-DOS | ||
| 309 | @cindex init file, default name under MS-DOS | ||
| 310 | |||
| 311 | On MS-DOS, file names are case-insensitive and limited to eight | ||
| 312 | characters, plus optionally a period and three more characters. Emacs | ||
| 313 | knows enough about these limitations to handle file names that were | ||
| 314 | meant for other operating systems. For instance, leading dots | ||
| 315 | @samp{.} in file names are invalid in MS-DOS, so Emacs transparently | ||
| 316 | converts them to underscores @samp{_}; thus your default init file | ||
| 317 | @iftex | ||
| 318 | (@pxref{Init File,,,emacs, the Emacs Manual}) | ||
| 319 | @end iftex | ||
| 320 | @ifnottex | ||
| 321 | (@pxref{Init File}) | ||
| 322 | @end ifnottex | ||
| 323 | is called @file{_emacs} on MS-DOS. Excess characters before or after | ||
| 324 | the period are generally ignored by MS-DOS itself; thus, if you visit | ||
| 325 | the file @file{LongFileName.EvenLongerExtension}, you will silently | ||
| 326 | get @file{longfile.eve}, but Emacs will still display the long file | ||
| 327 | name on the mode line. Other than that, it's up to you to specify | ||
| 328 | file names which are valid under MS-DOS; the transparent conversion as | ||
| 329 | described above only works on file names built into Emacs. | ||
| 330 | |||
| 331 | @cindex backup file names on MS-DOS | ||
| 332 | The above restrictions on the file names on MS-DOS make it almost | ||
| 333 | impossible to construct the name of a backup file | ||
| 334 | @iftex | ||
| 335 | (@pxref{Backup Names,,,emacs, the Emacs Manual}) | ||
| 336 | @end iftex | ||
| 337 | @ifnottex | ||
| 338 | (@pxref{Backup Names}) | ||
| 339 | @end ifnottex | ||
| 340 | without losing some of the original file name characters. For | ||
| 341 | example, the name of a backup file for @file{docs.txt} is | ||
| 342 | @file{docs.tx~} even if single backup is used. | ||
| 343 | |||
| 344 | @cindex file names under Windows 95/NT | ||
| 345 | @cindex long file names in DOS box under Windows 95/NT | ||
| 346 | If you run Emacs as a DOS application under Windows 9X, Windows ME, or | ||
| 347 | Windows 2000/XP, you can turn on support for long file names. If you do | ||
| 348 | that, Emacs doesn't truncate file names or convert them to lower case; | ||
| 349 | instead, it uses the file names that you specify, verbatim. To enable | ||
| 350 | long file name support, set the environment variable @env{LFN} to | ||
| 351 | @samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow | ||
| 352 | DOS programs to access long file names, so Emacs built for MS-DOS will | ||
| 353 | only see their short 8+3 aliases. | ||
| 354 | |||
| 355 | @cindex @env{HOME} directory under MS-DOS | ||
| 356 | MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends | ||
| 357 | that the directory where it is installed is the value of the @env{HOME} | ||
| 358 | environment variable. That is, if your Emacs binary, | ||
| 359 | @file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then | ||
| 360 | Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In | ||
| 361 | particular, that is where Emacs looks for the init file @file{_emacs}. | ||
| 362 | With this in mind, you can use @samp{~} in file names as an alias for | ||
| 363 | the home directory, as you would on GNU or Unix. You can also set | ||
| 364 | @env{HOME} variable in the environment before starting Emacs; its | ||
| 365 | value will then override the above default behavior. | ||
| 366 | |||
| 367 | Emacs on MS-DOS handles the directory name @file{/dev} specially, | ||
| 368 | because of a feature in the emulator libraries of DJGPP that pretends | ||
| 369 | I/O devices have names in that directory. We recommend that you avoid | ||
| 370 | using an actual directory named @file{/dev} on any disk. | ||
| 371 | |||
| 372 | @node MS-DOS Printing | ||
| 373 | @subsection Printing and MS-DOS | ||
| 374 | |||
| 375 | Printing commands, such as @code{lpr-buffer} | ||
| 376 | @iftex | ||
| 377 | (@pxref{Printing,,,emacs, the Emacs Manual}) and @code{ps-print-buffer} | ||
| 378 | (@pxref{PostScript,,,emacs, the Emacs Manual}) | ||
| 379 | @end iftex | ||
| 380 | @ifnottex | ||
| 381 | (@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript}) | ||
| 382 | @end ifnottex | ||
| 383 | can work on MS-DOS by sending the output to one of the printer ports, | ||
| 384 | if a Posix-style @code{lpr} program is unavailable. The same Emacs | ||
| 385 | variables control printing on all systems, but in some cases they have | ||
| 386 | different default values on MS-DOS. | ||
| 387 | |||
| 388 | @iftex | ||
| 389 | @xref{Windows Printing,,,emacs, the Emacs Manual}, | ||
| 390 | @end iftex | ||
| 391 | @ifnottex | ||
| 392 | @xref{Windows Printing}, | ||
| 393 | @end ifnottex | ||
| 394 | for details about setting up printing to a networked printer. | ||
| 395 | |||
| 396 | Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even | ||
| 397 | though they are connected to a Windows machine which uses a different | ||
| 398 | encoding for the same locale. For example, in the Latin-1 locale, DOS | ||
| 399 | uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and | ||
| 400 | MULE}. When you print to such printers from Windows, you can use the | ||
| 401 | @kbd{C-x RET c} (@code{universal-coding-system-argument}) command before | ||
| 402 | @kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS | ||
| 403 | codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET | ||
| 404 | M-x lpr-region RET} will print the region while converting it to the | ||
| 405 | codepage 850 encoding. You may need to create the @code{cp@var{nnn}} | ||
| 406 | coding system with @kbd{M-x codepage-setup}. | ||
| 407 | |||
| 408 | @vindex dos-printer | ||
| 409 | @vindex dos-ps-printer | ||
| 410 | For backwards compatibility, the value of @code{dos-printer} | ||
| 411 | (@code{dos-ps-printer}), if it has a value, overrides the value of | ||
| 412 | @code{printer-name} (@code{ps-printer-name}), on MS-DOS. | ||
| 413 | |||
| 414 | |||
| 415 | @node MS-DOS and MULE | ||
| 416 | @subsection International Support on MS-DOS | ||
| 417 | @cindex international support @r{(MS-DOS)} | ||
| 418 | |||
| 419 | Emacs on MS-DOS supports the same international character sets as it | ||
| 420 | does on GNU, Unix and other platforms | ||
| 421 | @iftex | ||
| 422 | (@pxref{International,,,emacs, the Emacs Manual}), | ||
| 423 | @end iftex | ||
| 424 | @ifnottex | ||
| 425 | (@pxref{International}), | ||
| 426 | @end ifnottex | ||
| 427 | including coding systems for converting between the different | ||
| 428 | character sets. However, due to incompatibilities between | ||
| 429 | MS-DOS/MS-Windows and other systems, there are several DOS-specific | ||
| 430 | aspects of this support that you should be aware of. This section | ||
| 431 | describes these aspects. | ||
| 432 | |||
| 433 | The description below is largely specific to the MS-DOS port of | ||
| 434 | Emacs, especially where it talks about practical implications for | ||
| 435 | Emacs users. For other operating systems, see the @file{code-pages.el} | ||
| 436 | package, which implements support for MS-DOS- and MS-Windows-specific | ||
| 437 | encodings for all platforms other than MS-DOS. | ||
| 438 | |||
| 439 | @table @kbd | ||
| 440 | @item M-x dos-codepage-setup | ||
| 441 | Set up Emacs display and coding systems as appropriate for the current | ||
| 442 | DOS codepage. | ||
| 443 | |||
| 444 | @item M-x codepage-setup | ||
| 445 | Create a coding system for a certain DOS codepage. | ||
| 446 | @end table | ||
| 447 | |||
| 448 | @cindex codepage, MS-DOS | ||
| 449 | @cindex DOS codepages | ||
| 450 | MS-DOS is designed to support one character set of 256 characters at | ||
| 451 | any given time, but gives you a variety of character sets to choose | ||
| 452 | from. The alternative character sets are known as @dfn{DOS codepages}. | ||
| 453 | Each codepage includes all 128 @acronym{ASCII} characters, but the other 128 | ||
| 454 | characters (codes 128 through 255) vary from one codepage to another. | ||
| 455 | Each DOS codepage is identified by a 3-digit number, such as 850, 862, | ||
| 456 | etc. | ||
| 457 | |||
| 458 | In contrast to X, which lets you use several fonts at the same time, | ||
| 459 | MS-DOS normally doesn't allow use of several codepages in a single | ||
| 460 | session. MS-DOS was designed to load a single codepage at system | ||
| 461 | startup, and require you to reboot in order to change | ||
| 462 | it@footnote{Normally, one particular codepage is burnt into the | ||
| 463 | display memory, while other codepages can be installed by modifying | ||
| 464 | system configuration files, such as @file{CONFIG.SYS}, and rebooting. | ||
| 465 | While there is third-party software that allows changing the codepage | ||
| 466 | without rebooting, we describe here how a stock MS-DOS system | ||
| 467 | behaves.}. Much the same limitation applies when you run DOS | ||
| 468 | executables on other systems such as MS-Windows. | ||
| 469 | |||
| 470 | @cindex unibyte operation @r{(MS-DOS)} | ||
| 471 | If you invoke Emacs on MS-DOS with the @samp{--unibyte} option | ||
| 472 | @iftex | ||
| 473 | (@pxref{Initial Options,,,emacs, the Emacs Manual}), | ||
| 474 | @end iftex | ||
| 475 | @ifnottex | ||
| 476 | (@pxref{Initial Options}), | ||
| 477 | @end ifnottex | ||
| 478 | Emacs does not perform any conversion of non-@acronym{ASCII} | ||
| 479 | characters. Instead, it reads and writes any non-@acronym{ASCII} | ||
| 480 | characters verbatim, and sends their 8-bit codes to the display | ||
| 481 | verbatim. Thus, unibyte Emacs on MS-DOS supports the current | ||
| 482 | codepage, whatever it may be, but cannot even represent any other | ||
| 483 | characters. | ||
| 484 | |||
| 485 | @vindex dos-codepage | ||
| 486 | For multibyte operation on MS-DOS, Emacs needs to know which | ||
| 487 | characters the chosen DOS codepage can display. So it queries the | ||
| 488 | system shortly after startup to get the chosen codepage number, and | ||
| 489 | stores the number in the variable @code{dos-codepage}. Some systems | ||
| 490 | return the default value 437 for the current codepage, even though the | ||
| 491 | actual codepage is different. (This typically happens when you use the | ||
| 492 | codepage built into the display hardware.) You can specify a different | ||
| 493 | codepage for Emacs to use by setting the variable @code{dos-codepage} in | ||
| 494 | your init file. | ||
| 495 | |||
| 496 | @cindex language environment, automatic selection on @r{MS-DOS} | ||
| 497 | Multibyte Emacs supports only certain DOS codepages: those which can | ||
| 498 | display Far-Eastern scripts, like the Japanese codepage 932, and those | ||
| 499 | that encode a single ISO 8859 character set. | ||
| 500 | |||
| 501 | The Far-Eastern codepages can directly display one of the MULE | ||
| 502 | character sets for these countries, so Emacs simply sets up to use the | ||
| 503 | appropriate terminal coding system that is supported by the codepage. | ||
| 504 | The special features described in the rest of this section mostly | ||
| 505 | pertain to codepages that encode ISO 8859 character sets. | ||
| 506 | |||
| 507 | For the codepages which correspond to one of the ISO character sets, | ||
| 508 | Emacs knows the character set name based on the codepage number. Emacs | ||
| 509 | automatically creates a coding system to support reading and writing | ||
| 510 | files that use the current codepage, and uses this coding system by | ||
| 511 | default. The name of this coding system is @code{cp@var{nnn}}, where | ||
| 512 | @var{nnn} is the codepage number.@footnote{The standard Emacs coding | ||
| 513 | systems for ISO 8859 are not quite right for the purpose, because | ||
| 514 | typically the DOS codepage does not match the standard ISO character | ||
| 515 | codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has | ||
| 516 | code 231 in the standard Latin-1 character set, but the corresponding | ||
| 517 | DOS codepage 850 uses code 135 for this glyph.} | ||
| 518 | |||
| 519 | @cindex mode line @r{(MS-DOS)} | ||
| 520 | All the @code{cp@var{nnn}} coding systems use the letter @samp{D} | ||
| 521 | (for ``DOS'') as their mode-line mnemonic. Since both the terminal | ||
| 522 | coding system and the default coding system for file I/O are set to | ||
| 523 | the proper @code{cp@var{nnn}} coding system at startup, it is normal | ||
| 524 | for the mode line on MS-DOS to begin with @samp{-DD\-}. | ||
| 525 | @iftex | ||
| 526 | @xref{Mode Line,,,emacs, the Emacs Manual}. | ||
| 527 | @end iftex | ||
| 528 | @ifnottex | ||
| 529 | @xref{Mode Line}. | ||
| 530 | @end ifnottex | ||
| 531 | Far-Eastern DOS terminals do not use the @code{cp@var{nnn}} coding | ||
| 532 | systems, and thus their initial mode line looks like the Emacs | ||
| 533 | default. | ||
| 534 | |||
| 535 | Since the codepage number also indicates which script you are using, | ||
| 536 | Emacs automatically runs @code{set-language-environment} to select the | ||
| 537 | language environment for that script | ||
| 538 | @iftex | ||
| 539 | (@pxref{Language Environments,,,emacs, the Emacs Manual}). | ||
| 540 | @end iftex | ||
| 541 | @ifnottex | ||
| 542 | (@pxref{Language Environments}). | ||
| 543 | @end ifnottex | ||
| 544 | |||
| 545 | If a buffer contains a character belonging to some other ISO 8859 | ||
| 546 | character set, not the one that the chosen DOS codepage supports, Emacs | ||
| 547 | displays it using a sequence of @acronym{ASCII} characters. For example, if the | ||
| 548 | current codepage doesn't have a glyph for the letter @samp{@`o} (small | ||
| 549 | @samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where | ||
| 550 | the braces serve as a visual indication that this is a single character. | ||
| 551 | (This may look awkward for some non-Latin characters, such as those from | ||
| 552 | Greek or Hebrew alphabets, but it is still readable by a person who | ||
| 553 | knows the language.) Even though the character may occupy several | ||
| 554 | columns on the screen, it is really still just a single character, and | ||
| 555 | all Emacs commands treat it as one. | ||
| 556 | |||
| 557 | @cindex IBM graphics characters (MS-DOS) | ||
| 558 | @cindex box-drawing characters (MS-DOS) | ||
| 559 | @cindex line-drawing characters (MS-DOS) | ||
| 560 | Not all characters in DOS codepages correspond to ISO 8859 | ||
| 561 | characters---some are used for other purposes, such as box-drawing | ||
| 562 | characters and other graphics. Emacs maps these characters to two | ||
| 563 | special character sets called @code{eight-bit-control} and | ||
| 564 | @code{eight-bit-graphic}, and displays them as their IBM glyphs. | ||
| 565 | However, you should be aware that other systems might display these | ||
| 566 | characters differently, so you should avoid them in text that might be | ||
| 567 | copied to a different operating system, or even to another DOS machine | ||
| 568 | that uses a different codepage. | ||
| 569 | |||
| 570 | @vindex dos-unsupported-character-glyph | ||
| 571 | Emacs supports many other characters sets aside from ISO 8859, but it | ||
| 572 | cannot display them on MS-DOS. So if one of these multibyte characters | ||
| 573 | appears in a buffer, Emacs on MS-DOS displays them as specified by the | ||
| 574 | @code{dos-unsupported-character-glyph} variable; by default, this glyph | ||
| 575 | is an empty triangle. Use the @kbd{C-u C-x =} command to display the | ||
| 576 | actual code and character set of such characters. | ||
| 577 | @iftex | ||
| 578 | @xref{Position Info,,,emacs, the Emacs Manual}. | ||
| 579 | @end iftex | ||
| 580 | @ifnottex | ||
| 581 | @xref{Position Info}. | ||
| 582 | @end ifnottex | ||
| 583 | |||
| 584 | @findex codepage-setup | ||
| 585 | By default, Emacs defines a coding system to support the current | ||
| 586 | codepage. To define a coding system for some other codepage (e.g., to | ||
| 587 | visit a file written on a DOS machine in another country), use the | ||
| 588 | @kbd{M-x codepage-setup} command. It prompts for the 3-digit code of | ||
| 589 | the codepage, with completion, then creates the coding system for the | ||
| 590 | specified codepage. You can then use the new coding system to read and | ||
| 591 | write files, but you must specify it explicitly for the file command | ||
| 592 | when you want to use it | ||
| 593 | @iftex | ||
| 594 | (@pxref{Text Coding,,,emacs, the Emacs Manual}). | ||
| 595 | @end iftex | ||
| 596 | @ifnottex | ||
| 597 | (@pxref{Text Coding}). | ||
| 598 | @end ifnottex | ||
| 599 | |||
| 600 | These coding systems are also useful for visiting a file encoded using | ||
| 601 | a DOS codepage, using Emacs running on some other operating system. | ||
| 602 | |||
| 603 | @cindex MS-Windows codepages | ||
| 604 | MS-Windows provides its own codepages, which are different from the | ||
| 605 | DOS codepages for the same locale. For example, DOS codepage 850 | ||
| 606 | supports the same character set as Windows codepage 1252; DOS codepage | ||
| 607 | 855 supports the same character set as Windows codepage 1251, etc. | ||
| 608 | The MS-Windows version of Emacs uses the current codepage for display | ||
| 609 | when invoked with the @samp{-nw} option. Support for codepages in the | ||
| 610 | Windows port of Emacs is part of the @file{code-pages.el} package. | ||
| 611 | |||
| 612 | @node MS-DOS Processes | ||
| 613 | @subsection Subprocesses on MS-DOS | ||
| 614 | |||
| 615 | @cindex compilation under MS-DOS | ||
| 616 | @cindex inferior processes under MS-DOS | ||
| 617 | @findex compile @r{(MS-DOS)} | ||
| 618 | @findex grep @r{(MS-DOS)} | ||
| 619 | Because MS-DOS is a single-process ``operating system,'' | ||
| 620 | asynchronous subprocesses are not available. In particular, Shell | ||
| 621 | mode and its variants do not work. Most Emacs features that use | ||
| 622 | asynchronous subprocesses also don't work on MS-DOS, including | ||
| 623 | Shell mode and GUD. When in doubt, try and see; commands that | ||
| 624 | don't work output an error message saying that asynchronous processes | ||
| 625 | aren't supported. | ||
| 626 | |||
| 627 | Compilation under Emacs with @kbd{M-x compile}, searching files with | ||
| 628 | @kbd{M-x grep} and displaying differences between files with @kbd{M-x | ||
| 629 | diff} do work, by running the inferior processes synchronously. This | ||
| 630 | means you cannot do any more editing until the inferior process | ||
| 631 | finishes. | ||
| 632 | |||
| 633 | Spell checking also works, by means of special support for synchronous | ||
| 634 | invocation of the @code{ispell} program. This is slower than the | ||
| 635 | asynchronous invocation on other platforms | ||
| 636 | |||
| 637 | Instead of the Shell mode, which doesn't work on MS-DOS, you can use | ||
| 638 | the @kbd{M-x eshell} command. This invokes the Eshell package that | ||
| 639 | implements a Posix-like shell entirely in Emacs Lisp. | ||
| 640 | |||
| 641 | By contrast, Emacs compiled as a native Windows application | ||
| 642 | @strong{does} support asynchronous subprocesses. | ||
| 643 | @iftex | ||
| 644 | @xref{Windows Processes,,,emacs, the Emacs Manual}. | ||
| 645 | @end iftex | ||
| 646 | @ifnottex | ||
| 647 | @xref{Windows Processes}. | ||
| 648 | @end ifnottex | ||
| 649 | |||
| 650 | @cindex printing under MS-DOS | ||
| 651 | Printing commands, such as @code{lpr-buffer} | ||
| 652 | @iftex | ||
| 653 | (@pxref{Printing,,,emacs, the Emacs Manual}) and | ||
| 654 | @code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}), | ||
| 655 | work in MS-DOS by sending the output to one of the printer ports. | ||
| 656 | @xref{MS-DOS Printing,,,emacs, the Emacs Manual}. | ||
| 657 | @end iftex | ||
| 658 | @ifnottex | ||
| 659 | (@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript}), | ||
| 660 | work in MS-DOS by sending the output to one of the printer ports. | ||
| 661 | @xref{MS-DOS Printing}. | ||
| 662 | @end ifnottex | ||
| 663 | |||
| 664 | When you run a subprocess synchronously on MS-DOS, make sure the | ||
| 665 | program terminates and does not try to read keyboard input. If the | ||
| 666 | program does not terminate on its own, you will be unable to terminate | ||
| 667 | it, because MS-DOS provides no general way to terminate a process. | ||
| 668 | Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these | ||
| 669 | cases. | ||
| 670 | |||
| 671 | Accessing files on other machines is not supported on MS-DOS. Other | ||
| 672 | network-oriented commands such as sending mail, Web browsing, remote | ||
| 673 | login, etc., don't work either, unless network access is built into | ||
| 674 | MS-DOS with some network redirector. | ||
| 675 | |||
| 676 | @cindex directory listing on MS-DOS | ||
| 677 | @vindex dired-listing-switches @r{(MS-DOS)} | ||
| 678 | Dired on MS-DOS uses the @code{ls-lisp} package where other | ||
| 679 | platforms use the system @code{ls} command. Therefore, Dired on | ||
| 680 | MS-DOS supports only some of the possible options you can mention in | ||
| 681 | the @code{dired-listing-switches} variable. The options that work are | ||
| 682 | @samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S}, | ||
| 683 | @samp{-s}, @samp{-t}, and @samp{-u}. | ||
| 684 | |||
| 685 | @ignore | ||
| 686 | arch-tag: 868d50ff-07f8-4a13-a807-dab6f1cdb431 | ||
| 687 | @end ignore | ||
diff --git a/doc/emacs/msdog.texi b/doc/emacs/msdog.texi new file mode 100644 index 00000000000..0ed15229b7c --- /dev/null +++ b/doc/emacs/msdog.texi | |||
| @@ -0,0 +1,766 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Microsoft Windows, Manifesto, Mac OS, Top | ||
| 6 | @appendix Emacs and Microsoft Windows/MS-DOS | ||
| 7 | @cindex Microsoft Windows | ||
| 8 | @cindex MS-Windows, Emacs peculiarities | ||
| 9 | |||
| 10 | This section describes peculiarities of using Emacs on Microsoft | ||
| 11 | Windows. Some of these peculiarities are also relevant to Microsoft's | ||
| 12 | older MS-DOS ``operating system'' (also known as ``MS-DOG''). | ||
| 13 | However, Emacs features that are relevant @emph{only} to MS-DOS are | ||
| 14 | described in a separate | ||
| 15 | @iftex | ||
| 16 | manual (@pxref{MS-DOS,,, emacs-xtra, Specialized Emacs Features}). | ||
| 17 | @end iftex | ||
| 18 | @ifnottex | ||
| 19 | section (@pxref{MS-DOS}). | ||
| 20 | @end ifnottex | ||
| 21 | |||
| 22 | |||
| 23 | The behavior of Emacs on MS-Windows is reasonably similar to what is | ||
| 24 | documented in the rest of the manual, including support for long file | ||
| 25 | names, multiple frames, scroll bars, mouse menus, and subprocesses. | ||
| 26 | However, a few special considerations apply, and they are described | ||
| 27 | here. | ||
| 28 | |||
| 29 | @menu | ||
| 30 | * Text and Binary:: Text files use CRLF to terminate lines. | ||
| 31 | * Windows Files:: File-name conventions on Windows. | ||
| 32 | * ls in Lisp:: Emulation of @code{ls} for Dired. | ||
| 33 | * Windows HOME:: Where Emacs looks for your @file{.emacs}. | ||
| 34 | * Windows Keyboard:: Windows-specific keyboard features. | ||
| 35 | * Windows Mouse:: Windows-specific mouse features. | ||
| 36 | * Windows Processes:: Running subprocesses on Windows. | ||
| 37 | * Windows Printing:: How to specify the printer on MS-Windows. | ||
| 38 | * Windows Misc:: Miscellaneous Windows features. | ||
| 39 | @ifnottex | ||
| 40 | * MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}). | ||
| 41 | @end ifnottex | ||
| 42 | @end menu | ||
| 43 | |||
| 44 | @node Text and Binary | ||
| 45 | @section Text Files and Binary Files | ||
| 46 | @cindex text and binary files on MS-DOS/MS-Windows | ||
| 47 | |||
| 48 | GNU Emacs uses newline characters to separate text lines. This is the | ||
| 49 | convention used on GNU, Unix, and other Posix-compliant systems. | ||
| 50 | |||
| 51 | @cindex end-of-line conversion on MS-DOS/MS-Windows | ||
| 52 | By contrast, MS-DOS and MS-Windows normally use carriage-return linefeed, | ||
| 53 | a two-character sequence, to separate text lines. (Linefeed is the same | ||
| 54 | character as newline.) Therefore, convenient editing of typical files | ||
| 55 | with Emacs requires conversion of these end-of-line (EOL) sequences. | ||
| 56 | And that is what Emacs normally does: it converts carriage-return | ||
| 57 | linefeed into newline when reading files, and converts newline into | ||
| 58 | carriage-return linefeed when writing files. The same mechanism that | ||
| 59 | handles conversion of international character codes does this conversion | ||
| 60 | also (@pxref{Coding Systems}). | ||
| 61 | |||
| 62 | @cindex cursor location, on MS-DOS | ||
| 63 | @cindex point location, on MS-DOS | ||
| 64 | One consequence of this special format-conversion of most files is | ||
| 65 | that character positions as reported by Emacs (@pxref{Position Info}) do | ||
| 66 | not agree with the file size information known to the operating system. | ||
| 67 | |||
| 68 | In addition, if Emacs recognizes from a file's contents that it uses | ||
| 69 | newline rather than carriage-return linefeed as its line separator, it | ||
| 70 | does not perform EOL conversion when reading or writing that file. | ||
| 71 | Thus, you can read and edit files from GNU and Unix systems on MS-DOS | ||
| 72 | with no special effort, and they will retain their Unix-style | ||
| 73 | end-of-line convention after you edit them. | ||
| 74 | |||
| 75 | The mode line indicates whether end-of-line translation was used for | ||
| 76 | the current buffer. If MS-DOS end-of-line translation is in use for the | ||
| 77 | buffer, the MS-Windows build of Emacs displays a backslash @samp{\} after | ||
| 78 | the coding system mnemonic near the beginning of the mode line | ||
| 79 | (@pxref{Mode Line}). If no EOL translation was performed, the string | ||
| 80 | @samp{(Unix)} is displayed instead of the backslash, to alert you that the | ||
| 81 | file's EOL format is not the usual carriage-return linefeed. | ||
| 82 | |||
| 83 | @cindex DOS-to-Unix conversion of files | ||
| 84 | To visit a file and specify whether it uses DOS-style or Unix-style | ||
| 85 | end-of-line, specify a coding system (@pxref{Text Coding}). For | ||
| 86 | example, @kbd{C-x @key{RET} c unix @key{RET} C-x C-f foobar.txt} | ||
| 87 | visits the file @file{foobar.txt} without converting the EOLs; if some | ||
| 88 | line ends with a carriage-return linefeed pair, Emacs will display | ||
| 89 | @samp{^M} at the end of that line. Similarly, you can direct Emacs to | ||
| 90 | save a buffer in a specified EOL format with the @kbd{C-x @key{RET} f} | ||
| 91 | command. For example, to save a buffer with Unix EOL format, type | ||
| 92 | @kbd{C-x @key{RET} f unix @key{RET} C-x C-s}. If you visit a file | ||
| 93 | with DOS EOL conversion, then save it with Unix EOL format, that | ||
| 94 | effectively converts the file to Unix EOL style, like @code{dos2unix}. | ||
| 95 | |||
| 96 | @cindex untranslated file system | ||
| 97 | @findex add-untranslated-filesystem | ||
| 98 | When you use NFS, Samba, or some other similar method to access file | ||
| 99 | systems that reside on computers using GNU or Unix systems, Emacs | ||
| 100 | should not perform end-of-line translation on any files in these file | ||
| 101 | systems---not even when you create a new file. To request this, | ||
| 102 | designate these file systems as @dfn{untranslated} file systems by | ||
| 103 | calling the function @code{add-untranslated-filesystem}. It takes one | ||
| 104 | argument: the file system name, including a drive letter and | ||
| 105 | optionally a directory. For example, | ||
| 106 | |||
| 107 | @example | ||
| 108 | (add-untranslated-filesystem "Z:") | ||
| 109 | @end example | ||
| 110 | |||
| 111 | @noindent | ||
| 112 | designates drive Z as an untranslated file system, and | ||
| 113 | |||
| 114 | @example | ||
| 115 | (add-untranslated-filesystem "Z:\\foo") | ||
| 116 | @end example | ||
| 117 | |||
| 118 | @noindent | ||
| 119 | designates directory @file{\foo} on drive Z as an untranslated file | ||
| 120 | system. | ||
| 121 | |||
| 122 | Most often you would use @code{add-untranslated-filesystem} in your | ||
| 123 | @file{.emacs} file, or in @file{site-start.el} so that all the users at | ||
| 124 | your site get the benefit of it. | ||
| 125 | |||
| 126 | @findex remove-untranslated-filesystem | ||
| 127 | To countermand the effect of @code{add-untranslated-filesystem}, use | ||
| 128 | the function @code{remove-untranslated-filesystem}. This function takes | ||
| 129 | one argument, which should be a string just like the one that was used | ||
| 130 | previously with @code{add-untranslated-filesystem}. | ||
| 131 | |||
| 132 | Designating a file system as untranslated does not affect character | ||
| 133 | set conversion, only end-of-line conversion. Essentially, it directs | ||
| 134 | Emacs to create new files with the Unix-style convention of using | ||
| 135 | newline at the end of a line. @xref{Coding Systems}. | ||
| 136 | |||
| 137 | @vindex file-name-buffer-file-type-alist | ||
| 138 | @cindex binary files, on MS-DOS/MS-Windows | ||
| 139 | Some kinds of files should not be converted at all, because their | ||
| 140 | contents are not really text. Therefore, Emacs on MS-Windows distinguishes | ||
| 141 | certain files as @dfn{binary files}. (This distinction is not part of | ||
| 142 | MS-Windows; it is made by Emacs only.) Binary files include executable | ||
| 143 | programs, compressed archives, etc. Emacs uses the file name to decide | ||
| 144 | whether to treat a file as binary: the variable | ||
| 145 | @code{file-name-buffer-file-type-alist} defines the file-name patterns | ||
| 146 | that indicate binary files. If a file name matches one of the patterns | ||
| 147 | for binary files (those whose associations are of the type | ||
| 148 | @code{(@var{pattern} . t)}, Emacs reads and writes that file using the | ||
| 149 | @code{no-conversion} coding system (@pxref{Coding Systems}) which turns | ||
| 150 | off @emph{all} coding-system conversions, not only the EOL conversion. | ||
| 151 | @code{file-name-buffer-file-type-alist} also includes file-name patterns | ||
| 152 | for files which are known to be Windows-style text files with | ||
| 153 | carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs | ||
| 154 | always writes those files with Windows-style EOLs. | ||
| 155 | |||
| 156 | If a file which belongs to an untranslated file system matches one of | ||
| 157 | the file-name patterns in @code{file-name-buffer-file-type-alist}, the | ||
| 158 | EOL conversion is determined by @code{file-name-buffer-file-type-alist}. | ||
| 159 | |||
| 160 | @node Windows Files | ||
| 161 | @section File Names on MS-Windows | ||
| 162 | @cindex file names on MS-Windows | ||
| 163 | |||
| 164 | MS-Windows and MS-DOS normally use a backslash, @samp{\}, to | ||
| 165 | separate name units within a file name, instead of the slash used on | ||
| 166 | other systems. Emacs on MS-DOS/MS-Windows permits use of either slash or | ||
| 167 | backslash, and also knows about drive letters in file names. | ||
| 168 | |||
| 169 | @cindex file-name completion, on MS-Windows | ||
| 170 | On MS-DOS/MS-Windows, file names are case-insensitive, so Emacs by | ||
| 171 | default ignores letter-case in file names during completion. | ||
| 172 | |||
| 173 | @vindex w32-get-true-file-attributes | ||
| 174 | If the variable @code{w32-get-true-file-attributes} is | ||
| 175 | non-@code{nil} (the default), Emacs tries to determine the accurate | ||
| 176 | link counts for files. This option is only useful on NTFS volumes, | ||
| 177 | and it considerably slows down Dired and other features, so use it | ||
| 178 | only on fast machines. | ||
| 179 | |||
| 180 | @node ls in Lisp | ||
| 181 | @section Emulation of @code{ls} on MS-Windows | ||
| 182 | @cindex Dired, and MS-Windows/MS-DOS | ||
| 183 | @cindex @code{ls} emulation | ||
| 184 | |||
| 185 | Dired normally uses the external program @code{ls} (or its close | ||
| 186 | work-alike) to produce the directory listing displayed in Dired | ||
| 187 | buffers (@pxref{Dired}). However, MS-Windows and MS-DOS systems don't | ||
| 188 | come with such a program, although several ports of @sc{gnu} @code{ls} | ||
| 189 | are available. Therefore, Emacs on those systems @emph{emulates} | ||
| 190 | @code{ls} in Lisp, by using the @file{ls-lisp.el} package. While | ||
| 191 | @file{ls-lisp.el} provides a reasonably full emulation of @code{ls}, | ||
| 192 | there are some options and features peculiar to that emulation; | ||
| 193 | @iftex | ||
| 194 | for more details, see the documentation of the variables whose names | ||
| 195 | begin with @code{ls-lisp}. | ||
| 196 | @end iftex | ||
| 197 | @ifnottex | ||
| 198 | they are described in this section. | ||
| 199 | |||
| 200 | The @code{ls} emulation supports many of the @code{ls} switches, but | ||
| 201 | it doesn't support all of them. Here's the list of the switches it | ||
| 202 | does support: @option{-A}, @option{-a}, @option{-B}, @option{-C}, | ||
| 203 | @option{-c}, @option{-i}, @option{-G}, @option{-g}, @option{-R}, | ||
| 204 | @option{-r}, @option{-S}, @option{-s}, @option{-t}, @option{-U}, | ||
| 205 | @option{-u}, and @option{-X}. The @option{-F} switch is partially | ||
| 206 | supported (it appends the character that classifies the file, but does | ||
| 207 | not prevent symlink following). | ||
| 208 | |||
| 209 | @vindex ls-lisp-use-insert-directory-program | ||
| 210 | On MS-Windows and MS-DOS, @file{ls-lisp.el} is preloaded when Emacs | ||
| 211 | is built, so the Lisp emulation of @code{ls} is always used on those | ||
| 212 | platforms. If you have a ported @code{ls}, setting | ||
| 213 | @code{ls-lisp-use-insert-directory-program} to a non-@code{nil} value | ||
| 214 | will revert to using an external program named by the variable | ||
| 215 | @code{insert-directory-program}. | ||
| 216 | |||
| 217 | @vindex ls-lisp-ignore-case | ||
| 218 | By default, @file{ls-lisp.el} uses a case-sensitive sort order for | ||
| 219 | the directory listing it produces; this is so the listing looks the | ||
| 220 | same as on other platforms. If you wish that the files be sorted in | ||
| 221 | case-insensitive order, set the variable @code{ls-lisp-ignore-case} to | ||
| 222 | a non-@code{nil} value. | ||
| 223 | |||
| 224 | @vindex ls-lisp-dirs-first | ||
| 225 | By default, files and subdirectories are sorted together, to emulate | ||
| 226 | the behavior of @code{ls}. However, native MS-Windows/MS-DOS file | ||
| 227 | managers list the directories before the files; if you want that | ||
| 228 | behavior, customize the option @code{ls-lisp-dirs-first} to a | ||
| 229 | non-@code{nil} value. | ||
| 230 | |||
| 231 | @vindex ls-lisp-verbosity | ||
| 232 | The variable @code{ls-lisp-verbosity} controls the file attributes | ||
| 233 | that @file{ls-lisp.el} displays. The value should be a list that | ||
| 234 | contains one or more of the symbols @code{links}, @code{uid}, and | ||
| 235 | @code{gid}. @code{links} means display the count of different file | ||
| 236 | names that are associated with (a.k.a.@: @dfn{links to}) the file's | ||
| 237 | data; this is only useful on NTFS volumes. @code{uid} means display | ||
| 238 | the numerical identifier of the user who owns the file. @code{gid} | ||
| 239 | means display the numerical identifier of the file owner's group. The | ||
| 240 | default value is @code{(links uid gid)} i.e.@: all the 3 optional | ||
| 241 | attributes are displayed. | ||
| 242 | |||
| 243 | @vindex ls-lisp-emulation | ||
| 244 | The variable @code{ls-lisp-emulation} controls the flavour of the | ||
| 245 | @code{ls} emulation by setting the defaults for the 3 options | ||
| 246 | described above: @code{ls-lisp-ignore-case}, | ||
| 247 | @code{ls-lisp-dirs-first}, and @code{ls-lisp-verbosity}. The value of | ||
| 248 | this option can be one of the following symbols: | ||
| 249 | |||
| 250 | @table @code | ||
| 251 | @item GNU | ||
| 252 | @itemx nil | ||
| 253 | Emulate @sc{gnu} systems; this is the default. This sets | ||
| 254 | @code{ls-lisp-ignore-case} and @code{ls-lisp-dirs-first} to | ||
| 255 | @code{nil}, and @code{ls-lisp-verbosity} to @code{(links uid gid)}. | ||
| 256 | @item UNIX | ||
| 257 | Emulate Unix systems. Like @code{GNU}, but sets | ||
| 258 | @code{ls-lisp-verbosity} to @code{(links uid)}. | ||
| 259 | @item MacOS | ||
| 260 | Emulate MacOS. Sets @code{ls-lisp-ignore-case} to @code{t}, and | ||
| 261 | @code{ls-lisp-dirs-first} and @code{ls-lisp-verbosity} to @code{nil}. | ||
| 262 | @item MS-Windows | ||
| 263 | Emulate MS-Windows. Sets @code{ls-lisp-ignore-case} and | ||
| 264 | @code{ls-lisp-dirs-first} to @code{t}, and @code{ls-lisp-verbosity} to | ||
| 265 | @code{(links)} on Windows NT/2K/XP/2K3 and to @code{nil} on Windows 9X. | ||
| 266 | Note that the default emulation is @emph{not} @code{MS-Windows}, even | ||
| 267 | on Windows, since many users of Emacs on those platforms prefer the | ||
| 268 | @sc{gnu} defaults. | ||
| 269 | @end table | ||
| 270 | |||
| 271 | @noindent | ||
| 272 | Any other value of @code{ls-lisp-emulation} means the same as | ||
| 273 | @code{GNU}. Note that this option needs to be set @emph{before} | ||
| 274 | @file{ls-lisp.el} is loaded, which means that on MS-Windows and MS-DOS | ||
| 275 | you will have to set the value from your @file{.emacs} file and then | ||
| 276 | restart Emacs, since @file{ls-lisp.el} is preloaded. | ||
| 277 | |||
| 278 | @vindex ls-lisp-support-shell-wildcards | ||
| 279 | The variable @code{ls-lisp-support-shell-wildcards} controls how | ||
| 280 | file-name patterns are supported: if it is non-@code{nil} (the | ||
| 281 | default), they are treated as shell-style wildcards; otherwise they | ||
| 282 | are treated as Emacs regular expressions. | ||
| 283 | |||
| 284 | @vindex ls-lisp-format-time-list | ||
| 285 | The variable @code{ls-lisp-format-time-list} defines how to format | ||
| 286 | the date and time of files. @emph{The value of this variable is | ||
| 287 | ignored}, unless Emacs cannot determine the current locale. (However, | ||
| 288 | if the value of @code{ls-lisp-use-localized-time-format} is | ||
| 289 | non-@code{nil}, Emacs obeys @code{ls-lisp-format-time-list} even if | ||
| 290 | the current locale is available; see below.) | ||
| 291 | |||
| 292 | The value of @code{ls-lisp-format-time-list} is a list of 2 strings. | ||
| 293 | The first string is used if the file was modified within the current | ||
| 294 | year, while the second string is used for older files. In each of | ||
| 295 | these two strings you can use @samp{%}-sequences to substitute parts | ||
| 296 | of the time. For example: | ||
| 297 | @lisp | ||
| 298 | ("%b %e %H:%M" "%b %e %Y") | ||
| 299 | @end lisp | ||
| 300 | |||
| 301 | @noindent | ||
| 302 | Note that the strings substituted for these @samp{%}-sequences depend | ||
| 303 | on the current locale. @xref{Time Parsing,,, elisp, The Emacs Lisp | ||
| 304 | Reference Manual}, for more about format time specs. | ||
| 305 | |||
| 306 | @vindex ls-lisp-use-localized-time-format | ||
| 307 | Normally, Emacs formats the file time stamps in either traditional | ||
| 308 | or ISO-style time format. However, if the value of the variable | ||
| 309 | @code{ls-lisp-use-localized-time-format} is non-@code{nil}, Emacs | ||
| 310 | formats file time stamps according to what | ||
| 311 | @code{ls-lisp-format-time-list} specifies. The @samp{%}-sequences in | ||
| 312 | @code{ls-lisp-format-time-list} produce locale-dependent month and day | ||
| 313 | names, which might cause misalignment of columns in Dired display. | ||
| 314 | @end ifnottex | ||
| 315 | |||
| 316 | @node Windows HOME | ||
| 317 | @section HOME Directory on MS-Windows | ||
| 318 | @cindex @code{HOME} directory on MS-Windows | ||
| 319 | |||
| 320 | The Windows equivalent of the @code{HOME} directory is the | ||
| 321 | @dfn{user-specific application data directory}. The actual location | ||
| 322 | depends on your Windows version and system configuration; typical values | ||
| 323 | are @file{C:\Documents and Settings\@var{username}\Application Data} on | ||
| 324 | Windows 2K/XP and later, and either @file{C:\WINDOWS\Application Data} | ||
| 325 | or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the | ||
| 326 | older Windows 9X/ME systems. | ||
| 327 | |||
| 328 | @cindex init file @file{.emacs} on MS-Windows | ||
| 329 | The home directory is where your init file @file{.emacs} is stored. | ||
| 330 | When Emacs starts, it first checks whether the environment variable | ||
| 331 | @env{HOME} is set. If it is, it looks for the init file in the | ||
| 332 | directory pointed by @env{HOME}. If @env{HOME} is not defined, Emacs | ||
| 333 | checks for an existing @file{.emacs} file in @file{C:\}, the root | ||
| 334 | directory of drive @file{C:}@footnote{ | ||
| 335 | The check in @file{C:\} is in preference to the application data | ||
| 336 | directory for compatibility with older versions of Emacs, which didn't | ||
| 337 | check the application data directory. | ||
| 338 | }. If there's no such file in @file{C:\}, Emacs next uses the Windows | ||
| 339 | system calls to find out the exact location of your application data | ||
| 340 | directory. If that fails as well, Emacs falls back to @file{C:\}. | ||
| 341 | |||
| 342 | Whatever the final place is, Emacs sets the value of the @env{HOME} | ||
| 343 | environment variable to point to it, and it will use that location for | ||
| 344 | other files and directories it normally creates in the user's home | ||
| 345 | directory. | ||
| 346 | |||
| 347 | You can always find out where Emacs thinks is your home directory's | ||
| 348 | location by typing @kbd{C-x d ~/ @key{RET}}. This should present the | ||
| 349 | list of files in the home directory, and show its full name on the | ||
| 350 | first line. Likewise, to visit your init file, type @kbd{C-x C-f | ||
| 351 | ~/.emacs @key{RET}}. | ||
| 352 | |||
| 353 | @cindex @file{_emacs} init file, MS-Windows | ||
| 354 | Because MS-DOS does not allow file names with leading dots, and | ||
| 355 | because older Windows systems made it hard to create files with such | ||
| 356 | names, the Windows port of Emacs supports an alternative name | ||
| 357 | @file{_emacs} as a fallback, if such a file exists in the home | ||
| 358 | directory, whereas @file{.emacs} does not. | ||
| 359 | |||
| 360 | @node Windows Keyboard | ||
| 361 | @section Keyboard Usage on MS-Windows | ||
| 362 | @cindex keyboard, MS-Windows | ||
| 363 | |||
| 364 | This section describes the Windows-specific features related to | ||
| 365 | keyboard input in Emacs. | ||
| 366 | |||
| 367 | @cindex MS-Windows keyboard shortcuts | ||
| 368 | Many key combinations (known as ``keyboard shortcuts'') that have | ||
| 369 | conventional uses in MS-Windows programs conflict with traditional | ||
| 370 | Emacs key bindings. (These Emacs key bindings were established years | ||
| 371 | before Microsoft was founded.) Examples of conflicts include | ||
| 372 | @kbd{C-c}, @kbd{C-x}, @kbd{C-z}, @kbd{C-a}, and @kbd{W-@key{SPC}}. | ||
| 373 | You can redefine some of them with meanings more like the MS-Windows | ||
| 374 | meanings by enabling CUA Mode (@pxref{CUA Bindings}). | ||
| 375 | |||
| 376 | @kindex F10 @r{(MS-Windows)} | ||
| 377 | @cindex menu bar access using keyboard @r{(MS-Windows)} | ||
| 378 | The @key{F10} key on Windows activates the menu bar in a way that | ||
| 379 | makes it possible to use the menus without a mouse. In this mode, the | ||
| 380 | arrow keys traverse the menus, @key{RET} selects a highlighted menu | ||
| 381 | item, and @key{ESC} closes the menu. | ||
| 382 | |||
| 383 | @iftex | ||
| 384 | @inforef{Windows Keyboard, , emacs}, for information about additional | ||
| 385 | Windows-specific variables in this category. | ||
| 386 | @end iftex | ||
| 387 | @ifnottex | ||
| 388 | @vindex w32-alt-is-meta | ||
| 389 | @cindex @code{Alt} key (MS-Windows) | ||
| 390 | By default, the key labeled @key{Alt} is mapped as the @key{META} | ||
| 391 | key. If you wish it to produce the @code{Alt} modifier instead, set | ||
| 392 | the variable @code{w32-alt-is-meta} to a @code{nil} value. | ||
| 393 | |||
| 394 | @vindex w32-capslock-is-shiftlock | ||
| 395 | By default, the @key{CapsLock} key only affects normal character | ||
| 396 | keys (it converts lower-case characters to their upper-case | ||
| 397 | variants). However, if you set the variable | ||
| 398 | @code{w32-capslock-is-shiftlock} to a non-@code{nil} value, the | ||
| 399 | @key{CapsLock} key will affect non-character keys as well, as if you | ||
| 400 | pressed the @key{Shift} key while typing the non-character key. | ||
| 401 | |||
| 402 | @vindex w32-enable-caps-lock | ||
| 403 | If the variable @code{w32-enable-caps-lock} is set to a @code{nil} | ||
| 404 | value, the @key{CapsLock} key produces the symbol @code{capslock} | ||
| 405 | instead of the shifted version of they keys. The default value is | ||
| 406 | @code{t}. | ||
| 407 | |||
| 408 | @vindex w32-enable-num-lock | ||
| 409 | @cindex keypad keys (MS-Windows) | ||
| 410 | Similarly, if @code{w32-enable-num-lock} is @code{nil}, the | ||
| 411 | @key{NumLock} key will produce the symbol @code{kp-numlock}. The | ||
| 412 | default is @code{t}, which causes @key{NumLock} to work as expected: | ||
| 413 | toggle the meaning of the keys on the numeric keypad. | ||
| 414 | @end ifnottex | ||
| 415 | |||
| 416 | @vindex w32-apps-modifier | ||
| 417 | The variable @code{w32-apps-modifier} controls the effect of the | ||
| 418 | @key{Apps} key (usually located between the right @key{Alt} and the | ||
| 419 | right @key{Ctrl} keys). Its value can be one of the symbols | ||
| 420 | @code{hyper}, @code{super}, @code{meta}, @code{alt}, @code{control}, | ||
| 421 | or @code{shift} for the respective modifier, or @code{nil} to appear | ||
| 422 | as the key @code{apps}. The default is @code{nil}. | ||
| 423 | |||
| 424 | @vindex w32-lwindow-modifier | ||
| 425 | @vindex w32-rwindow-modifier | ||
| 426 | @vindex w32-scroll-lock-modifier | ||
| 427 | The variable @code{w32-lwindow-modifier} determines the effect of | ||
| 428 | the left Windows key (usually labeled with @key{start} and the Windows | ||
| 429 | logo). If its value is @code{nil} (the default), the key will produce | ||
| 430 | the symbol @code{lwindow}. Setting it to one of the symbols | ||
| 431 | @code{hyper}, @code{super}, @code{meta}, @code{alt}, @code{control}, | ||
| 432 | or @code{shift} will produce the respective modifier. A similar | ||
| 433 | variable @code{w32-rwindow-modifier} controls the effect of the right | ||
| 434 | Windows key, and @code{w32-scroll-lock-modifier} does the same for the | ||
| 435 | @key{ScrLock} key. If these variables are set to @code{nil}, the | ||
| 436 | right Windows key produces the symbol @code{rwindow} and @key{ScrLock} | ||
| 437 | produces the symbol @code{scroll}. | ||
| 438 | |||
| 439 | @vindex w32-pass-alt-to-system | ||
| 440 | @cindex Windows system menu | ||
| 441 | @cindex @code{Alt} key invokes menu (Windows) | ||
| 442 | Emacs compiled as a native Windows application normally turns off | ||
| 443 | the Windows feature that tapping the @key{ALT} key invokes the Windows | ||
| 444 | menu. The reason is that the @key{ALT} serves as @key{META} in Emacs. | ||
| 445 | When using Emacs, users often press the @key{META} key temporarily and | ||
| 446 | then change their minds; if this has the effect of bringing up the | ||
| 447 | Windows menu, it alters the meaning of subsequent commands. Many | ||
| 448 | users find this frustrating. | ||
| 449 | |||
| 450 | You can re-enable Windows' default handling of tapping the @key{ALT} | ||
| 451 | key by setting @code{w32-pass-alt-to-system} to a non-@code{nil} | ||
| 452 | value. | ||
| 453 | |||
| 454 | @ifnottex | ||
| 455 | @vindex w32-pass-lwindow-to-system | ||
| 456 | @vindex w32-pass-rwindow-to-system | ||
| 457 | The variables @code{w32-pass-lwindow-to-system} and | ||
| 458 | @code{w32-pass-rwindow-to-system} determine whether the respective | ||
| 459 | keys are passed to Windows or swallowed by Emacs. If the value is | ||
| 460 | @code{nil}, the respective key is silently swallowed by Emacs, | ||
| 461 | otherwise it is passed to Windows. The default is @code{t} for both | ||
| 462 | of these variables. Passing each of these keys to Windows produces | ||
| 463 | its normal effect: for example, @kbd{@key{Lwindow}} opens the | ||
| 464 | @code{Start} menu, etc.@footnote{ | ||
| 465 | Some combinations of the ``Windows'' keys with other keys are caught | ||
| 466 | by Windows at low level in a way that Emacs currently cannot prevent. | ||
| 467 | For example, @kbd{@key{Lwindow} r} always pops up the Windows | ||
| 468 | @samp{Run} dialog. Customizing the value of | ||
| 469 | @code{w32-phantom-key-code} might help in some cases, though.} | ||
| 470 | |||
| 471 | @vindex w32-recognize-altgr | ||
| 472 | @kindex AltGr @r{(MS-Windows)} | ||
| 473 | @cindex AltGr key (MS-Windows) | ||
| 474 | The variable @code{w32-recognize-altgr} controls whether the | ||
| 475 | @key{AltGr} key (if it exists on your keyboard), or its equivalent, | ||
| 476 | the combination of the right @key{Alt} and left @key{Ctrl} keys | ||
| 477 | pressed together, is recognized as the @key{AltGr} key. The default | ||
| 478 | is @code{t}, which means these keys produce @code{AltGr}; setting it | ||
| 479 | to @code{nil} causes @key{AltGr} or the equivalent key combination to | ||
| 480 | be interpreted as the combination of @key{CTRL} and @key{META} | ||
| 481 | modifiers. | ||
| 482 | @end ifnottex | ||
| 483 | |||
| 484 | @node Windows Mouse | ||
| 485 | @section Mouse Usage on MS-Windows | ||
| 486 | @cindex mouse, and MS-Windows | ||
| 487 | |||
| 488 | This section describes the Windows-specific variables related to | ||
| 489 | mouse. | ||
| 490 | |||
| 491 | @vindex w32-mouse-button-tolerance | ||
| 492 | @cindex simulation of middle mouse button | ||
| 493 | The variable @code{w32-mouse-button-tolerance} specifies the | ||
| 494 | time interval, in milliseconds, for faking middle mouse button press | ||
| 495 | on 2-button mice. If both mouse buttons are depressed within this | ||
| 496 | time interval, Emacs generates a middle mouse button click event | ||
| 497 | instead of a double click on one of the buttons. | ||
| 498 | |||
| 499 | @vindex w32-pass-extra-mouse-buttons-to-system | ||
| 500 | If the variable @code{w32-pass-extra-mouse-buttons-to-system} is | ||
| 501 | non-@code{nil}, Emacs passes the fourth and fifth mouse buttons to | ||
| 502 | Windows. | ||
| 503 | |||
| 504 | @vindex w32-swap-mouse-buttons | ||
| 505 | The variable @code{w32-swap-mouse-buttons} controls which of the 3 | ||
| 506 | mouse buttons generates the @kbd{mouse-2} events. When it is | ||
| 507 | @code{nil} (the default), the middle button generates @kbd{mouse-2} | ||
| 508 | and the right button generates @kbd{mouse-3} events. If this variable | ||
| 509 | is non-@code{nil}, the roles of these two buttons are reversed. | ||
| 510 | |||
| 511 | @node Windows Processes | ||
| 512 | @section Subprocesses on Windows 9X/ME and Windows NT/2K/XP | ||
| 513 | @cindex subprocesses on MS-Windows | ||
| 514 | |||
| 515 | @cindex DOS applications, running from Emacs | ||
| 516 | Emacs compiled as a native Windows application (as opposed to the DOS | ||
| 517 | version) includes full support for asynchronous subprocesses. | ||
| 518 | In the Windows version, synchronous and asynchronous subprocesses work | ||
| 519 | fine on both | ||
| 520 | Windows 9X/ME and Windows NT/2K/XP as long as you run only 32-bit Windows | ||
| 521 | applications. However, when you run a DOS application in a subprocess, | ||
| 522 | you may encounter problems or be unable to run the application at all; | ||
| 523 | and if you run two DOS applications at the same time in two | ||
| 524 | subprocesses, you may have to reboot your system. | ||
| 525 | |||
| 526 | Since the standard command interpreter (and most command line utilities) | ||
| 527 | on Windows 9X are DOS applications, these problems are significant when | ||
| 528 | using that system. But there's nothing we can do about them; only | ||
| 529 | Microsoft can fix them. | ||
| 530 | |||
| 531 | If you run just one DOS application subprocess, the subprocess should | ||
| 532 | work as expected as long as it is ``well-behaved'' and does not perform | ||
| 533 | direct screen access or other unusual actions. If you have a CPU | ||
| 534 | monitor application, your machine will appear to be 100% busy even when | ||
| 535 | the DOS application is idle, but this is only an artifact of the way CPU | ||
| 536 | monitors measure processor load. | ||
| 537 | |||
| 538 | You must terminate the DOS application before you start any other DOS | ||
| 539 | application in a different subprocess. Emacs is unable to interrupt or | ||
| 540 | terminate a DOS subprocess. The only way you can terminate such a | ||
| 541 | subprocess is by giving it a command that tells its program to exit. | ||
| 542 | |||
| 543 | If you attempt to run two DOS applications at the same time in separate | ||
| 544 | subprocesses, the second one that is started will be suspended until the | ||
| 545 | first one finishes, even if either or both of them are asynchronous. | ||
| 546 | |||
| 547 | @cindex kill DOS application | ||
| 548 | If you can go to the first subprocess, and tell it to exit, the second | ||
| 549 | subprocess should continue normally. However, if the second subprocess | ||
| 550 | is synchronous, Emacs itself will be hung until the first subprocess | ||
| 551 | finishes. If it will not finish without user input, then you have no | ||
| 552 | choice but to reboot if you are running on Windows 9X. If you are | ||
| 553 | running on Windows NT/2K/XP, you can use a process viewer application to kill | ||
| 554 | the appropriate instance of NTVDM instead (this will terminate both DOS | ||
| 555 | subprocesses). | ||
| 556 | |||
| 557 | If you have to reboot Windows 9X in this situation, do not use the | ||
| 558 | @code{Shutdown} command on the @code{Start} menu; that usually hangs the | ||
| 559 | system. Instead, type @kbd{CTL-ALT-@key{DEL}} and then choose | ||
| 560 | @code{Shutdown}. That usually works, although it may take a few minutes | ||
| 561 | to do its job. | ||
| 562 | |||
| 563 | @vindex w32-quote-process-args | ||
| 564 | The variable @code{w32-quote-process-args} controls how Emacs quotes | ||
| 565 | the process arguments. Non-@code{nil} means quote with the @code{"} | ||
| 566 | character. If the value is a character, use that character to escape | ||
| 567 | any quote characters that appear; otherwise chose a suitable escape | ||
| 568 | character based on the type of the program. | ||
| 569 | |||
| 570 | @ifnottex | ||
| 571 | @findex w32-shell-execute | ||
| 572 | The function @code{w32-shell-execute} can be useful for writing | ||
| 573 | customized commands that run MS-Windows applications registered to | ||
| 574 | handle a certain standard Windows operation for a specific type of | ||
| 575 | document or file. This function is a wrapper around the Windows | ||
| 576 | @code{ShellExecute} API. See the MS-Windows API documentation for | ||
| 577 | more details. | ||
| 578 | @end ifnottex | ||
| 579 | |||
| 580 | @node Windows Printing | ||
| 581 | @section Printing and MS-Windows | ||
| 582 | |||
| 583 | Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and | ||
| 584 | @code{ps-print-buffer} (@pxref{PostScript}) work in MS-DOS and | ||
| 585 | MS-Windows by sending the output to one of the printer ports, if a | ||
| 586 | Posix-style @code{lpr} program is unavailable. The same Emacs | ||
| 587 | variables control printing on all systems, but in some cases they have | ||
| 588 | different default values on MS-DOS and MS-Windows. | ||
| 589 | |||
| 590 | Emacs on Windows automatically determines your default printer and | ||
| 591 | sets the variable @var{printer-name} to that printer's name. But in | ||
| 592 | some rare cases this can fail, or you may wish to use a different | ||
| 593 | printer from within Emacs. The rest of this section explains how to | ||
| 594 | tell Emacs which printer to use. | ||
| 595 | |||
| 596 | @vindex printer-name@r{, (MS-DOS/MW-Windows)} | ||
| 597 | If you want to use your local printer, then set the Lisp variable | ||
| 598 | @code{lpr-command} to @code{""} (its default value on Windows) and | ||
| 599 | @code{printer-name} to the name of the printer port---for example, | ||
| 600 | @code{"PRN"}, the usual local printer port or @code{"LPT2"}, or | ||
| 601 | @code{"COM1"} for a serial printer. You can also set | ||
| 602 | @code{printer-name} to a file name, in which case ``printed'' output | ||
| 603 | is actually appended to that file. If you set @code{printer-name} to | ||
| 604 | @code{"NUL"}, printed output is silently discarded (sent to the system | ||
| 605 | null device). | ||
| 606 | |||
| 607 | You can also use a printer shared by another machine by setting | ||
| 608 | @code{printer-name} to the UNC share name for that printer---for | ||
| 609 | example, @code{"//joes_pc/hp4si"}. (It doesn't matter whether you use | ||
| 610 | forward slashes or backslashes here.) To find out the names of shared | ||
| 611 | printers, run the command @samp{net view} from the command prompt to | ||
| 612 | obtain a list of servers, and @samp{net view @var{server-name}} to see | ||
| 613 | the names of printers (and directories) shared by that server. | ||
| 614 | Alternatively, click the @samp{Network Neighborhood} icon on your | ||
| 615 | desktop, and look for machines which share their printers via the | ||
| 616 | network. | ||
| 617 | |||
| 618 | @cindex @samp{net use}, and printing on MS-Windows | ||
| 619 | @cindex networked printers (MS-Windows) | ||
| 620 | If the printer doesn't appear in the output of @samp{net view}, or | ||
| 621 | if setting @code{printer-name} to the UNC share name doesn't produce a | ||
| 622 | hardcopy on that printer, you can use the @samp{net use} command to | ||
| 623 | connect a local print port such as @code{"LPT2"} to the networked | ||
| 624 | printer. For example, typing @kbd{net use LPT2: \\joes_pc\hp4si}@footnote{ | ||
| 625 | Note that the @samp{net use} command requires the UNC share name to be | ||
| 626 | typed with the Windows-style backslashes, while the value of | ||
| 627 | @code{printer-name} can be set with either forward- or backslashes.} | ||
| 628 | causes Windows to @dfn{capture} the @code{LPT2} port and redirect the | ||
| 629 | printed material to the printer connected to the machine @code{joes_pc}. | ||
| 630 | After this command, setting @code{printer-name} to @code{"LPT2"} | ||
| 631 | should produce the hardcopy on the networked printer. | ||
| 632 | |||
| 633 | With some varieties of Windows network software, you can instruct | ||
| 634 | Windows to capture a specific printer port such as @code{"LPT2"}, and | ||
| 635 | redirect it to a networked printer via the @w{@code{Control | ||
| 636 | Panel->Printers}} applet instead of @samp{net use}. | ||
| 637 | |||
| 638 | If you set @code{printer-name} to a file name, it's best to use an | ||
| 639 | absolute file name. Emacs changes the working directory according to | ||
| 640 | the default directory of the current buffer, so if the file name in | ||
| 641 | @code{printer-name} is relative, you will end up with several such | ||
| 642 | files, each one in the directory of the buffer from which the printing | ||
| 643 | was done. | ||
| 644 | |||
| 645 | If the value of @code{printer-name} is correct, but printing does | ||
| 646 | not produce the hardcopy on your printer, it is possible that your | ||
| 647 | printer does not support printing plain text (some cheap printers omit | ||
| 648 | this functionality). In that case, try the PostScript print commands, | ||
| 649 | described below. | ||
| 650 | |||
| 651 | @findex print-buffer @r{(MS-DOS)} | ||
| 652 | @findex print-region @r{(MS-DOS)} | ||
| 653 | @vindex lpr-headers-switches @r{(MS-DOS)} | ||
| 654 | The commands @code{print-buffer} and @code{print-region} call the | ||
| 655 | @code{pr} program, or use special switches to the @code{lpr} program, to | ||
| 656 | produce headers on each printed page. MS-DOS and MS-Windows don't | ||
| 657 | normally have these programs, so by default, the variable | ||
| 658 | @code{lpr-headers-switches} is set so that the requests to print page | ||
| 659 | headers are silently ignored. Thus, @code{print-buffer} and | ||
| 660 | @code{print-region} produce the same output as @code{lpr-buffer} and | ||
| 661 | @code{lpr-region}, respectively. If you do have a suitable @code{pr} | ||
| 662 | program (for example, from GNU Coreutils), set | ||
| 663 | @code{lpr-headers-switches} to @code{nil}; Emacs will then call | ||
| 664 | @code{pr} to produce the page headers, and print the resulting output as | ||
| 665 | specified by @code{printer-name}. | ||
| 666 | |||
| 667 | @vindex print-region-function @r{(MS-DOS)} | ||
| 668 | @cindex lpr usage under MS-DOS | ||
| 669 | @vindex lpr-command @r{(MS-DOS)} | ||
| 670 | @vindex lpr-switches @r{(MS-DOS)} | ||
| 671 | Finally, if you do have an @code{lpr} work-alike, you can set the | ||
| 672 | variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use | ||
| 673 | @code{lpr} for printing, as on other systems. (If the name of the | ||
| 674 | program isn't @code{lpr}, set @code{lpr-command} to specify where to | ||
| 675 | find it.) The variable @code{lpr-switches} has its standard meaning | ||
| 676 | when @code{lpr-command} is not @code{""}. If the variable | ||
| 677 | @code{printer-name} has a string value, it is used as the value for the | ||
| 678 | @code{-P} option to @code{lpr}, as on Unix. | ||
| 679 | |||
| 680 | @findex ps-print-buffer @r{(MS-DOS)} | ||
| 681 | @findex ps-spool-buffer @r{(MS-DOS)} | ||
| 682 | @vindex ps-printer-name @r{(MS-DOS)} | ||
| 683 | @vindex ps-lpr-command @r{(MS-DOS)} | ||
| 684 | @vindex ps-lpr-switches @r{(MS-DOS)} | ||
| 685 | A parallel set of variables, @code{ps-lpr-command}, | ||
| 686 | @code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript | ||
| 687 | Variables}), defines how PostScript files should be printed. These | ||
| 688 | variables are used in the same way as the corresponding variables | ||
| 689 | described above for non-PostScript printing. Thus, the value of | ||
| 690 | @code{ps-printer-name} is used as the name of the device (or file) to | ||
| 691 | which PostScript output is sent, just as @code{printer-name} is used | ||
| 692 | for non-PostScript printing. (There are two distinct sets of | ||
| 693 | variables in case you have two printers attached to two different | ||
| 694 | ports, and only one of them is a PostScript printer.) | ||
| 695 | |||
| 696 | The default value of the variable @code{ps-lpr-command} is @code{""}, | ||
| 697 | which causes PostScript output to be sent to the printer port specified | ||
| 698 | by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to | ||
| 699 | the name of a program which will accept PostScript files. Thus, if you | ||
| 700 | have a non-PostScript printer, you can set this variable to the name of | ||
| 701 | a PostScript interpreter program (such as Ghostscript). Any switches | ||
| 702 | that need to be passed to the interpreter program are specified using | ||
| 703 | @code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a | ||
| 704 | string, it will be added to the list of switches as the value for the | ||
| 705 | @code{-P} option. This is probably only useful if you are using | ||
| 706 | @code{lpr}, so when using an interpreter typically you would set | ||
| 707 | @code{ps-printer-name} to something other than a string so it is | ||
| 708 | ignored.) | ||
| 709 | |||
| 710 | For example, to use Ghostscript for printing on the system's default | ||
| 711 | printer, put this in your @file{.emacs} file: | ||
| 712 | |||
| 713 | @example | ||
| 714 | (setq ps-printer-name t) | ||
| 715 | (setq ps-lpr-command "D:/gs6.01/bin/gswin32c.exe") | ||
| 716 | (setq ps-lpr-switches '("-q" "-dNOPAUSE" "-dBATCH" | ||
| 717 | "-sDEVICE=mswinpr2" | ||
| 718 | "-sPAPERSIZE=a4")) | ||
| 719 | @end example | ||
| 720 | |||
| 721 | @noindent | ||
| 722 | (This assumes that Ghostscript is installed in the | ||
| 723 | @file{D:/gs6.01} directory.) | ||
| 724 | |||
| 725 | @node Windows Misc | ||
| 726 | @section Miscellaneous Windows-specific features | ||
| 727 | |||
| 728 | This section describes miscellaneous Windows-specific features. | ||
| 729 | |||
| 730 | @vindex w32-use-visible-system-caret | ||
| 731 | @cindex screen reader software, MS-Windows | ||
| 732 | The variable @code{w32-use-visible-system-caret} is a flag that | ||
| 733 | determines whether to make the system caret visible. The default is | ||
| 734 | @code{nil}, which means Emacs draws its own cursor to indicate the | ||
| 735 | position of point. A non-@code{nil} value means Emacs will indicate | ||
| 736 | point location by the system caret; this facilitates use of screen | ||
| 737 | reader software. When this variable is non-@code{nil}, other | ||
| 738 | variables affecting the cursor display have no effect. | ||
| 739 | |||
| 740 | @iftex | ||
| 741 | @inforef{Windows Misc, , emacs}, for information about additional | ||
| 742 | Windows-specific variables in this category. | ||
| 743 | @end iftex | ||
| 744 | |||
| 745 | @ifnottex | ||
| 746 | @vindex w32-grab-focus-on-raise | ||
| 747 | @cindex frame focus policy, MS-Windows | ||
| 748 | The variable @code{w32-grab-focus-on-raise}, if set to a | ||
| 749 | non-@code{nil} value causes a frame to grab focus when it is raised. | ||
| 750 | The default is @code{t}, which fits well with the Windows default | ||
| 751 | click-to-focus policy. | ||
| 752 | |||
| 753 | @vindex w32-list-proportional-fonts | ||
| 754 | The variable @code{w32-list-proportional-fonts} controls whether | ||
| 755 | proportional fonts are included in the font selection dialog. If its | ||
| 756 | value is non-@code{nil}, these fonts will be included. The default is | ||
| 757 | @code{nil}. | ||
| 758 | @end ifnottex | ||
| 759 | |||
| 760 | @ifnottex | ||
| 761 | @include msdog-xtra.texi | ||
| 762 | @end ifnottex | ||
| 763 | |||
| 764 | @ignore | ||
| 765 | arch-tag: f39d2590-5dcc-4318-88d9-0eb73ca10fa2 | ||
| 766 | @end ignore | ||
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi new file mode 100644 index 00000000000..c71c820dc27 --- /dev/null +++ b/doc/emacs/mule.texi | |||
| @@ -0,0 +1,1535 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, | ||
| 3 | @c 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node International, Major Modes, Frames, Top | ||
| 6 | @chapter International Character Set Support | ||
| 7 | @cindex MULE | ||
| 8 | @cindex international scripts | ||
| 9 | @cindex multibyte characters | ||
| 10 | @cindex encoding of characters | ||
| 11 | |||
| 12 | @cindex Celtic | ||
| 13 | @cindex Chinese | ||
| 14 | @cindex Cyrillic | ||
| 15 | @cindex Czech | ||
| 16 | @cindex Devanagari | ||
| 17 | @cindex Hindi | ||
| 18 | @cindex Marathi | ||
| 19 | @cindex Ethiopic | ||
| 20 | @cindex German | ||
| 21 | @cindex Greek | ||
| 22 | @cindex Hebrew | ||
| 23 | @cindex IPA | ||
| 24 | @cindex Japanese | ||
| 25 | @cindex Korean | ||
| 26 | @cindex Lao | ||
| 27 | @cindex Latin | ||
| 28 | @cindex Polish | ||
| 29 | @cindex Romanian | ||
| 30 | @cindex Slovak | ||
| 31 | @cindex Slovenian | ||
| 32 | @cindex Thai | ||
| 33 | @cindex Tibetan | ||
| 34 | @cindex Turkish | ||
| 35 | @cindex Vietnamese | ||
| 36 | @cindex Dutch | ||
| 37 | @cindex Spanish | ||
| 38 | Emacs supports a wide variety of international character sets, | ||
| 39 | including European and Vietnamese variants of the Latin alphabet, as | ||
| 40 | well as Cyrillic, Devanagari (for Hindi and Marathi), Ethiopic, Greek, | ||
| 41 | Han (for Chinese and Japanese), Hangul (for Korean), Hebrew, IPA, | ||
| 42 | Kannada, Lao, Malayalam, Tamil, Thai, Tibetan, and Vietnamese scripts. | ||
| 43 | Emacs also supports various encodings of these characters used by | ||
| 44 | other internationalized software, such as word processors and mailers. | ||
| 45 | |||
| 46 | Emacs allows editing text with international characters by supporting | ||
| 47 | all the related activities: | ||
| 48 | |||
| 49 | @itemize @bullet | ||
| 50 | @item | ||
| 51 | You can visit files with non-@acronym{ASCII} characters, save non-@acronym{ASCII} text, and | ||
| 52 | pass non-@acronym{ASCII} text between Emacs and programs it invokes (such as | ||
| 53 | compilers, spell-checkers, and mailers). Setting your language | ||
| 54 | environment (@pxref{Language Environments}) takes care of setting up the | ||
| 55 | coding systems and other options for a specific language or culture. | ||
| 56 | Alternatively, you can specify how Emacs should encode or decode text | ||
| 57 | for each command; see @ref{Text Coding}. | ||
| 58 | |||
| 59 | @item | ||
| 60 | You can display non-@acronym{ASCII} characters encoded by the various | ||
| 61 | scripts. This works by using appropriate fonts on graphics displays | ||
| 62 | (@pxref{Defining Fontsets}), and by sending special codes to text-only | ||
| 63 | displays (@pxref{Terminal Coding}). If some characters are displayed | ||
| 64 | incorrectly, refer to @ref{Undisplayable Characters}, which describes | ||
| 65 | possible problems and explains how to solve them. | ||
| 66 | |||
| 67 | @item | ||
| 68 | You can insert non-@acronym{ASCII} characters or search for them. To do that, | ||
| 69 | you can specify an input method (@pxref{Select Input Method}) suitable | ||
| 70 | for your language, or use the default input method set up when you set | ||
| 71 | your language environment. If | ||
| 72 | your keyboard can produce non-@acronym{ASCII} characters, you can select an | ||
| 73 | appropriate keyboard coding system (@pxref{Terminal Coding}), and Emacs | ||
| 74 | will accept those characters. Latin-1 characters can also be input by | ||
| 75 | using the @kbd{C-x 8} prefix, see @ref{Unibyte Mode}. | ||
| 76 | |||
| 77 | On X Window systems, your locale should be set to an appropriate value | ||
| 78 | to make sure Emacs interprets keyboard input correctly; see | ||
| 79 | @ref{Language Environments, locales}. | ||
| 80 | @end itemize | ||
| 81 | |||
| 82 | The rest of this chapter describes these issues in detail. | ||
| 83 | |||
| 84 | @menu | ||
| 85 | * International Chars:: Basic concepts of multibyte characters. | ||
| 86 | * Enabling Multibyte:: Controlling whether to use multibyte characters. | ||
| 87 | * Language Environments:: Setting things up for the language you use. | ||
| 88 | * Input Methods:: Entering text characters not on your keyboard. | ||
| 89 | * Select Input Method:: Specifying your choice of input methods. | ||
| 90 | * Multibyte Conversion:: How single-byte characters convert to multibyte. | ||
| 91 | * Coding Systems:: Character set conversion when you read and | ||
| 92 | write files, and so on. | ||
| 93 | * Recognize Coding:: How Emacs figures out which conversion to use. | ||
| 94 | * Specify Coding:: Specifying a file's coding system explicitly. | ||
| 95 | * Output Coding:: Choosing coding systems for output. | ||
| 96 | * Text Coding:: Choosing conversion to use for file text. | ||
| 97 | * Communication Coding:: Coding systems for interprocess communication. | ||
| 98 | * File Name Coding:: Coding systems for file @emph{names}. | ||
| 99 | * Terminal Coding:: Specifying coding systems for converting | ||
| 100 | terminal input and output. | ||
| 101 | * Fontsets:: Fontsets are collections of fonts | ||
| 102 | that cover the whole spectrum of characters. | ||
| 103 | * Defining Fontsets:: Defining a new fontset. | ||
| 104 | * Undisplayable Characters:: When characters don't display. | ||
| 105 | * Unibyte Mode:: You can pick one European character set | ||
| 106 | to use without multibyte characters. | ||
| 107 | * Charsets:: How Emacs groups its internal character codes. | ||
| 108 | @end menu | ||
| 109 | |||
| 110 | @node International Chars | ||
| 111 | @section Introduction to International Character Sets | ||
| 112 | |||
| 113 | The users of international character sets and scripts have | ||
| 114 | established many more-or-less standard coding systems for storing | ||
| 115 | files. Emacs internally uses a single multibyte character encoding, | ||
| 116 | so that it can intermix characters from all these scripts in a single | ||
| 117 | buffer or string. This encoding represents each non-@acronym{ASCII} | ||
| 118 | character as a sequence of bytes in the range 0200 through 0377. | ||
| 119 | Emacs translates between the multibyte character encoding and various | ||
| 120 | other coding systems when reading and writing files, when exchanging | ||
| 121 | data with subprocesses, and (in some cases) in the @kbd{C-q} command | ||
| 122 | (@pxref{Multibyte Conversion}). | ||
| 123 | |||
| 124 | @kindex C-h h | ||
| 125 | @findex view-hello-file | ||
| 126 | @cindex undisplayable characters | ||
| 127 | @cindex @samp{?} in display | ||
| 128 | The command @kbd{C-h h} (@code{view-hello-file}) displays the file | ||
| 129 | @file{etc/HELLO}, which shows how to say ``hello'' in many languages. | ||
| 130 | This illustrates various scripts. If some characters can't be | ||
| 131 | displayed on your terminal, they appear as @samp{?} or as hollow boxes | ||
| 132 | (@pxref{Undisplayable Characters}). | ||
| 133 | |||
| 134 | Keyboards, even in the countries where these character sets are used, | ||
| 135 | generally don't have keys for all the characters in them. So Emacs | ||
| 136 | supports various @dfn{input methods}, typically one for each script or | ||
| 137 | language, to make it convenient to type them. | ||
| 138 | |||
| 139 | @kindex C-x RET | ||
| 140 | The prefix key @kbd{C-x @key{RET}} is used for commands that pertain | ||
| 141 | to multibyte characters, coding systems, and input methods. | ||
| 142 | |||
| 143 | @node Enabling Multibyte | ||
| 144 | @section Enabling Multibyte Characters | ||
| 145 | |||
| 146 | By default, Emacs starts in multibyte mode, because that allows you to | ||
| 147 | use all the supported languages and scripts without limitations. | ||
| 148 | |||
| 149 | @cindex turn multibyte support on or off | ||
| 150 | You can enable or disable multibyte character support, either for | ||
| 151 | Emacs as a whole, or for a single buffer. When multibyte characters | ||
| 152 | are disabled in a buffer, we call that @dfn{unibyte mode}. Then each | ||
| 153 | byte in that buffer represents a character, even codes 0200 through | ||
| 154 | 0377. | ||
| 155 | |||
| 156 | The old features for supporting the European character sets, ISO | ||
| 157 | Latin-1 and ISO Latin-2, work in unibyte mode as they did in Emacs 19 | ||
| 158 | and also work for the other ISO 8859 character sets. However, there | ||
| 159 | is no need to turn off multibyte character support to use ISO Latin; | ||
| 160 | the Emacs multibyte character set includes all the characters in these | ||
| 161 | character sets, and Emacs can translate automatically to and from the | ||
| 162 | ISO codes. | ||
| 163 | |||
| 164 | To edit a particular file in unibyte representation, visit it using | ||
| 165 | @code{find-file-literally}. @xref{Visiting}. To convert a buffer in | ||
| 166 | multibyte representation into a single-byte representation of the same | ||
| 167 | characters, the easiest way is to save the contents in a file, kill the | ||
| 168 | buffer, and find the file again with @code{find-file-literally}. You | ||
| 169 | can also use @kbd{C-x @key{RET} c} | ||
| 170 | (@code{universal-coding-system-argument}) and specify @samp{raw-text} as | ||
| 171 | the coding system with which to find or save a file. @xref{Text | ||
| 172 | Coding}. Finding a file as @samp{raw-text} doesn't disable format | ||
| 173 | conversion, uncompression and auto mode selection as | ||
| 174 | @code{find-file-literally} does. | ||
| 175 | |||
| 176 | @vindex enable-multibyte-characters | ||
| 177 | @vindex default-enable-multibyte-characters | ||
| 178 | To turn off multibyte character support by default, start Emacs with | ||
| 179 | the @samp{--unibyte} option (@pxref{Initial Options}), or set the | ||
| 180 | environment variable @env{EMACS_UNIBYTE}. You can also customize | ||
| 181 | @code{enable-multibyte-characters} or, equivalently, directly set the | ||
| 182 | variable @code{default-enable-multibyte-characters} to @code{nil} in | ||
| 183 | your init file to have basically the same effect as @samp{--unibyte}. | ||
| 184 | |||
| 185 | @findex toggle-enable-multibyte-characters | ||
| 186 | To convert a unibyte session to a multibyte session, set | ||
| 187 | @code{default-enable-multibyte-characters} to @code{t}. Buffers which | ||
| 188 | were created in the unibyte session before you turn on multibyte support | ||
| 189 | will stay unibyte. You can turn on multibyte support in a specific | ||
| 190 | buffer by invoking the command @code{toggle-enable-multibyte-characters} | ||
| 191 | in that buffer. | ||
| 192 | |||
| 193 | @cindex Lisp files, and multibyte operation | ||
| 194 | @cindex multibyte operation, and Lisp files | ||
| 195 | @cindex unibyte operation, and Lisp files | ||
| 196 | @cindex init file, and non-@acronym{ASCII} characters | ||
| 197 | @cindex environment variables, and non-@acronym{ASCII} characters | ||
| 198 | With @samp{--unibyte}, multibyte strings are not created during | ||
| 199 | initialization from the values of environment variables, | ||
| 200 | @file{/etc/passwd} entries etc.@: that contain non-@acronym{ASCII} 8-bit | ||
| 201 | characters. | ||
| 202 | |||
| 203 | Emacs normally loads Lisp files as multibyte, regardless of whether | ||
| 204 | you used @samp{--unibyte}. This includes the Emacs initialization file, | ||
| 205 | @file{.emacs}, and the initialization files of Emacs packages such as | ||
| 206 | Gnus. However, you can specify unibyte loading for a particular Lisp | ||
| 207 | file, by putting @w{@samp{-*-unibyte: t;-*-}} in a comment on the first | ||
| 208 | line (@pxref{File Variables}). Then that file is always loaded as | ||
| 209 | unibyte text, even if you did not start Emacs with @samp{--unibyte}. | ||
| 210 | The motivation for these conventions is that it is more reliable to | ||
| 211 | always load any particular Lisp file in the same way. However, you can | ||
| 212 | load a Lisp file as unibyte, on any one occasion, by typing @kbd{C-x | ||
| 213 | @key{RET} c raw-text @key{RET}} immediately before loading it. | ||
| 214 | |||
| 215 | The mode line indicates whether multibyte character support is | ||
| 216 | enabled in the current buffer. If it is, there are two or more | ||
| 217 | characters (most often two dashes) near the beginning of the mode | ||
| 218 | line, before the indication of the visited file's end-of-line | ||
| 219 | convention (colon, backslash, etc.). When multibyte characters | ||
| 220 | are not enabled, nothing precedes the colon except a single dash. | ||
| 221 | @xref{Mode Line}, for more details about this. | ||
| 222 | |||
| 223 | @node Language Environments | ||
| 224 | @section Language Environments | ||
| 225 | @cindex language environments | ||
| 226 | |||
| 227 | All supported character sets are supported in Emacs buffers whenever | ||
| 228 | multibyte characters are enabled; there is no need to select a | ||
| 229 | particular language in order to display its characters in an Emacs | ||
| 230 | buffer. However, it is important to select a @dfn{language environment} | ||
| 231 | in order to set various defaults. The language environment really | ||
| 232 | represents a choice of preferred script (more or less) rather than a | ||
| 233 | choice of language. | ||
| 234 | |||
| 235 | The language environment controls which coding systems to recognize | ||
| 236 | when reading text (@pxref{Recognize Coding}). This applies to files, | ||
| 237 | incoming mail, netnews, and any other text you read into Emacs. It may | ||
| 238 | also specify the default coding system to use when you create a file. | ||
| 239 | Each language environment also specifies a default input method. | ||
| 240 | |||
| 241 | @findex set-language-environment | ||
| 242 | @vindex current-language-environment | ||
| 243 | To select a language environment, you can customize the variable | ||
| 244 | @code{current-language-environment} or use the command @kbd{M-x | ||
| 245 | set-language-environment}. It makes no difference which buffer is | ||
| 246 | current when you use this command, because the effects apply globally to | ||
| 247 | the Emacs session. The supported language environments include: | ||
| 248 | |||
| 249 | @cindex Euro sign | ||
| 250 | @cindex UTF-8 | ||
| 251 | @quotation | ||
| 252 | ASCII, Belarusian, Brazilian Portuguese, Bulgarian, Chinese-BIG5, | ||
| 253 | Chinese-CNS, Chinese-EUC-TW, Chinese-GB, Croatian, Cyrillic-ALT, | ||
| 254 | Cyrillic-ISO, Cyrillic-KOI8, Czech, Devanagari, Dutch, English, | ||
| 255 | Esperanto, Ethiopic, French, Georgian, German, Greek, Hebrew, IPA, | ||
| 256 | Italian, Japanese, Kannada, Korean, Lao, Latin-1, Latin-2, Latin-3, | ||
| 257 | Latin-4, Latin-5, Latin-6, Latin-7, Latin-8 (Celtic), Latin-9 (updated | ||
| 258 | Latin-1 with the Euro sign), Latvian, Lithuanian, Malayalam, Polish, | ||
| 259 | Romanian, Russian, Slovak, Slovenian, Spanish, Swedish, Tajik, Tamil, | ||
| 260 | Thai, Tibetan, Turkish, UTF-8 (for a setup which prefers Unicode | ||
| 261 | characters and files encoded in UTF-8), Ukrainian, Vietnamese, Welsh, | ||
| 262 | and Windows-1255 (for a setup which prefers Cyrillic characters and | ||
| 263 | files encoded in Windows-1255). | ||
| 264 | @tex | ||
| 265 | \hbadness=10000\par % just avoid underfull hbox warning | ||
| 266 | @end tex | ||
| 267 | @end quotation | ||
| 268 | |||
| 269 | @cindex fonts for various scripts | ||
| 270 | @cindex Intlfonts package, installation | ||
| 271 | To display the script(s) used by your language environment on a | ||
| 272 | graphical display, you need to have a suitable font. If some of the | ||
| 273 | characters appear as empty boxes, you should install the GNU Intlfonts | ||
| 274 | package, which includes fonts for most supported scripts.@footnote{If | ||
| 275 | you run Emacs on X, you need to inform the X server about the location | ||
| 276 | of the newly installed fonts with the following commands: | ||
| 277 | |||
| 278 | @example | ||
| 279 | xset fp+ /usr/local/share/emacs/fonts | ||
| 280 | xset fp rehash | ||
| 281 | @end example | ||
| 282 | } | ||
| 283 | @xref{Fontsets}, for more details about setting up your fonts. | ||
| 284 | |||
| 285 | @findex set-locale-environment | ||
| 286 | @vindex locale-language-names | ||
| 287 | @vindex locale-charset-language-names | ||
| 288 | @cindex locales | ||
| 289 | Some operating systems let you specify the character-set locale you | ||
| 290 | are using by setting the locale environment variables @env{LC_ALL}, | ||
| 291 | @env{LC_CTYPE}, or @env{LANG}.@footnote{If more than one of these is | ||
| 292 | set, the first one that is nonempty specifies your locale for this | ||
| 293 | purpose.} During startup, Emacs looks up your character-set locale's | ||
| 294 | name in the system locale alias table, matches its canonical name | ||
| 295 | against entries in the value of the variables | ||
| 296 | @code{locale-charset-language-names} and @code{locale-language-names}, | ||
| 297 | and selects the corresponding language environment if a match is found. | ||
| 298 | (The former variable overrides the latter.) It also adjusts the display | ||
| 299 | table and terminal coding system, the locale coding system, the | ||
| 300 | preferred coding system as needed for the locale, and---last but not | ||
| 301 | least---the way Emacs decodes non-@acronym{ASCII} characters sent by your keyboard. | ||
| 302 | |||
| 303 | If you modify the @env{LC_ALL}, @env{LC_CTYPE}, or @env{LANG} | ||
| 304 | environment variables while running Emacs, you may want to invoke the | ||
| 305 | @code{set-locale-environment} function afterwards to readjust the | ||
| 306 | language environment from the new locale. | ||
| 307 | |||
| 308 | @vindex locale-preferred-coding-systems | ||
| 309 | The @code{set-locale-environment} function normally uses the preferred | ||
| 310 | coding system established by the language environment to decode system | ||
| 311 | messages. But if your locale matches an entry in the variable | ||
| 312 | @code{locale-preferred-coding-systems}, Emacs uses the corresponding | ||
| 313 | coding system instead. For example, if the locale @samp{ja_JP.PCK} | ||
| 314 | matches @code{japanese-shift-jis} in | ||
| 315 | @code{locale-preferred-coding-systems}, Emacs uses that encoding even | ||
| 316 | though it might normally use @code{japanese-iso-8bit}. | ||
| 317 | |||
| 318 | You can override the language environment chosen at startup with | ||
| 319 | explicit use of the command @code{set-language-environment}, or with | ||
| 320 | customization of @code{current-language-environment} in your init | ||
| 321 | file. | ||
| 322 | |||
| 323 | @kindex C-h L | ||
| 324 | @findex describe-language-environment | ||
| 325 | To display information about the effects of a certain language | ||
| 326 | environment @var{lang-env}, use the command @kbd{C-h L @var{lang-env} | ||
| 327 | @key{RET}} (@code{describe-language-environment}). This tells you | ||
| 328 | which languages this language environment is useful for, and lists the | ||
| 329 | character sets, coding systems, and input methods that go with it. It | ||
| 330 | also shows some sample text to illustrate scripts used in this | ||
| 331 | language environment. If you give an empty input for @var{lang-env}, | ||
| 332 | this command describes the chosen language environment. | ||
| 333 | |||
| 334 | @vindex set-language-environment-hook | ||
| 335 | You can customize any language environment with the normal hook | ||
| 336 | @code{set-language-environment-hook}. The command | ||
| 337 | @code{set-language-environment} runs that hook after setting up the new | ||
| 338 | language environment. The hook functions can test for a specific | ||
| 339 | language environment by checking the variable | ||
| 340 | @code{current-language-environment}. This hook is where you should | ||
| 341 | put non-default settings for specific language environment, such as | ||
| 342 | coding systems for keyboard input and terminal output, the default | ||
| 343 | input method, etc. | ||
| 344 | |||
| 345 | @vindex exit-language-environment-hook | ||
| 346 | Before it starts to set up the new language environment, | ||
| 347 | @code{set-language-environment} first runs the hook | ||
| 348 | @code{exit-language-environment-hook}. This hook is useful for undoing | ||
| 349 | customizations that were made with @code{set-language-environment-hook}. | ||
| 350 | For instance, if you set up a special key binding in a specific language | ||
| 351 | environment using @code{set-language-environment-hook}, you should set | ||
| 352 | up @code{exit-language-environment-hook} to restore the normal binding | ||
| 353 | for that key. | ||
| 354 | |||
| 355 | @node Input Methods | ||
| 356 | @section Input Methods | ||
| 357 | |||
| 358 | @cindex input methods | ||
| 359 | An @dfn{input method} is a kind of character conversion designed | ||
| 360 | specifically for interactive input. In Emacs, typically each language | ||
| 361 | has its own input method; sometimes several languages which use the same | ||
| 362 | characters can share one input method. A few languages support several | ||
| 363 | input methods. | ||
| 364 | |||
| 365 | The simplest kind of input method works by mapping @acronym{ASCII} letters | ||
| 366 | into another alphabet; this allows you to use one other alphabet | ||
| 367 | instead of @acronym{ASCII}. The Greek and Russian input methods | ||
| 368 | work this way. | ||
| 369 | |||
| 370 | A more powerful technique is composition: converting sequences of | ||
| 371 | characters into one letter. Many European input methods use composition | ||
| 372 | to produce a single non-@acronym{ASCII} letter from a sequence that consists of a | ||
| 373 | letter followed by accent characters (or vice versa). For example, some | ||
| 374 | methods convert the sequence @kbd{a'} into a single accented letter. | ||
| 375 | These input methods have no special commands of their own; all they do | ||
| 376 | is compose sequences of printing characters. | ||
| 377 | |||
| 378 | The input methods for syllabic scripts typically use mapping followed | ||
| 379 | by composition. The input methods for Thai and Korean work this way. | ||
| 380 | First, letters are mapped into symbols for particular sounds or tone | ||
| 381 | marks; then, sequences of these which make up a whole syllable are | ||
| 382 | mapped into one syllable sign. | ||
| 383 | |||
| 384 | Chinese and Japanese require more complex methods. In Chinese input | ||
| 385 | methods, first you enter the phonetic spelling of a Chinese word (in | ||
| 386 | input method @code{chinese-py}, among others), or a sequence of | ||
| 387 | portions of the character (input methods @code{chinese-4corner} and | ||
| 388 | @code{chinese-sw}, and others). One input sequence typically | ||
| 389 | corresponds to many possible Chinese characters. You select the one | ||
| 390 | you mean using keys such as @kbd{C-f}, @kbd{C-b}, @kbd{C-n}, | ||
| 391 | @kbd{C-p}, and digits, which have special meanings in this situation. | ||
| 392 | |||
| 393 | The possible characters are conceptually arranged in several rows, | ||
| 394 | with each row holding up to 10 alternatives. Normally, Emacs displays | ||
| 395 | just one row at a time, in the echo area; @code{(@var{i}/@var{j})} | ||
| 396 | appears at the beginning, to indicate that this is the @var{i}th row | ||
| 397 | out of a total of @var{j} rows. Type @kbd{C-n} or @kbd{C-p} to | ||
| 398 | display the next row or the previous row. | ||
| 399 | |||
| 400 | Type @kbd{C-f} and @kbd{C-b} to move forward and backward among | ||
| 401 | the alternatives in the current row. As you do this, Emacs highlights | ||
| 402 | the current alternative with a special color; type @code{C-@key{SPC}} | ||
| 403 | to select the current alternative and use it as input. The | ||
| 404 | alternatives in the row are also numbered; the number appears before | ||
| 405 | the alternative. Typing a digit @var{n} selects the @var{n}th | ||
| 406 | alternative of the current row and uses it as input. | ||
| 407 | |||
| 408 | @key{TAB} in these Chinese input methods displays a buffer showing | ||
| 409 | all the possible characters at once; then clicking @kbd{Mouse-2} on | ||
| 410 | one of them selects that alternative. The keys @kbd{C-f}, @kbd{C-b}, | ||
| 411 | @kbd{C-n}, @kbd{C-p}, and digits continue to work as usual, but they | ||
| 412 | do the highlighting in the buffer showing the possible characters, | ||
| 413 | rather than in the echo area. | ||
| 414 | |||
| 415 | In Japanese input methods, first you input a whole word using | ||
| 416 | phonetic spelling; then, after the word is in the buffer, Emacs | ||
| 417 | converts it into one or more characters using a large dictionary. One | ||
| 418 | phonetic spelling corresponds to a number of different Japanese words; | ||
| 419 | to select one of them, use @kbd{C-n} and @kbd{C-p} to cycle through | ||
| 420 | the alternatives. | ||
| 421 | |||
| 422 | Sometimes it is useful to cut off input method processing so that the | ||
| 423 | characters you have just entered will not combine with subsequent | ||
| 424 | characters. For example, in input method @code{latin-1-postfix}, the | ||
| 425 | sequence @kbd{e '} combines to form an @samp{e} with an accent. What if | ||
| 426 | you want to enter them as separate characters? | ||
| 427 | |||
| 428 | One way is to type the accent twice; this is a special feature for | ||
| 429 | entering the separate letter and accent. For example, @kbd{e ' '} gives | ||
| 430 | you the two characters @samp{e'}. Another way is to type another letter | ||
| 431 | after the @kbd{e}---something that won't combine with that---and | ||
| 432 | immediately delete it. For example, you could type @kbd{e e @key{DEL} | ||
| 433 | '} to get separate @samp{e} and @samp{'}. | ||
| 434 | |||
| 435 | Another method, more general but not quite as easy to type, is to use | ||
| 436 | @kbd{C-\ C-\} between two characters to stop them from combining. This | ||
| 437 | is the command @kbd{C-\} (@code{toggle-input-method}) used twice. | ||
| 438 | @ifnottex | ||
| 439 | @xref{Select Input Method}. | ||
| 440 | @end ifnottex | ||
| 441 | |||
| 442 | @cindex incremental search, input method interference | ||
| 443 | @kbd{C-\ C-\} is especially useful inside an incremental search, | ||
| 444 | because it stops waiting for more characters to combine, and starts | ||
| 445 | searching for what you have already entered. | ||
| 446 | |||
| 447 | To find out how to input the character after point using the current | ||
| 448 | input method, type @kbd{C-u C-x =}. @xref{Position Info}. | ||
| 449 | |||
| 450 | @vindex input-method-verbose-flag | ||
| 451 | @vindex input-method-highlight-flag | ||
| 452 | The variables @code{input-method-highlight-flag} and | ||
| 453 | @code{input-method-verbose-flag} control how input methods explain | ||
| 454 | what is happening. If @code{input-method-highlight-flag} is | ||
| 455 | non-@code{nil}, the partial sequence is highlighted in the buffer (for | ||
| 456 | most input methods---some disable this feature). If | ||
| 457 | @code{input-method-verbose-flag} is non-@code{nil}, the list of | ||
| 458 | possible characters to type next is displayed in the echo area (but | ||
| 459 | not when you are in the minibuffer). | ||
| 460 | |||
| 461 | @node Select Input Method | ||
| 462 | @section Selecting an Input Method | ||
| 463 | |||
| 464 | @table @kbd | ||
| 465 | @item C-\ | ||
| 466 | Enable or disable use of the selected input method. | ||
| 467 | |||
| 468 | @item C-x @key{RET} C-\ @var{method} @key{RET} | ||
| 469 | Select a new input method for the current buffer. | ||
| 470 | |||
| 471 | @item C-h I @var{method} @key{RET} | ||
| 472 | @itemx C-h C-\ @var{method} @key{RET} | ||
| 473 | @findex describe-input-method | ||
| 474 | @kindex C-h I | ||
| 475 | @kindex C-h C-\ | ||
| 476 | Describe the input method @var{method} (@code{describe-input-method}). | ||
| 477 | By default, it describes the current input method (if any). This | ||
| 478 | description should give you the full details of how to use any | ||
| 479 | particular input method. | ||
| 480 | |||
| 481 | @item M-x list-input-methods | ||
| 482 | Display a list of all the supported input methods. | ||
| 483 | @end table | ||
| 484 | |||
| 485 | @findex set-input-method | ||
| 486 | @vindex current-input-method | ||
| 487 | @kindex C-x RET C-\ | ||
| 488 | To choose an input method for the current buffer, use @kbd{C-x | ||
| 489 | @key{RET} C-\} (@code{set-input-method}). This command reads the | ||
| 490 | input method name from the minibuffer; the name normally starts with the | ||
| 491 | language environment that it is meant to be used with. The variable | ||
| 492 | @code{current-input-method} records which input method is selected. | ||
| 493 | |||
| 494 | @findex toggle-input-method | ||
| 495 | @kindex C-\ | ||
| 496 | Input methods use various sequences of @acronym{ASCII} characters to | ||
| 497 | stand for non-@acronym{ASCII} characters. Sometimes it is useful to | ||
| 498 | turn off the input method temporarily. To do this, type @kbd{C-\} | ||
| 499 | (@code{toggle-input-method}). To reenable the input method, type | ||
| 500 | @kbd{C-\} again. | ||
| 501 | |||
| 502 | If you type @kbd{C-\} and you have not yet selected an input method, | ||
| 503 | it prompts for you to specify one. This has the same effect as using | ||
| 504 | @kbd{C-x @key{RET} C-\} to specify an input method. | ||
| 505 | |||
| 506 | When invoked with a numeric argument, as in @kbd{C-u C-\}, | ||
| 507 | @code{toggle-input-method} always prompts you for an input method, | ||
| 508 | suggesting the most recently selected one as the default. | ||
| 509 | |||
| 510 | @vindex default-input-method | ||
| 511 | Selecting a language environment specifies a default input method for | ||
| 512 | use in various buffers. When you have a default input method, you can | ||
| 513 | select it in the current buffer by typing @kbd{C-\}. The variable | ||
| 514 | @code{default-input-method} specifies the default input method | ||
| 515 | (@code{nil} means there is none). | ||
| 516 | |||
| 517 | In some language environments, which support several different input | ||
| 518 | methods, you might want to use an input method different from the | ||
| 519 | default chosen by @code{set-language-environment}. You can instruct | ||
| 520 | Emacs to select a different default input method for a certain | ||
| 521 | language environment, if you wish, by using | ||
| 522 | @code{set-language-environment-hook} (@pxref{Language Environments, | ||
| 523 | set-language-environment-hook}). For example: | ||
| 524 | |||
| 525 | @lisp | ||
| 526 | (defun my-chinese-setup () | ||
| 527 | "Set up my private Chinese environment." | ||
| 528 | (if (equal current-language-environment "Chinese-GB") | ||
| 529 | (setq default-input-method "chinese-tonepy"))) | ||
| 530 | (add-hook 'set-language-environment-hook 'my-chinese-setup) | ||
| 531 | @end lisp | ||
| 532 | |||
| 533 | @noindent | ||
| 534 | This sets the default input method to be @code{chinese-tonepy} | ||
| 535 | whenever you choose a Chinese-GB language environment. | ||
| 536 | |||
| 537 | @findex quail-set-keyboard-layout | ||
| 538 | Some input methods for alphabetic scripts work by (in effect) | ||
| 539 | remapping the keyboard to emulate various keyboard layouts commonly used | ||
| 540 | for those scripts. How to do this remapping properly depends on your | ||
| 541 | actual keyboard layout. To specify which layout your keyboard has, use | ||
| 542 | the command @kbd{M-x quail-set-keyboard-layout}. | ||
| 543 | |||
| 544 | @findex quail-show-key | ||
| 545 | You can use the command @kbd{M-x quail-show-key} to show what key (or | ||
| 546 | key sequence) to type in order to input the character following point, | ||
| 547 | using the selected keyboard layout. The command @kbd{C-u C-x =} also | ||
| 548 | shows that information in addition to the other information about the | ||
| 549 | character. | ||
| 550 | |||
| 551 | @findex list-input-methods | ||
| 552 | To see a list of all the supported input methods, type @kbd{M-x | ||
| 553 | list-input-methods}. The list gives information about each input | ||
| 554 | method, including the string that stands for it in the mode line. | ||
| 555 | |||
| 556 | @node Multibyte Conversion | ||
| 557 | @section Unibyte and Multibyte Non-@acronym{ASCII} characters | ||
| 558 | |||
| 559 | When multibyte characters are enabled, character codes 0240 (octal) | ||
| 560 | through 0377 (octal) are not really legitimate in the buffer. The valid | ||
| 561 | non-@acronym{ASCII} printing characters have codes that start from 0400. | ||
| 562 | |||
| 563 | If you type a self-inserting character in the range 0240 through | ||
| 564 | 0377, or if you use @kbd{C-q} to insert one, Emacs assumes you | ||
| 565 | intended to use one of the ISO Latin-@var{n} character sets, and | ||
| 566 | converts it to the Emacs code representing that Latin-@var{n} | ||
| 567 | character. You select @emph{which} ISO Latin character set to use | ||
| 568 | through your choice of language environment | ||
| 569 | @iftex | ||
| 570 | (see above). | ||
| 571 | @end iftex | ||
| 572 | @ifnottex | ||
| 573 | (@pxref{Language Environments}). | ||
| 574 | @end ifnottex | ||
| 575 | If you do not specify a choice, the default is Latin-1. | ||
| 576 | |||
| 577 | If you insert a character in the range 0200 through 0237, which | ||
| 578 | forms the @code{eight-bit-control} character set, it is inserted | ||
| 579 | literally. You should normally avoid doing this since buffers | ||
| 580 | containing such characters have to be written out in either the | ||
| 581 | @code{emacs-mule} or @code{raw-text} coding system, which is usually | ||
| 582 | not what you want. | ||
| 583 | |||
| 584 | @node Coding Systems | ||
| 585 | @section Coding Systems | ||
| 586 | @cindex coding systems | ||
| 587 | |||
| 588 | Users of various languages have established many more-or-less standard | ||
| 589 | coding systems for representing them. Emacs does not use these coding | ||
| 590 | systems internally; instead, it converts from various coding systems to | ||
| 591 | its own system when reading data, and converts the internal coding | ||
| 592 | system to other coding systems when writing data. Conversion is | ||
| 593 | possible in reading or writing files, in sending or receiving from the | ||
| 594 | terminal, and in exchanging data with subprocesses. | ||
| 595 | |||
| 596 | Emacs assigns a name to each coding system. Most coding systems are | ||
| 597 | used for one language, and the name of the coding system starts with the | ||
| 598 | language name. Some coding systems are used for several languages; | ||
| 599 | their names usually start with @samp{iso}. There are also special | ||
| 600 | coding systems @code{no-conversion}, @code{raw-text} and | ||
| 601 | @code{emacs-mule} which do not convert printing characters at all. | ||
| 602 | |||
| 603 | @cindex international files from DOS/Windows systems | ||
| 604 | A special class of coding systems, collectively known as | ||
| 605 | @dfn{codepages}, is designed to support text encoded by MS-Windows and | ||
| 606 | MS-DOS software. The names of these coding systems are | ||
| 607 | @code{cp@var{nnnn}}, where @var{nnnn} is a 3- or 4-digit number of the | ||
| 608 | codepage. You can use these encodings just like any other coding | ||
| 609 | system; for example, to visit a file encoded in codepage 850, type | ||
| 610 | @kbd{C-x @key{RET} c cp850 @key{RET} C-x C-f @var{filename} | ||
| 611 | @key{RET}}@footnote{ | ||
| 612 | In the MS-DOS port of Emacs, you need to create a @code{cp@var{nnn}} | ||
| 613 | coding system with @kbd{M-x codepage-setup}, before you can use it. | ||
| 614 | @iftex | ||
| 615 | @xref{MS-DOS and MULE,,,emacs-extra,Specialized Emacs Features}. | ||
| 616 | @end iftex | ||
| 617 | @ifnottex | ||
| 618 | @xref{MS-DOS and MULE}. | ||
| 619 | @end ifnottex | ||
| 620 | }. | ||
| 621 | |||
| 622 | In addition to converting various representations of non-@acronym{ASCII} | ||
| 623 | characters, a coding system can perform end-of-line conversion. Emacs | ||
| 624 | handles three different conventions for how to separate lines in a file: | ||
| 625 | newline, carriage-return linefeed, and just carriage-return. | ||
| 626 | |||
| 627 | @table @kbd | ||
| 628 | @item C-h C @var{coding} @key{RET} | ||
| 629 | Describe coding system @var{coding}. | ||
| 630 | |||
| 631 | @item C-h C @key{RET} | ||
| 632 | Describe the coding systems currently in use. | ||
| 633 | |||
| 634 | @item M-x list-coding-systems | ||
| 635 | Display a list of all the supported coding systems. | ||
| 636 | @end table | ||
| 637 | |||
| 638 | @kindex C-h C | ||
| 639 | @findex describe-coding-system | ||
| 640 | The command @kbd{C-h C} (@code{describe-coding-system}) displays | ||
| 641 | information about particular coding systems, including the end-of-line | ||
| 642 | conversion specified by those coding systems. You can specify a coding | ||
| 643 | system name as the argument; alternatively, with an empty argument, it | ||
| 644 | describes the coding systems currently selected for various purposes, | ||
| 645 | both in the current buffer and as the defaults, and the priority list | ||
| 646 | for recognizing coding systems (@pxref{Recognize Coding}). | ||
| 647 | |||
| 648 | @findex list-coding-systems | ||
| 649 | To display a list of all the supported coding systems, type @kbd{M-x | ||
| 650 | list-coding-systems}. The list gives information about each coding | ||
| 651 | system, including the letter that stands for it in the mode line | ||
| 652 | (@pxref{Mode Line}). | ||
| 653 | |||
| 654 | @cindex end-of-line conversion | ||
| 655 | @cindex line endings | ||
| 656 | @cindex MS-DOS end-of-line conversion | ||
| 657 | @cindex Macintosh end-of-line conversion | ||
| 658 | Each of the coding systems that appear in this list---except for | ||
| 659 | @code{no-conversion}, which means no conversion of any kind---specifies | ||
| 660 | how and whether to convert printing characters, but leaves the choice of | ||
| 661 | end-of-line conversion to be decided based on the contents of each file. | ||
| 662 | For example, if the file appears to use the sequence carriage-return | ||
| 663 | linefeed to separate lines, DOS end-of-line conversion will be used. | ||
| 664 | |||
| 665 | Each of the listed coding systems has three variants which specify | ||
| 666 | exactly what to do for end-of-line conversion: | ||
| 667 | |||
| 668 | @table @code | ||
| 669 | @item @dots{}-unix | ||
| 670 | Don't do any end-of-line conversion; assume the file uses | ||
| 671 | newline to separate lines. (This is the convention normally used | ||
| 672 | on Unix and GNU systems.) | ||
| 673 | |||
| 674 | @item @dots{}-dos | ||
| 675 | Assume the file uses carriage-return linefeed to separate lines, and do | ||
| 676 | the appropriate conversion. (This is the convention normally used on | ||
| 677 | Microsoft systems.@footnote{It is also specified for MIME @samp{text/*} | ||
| 678 | bodies and in other network transport contexts. It is different | ||
| 679 | from the SGML reference syntax record-start/record-end format which | ||
| 680 | Emacs doesn't support directly.}) | ||
| 681 | |||
| 682 | @item @dots{}-mac | ||
| 683 | Assume the file uses carriage-return to separate lines, and do the | ||
| 684 | appropriate conversion. (This is the convention normally used on the | ||
| 685 | Macintosh system.) | ||
| 686 | @end table | ||
| 687 | |||
| 688 | These variant coding systems are omitted from the | ||
| 689 | @code{list-coding-systems} display for brevity, since they are entirely | ||
| 690 | predictable. For example, the coding system @code{iso-latin-1} has | ||
| 691 | variants @code{iso-latin-1-unix}, @code{iso-latin-1-dos} and | ||
| 692 | @code{iso-latin-1-mac}. | ||
| 693 | |||
| 694 | @cindex @code{undecided}, coding system | ||
| 695 | The coding systems @code{unix}, @code{dos}, and @code{mac} are | ||
| 696 | aliases for @code{undecided-unix}, @code{undecided-dos}, and | ||
| 697 | @code{undecided-mac}, respectively. These coding systems specify only | ||
| 698 | the end-of-line conversion, and leave the character code conversion to | ||
| 699 | be deduced from the text itself. | ||
| 700 | |||
| 701 | The coding system @code{raw-text} is good for a file which is mainly | ||
| 702 | @acronym{ASCII} text, but may contain byte values above 127 which are | ||
| 703 | not meant to encode non-@acronym{ASCII} characters. With | ||
| 704 | @code{raw-text}, Emacs copies those byte values unchanged, and sets | ||
| 705 | @code{enable-multibyte-characters} to @code{nil} in the current buffer | ||
| 706 | so that they will be interpreted properly. @code{raw-text} handles | ||
| 707 | end-of-line conversion in the usual way, based on the data | ||
| 708 | encountered, and has the usual three variants to specify the kind of | ||
| 709 | end-of-line conversion to use. | ||
| 710 | |||
| 711 | In contrast, the coding system @code{no-conversion} specifies no | ||
| 712 | character code conversion at all---none for non-@acronym{ASCII} byte values and | ||
| 713 | none for end of line. This is useful for reading or writing binary | ||
| 714 | files, tar files, and other files that must be examined verbatim. It, | ||
| 715 | too, sets @code{enable-multibyte-characters} to @code{nil}. | ||
| 716 | |||
| 717 | The easiest way to edit a file with no conversion of any kind is with | ||
| 718 | the @kbd{M-x find-file-literally} command. This uses | ||
| 719 | @code{no-conversion}, and also suppresses other Emacs features that | ||
| 720 | might convert the file contents before you see them. @xref{Visiting}. | ||
| 721 | |||
| 722 | The coding system @code{emacs-mule} means that the file contains | ||
| 723 | non-@acronym{ASCII} characters stored with the internal Emacs encoding. It | ||
| 724 | handles end-of-line conversion based on the data encountered, and has | ||
| 725 | the usual three variants to specify the kind of end-of-line conversion. | ||
| 726 | |||
| 727 | @findex unify-8859-on-decoding-mode | ||
| 728 | @anchor{Character Translation} | ||
| 729 | The @dfn{character translation} feature can modify the effect of | ||
| 730 | various coding systems, by changing the internal Emacs codes that | ||
| 731 | decoding produces. For instance, the command | ||
| 732 | @code{unify-8859-on-decoding-mode} enables a mode that ``unifies'' the | ||
| 733 | Latin alphabets when decoding text. This works by converting all | ||
| 734 | non-@acronym{ASCII} Latin-@var{n} characters to either Latin-1 or | ||
| 735 | Unicode characters. This way it is easier to use various | ||
| 736 | Latin-@var{n} alphabets together. (In a future Emacs version we hope | ||
| 737 | to move towards full Unicode support and complete unification of | ||
| 738 | character sets.) | ||
| 739 | |||
| 740 | @vindex enable-character-translation | ||
| 741 | If you set the variable @code{enable-character-translation} to | ||
| 742 | @code{nil}, that disables all character translation (including | ||
| 743 | @code{unify-8859-on-decoding-mode}). | ||
| 744 | |||
| 745 | @node Recognize Coding | ||
| 746 | @section Recognizing Coding Systems | ||
| 747 | |||
| 748 | Emacs tries to recognize which coding system to use for a given text | ||
| 749 | as an integral part of reading that text. (This applies to files | ||
| 750 | being read, output from subprocesses, text from X selections, etc.) | ||
| 751 | Emacs can select the right coding system automatically most of the | ||
| 752 | time---once you have specified your preferences. | ||
| 753 | |||
| 754 | Some coding systems can be recognized or distinguished by which byte | ||
| 755 | sequences appear in the data. However, there are coding systems that | ||
| 756 | cannot be distinguished, not even potentially. For example, there is no | ||
| 757 | way to distinguish between Latin-1 and Latin-2; they use the same byte | ||
| 758 | values with different meanings. | ||
| 759 | |||
| 760 | Emacs handles this situation by means of a priority list of coding | ||
| 761 | systems. Whenever Emacs reads a file, if you do not specify the coding | ||
| 762 | system to use, Emacs checks the data against each coding system, | ||
| 763 | starting with the first in priority and working down the list, until it | ||
| 764 | finds a coding system that fits the data. Then it converts the file | ||
| 765 | contents assuming that they are represented in this coding system. | ||
| 766 | |||
| 767 | The priority list of coding systems depends on the selected language | ||
| 768 | environment (@pxref{Language Environments}). For example, if you use | ||
| 769 | French, you probably want Emacs to prefer Latin-1 to Latin-2; if you use | ||
| 770 | Czech, you probably want Latin-2 to be preferred. This is one of the | ||
| 771 | reasons to specify a language environment. | ||
| 772 | |||
| 773 | @findex prefer-coding-system | ||
| 774 | However, you can alter the coding system priority list in detail | ||
| 775 | with the command @kbd{M-x prefer-coding-system}. This command reads | ||
| 776 | the name of a coding system from the minibuffer, and adds it to the | ||
| 777 | front of the priority list, so that it is preferred to all others. If | ||
| 778 | you use this command several times, each use adds one element to the | ||
| 779 | front of the priority list. | ||
| 780 | |||
| 781 | If you use a coding system that specifies the end-of-line conversion | ||
| 782 | type, such as @code{iso-8859-1-dos}, what this means is that Emacs | ||
| 783 | should attempt to recognize @code{iso-8859-1} with priority, and should | ||
| 784 | use DOS end-of-line conversion when it does recognize @code{iso-8859-1}. | ||
| 785 | |||
| 786 | @vindex file-coding-system-alist | ||
| 787 | Sometimes a file name indicates which coding system to use for the | ||
| 788 | file. The variable @code{file-coding-system-alist} specifies this | ||
| 789 | correspondence. There is a special function | ||
| 790 | @code{modify-coding-system-alist} for adding elements to this list. For | ||
| 791 | example, to read and write all @samp{.txt} files using the coding system | ||
| 792 | @code{chinese-iso-8bit}, you can execute this Lisp expression: | ||
| 793 | |||
| 794 | @smallexample | ||
| 795 | (modify-coding-system-alist 'file "\\.txt\\'" 'chinese-iso-8bit) | ||
| 796 | @end smallexample | ||
| 797 | |||
| 798 | @noindent | ||
| 799 | The first argument should be @code{file}, the second argument should be | ||
| 800 | a regular expression that determines which files this applies to, and | ||
| 801 | the third argument says which coding system to use for these files. | ||
| 802 | |||
| 803 | @vindex inhibit-eol-conversion | ||
| 804 | @cindex DOS-style end-of-line display | ||
| 805 | Emacs recognizes which kind of end-of-line conversion to use based on | ||
| 806 | the contents of the file: if it sees only carriage-returns, or only | ||
| 807 | carriage-return linefeed sequences, then it chooses the end-of-line | ||
| 808 | conversion accordingly. You can inhibit the automatic use of | ||
| 809 | end-of-line conversion by setting the variable @code{inhibit-eol-conversion} | ||
| 810 | to non-@code{nil}. If you do that, DOS-style files will be displayed | ||
| 811 | with the @samp{^M} characters visible in the buffer; some people | ||
| 812 | prefer this to the more subtle @samp{(DOS)} end-of-line type | ||
| 813 | indication near the left edge of the mode line (@pxref{Mode Line, | ||
| 814 | eol-mnemonic}). | ||
| 815 | |||
| 816 | @vindex inhibit-iso-escape-detection | ||
| 817 | @cindex escape sequences in files | ||
| 818 | By default, the automatic detection of coding system is sensitive to | ||
| 819 | escape sequences. If Emacs sees a sequence of characters that begin | ||
| 820 | with an escape character, and the sequence is valid as an ISO-2022 | ||
| 821 | code, that tells Emacs to use one of the ISO-2022 encodings to decode | ||
| 822 | the file. | ||
| 823 | |||
| 824 | However, there may be cases that you want to read escape sequences | ||
| 825 | in a file as is. In such a case, you can set the variable | ||
| 826 | @code{inhibit-iso-escape-detection} to non-@code{nil}. Then the code | ||
| 827 | detection ignores any escape sequences, and never uses an ISO-2022 | ||
| 828 | encoding. The result is that all escape sequences become visible in | ||
| 829 | the buffer. | ||
| 830 | |||
| 831 | The default value of @code{inhibit-iso-escape-detection} is | ||
| 832 | @code{nil}. We recommend that you not change it permanently, only for | ||
| 833 | one specific operation. That's because many Emacs Lisp source files | ||
| 834 | in the Emacs distribution contain non-@acronym{ASCII} characters encoded in the | ||
| 835 | coding system @code{iso-2022-7bit}, and they won't be | ||
| 836 | decoded correctly when you visit those files if you suppress the | ||
| 837 | escape sequence detection. | ||
| 838 | |||
| 839 | @vindex auto-coding-alist | ||
| 840 | @vindex auto-coding-regexp-alist | ||
| 841 | @vindex auto-coding-functions | ||
| 842 | The variables @code{auto-coding-alist}, | ||
| 843 | @code{auto-coding-regexp-alist} and @code{auto-coding-functions} are | ||
| 844 | the strongest way to specify the coding system for certain patterns of | ||
| 845 | file names, or for files containing certain patterns; these variables | ||
| 846 | even override @samp{-*-coding:-*-} tags in the file itself. Emacs | ||
| 847 | uses @code{auto-coding-alist} for tar and archive files, to prevent it | ||
| 848 | from being confused by a @samp{-*-coding:-*-} tag in a member of the | ||
| 849 | archive and thinking it applies to the archive file as a whole. | ||
| 850 | Likewise, Emacs uses @code{auto-coding-regexp-alist} to ensure that | ||
| 851 | RMAIL files, whose names in general don't match any particular | ||
| 852 | pattern, are decoded correctly. One of the builtin | ||
| 853 | @code{auto-coding-functions} detects the encoding for XML files. | ||
| 854 | |||
| 855 | @vindex rmail-decode-mime-charset | ||
| 856 | When you get new mail in Rmail, each message is translated | ||
| 857 | automatically from the coding system it is written in, as if it were a | ||
| 858 | separate file. This uses the priority list of coding systems that you | ||
| 859 | have specified. If a MIME message specifies a character set, Rmail | ||
| 860 | obeys that specification, unless @code{rmail-decode-mime-charset} is | ||
| 861 | @code{nil}. | ||
| 862 | |||
| 863 | @vindex rmail-file-coding-system | ||
| 864 | For reading and saving Rmail files themselves, Emacs uses the coding | ||
| 865 | system specified by the variable @code{rmail-file-coding-system}. The | ||
| 866 | default value is @code{nil}, which means that Rmail files are not | ||
| 867 | translated (they are read and written in the Emacs internal character | ||
| 868 | code). | ||
| 869 | |||
| 870 | @node Specify Coding | ||
| 871 | @section Specifying a File's Coding System | ||
| 872 | |||
| 873 | If Emacs recognizes the encoding of a file incorrectly, you can | ||
| 874 | reread the file using the correct coding system by typing @kbd{C-x | ||
| 875 | @key{RET} r @var{coding-system} @key{RET}}. To see what coding system | ||
| 876 | Emacs actually used to decode the file, look at the coding system | ||
| 877 | mnemonic letter near the left edge of the mode line (@pxref{Mode | ||
| 878 | Line}), or type @kbd{C-h C @key{RET}}. | ||
| 879 | |||
| 880 | @vindex coding | ||
| 881 | You can specify the coding system for a particular file in the file | ||
| 882 | itself, using the @w{@samp{-*-@dots{}-*-}} construct at the beginning, | ||
| 883 | or a local variables list at the end (@pxref{File Variables}). You do | ||
| 884 | this by defining a value for the ``variable'' named @code{coding}. | ||
| 885 | Emacs does not really have a variable @code{coding}; instead of | ||
| 886 | setting a variable, this uses the specified coding system for the | ||
| 887 | file. For example, @samp{-*-mode: C; coding: latin-1;-*-} specifies | ||
| 888 | use of the Latin-1 coding system, as well as C mode. When you specify | ||
| 889 | the coding explicitly in the file, that overrides | ||
| 890 | @code{file-coding-system-alist}. | ||
| 891 | |||
| 892 | If you add the character @samp{!} at the end of the coding system | ||
| 893 | name in @code{coding}, it disables any character translation | ||
| 894 | (@pxref{Character Translation}) while decoding the file. This is | ||
| 895 | useful when you need to make sure that the character codes in the | ||
| 896 | Emacs buffer will not vary due to changes in user settings; for | ||
| 897 | instance, for the sake of strings in Emacs Lisp source files. | ||
| 898 | |||
| 899 | @node Output Coding | ||
| 900 | @section Choosing Coding Systems for Output | ||
| 901 | |||
| 902 | @vindex buffer-file-coding-system | ||
| 903 | Once Emacs has chosen a coding system for a buffer, it stores that | ||
| 904 | coding system in @code{buffer-file-coding-system}. That makes it the | ||
| 905 | default for operations that write from this buffer into a file, such | ||
| 906 | as @code{save-buffer} and @code{write-region}. You can specify a | ||
| 907 | different coding system for further file output from the buffer using | ||
| 908 | @code{set-buffer-file-coding-system} (@pxref{Text Coding}). | ||
| 909 | |||
| 910 | You can insert any character Emacs supports into any Emacs buffer, | ||
| 911 | but most coding systems can only handle a subset of these characters. | ||
| 912 | Therefore, you can insert characters that cannot be encoded with the | ||
| 913 | coding system that will be used to save the buffer. For example, you | ||
| 914 | could start with an @acronym{ASCII} file and insert a few Latin-1 | ||
| 915 | characters into it, or you could edit a text file in Polish encoded in | ||
| 916 | @code{iso-8859-2} and add some Russian words to it. When you save | ||
| 917 | that buffer, Emacs cannot use the current value of | ||
| 918 | @code{buffer-file-coding-system}, because the characters you added | ||
| 919 | cannot be encoded by that coding system. | ||
| 920 | |||
| 921 | When that happens, Emacs tries the most-preferred coding system (set | ||
| 922 | by @kbd{M-x prefer-coding-system} or @kbd{M-x | ||
| 923 | set-language-environment}), and if that coding system can safely | ||
| 924 | encode all of the characters in the buffer, Emacs uses it, and stores | ||
| 925 | its value in @code{buffer-file-coding-system}. Otherwise, Emacs | ||
| 926 | displays a list of coding systems suitable for encoding the buffer's | ||
| 927 | contents, and asks you to choose one of those coding systems. | ||
| 928 | |||
| 929 | If you insert the unsuitable characters in a mail message, Emacs | ||
| 930 | behaves a bit differently. It additionally checks whether the | ||
| 931 | most-preferred coding system is recommended for use in MIME messages; | ||
| 932 | if not, Emacs tells you that the most-preferred coding system is not | ||
| 933 | recommended and prompts you for another coding system. This is so you | ||
| 934 | won't inadvertently send a message encoded in a way that your | ||
| 935 | recipient's mail software will have difficulty decoding. (You can | ||
| 936 | still use an unsuitable coding system if you type its name in response | ||
| 937 | to the question.) | ||
| 938 | |||
| 939 | @vindex sendmail-coding-system | ||
| 940 | When you send a message with Mail mode (@pxref{Sending Mail}), Emacs has | ||
| 941 | four different ways to determine the coding system to use for encoding | ||
| 942 | the message text. It tries the buffer's own value of | ||
| 943 | @code{buffer-file-coding-system}, if that is non-@code{nil}. Otherwise, | ||
| 944 | it uses the value of @code{sendmail-coding-system}, if that is | ||
| 945 | non-@code{nil}. The third way is to use the default coding system for | ||
| 946 | new files, which is controlled by your choice of language environment, | ||
| 947 | if that is non-@code{nil}. If all of these three values are @code{nil}, | ||
| 948 | Emacs encodes outgoing mail using the Latin-1 coding system. | ||
| 949 | |||
| 950 | @node Text Coding | ||
| 951 | @section Specifying a Coding System for File Text | ||
| 952 | |||
| 953 | In cases where Emacs does not automatically choose the right coding | ||
| 954 | system for a file's contents, you can use these commands to specify | ||
| 955 | one: | ||
| 956 | |||
| 957 | @table @kbd | ||
| 958 | @item C-x @key{RET} f @var{coding} @key{RET} | ||
| 959 | Use coding system @var{coding} for saving or revisiting the visited | ||
| 960 | file in the current buffer. | ||
| 961 | |||
| 962 | @item C-x @key{RET} c @var{coding} @key{RET} | ||
| 963 | Specify coding system @var{coding} for the immediately following | ||
| 964 | command. | ||
| 965 | |||
| 966 | @item C-x @key{RET} r @var{coding} @key{RET} | ||
| 967 | Revisit the current file using the coding system @var{coding}. | ||
| 968 | |||
| 969 | @item M-x recode-region @key{RET} @var{right} @key{RET} @var{wrong} @key{RET} | ||
| 970 | Convert a region that was decoded using coding system @var{wrong}, | ||
| 971 | decoding it using coding system @var{right} instead. | ||
| 972 | @end table | ||
| 973 | |||
| 974 | @kindex C-x RET f | ||
| 975 | @findex set-buffer-file-coding-system | ||
| 976 | The command @kbd{C-x @key{RET} f} | ||
| 977 | (@code{set-buffer-file-coding-system}) sets the file coding system for | ||
| 978 | the current buffer---in other words, it says which coding system to | ||
| 979 | use when saving or reverting the visited file. You specify which | ||
| 980 | coding system using the minibuffer. If you specify a coding system | ||
| 981 | that cannot handle all of the characters in the buffer, Emacs warns | ||
| 982 | you about the troublesome characters when you actually save the | ||
| 983 | buffer. | ||
| 984 | |||
| 985 | @cindex specify end-of-line conversion | ||
| 986 | You can also use this command to specify the end-of-line conversion | ||
| 987 | (@pxref{Coding Systems, end-of-line conversion}) for encoding the | ||
| 988 | current buffer. For example, @kbd{C-x @key{RET} f dos @key{RET}} will | ||
| 989 | cause Emacs to save the current buffer's text with DOS-style CRLF line | ||
| 990 | endings. | ||
| 991 | |||
| 992 | @kindex C-x RET c | ||
| 993 | @findex universal-coding-system-argument | ||
| 994 | Another way to specify the coding system for a file is when you visit | ||
| 995 | the file. First use the command @kbd{C-x @key{RET} c} | ||
| 996 | (@code{universal-coding-system-argument}); this command uses the | ||
| 997 | minibuffer to read a coding system name. After you exit the minibuffer, | ||
| 998 | the specified coding system is used for @emph{the immediately following | ||
| 999 | command}. | ||
| 1000 | |||
| 1001 | So if the immediately following command is @kbd{C-x C-f}, for example, | ||
| 1002 | it reads the file using that coding system (and records the coding | ||
| 1003 | system for when you later save the file). Or if the immediately following | ||
| 1004 | command is @kbd{C-x C-w}, it writes the file using that coding system. | ||
| 1005 | When you specify the coding system for saving in this way, instead | ||
| 1006 | of with @kbd{C-x @key{RET} f}, there is no warning if the buffer | ||
| 1007 | contains characters that the coding system cannot handle. | ||
| 1008 | |||
| 1009 | Other file commands affected by a specified coding system include | ||
| 1010 | @kbd{C-x i} and @kbd{C-x C-v}, as well as the other-window variants | ||
| 1011 | of @kbd{C-x C-f}. @kbd{C-x @key{RET} c} also affects commands that | ||
| 1012 | start subprocesses, including @kbd{M-x shell} (@pxref{Shell}). If the | ||
| 1013 | immediately following command does not use the coding system, then | ||
| 1014 | @kbd{C-x @key{RET} c} ultimately has no effect. | ||
| 1015 | |||
| 1016 | An easy way to visit a file with no conversion is with the @kbd{M-x | ||
| 1017 | find-file-literally} command. @xref{Visiting}. | ||
| 1018 | |||
| 1019 | @vindex default-buffer-file-coding-system | ||
| 1020 | The variable @code{default-buffer-file-coding-system} specifies the | ||
| 1021 | choice of coding system to use when you create a new file. It applies | ||
| 1022 | when you find a new file, and when you create a buffer and then save it | ||
| 1023 | in a file. Selecting a language environment typically sets this | ||
| 1024 | variable to a good choice of default coding system for that language | ||
| 1025 | environment. | ||
| 1026 | |||
| 1027 | @kindex C-x RET r | ||
| 1028 | @findex revert-buffer-with-coding-system | ||
| 1029 | If you visit a file with a wrong coding system, you can correct this | ||
| 1030 | with @kbd{C-x @key{RET} r} (@code{revert-buffer-with-coding-system}). | ||
| 1031 | This visits the current file again, using a coding system you specify. | ||
| 1032 | |||
| 1033 | @findex recode-region | ||
| 1034 | If a piece of text has already been inserted into a buffer using the | ||
| 1035 | wrong coding system, you can redo the decoding of it using @kbd{M-x | ||
| 1036 | recode-region}. This prompts you for the proper coding system, then | ||
| 1037 | for the wrong coding system that was actually used, and does the | ||
| 1038 | conversion. It first encodes the region using the wrong coding system, | ||
| 1039 | then decodes it again using the proper coding system. | ||
| 1040 | |||
| 1041 | @node Communication Coding | ||
| 1042 | @section Coding Systems for Interprocess Communication | ||
| 1043 | |||
| 1044 | This section explains how to specify coding systems for use | ||
| 1045 | in communication with other processes. | ||
| 1046 | |||
| 1047 | @table @kbd | ||
| 1048 | @item C-x @key{RET} x @var{coding} @key{RET} | ||
| 1049 | Use coding system @var{coding} for transferring selections to and from | ||
| 1050 | other window-based applications. | ||
| 1051 | |||
| 1052 | @item C-x @key{RET} X @var{coding} @key{RET} | ||
| 1053 | Use coding system @var{coding} for transferring @emph{one} | ||
| 1054 | selection---the next one---to or from another window-based application. | ||
| 1055 | |||
| 1056 | @item C-x @key{RET} p @var{input-coding} @key{RET} @var{output-coding} @key{RET} | ||
| 1057 | Use coding systems @var{input-coding} and @var{output-coding} for | ||
| 1058 | subprocess input and output in the current buffer. | ||
| 1059 | |||
| 1060 | @item C-x @key{RET} c @var{coding} @key{RET} | ||
| 1061 | Specify coding system @var{coding} for the immediately following | ||
| 1062 | command. | ||
| 1063 | @end table | ||
| 1064 | |||
| 1065 | @kindex C-x RET x | ||
| 1066 | @kindex C-x RET X | ||
| 1067 | @findex set-selection-coding-system | ||
| 1068 | @findex set-next-selection-coding-system | ||
| 1069 | The command @kbd{C-x @key{RET} x} (@code{set-selection-coding-system}) | ||
| 1070 | specifies the coding system for sending selected text to other windowing | ||
| 1071 | applications, and for receiving the text of selections made in other | ||
| 1072 | applications. This command applies to all subsequent selections, until | ||
| 1073 | you override it by using the command again. The command @kbd{C-x | ||
| 1074 | @key{RET} X} (@code{set-next-selection-coding-system}) specifies the | ||
| 1075 | coding system for the next selection made in Emacs or read by Emacs. | ||
| 1076 | |||
| 1077 | @kindex C-x RET p | ||
| 1078 | @findex set-buffer-process-coding-system | ||
| 1079 | The command @kbd{C-x @key{RET} p} (@code{set-buffer-process-coding-system}) | ||
| 1080 | specifies the coding system for input and output to a subprocess. This | ||
| 1081 | command applies to the current buffer; normally, each subprocess has its | ||
| 1082 | own buffer, and thus you can use this command to specify translation to | ||
| 1083 | and from a particular subprocess by giving the command in the | ||
| 1084 | corresponding buffer. | ||
| 1085 | |||
| 1086 | You can also use @kbd{C-x @key{RET} c} just before the command that | ||
| 1087 | runs or starts a subprocess, to specify the coding system to use for | ||
| 1088 | communication with that subprocess. | ||
| 1089 | |||
| 1090 | The default for translation of process input and output depends on the | ||
| 1091 | current language environment. | ||
| 1092 | |||
| 1093 | @vindex locale-coding-system | ||
| 1094 | @cindex decoding non-@acronym{ASCII} keyboard input on X | ||
| 1095 | The variable @code{locale-coding-system} specifies a coding system | ||
| 1096 | to use when encoding and decoding system strings such as system error | ||
| 1097 | messages and @code{format-time-string} formats and time stamps. That | ||
| 1098 | coding system is also used for decoding non-@acronym{ASCII} keyboard input on X | ||
| 1099 | Window systems. You should choose a coding system that is compatible | ||
| 1100 | with the underlying system's text representation, which is normally | ||
| 1101 | specified by one of the environment variables @env{LC_ALL}, | ||
| 1102 | @env{LC_CTYPE}, and @env{LANG}. (The first one, in the order | ||
| 1103 | specified above, whose value is nonempty is the one that determines | ||
| 1104 | the text representation.) | ||
| 1105 | |||
| 1106 | @node File Name Coding | ||
| 1107 | @section Coding Systems for File Names | ||
| 1108 | |||
| 1109 | @table @kbd | ||
| 1110 | @item C-x @key{RET} F @var{coding} @key{RET} | ||
| 1111 | Use coding system @var{coding} for encoding and decoding file | ||
| 1112 | @emph{names}. | ||
| 1113 | @end table | ||
| 1114 | |||
| 1115 | @vindex file-name-coding-system | ||
| 1116 | @cindex file names with non-@acronym{ASCII} characters | ||
| 1117 | The variable @code{file-name-coding-system} specifies a coding | ||
| 1118 | system to use for encoding file names. It has no effect on reading | ||
| 1119 | and writing the @emph{contents} of files. | ||
| 1120 | |||
| 1121 | @findex set-file-name-coding-system | ||
| 1122 | @kindex C-x @key{RET} F | ||
| 1123 | If you set the variable to a coding system name (as a Lisp symbol or | ||
| 1124 | a string), Emacs encodes file names using that coding system for all | ||
| 1125 | file operations. This makes it possible to use non-@acronym{ASCII} | ||
| 1126 | characters in file names---or, at least, those non-@acronym{ASCII} | ||
| 1127 | characters which the specified coding system can encode. Use @kbd{C-x | ||
| 1128 | @key{RET} F} (@code{set-file-name-coding-system}) to specify this | ||
| 1129 | interactively. | ||
| 1130 | |||
| 1131 | If @code{file-name-coding-system} is @code{nil}, Emacs uses a | ||
| 1132 | default coding system determined by the selected language environment. | ||
| 1133 | In the default language environment, any non-@acronym{ASCII} | ||
| 1134 | characters in file names are not encoded specially; they appear in the | ||
| 1135 | file system using the internal Emacs representation. | ||
| 1136 | |||
| 1137 | @strong{Warning:} if you change @code{file-name-coding-system} (or the | ||
| 1138 | language environment) in the middle of an Emacs session, problems can | ||
| 1139 | result if you have already visited files whose names were encoded using | ||
| 1140 | the earlier coding system and cannot be encoded (or are encoded | ||
| 1141 | differently) under the new coding system. If you try to save one of | ||
| 1142 | these buffers under the visited file name, saving may use the wrong file | ||
| 1143 | name, or it may get an error. If such a problem happens, use @kbd{C-x | ||
| 1144 | C-w} to specify a new file name for that buffer. | ||
| 1145 | |||
| 1146 | @findex recode-file-name | ||
| 1147 | If a mistake occurs when encoding a file name, use the command | ||
| 1148 | @kbd{M-x recode-file-name} to change the file name's coding | ||
| 1149 | system. This prompts for an existing file name, its old coding | ||
| 1150 | system, and the coding system to which you wish to convert. | ||
| 1151 | |||
| 1152 | @node Terminal Coding | ||
| 1153 | @section Coding Systems for Terminal I/O | ||
| 1154 | |||
| 1155 | @table @kbd | ||
| 1156 | @item C-x @key{RET} k @var{coding} @key{RET} | ||
| 1157 | Use coding system @var{coding} for keyboard input. | ||
| 1158 | |||
| 1159 | @item C-x @key{RET} t @var{coding} @key{RET} | ||
| 1160 | Use coding system @var{coding} for terminal output. | ||
| 1161 | @end table | ||
| 1162 | |||
| 1163 | @kindex C-x RET t | ||
| 1164 | @findex set-terminal-coding-system | ||
| 1165 | The command @kbd{C-x @key{RET} t} (@code{set-terminal-coding-system}) | ||
| 1166 | specifies the coding system for terminal output. If you specify a | ||
| 1167 | character code for terminal output, all characters output to the | ||
| 1168 | terminal are translated into that coding system. | ||
| 1169 | |||
| 1170 | This feature is useful for certain character-only terminals built to | ||
| 1171 | support specific languages or character sets---for example, European | ||
| 1172 | terminals that support one of the ISO Latin character sets. You need to | ||
| 1173 | specify the terminal coding system when using multibyte text, so that | ||
| 1174 | Emacs knows which characters the terminal can actually handle. | ||
| 1175 | |||
| 1176 | By default, output to the terminal is not translated at all, unless | ||
| 1177 | Emacs can deduce the proper coding system from your terminal type or | ||
| 1178 | your locale specification (@pxref{Language Environments}). | ||
| 1179 | |||
| 1180 | @kindex C-x RET k | ||
| 1181 | @findex set-keyboard-coding-system | ||
| 1182 | @vindex keyboard-coding-system | ||
| 1183 | The command @kbd{C-x @key{RET} k} (@code{set-keyboard-coding-system}) | ||
| 1184 | or the variable @code{keyboard-coding-system} specifies the coding | ||
| 1185 | system for keyboard input. Character-code translation of keyboard | ||
| 1186 | input is useful for terminals with keys that send non-@acronym{ASCII} | ||
| 1187 | graphic characters---for example, some terminals designed for ISO | ||
| 1188 | Latin-1 or subsets of it. | ||
| 1189 | |||
| 1190 | By default, keyboard input is translated based on your system locale | ||
| 1191 | setting. If your terminal does not really support the encoding | ||
| 1192 | implied by your locale (for example, if you find it inserts a | ||
| 1193 | non-@acronym{ASCII} character if you type @kbd{M-i}), you will need to set | ||
| 1194 | @code{keyboard-coding-system} to @code{nil} to turn off encoding. | ||
| 1195 | You can do this by putting | ||
| 1196 | |||
| 1197 | @lisp | ||
| 1198 | (set-keyboard-coding-system nil) | ||
| 1199 | @end lisp | ||
| 1200 | |||
| 1201 | @noindent | ||
| 1202 | in your @file{~/.emacs} file. | ||
| 1203 | |||
| 1204 | There is a similarity between using a coding system translation for | ||
| 1205 | keyboard input, and using an input method: both define sequences of | ||
| 1206 | keyboard input that translate into single characters. However, input | ||
| 1207 | methods are designed to be convenient for interactive use by humans, and | ||
| 1208 | the sequences that are translated are typically sequences of @acronym{ASCII} | ||
| 1209 | printing characters. Coding systems typically translate sequences of | ||
| 1210 | non-graphic characters. | ||
| 1211 | |||
| 1212 | @node Fontsets | ||
| 1213 | @section Fontsets | ||
| 1214 | @cindex fontsets | ||
| 1215 | |||
| 1216 | A font typically defines shapes for a single alphabet or script. | ||
| 1217 | Therefore, displaying the entire range of scripts that Emacs supports | ||
| 1218 | requires a collection of many fonts. In Emacs, such a collection is | ||
| 1219 | called a @dfn{fontset}. A fontset is defined by a list of fonts, each | ||
| 1220 | assigned to handle a range of character codes. | ||
| 1221 | |||
| 1222 | Each fontset has a name, like a font. However, while fonts are | ||
| 1223 | stored in the system and the available font names are defined by the | ||
| 1224 | system, fontsets are defined within Emacs itself. Once you have | ||
| 1225 | defined a fontset, you can use it within Emacs by specifying its name, | ||
| 1226 | anywhere that you could use a single font. Of course, Emacs fontsets | ||
| 1227 | can use only the fonts that the system supports; if certain characters | ||
| 1228 | appear on the screen as hollow boxes, this means that the fontset in | ||
| 1229 | use for them has no font for those characters.@footnote{The Emacs | ||
| 1230 | installation instructions have information on additional font | ||
| 1231 | support.} | ||
| 1232 | |||
| 1233 | Emacs creates two fontsets automatically: the @dfn{standard fontset} | ||
| 1234 | and the @dfn{startup fontset}. The standard fontset is most likely to | ||
| 1235 | have fonts for a wide variety of non-@acronym{ASCII} characters; | ||
| 1236 | however, this is not the default for Emacs to use. (By default, Emacs | ||
| 1237 | tries to find a font that has bold and italic variants.) You can | ||
| 1238 | specify use of the standard fontset with the @samp{-fn} option. For | ||
| 1239 | example, | ||
| 1240 | |||
| 1241 | @example | ||
| 1242 | emacs -fn fontset-standard | ||
| 1243 | @end example | ||
| 1244 | |||
| 1245 | @noindent | ||
| 1246 | You can also specify a fontset with the @samp{Font} resource (@pxref{X | ||
| 1247 | Resources}). | ||
| 1248 | |||
| 1249 | A fontset does not necessarily specify a font for every character | ||
| 1250 | code. If a fontset specifies no font for a certain character, or if it | ||
| 1251 | specifies a font that does not exist on your system, then it cannot | ||
| 1252 | display that character properly. It will display that character as an | ||
| 1253 | empty box instead. | ||
| 1254 | |||
| 1255 | @node Defining Fontsets | ||
| 1256 | @section Defining fontsets | ||
| 1257 | |||
| 1258 | @vindex standard-fontset-spec | ||
| 1259 | @cindex standard fontset | ||
| 1260 | Emacs creates a standard fontset automatically according to the value | ||
| 1261 | of @code{standard-fontset-spec}. This fontset's name is | ||
| 1262 | |||
| 1263 | @example | ||
| 1264 | -*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard | ||
| 1265 | @end example | ||
| 1266 | |||
| 1267 | @noindent | ||
| 1268 | or just @samp{fontset-standard} for short. | ||
| 1269 | |||
| 1270 | Bold, italic, and bold-italic variants of the standard fontset are | ||
| 1271 | created automatically. Their names have @samp{bold} instead of | ||
| 1272 | @samp{medium}, or @samp{i} instead of @samp{r}, or both. | ||
| 1273 | |||
| 1274 | @cindex startup fontset | ||
| 1275 | If you specify a default @acronym{ASCII} font with the @samp{Font} resource or | ||
| 1276 | the @samp{-fn} argument, Emacs generates a fontset from it | ||
| 1277 | automatically. This is the @dfn{startup fontset} and its name is | ||
| 1278 | @code{fontset-startup}. It does this by replacing the @var{foundry}, | ||
| 1279 | @var{family}, @var{add_style}, and @var{average_width} fields of the | ||
| 1280 | font name with @samp{*}, replacing @var{charset_registry} field with | ||
| 1281 | @samp{fontset}, and replacing @var{charset_encoding} field with | ||
| 1282 | @samp{startup}, then using the resulting string to specify a fontset. | ||
| 1283 | |||
| 1284 | For instance, if you start Emacs this way, | ||
| 1285 | |||
| 1286 | @example | ||
| 1287 | emacs -fn "*courier-medium-r-normal--14-140-*-iso8859-1" | ||
| 1288 | @end example | ||
| 1289 | |||
| 1290 | @noindent | ||
| 1291 | Emacs generates the following fontset and uses it for the initial X | ||
| 1292 | window frame: | ||
| 1293 | |||
| 1294 | @example | ||
| 1295 | -*-*-medium-r-normal-*-14-140-*-*-*-*-fontset-startup | ||
| 1296 | @end example | ||
| 1297 | |||
| 1298 | With the X resource @samp{Emacs.Font}, you can specify a fontset name | ||
| 1299 | just like an actual font name. But be careful not to specify a fontset | ||
| 1300 | name in a wildcard resource like @samp{Emacs*Font}---that wildcard | ||
| 1301 | specification matches various other resources, such as for menus, and | ||
| 1302 | menus cannot handle fontsets. | ||
| 1303 | |||
| 1304 | You can specify additional fontsets using X resources named | ||
| 1305 | @samp{Fontset-@var{n}}, where @var{n} is an integer starting from 0. | ||
| 1306 | The resource value should have this form: | ||
| 1307 | |||
| 1308 | @smallexample | ||
| 1309 | @var{fontpattern}, @r{[}@var{charset}:@var{font}@r{]@dots{}} | ||
| 1310 | @end smallexample | ||
| 1311 | |||
| 1312 | @noindent | ||
| 1313 | @var{fontpattern} should have the form of a standard X font name, except | ||
| 1314 | for the last two fields. They should have the form | ||
| 1315 | @samp{fontset-@var{alias}}. | ||
| 1316 | |||
| 1317 | The fontset has two names, one long and one short. The long name is | ||
| 1318 | @var{fontpattern}. The short name is @samp{fontset-@var{alias}}. You | ||
| 1319 | can refer to the fontset by either name. | ||
| 1320 | |||
| 1321 | The construct @samp{@var{charset}:@var{font}} specifies which font to | ||
| 1322 | use (in this fontset) for one particular character set. Here, | ||
| 1323 | @var{charset} is the name of a character set, and @var{font} is the | ||
| 1324 | font to use for that character set. You can use this construct any | ||
| 1325 | number of times in defining one fontset. | ||
| 1326 | |||
| 1327 | For the other character sets, Emacs chooses a font based on | ||
| 1328 | @var{fontpattern}. It replaces @samp{fontset-@var{alias}} with values | ||
| 1329 | that describe the character set. For the @acronym{ASCII} character font, | ||
| 1330 | @samp{fontset-@var{alias}} is replaced with @samp{ISO8859-1}. | ||
| 1331 | |||
| 1332 | In addition, when several consecutive fields are wildcards, Emacs | ||
| 1333 | collapses them into a single wildcard. This is to prevent use of | ||
| 1334 | auto-scaled fonts. Fonts made by scaling larger fonts are not usable | ||
| 1335 | for editing, and scaling a smaller font is not useful because it is | ||
| 1336 | better to use the smaller font in its own size, which is what Emacs | ||
| 1337 | does. | ||
| 1338 | |||
| 1339 | Thus if @var{fontpattern} is this, | ||
| 1340 | |||
| 1341 | @example | ||
| 1342 | -*-fixed-medium-r-normal-*-24-*-*-*-*-*-fontset-24 | ||
| 1343 | @end example | ||
| 1344 | |||
| 1345 | @noindent | ||
| 1346 | the font specification for @acronym{ASCII} characters would be this: | ||
| 1347 | |||
| 1348 | @example | ||
| 1349 | -*-fixed-medium-r-normal-*-24-*-ISO8859-1 | ||
| 1350 | @end example | ||
| 1351 | |||
| 1352 | @noindent | ||
| 1353 | and the font specification for Chinese GB2312 characters would be this: | ||
| 1354 | |||
| 1355 | @example | ||
| 1356 | -*-fixed-medium-r-normal-*-24-*-gb2312*-* | ||
| 1357 | @end example | ||
| 1358 | |||
| 1359 | You may not have any Chinese font matching the above font | ||
| 1360 | specification. Most X distributions include only Chinese fonts that | ||
| 1361 | have @samp{song ti} or @samp{fangsong ti} in @var{family} field. In | ||
| 1362 | such a case, @samp{Fontset-@var{n}} can be specified as below: | ||
| 1363 | |||
| 1364 | @smallexample | ||
| 1365 | Emacs.Fontset-0: -*-fixed-medium-r-normal-*-24-*-*-*-*-*-fontset-24,\ | ||
| 1366 | chinese-gb2312:-*-*-medium-r-normal-*-24-*-gb2312*-* | ||
| 1367 | @end smallexample | ||
| 1368 | |||
| 1369 | @noindent | ||
| 1370 | Then, the font specifications for all but Chinese GB2312 characters have | ||
| 1371 | @samp{fixed} in the @var{family} field, and the font specification for | ||
| 1372 | Chinese GB2312 characters has a wild card @samp{*} in the @var{family} | ||
| 1373 | field. | ||
| 1374 | |||
| 1375 | @findex create-fontset-from-fontset-spec | ||
| 1376 | The function that processes the fontset resource value to create the | ||
| 1377 | fontset is called @code{create-fontset-from-fontset-spec}. You can also | ||
| 1378 | call this function explicitly to create a fontset. | ||
| 1379 | |||
| 1380 | @xref{Font X}, for more information about font naming in X. | ||
| 1381 | |||
| 1382 | @node Undisplayable Characters | ||
| 1383 | @section Undisplayable Characters | ||
| 1384 | |||
| 1385 | There may be a some non-@acronym{ASCII} characters that your terminal cannot | ||
| 1386 | display. Most text-only terminals support just a single character | ||
| 1387 | set (use the variable @code{default-terminal-coding-system} | ||
| 1388 | (@pxref{Terminal Coding}) to tell Emacs which one); characters which | ||
| 1389 | can't be encoded in that coding system are displayed as @samp{?} by | ||
| 1390 | default. | ||
| 1391 | |||
| 1392 | Graphical displays can display a broader range of characters, but | ||
| 1393 | you may not have fonts installed for all of them; characters that have | ||
| 1394 | no font appear as a hollow box. | ||
| 1395 | |||
| 1396 | If you use Latin-1 characters but your terminal can't display | ||
| 1397 | Latin-1, you can arrange to display mnemonic @acronym{ASCII} sequences | ||
| 1398 | instead, e.g.@: @samp{"o} for o-umlaut. Load the library | ||
| 1399 | @file{iso-ascii} to do this. | ||
| 1400 | |||
| 1401 | @vindex latin1-display | ||
| 1402 | If your terminal can display Latin-1, you can display characters | ||
| 1403 | from other European character sets using a mixture of equivalent | ||
| 1404 | Latin-1 characters and @acronym{ASCII} mnemonics. Customize the variable | ||
| 1405 | @code{latin1-display} to enable this. The mnemonic @acronym{ASCII} | ||
| 1406 | sequences mostly correspond to those of the prefix input methods. | ||
| 1407 | |||
| 1408 | @node Unibyte Mode | ||
| 1409 | @section Unibyte Editing Mode | ||
| 1410 | |||
| 1411 | @cindex European character sets | ||
| 1412 | @cindex accented characters | ||
| 1413 | @cindex ISO Latin character sets | ||
| 1414 | @cindex Unibyte operation | ||
| 1415 | The ISO 8859 Latin-@var{n} character sets define character codes in | ||
| 1416 | the range 0240 to 0377 octal (160 to 255 decimal) to handle the | ||
| 1417 | accented letters and punctuation needed by various European languages | ||
| 1418 | (and some non-European ones). If you disable multibyte characters, | ||
| 1419 | Emacs can still handle @emph{one} of these character codes at a time. | ||
| 1420 | To specify @emph{which} of these codes to use, invoke @kbd{M-x | ||
| 1421 | set-language-environment} and specify a suitable language environment | ||
| 1422 | such as @samp{Latin-@var{n}}. | ||
| 1423 | |||
| 1424 | For more information about unibyte operation, see @ref{Enabling | ||
| 1425 | Multibyte}. Note particularly that you probably want to ensure that | ||
| 1426 | your initialization files are read as unibyte if they contain | ||
| 1427 | non-@acronym{ASCII} characters. | ||
| 1428 | |||
| 1429 | @vindex unibyte-display-via-language-environment | ||
| 1430 | Emacs can also display those characters, provided the terminal or font | ||
| 1431 | in use supports them. This works automatically. Alternatively, on a | ||
| 1432 | graphical display, Emacs can also display single-byte characters | ||
| 1433 | through fontsets, in effect by displaying the equivalent multibyte | ||
| 1434 | characters according to the current language environment. To request | ||
| 1435 | this, set the variable @code{unibyte-display-via-language-environment} | ||
| 1436 | to a non-@code{nil} value. | ||
| 1437 | |||
| 1438 | @cindex @code{iso-ascii} library | ||
| 1439 | If your terminal does not support display of the Latin-1 character | ||
| 1440 | set, Emacs can display these characters as @acronym{ASCII} sequences which at | ||
| 1441 | least give you a clear idea of what the characters are. To do this, | ||
| 1442 | load the library @code{iso-ascii}. Similar libraries for other | ||
| 1443 | Latin-@var{n} character sets could be implemented, but we don't have | ||
| 1444 | them yet. | ||
| 1445 | |||
| 1446 | @findex standard-display-8bit | ||
| 1447 | @cindex 8-bit display | ||
| 1448 | Normally non-ISO-8859 characters (decimal codes between 128 and 159 | ||
| 1449 | inclusive) are displayed as octal escapes. You can change this for | ||
| 1450 | non-standard ``extended'' versions of ISO-8859 character sets by using the | ||
| 1451 | function @code{standard-display-8bit} in the @code{disp-table} library. | ||
| 1452 | |||
| 1453 | There are two ways to input single-byte non-@acronym{ASCII} | ||
| 1454 | characters: | ||
| 1455 | |||
| 1456 | @itemize @bullet | ||
| 1457 | @cindex 8-bit input | ||
| 1458 | @item | ||
| 1459 | You can use an input method for the selected language environment. | ||
| 1460 | @xref{Input Methods}. When you use an input method in a unibyte buffer, | ||
| 1461 | the non-@acronym{ASCII} character you specify with it is converted to unibyte. | ||
| 1462 | |||
| 1463 | @item | ||
| 1464 | If your keyboard can generate character codes 128 (decimal) and up, | ||
| 1465 | representing non-@acronym{ASCII} characters, you can type those character codes | ||
| 1466 | directly. | ||
| 1467 | |||
| 1468 | On a graphical display, you should not need to do anything special to use | ||
| 1469 | these keys; they should simply work. On a text-only terminal, you | ||
| 1470 | should use the command @code{M-x set-keyboard-coding-system} or the | ||
| 1471 | variable @code{keyboard-coding-system} to specify which coding system | ||
| 1472 | your keyboard uses (@pxref{Terminal Coding}). Enabling this feature | ||
| 1473 | will probably require you to use @kbd{ESC} to type Meta characters; | ||
| 1474 | however, on a console terminal or in @code{xterm}, you can arrange for | ||
| 1475 | Meta to be converted to @kbd{ESC} and still be able type 8-bit | ||
| 1476 | characters present directly on the keyboard or using @kbd{Compose} or | ||
| 1477 | @kbd{AltGr} keys. @xref{User Input}. | ||
| 1478 | |||
| 1479 | @kindex C-x 8 | ||
| 1480 | @cindex @code{iso-transl} library | ||
| 1481 | @cindex compose character | ||
| 1482 | @cindex dead character | ||
| 1483 | @item | ||
| 1484 | For Latin-1 only, you can use the key @kbd{C-x 8} as a ``compose | ||
| 1485 | character'' prefix for entry of non-@acronym{ASCII} Latin-1 printing | ||
| 1486 | characters. @kbd{C-x 8} is good for insertion (in the minibuffer as | ||
| 1487 | well as other buffers), for searching, and in any other context where | ||
| 1488 | a key sequence is allowed. | ||
| 1489 | |||
| 1490 | @kbd{C-x 8} works by loading the @code{iso-transl} library. Once that | ||
| 1491 | library is loaded, the @key{ALT} modifier key, if the keyboard has | ||
| 1492 | one, serves the same purpose as @kbd{C-x 8}: use @key{ALT} together | ||
| 1493 | with an accent character to modify the following letter. In addition, | ||
| 1494 | if the keyboard has keys for the Latin-1 ``dead accent characters,'' | ||
| 1495 | they too are defined to compose with the following character, once | ||
| 1496 | @code{iso-transl} is loaded. | ||
| 1497 | |||
| 1498 | Use @kbd{C-x 8 C-h} to list all the available @kbd{C-x 8} translations. | ||
| 1499 | @end itemize | ||
| 1500 | |||
| 1501 | @node Charsets | ||
| 1502 | @section Charsets | ||
| 1503 | @cindex charsets | ||
| 1504 | |||
| 1505 | Emacs groups all supported characters into disjoint @dfn{charsets}. | ||
| 1506 | Each character code belongs to one and only one charset. For | ||
| 1507 | historical reasons, Emacs typically divides an 8-bit character code | ||
| 1508 | for an extended version of @acronym{ASCII} into two charsets: | ||
| 1509 | @acronym{ASCII}, which covers the codes 0 through 127, plus another | ||
| 1510 | charset which covers the ``right-hand part'' (the codes 128 and up). | ||
| 1511 | For instance, the characters of Latin-1 include the Emacs charset | ||
| 1512 | @code{ascii} plus the Emacs charset @code{latin-iso8859-1}. | ||
| 1513 | |||
| 1514 | Emacs characters belonging to different charsets may look the same, | ||
| 1515 | but they are still different characters. For example, the letter | ||
| 1516 | @samp{o} with acute accent in charset @code{latin-iso8859-1}, used for | ||
| 1517 | Latin-1, is different from the letter @samp{o} with acute accent in | ||
| 1518 | charset @code{latin-iso8859-2}, used for Latin-2. | ||
| 1519 | |||
| 1520 | @findex list-charset-chars | ||
| 1521 | @cindex characters in a certain charset | ||
| 1522 | @findex describe-character-set | ||
| 1523 | There are two commands for obtaining information about Emacs | ||
| 1524 | charsets. The command @kbd{M-x list-charset-chars} prompts for a name | ||
| 1525 | of a character set, and displays all the characters in that character | ||
| 1526 | set. The command @kbd{M-x describe-character-set} prompts for a | ||
| 1527 | charset name and displays information about that charset, including | ||
| 1528 | its internal representation within Emacs. | ||
| 1529 | |||
| 1530 | To find out which charset a character in the buffer belongs to, | ||
| 1531 | put point before it and type @kbd{C-u C-x =}. | ||
| 1532 | |||
| 1533 | @ignore | ||
| 1534 | arch-tag: 310ba60d-31ef-4ce7-91f1-f282dd57b6b3 | ||
| 1535 | @end ignore | ||
diff --git a/doc/emacs/picture-xtra.texi b/doc/emacs/picture-xtra.texi new file mode 100644 index 00000000000..ad3b9f27cc5 --- /dev/null +++ b/doc/emacs/picture-xtra.texi | |||
| @@ -0,0 +1,291 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | @c | ||
| 5 | @c This file is included either in emacs-xtra.texi (when producing the | ||
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | ||
| 7 | @node Picture Mode | ||
| 8 | @chapter Editing Pictures | ||
| 9 | @cindex pictures | ||
| 10 | @cindex making pictures out of text characters | ||
| 11 | @findex edit-picture | ||
| 12 | |||
| 13 | To edit a picture made out of text characters (for example, a picture | ||
| 14 | of the division of a register into fields, as a comment in a program), | ||
| 15 | use the command @kbd{M-x edit-picture} to enter Picture mode. | ||
| 16 | |||
| 17 | In Picture mode, editing is based on the @dfn{quarter-plane} model of | ||
| 18 | text, according to which the text characters lie studded on an area that | ||
| 19 | stretches infinitely far to the right and downward. The concept of the end | ||
| 20 | of a line does not exist in this model; the most you can say is where the | ||
| 21 | last nonblank character on the line is found. | ||
| 22 | |||
| 23 | Of course, Emacs really always considers text as a sequence of | ||
| 24 | characters, and lines really do have ends. But Picture mode replaces | ||
| 25 | the most frequently-used commands with variants that simulate the | ||
| 26 | quarter-plane model of text. They do this by inserting spaces or by | ||
| 27 | converting tabs to spaces. | ||
| 28 | |||
| 29 | Most of the basic editing commands of Emacs are redefined by Picture mode | ||
| 30 | to do essentially the same thing but in a quarter-plane way. In addition, | ||
| 31 | Picture mode defines various keys starting with the @kbd{C-c} prefix to | ||
| 32 | run special picture editing commands. | ||
| 33 | |||
| 34 | One of these keys, @kbd{C-c C-c}, is particularly important. Often a | ||
| 35 | picture is part of a larger file that is usually edited in some other | ||
| 36 | major mode. @kbd{M-x edit-picture} records the name of the previous | ||
| 37 | major mode so you can use the @kbd{C-c C-c} command | ||
| 38 | (@code{picture-mode-exit}) later to go back to that mode. @kbd{C-c C-c} | ||
| 39 | also deletes spaces from the ends of lines, unless given a numeric | ||
| 40 | argument. | ||
| 41 | |||
| 42 | The special commands of Picture mode all work in other modes (provided | ||
| 43 | the @file{picture} library is loaded), but are not bound to keys except | ||
| 44 | in Picture mode. The descriptions below talk of moving ``one column'' | ||
| 45 | and so on, but all the picture mode commands handle numeric arguments as | ||
| 46 | their normal equivalents do. | ||
| 47 | |||
| 48 | @vindex picture-mode-hook | ||
| 49 | Turning on Picture mode runs the hook @code{picture-mode-hook}. | ||
| 50 | Additional extensions to Picture mode can be found in | ||
| 51 | @file{artist.el}. | ||
| 52 | |||
| 53 | @menu | ||
| 54 | * Basic Picture:: Basic concepts and simple commands of Picture Mode. | ||
| 55 | * Insert in Picture:: Controlling direction of cursor motion | ||
| 56 | after "self-inserting" characters. | ||
| 57 | * Tabs in Picture:: Various features for tab stops and indentation. | ||
| 58 | * Rectangles in Picture:: Clearing and superimposing rectangles. | ||
| 59 | @end menu | ||
| 60 | |||
| 61 | @node Basic Picture | ||
| 62 | @section Basic Editing in Picture Mode | ||
| 63 | |||
| 64 | @findex picture-forward-column | ||
| 65 | @findex picture-backward-column | ||
| 66 | @findex picture-move-down | ||
| 67 | @findex picture-move-up | ||
| 68 | @cindex editing in Picture mode | ||
| 69 | |||
| 70 | Most keys do the same thing in Picture mode that they usually do, but | ||
| 71 | do it in a quarter-plane style. For example, @kbd{C-f} is rebound to | ||
| 72 | run @code{picture-forward-column}, a command which moves point one | ||
| 73 | column to the right, inserting a space if necessary so that the actual | ||
| 74 | end of the line makes no difference. @kbd{C-b} is rebound to run | ||
| 75 | @code{picture-backward-column}, which always moves point left one | ||
| 76 | column, converting a tab to multiple spaces if necessary. @kbd{C-n} and | ||
| 77 | @kbd{C-p} are rebound to run @code{picture-move-down} and | ||
| 78 | @code{picture-move-up}, which can either insert spaces or convert tabs | ||
| 79 | as necessary to make sure that point stays in exactly the same column. | ||
| 80 | @kbd{C-e} runs @code{picture-end-of-line}, which moves to after the last | ||
| 81 | nonblank character on the line. There is no need to change @kbd{C-a}, | ||
| 82 | as the choice of screen model does not affect beginnings of | ||
| 83 | lines. | ||
| 84 | |||
| 85 | @findex picture-newline | ||
| 86 | Insertion of text is adapted to the quarter-plane screen model | ||
| 87 | through the use of Overwrite mode | ||
| 88 | @iftex | ||
| 89 | (@pxref{Minor Modes,,, emacs, the Emacs Manual}.) | ||
| 90 | @end iftex | ||
| 91 | @ifnottex | ||
| 92 | (@pxref{Minor Modes}.) | ||
| 93 | @end ifnottex | ||
| 94 | Self-inserting characters replace existing text, column by column, | ||
| 95 | rather than pushing existing text to the right. @key{RET} runs | ||
| 96 | @code{picture-newline}, which just moves to the beginning of the | ||
| 97 | following line so that new text will replace that line. | ||
| 98 | |||
| 99 | @findex picture-backward-clear-column | ||
| 100 | @findex picture-clear-column | ||
| 101 | @findex picture-clear-line | ||
| 102 | In Picture mode, the commands that normally delete or kill text, | ||
| 103 | instead erase text (replacing it with spaces). @key{DEL} | ||
| 104 | (@code{picture-backward-clear-column}) replaces the preceding | ||
| 105 | character with a space rather than removing it; this moves point | ||
| 106 | backwards. @kbd{C-d} (@code{picture-clear-column}) replaces the next | ||
| 107 | character or characters with spaces, but does not move point. (If you | ||
| 108 | want to clear characters to spaces and move forward over them, use | ||
| 109 | @key{SPC}.) @kbd{C-k} (@code{picture-clear-line}) really kills the | ||
| 110 | contents of lines, but does not delete the newlines from the buffer. | ||
| 111 | |||
| 112 | @findex picture-open-line | ||
| 113 | To do actual insertion, you must use special commands. @kbd{C-o} | ||
| 114 | (@code{picture-open-line}) creates a blank line after the current | ||
| 115 | line; it never splits a line. @kbd{C-M-o} (@code{split-line}) makes | ||
| 116 | sense in Picture mode, so it is not changed. @kbd{C-j} | ||
| 117 | (@code{picture-duplicate-line}) inserts another line with the same | ||
| 118 | contents below the current line. | ||
| 119 | |||
| 120 | @kindex C-c C-d @r{(Picture mode)} | ||
| 121 | To do actual deletion in Picture mode, use @kbd{C-w}, @kbd{C-c C-d} | ||
| 122 | (which is defined as @code{delete-char}, as @kbd{C-d} is in other | ||
| 123 | modes), or one of the picture rectangle commands (@pxref{Rectangles in | ||
| 124 | Picture}). | ||
| 125 | |||
| 126 | @node Insert in Picture | ||
| 127 | @section Controlling Motion after Insert | ||
| 128 | |||
| 129 | @findex picture-movement-up | ||
| 130 | @findex picture-movement-down | ||
| 131 | @findex picture-movement-left | ||
| 132 | @findex picture-movement-right | ||
| 133 | @findex picture-movement-nw | ||
| 134 | @findex picture-movement-ne | ||
| 135 | @findex picture-movement-sw | ||
| 136 | @findex picture-movement-se | ||
| 137 | @kindex C-c < @r{(Picture mode)} | ||
| 138 | @kindex C-c > @r{(Picture mode)} | ||
| 139 | @kindex C-c ^ @r{(Picture mode)} | ||
| 140 | @kindex C-c . @r{(Picture mode)} | ||
| 141 | @kindex C-c ` @r{(Picture mode)} | ||
| 142 | @kindex C-c ' @r{(Picture mode)} | ||
| 143 | @kindex C-c / @r{(Picture mode)} | ||
| 144 | @kindex C-c \ @r{(Picture mode)} | ||
| 145 | Since ``self-inserting'' characters in Picture mode overwrite and move | ||
| 146 | point, there is no essential restriction on how point should be moved. | ||
| 147 | Normally point moves right, but you can specify any of the eight | ||
| 148 | orthogonal or diagonal directions for motion after a ``self-inserting'' | ||
| 149 | character. This is useful for drawing lines in the buffer. | ||
| 150 | |||
| 151 | @table @kbd | ||
| 152 | @item C-c < | ||
| 153 | @itemx C-c @key{LEFT} | ||
| 154 | Move left after insertion (@code{picture-movement-left}). | ||
| 155 | @item C-c > | ||
| 156 | @itemx C-c @key{RIGHT} | ||
| 157 | Move right after insertion (@code{picture-movement-right}). | ||
| 158 | @item C-c ^ | ||
| 159 | @itemx C-c @key{UP} | ||
| 160 | Move up after insertion (@code{picture-movement-up}). | ||
| 161 | @item C-c . | ||
| 162 | @itemx C-c @key{DOWN} | ||
| 163 | Move down after insertion (@code{picture-movement-down}). | ||
| 164 | @item C-c ` | ||
| 165 | @itemx C-c @key{HOME} | ||
| 166 | Move up and left (``northwest'') after insertion (@code{picture-movement-nw}). | ||
| 167 | @item C-c ' | ||
| 168 | @itemx C-c @key{PAGEUP} | ||
| 169 | Move up and right (``northeast'') after insertion | ||
| 170 | (@code{picture-movement-ne}). | ||
| 171 | @item C-c / | ||
| 172 | @itemx C-c @key{END} | ||
| 173 | Move down and left (``southwest'') after insertion | ||
| 174 | @*(@code{picture-movement-sw}). | ||
| 175 | @item C-c \ | ||
| 176 | @itemx C-c @key{PAGEDOWN} | ||
| 177 | Move down and right (``southeast'') after insertion | ||
| 178 | @*(@code{picture-movement-se}). | ||
| 179 | @end table | ||
| 180 | |||
| 181 | @kindex C-c C-f @r{(Picture mode)} | ||
| 182 | @kindex C-c C-b @r{(Picture mode)} | ||
| 183 | @findex picture-motion | ||
| 184 | @findex picture-motion-reverse | ||
| 185 | Two motion commands move based on the current Picture insertion | ||
| 186 | direction. The command @kbd{C-c C-f} (@code{picture-motion}) moves in the | ||
| 187 | same direction as motion after ``insertion'' currently does, while @kbd{C-c | ||
| 188 | C-b} (@code{picture-motion-reverse}) moves in the opposite direction. | ||
| 189 | |||
| 190 | @node Tabs in Picture | ||
| 191 | @section Picture Mode Tabs | ||
| 192 | |||
| 193 | @kindex M-TAB @r{(Picture mode)} | ||
| 194 | @findex picture-tab-search | ||
| 195 | @vindex picture-tab-chars | ||
| 196 | Two kinds of tab-like action are provided in Picture mode. Use | ||
| 197 | @kbd{M-@key{TAB}} (@code{picture-tab-search}) for context-based tabbing. | ||
| 198 | With no argument, it moves to a point underneath the next | ||
| 199 | ``interesting'' character that follows whitespace in the previous | ||
| 200 | nonblank line. ``Next'' here means ``appearing at a horizontal position | ||
| 201 | greater than the one point starts out at.'' With an argument, as in | ||
| 202 | @kbd{C-u M-@key{TAB}}, this command moves to the next such interesting | ||
| 203 | character in the current line. @kbd{M-@key{TAB}} does not change the | ||
| 204 | text; it only moves point. ``Interesting'' characters are defined by | ||
| 205 | the variable @code{picture-tab-chars}, which should define a set of | ||
| 206 | characters. The syntax for this variable is like the syntax used inside | ||
| 207 | of @samp{[@dots{}]} in a regular expression---but without the @samp{[} | ||
| 208 | and the @samp{]}. Its default value is @code{"!-~"}. | ||
| 209 | |||
| 210 | @findex picture-tab | ||
| 211 | @key{TAB} itself runs @code{picture-tab}, which operates based on the | ||
| 212 | current tab stop settings; it is the Picture mode equivalent of | ||
| 213 | @code{tab-to-tab-stop}. Normally it just moves point, but with a numeric | ||
| 214 | argument it clears the text that it moves over. | ||
| 215 | |||
| 216 | @kindex C-c TAB @r{(Picture mode)} | ||
| 217 | @findex picture-set-tab-stops | ||
| 218 | The context-based and tab-stop-based forms of tabbing are brought | ||
| 219 | together by the command @kbd{C-c @key{TAB}} (@code{picture-set-tab-stops}). | ||
| 220 | This command sets the tab stops to the positions which @kbd{M-@key{TAB}} | ||
| 221 | would consider significant in the current line. The use of this command, | ||
| 222 | together with @key{TAB}, can get the effect of context-based tabbing. But | ||
| 223 | @kbd{M-@key{TAB}} is more convenient in the cases where it is sufficient. | ||
| 224 | |||
| 225 | It may be convenient to prevent use of actual tab characters in | ||
| 226 | pictures. For example, this prevents @kbd{C-x @key{TAB}} from messing | ||
| 227 | up the picture. You can do this by setting the variable | ||
| 228 | @code{indent-tabs-mode} to @code{nil}. | ||
| 229 | |||
| 230 | @node Rectangles in Picture | ||
| 231 | @section Picture Mode Rectangle Commands | ||
| 232 | @cindex rectangles and Picture mode | ||
| 233 | @cindex Picture mode and rectangles | ||
| 234 | |||
| 235 | Picture mode defines commands for working on rectangular pieces of | ||
| 236 | the text in ways that fit with the quarter-plane model. The standard | ||
| 237 | rectangle commands may also be useful. | ||
| 238 | @iftex | ||
| 239 | @xref{Rectangles,,, emacs, the Emacs Manual}. | ||
| 240 | @end iftex | ||
| 241 | @ifnottex | ||
| 242 | @xref{Rectangles}. | ||
| 243 | @end ifnottex | ||
| 244 | |||
| 245 | @table @kbd | ||
| 246 | @item C-c C-k | ||
| 247 | Clear out the region-rectangle with spaces | ||
| 248 | (@code{picture-clear-rectangle}). With argument, delete the text. | ||
| 249 | @item C-c C-w @var{r} | ||
| 250 | Similar, but save rectangle contents in register @var{r} first | ||
| 251 | (@code{picture-clear-rectangle-to-register}). | ||
| 252 | @item C-c C-y | ||
| 253 | Copy last killed rectangle into the buffer by overwriting, with upper | ||
| 254 | left corner at point (@code{picture-yank-rectangle}). With argument, | ||
| 255 | insert instead. | ||
| 256 | @item C-c C-x @var{r} | ||
| 257 | Similar, but use the rectangle in register @var{r} | ||
| 258 | (@code{picture-yank-rectangle-from-register}). | ||
| 259 | @end table | ||
| 260 | |||
| 261 | @kindex C-c C-k @r{(Picture mode)} | ||
| 262 | @kindex C-c C-w @r{(Picture mode)} | ||
| 263 | @findex picture-clear-rectangle | ||
| 264 | @findex picture-clear-rectangle-to-register | ||
| 265 | The picture rectangle commands @kbd{C-c C-k} | ||
| 266 | (@code{picture-clear-rectangle}) and @kbd{C-c C-w} | ||
| 267 | (@code{picture-clear-rectangle-to-register}) differ from the standard | ||
| 268 | rectangle commands in that they normally clear the rectangle instead of | ||
| 269 | deleting it; this is analogous with the way @kbd{C-d} is changed in Picture | ||
| 270 | mode. | ||
| 271 | |||
| 272 | However, deletion of rectangles can be useful in Picture mode, so | ||
| 273 | these commands delete the rectangle if given a numeric argument. | ||
| 274 | @kbd{C-c C-k} either with or without a numeric argument saves the | ||
| 275 | rectangle for @kbd{C-c C-y}. | ||
| 276 | |||
| 277 | @kindex C-c C-y @r{(Picture mode)} | ||
| 278 | @kindex C-c C-x @r{(Picture mode)} | ||
| 279 | @findex picture-yank-rectangle | ||
| 280 | @findex picture-yank-rectangle-from-register | ||
| 281 | The Picture mode commands for yanking rectangles differ from the | ||
| 282 | standard ones in that they overwrite instead of inserting. This is | ||
| 283 | the same way that Picture mode insertion of other text differs from | ||
| 284 | other modes. @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts | ||
| 285 | (by overwriting) the rectangle that was most recently killed, while | ||
| 286 | @kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does | ||
| 287 | likewise for the rectangle found in a specified register. | ||
| 288 | |||
| 289 | @ignore | ||
| 290 | arch-tag: 10e423ad-d896-42f2-a7e8-7018adeaf8c2 | ||
| 291 | @end ignore | ||
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi new file mode 100644 index 00000000000..2472d7daabe --- /dev/null +++ b/doc/emacs/programs.texi | |||
| @@ -0,0 +1,1773 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000, | ||
| 3 | @c 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Programs, Building, Text, Top | ||
| 6 | @chapter Editing Programs | ||
| 7 | @cindex Lisp editing | ||
| 8 | @cindex C editing | ||
| 9 | @cindex program editing | ||
| 10 | |||
| 11 | Emacs provides many features to facilitate editing programs. Some | ||
| 12 | of these features can | ||
| 13 | |||
| 14 | @itemize @bullet | ||
| 15 | @item | ||
| 16 | Find or move over top-level definitions (@pxref{Defuns}). | ||
| 17 | @item | ||
| 18 | Apply the usual indentation conventions of the language | ||
| 19 | (@pxref{Program Indent}). | ||
| 20 | @item | ||
| 21 | Balance parentheses (@pxref{Parentheses}). | ||
| 22 | @item | ||
| 23 | Insert, kill or align comments (@pxref{Comments}). | ||
| 24 | @item | ||
| 25 | Highlight program syntax (@pxref{Font Lock}). | ||
| 26 | @end itemize | ||
| 27 | |||
| 28 | This chapter describes these features and many more. | ||
| 29 | |||
| 30 | @menu | ||
| 31 | * Program Modes:: Major modes for editing programs. | ||
| 32 | * Defuns:: Commands to operate on major top-level parts | ||
| 33 | of a program. | ||
| 34 | * Program Indent:: Adjusting indentation to show the nesting. | ||
| 35 | * Parentheses:: Commands that operate on parentheses. | ||
| 36 | * Comments:: Inserting, killing, and aligning comments. | ||
| 37 | * Documentation:: Getting documentation of functions you plan to call. | ||
| 38 | * Hideshow:: Displaying blocks selectively. | ||
| 39 | * Symbol Completion:: Completion on symbol names of your program or language. | ||
| 40 | * Glasses:: Making identifiersLikeThis more readable. | ||
| 41 | * Misc for Programs:: Other Emacs features useful for editing programs. | ||
| 42 | * C Modes:: Special commands of C, C++, Objective-C, | ||
| 43 | Java, and Pike modes. | ||
| 44 | * Asm Mode:: Asm mode and its special features. | ||
| 45 | @ifnottex | ||
| 46 | * Fortran:: Fortran mode and its special features. | ||
| 47 | @end ifnottex | ||
| 48 | @end menu | ||
| 49 | |||
| 50 | @node Program Modes | ||
| 51 | @section Major Modes for Programming Languages | ||
| 52 | @cindex modes for programming languages | ||
| 53 | |||
| 54 | Emacs has specialized major modes for various programming languages. | ||
| 55 | @xref{Major Modes}. A programming language major mode typically | ||
| 56 | specifies the syntax of expressions, the customary rules for | ||
| 57 | indentation, how to do syntax highlighting for the language, and how | ||
| 58 | to find the beginning of a function definition. It often customizes | ||
| 59 | or provides facilities for compiling and debugging programs as well. | ||
| 60 | |||
| 61 | Ideally, Emacs should provide a major mode for each programming | ||
| 62 | language that you might want to edit; if it doesn't have a mode for | ||
| 63 | your favorite language, you can contribute one. But often the mode | ||
| 64 | for one language can serve for other syntactically similar languages. | ||
| 65 | The major mode for language @var{l} is called @code{@var{l}-mode}, | ||
| 66 | and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}. | ||
| 67 | @xref{Choosing Modes}. | ||
| 68 | |||
| 69 | @cindex Perl mode | ||
| 70 | @cindex Icon mode | ||
| 71 | @cindex Makefile mode | ||
| 72 | @cindex Tcl mode | ||
| 73 | @cindex CPerl mode | ||
| 74 | @cindex DSSSL mode | ||
| 75 | @cindex Octave mode | ||
| 76 | @cindex Metafont mode | ||
| 77 | @cindex Modula2 mode | ||
| 78 | @cindex Prolog mode | ||
| 79 | @cindex Python mode | ||
| 80 | @cindex Simula mode | ||
| 81 | @cindex VHDL mode | ||
| 82 | @cindex M4 mode | ||
| 83 | @cindex Shell-script mode | ||
| 84 | @cindex Delphi mode | ||
| 85 | @cindex PostScript mode | ||
| 86 | @cindex Conf mode | ||
| 87 | @cindex DNS mode | ||
| 88 | The existing programming language major modes include Lisp, Scheme (a | ||
| 89 | variant of Lisp) and the Scheme-based DSSSL expression language, Ada, | ||
| 90 | ASM, AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed | ||
| 91 | format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s | ||
| 92 | companion for font creation), Modula2, Objective-C, Octave, Pascal, | ||
| 93 | Perl, Pike, PostScript, Prolog, Python, Simula, Tcl, and VHDL. An | ||
| 94 | alternative mode for Perl is called CPerl mode. Modes are available for | ||
| 95 | the scripting languages of the common GNU and Unix shells, VMS DCL, and | ||
| 96 | MS-DOS/MS-Windows @samp{BAT} files. There are also major modes for | ||
| 97 | editing makefiles, DNS master files, and various sorts of configuration | ||
| 98 | files. | ||
| 99 | |||
| 100 | @kindex DEL @r{(programming modes)} | ||
| 101 | @findex c-electric-backspace | ||
| 102 | In most programming languages, indentation should vary from line to | ||
| 103 | line to illustrate the structure of the program. So the major modes | ||
| 104 | for programming languages arrange for @key{TAB} to update the | ||
| 105 | indentation of the current line. They also rebind @key{DEL} to treat | ||
| 106 | a tab as if it were the equivalent number of spaces; this lets you | ||
| 107 | delete one column of indentation without worrying whether the | ||
| 108 | whitespace consists of spaces or tabs. Use @kbd{C-b C-d} to delete a | ||
| 109 | tab character before point, in these modes. | ||
| 110 | |||
| 111 | Separate manuals are available for the modes for Ada (@pxref{Top, , Ada | ||
| 112 | Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK | ||
| 113 | (@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes | ||
| 114 | (@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}). For Fortran | ||
| 115 | mode, see | ||
| 116 | @iftex | ||
| 117 | @ref{Fortran,,, emacs-xtra, Specialized Emacs Features}. | ||
| 118 | @end iftex | ||
| 119 | @ifnottex | ||
| 120 | @ref{Fortran}. | ||
| 121 | @end ifnottex | ||
| 122 | |||
| 123 | |||
| 124 | @cindex mode hook | ||
| 125 | @vindex c-mode-hook | ||
| 126 | @vindex lisp-mode-hook | ||
| 127 | @vindex emacs-lisp-mode-hook | ||
| 128 | @vindex lisp-interaction-mode-hook | ||
| 129 | @vindex scheme-mode-hook | ||
| 130 | Turning on a major mode runs a normal hook called the @dfn{mode | ||
| 131 | hook}, which is the value of a Lisp variable. Each major mode has a | ||
| 132 | mode hook, and the hook's name is always made from the mode command's | ||
| 133 | name by adding @samp{-hook}. For example, turning on C mode runs the | ||
| 134 | hook @code{c-mode-hook}, while turning on Lisp mode runs the hook | ||
| 135 | @code{lisp-mode-hook}. The purpose of the mode hook is to give you a | ||
| 136 | place to set up customizations for that major mode. @xref{Hooks}. | ||
| 137 | |||
| 138 | @node Defuns | ||
| 139 | @section Top-Level Definitions, or Defuns | ||
| 140 | |||
| 141 | In Emacs, a major definition at the top level in the buffer, | ||
| 142 | something like a function, is called a @dfn{defun}. The name comes | ||
| 143 | from Lisp, but in Emacs we use it for all languages. | ||
| 144 | |||
| 145 | @menu | ||
| 146 | * Left Margin Paren:: An open-paren or similar opening delimiter | ||
| 147 | starts a defun if it is at the left margin. | ||
| 148 | * Moving by Defuns:: Commands to move over or mark a major definition. | ||
| 149 | * Imenu:: Making buffer indexes as menus. | ||
| 150 | * Which Function:: Which Function mode shows which function you are in. | ||
| 151 | @end menu | ||
| 152 | |||
| 153 | @node Left Margin Paren | ||
| 154 | @subsection Left Margin Convention | ||
| 155 | |||
| 156 | @cindex open-parenthesis in leftmost column | ||
| 157 | @cindex ( in leftmost column | ||
| 158 | Emacs assumes by default that any opening delimiter found at the | ||
| 159 | left margin is the start of a top-level definition, or defun. | ||
| 160 | Therefore, @strong{don't put an opening delimiter at the left margin | ||
| 161 | unless it should have that significance}. For instance, never put an | ||
| 162 | open-parenthesis at the left margin in a Lisp file unless it is the | ||
| 163 | start of a top-level list. | ||
| 164 | |||
| 165 | If you don't follow this convention, not only will you have trouble | ||
| 166 | when you explicitly use the commands for motion by defuns; other | ||
| 167 | features that use them will also give you trouble. This includes | ||
| 168 | the indentation commands (@pxref{Program Indent}) and Font Lock | ||
| 169 | mode (@pxref{Font Lock}). | ||
| 170 | |||
| 171 | The most likely problem case is when you want an opening delimiter | ||
| 172 | at the start of a line inside a string. To avoid trouble, put an | ||
| 173 | escape character (@samp{\}, in C and Emacs Lisp, @samp{/} in some | ||
| 174 | other Lisp dialects) before the opening delimiter. This will not | ||
| 175 | affect the contents of the string, but will prevent that opening | ||
| 176 | delimiter from starting a defun. Here's an example: | ||
| 177 | |||
| 178 | @example | ||
| 179 | (insert "Foo: | ||
| 180 | \(bar) | ||
| 181 | ") | ||
| 182 | @end example | ||
| 183 | |||
| 184 | To help you catch violations of this convention, Font Lock mode | ||
| 185 | highlights confusing opening delimiters (those that ought to be | ||
| 186 | quoted) in bold red. | ||
| 187 | |||
| 188 | If you need to override this convention, you can so by setting this | ||
| 189 | user option: | ||
| 190 | |||
| 191 | @defvar open-paren-in-column-0-is-defun-start | ||
| 192 | If this user option is set to @code{t} (the default), opening | ||
| 193 | parentheses or braces at column zero always start defuns. When it's | ||
| 194 | @code{nil}, defuns are found by searching for parens or braces at the | ||
| 195 | outermost level. | ||
| 196 | @end defvar | ||
| 197 | |||
| 198 | Usually, you shouldn't need to set | ||
| 199 | @code{open-paren-in-column-0-is-defun-start} to @code{nil}. However, | ||
| 200 | if your buffer contains parentheses or braces in column zero which | ||
| 201 | don't start defuns and this confuses Emacs, it sometimes helps to set | ||
| 202 | the option to @code{nil}. Be aware, though, that this will make | ||
| 203 | scrolling and display in large buffers quite sluggish, and that | ||
| 204 | parentheses and braces must be correctly matched throughout the buffer | ||
| 205 | for it to work properly. | ||
| 206 | |||
| 207 | In the earliest days, the original Emacs found defuns by moving | ||
| 208 | upward a level of parentheses or braces until there were no more | ||
| 209 | levels to go up. This always required scanning all the way back to | ||
| 210 | the beginning of the buffer, even for a small function. To speed up | ||
| 211 | the operation, we changed Emacs to assume that any opening delimiter | ||
| 212 | at the left margin is the start of a defun. This heuristic is nearly | ||
| 213 | always right, and avoids the need to scan back to the beginning of the | ||
| 214 | buffer. However, now that modern computers are so powerful, this | ||
| 215 | scanning is rarely slow enough to annoy, so we've provided a way to | ||
| 216 | disable the heuristic. | ||
| 217 | |||
| 218 | @node Moving by Defuns | ||
| 219 | @subsection Moving by Defuns | ||
| 220 | @cindex defuns | ||
| 221 | |||
| 222 | These commands move point or set up the region based on top-level | ||
| 223 | major definitions, also called @dfn{defuns}. | ||
| 224 | |||
| 225 | @table @kbd | ||
| 226 | @item C-M-a | ||
| 227 | Move to beginning of current or preceding defun | ||
| 228 | (@code{beginning-of-defun}). | ||
| 229 | @item C-M-e | ||
| 230 | Move to end of current or following defun (@code{end-of-defun}). | ||
| 231 | @item C-M-h | ||
| 232 | Put region around whole current or following defun (@code{mark-defun}). | ||
| 233 | @end table | ||
| 234 | |||
| 235 | @cindex move to beginning or end of function | ||
| 236 | @cindex function, move to beginning or end | ||
| 237 | @kindex C-M-a | ||
| 238 | @kindex C-M-e | ||
| 239 | @kindex C-M-h | ||
| 240 | @findex beginning-of-defun | ||
| 241 | @findex end-of-defun | ||
| 242 | @findex mark-defun | ||
| 243 | The commands to move to the beginning and end of the current defun | ||
| 244 | are @kbd{C-M-a} (@code{beginning-of-defun}) and @kbd{C-M-e} | ||
| 245 | (@code{end-of-defun}). If you repeat one of these commands, or use a | ||
| 246 | positive numeric argument, each repetition moves to the next defun in | ||
| 247 | the direction of motion. | ||
| 248 | |||
| 249 | @kbd{C-M-a} with a negative argument @minus{}@var{n} moves forward | ||
| 250 | @var{n} times to the next beginning of a defun. This is not exactly | ||
| 251 | the same place that @kbd{C-M-e} with argument @var{n} would move to; | ||
| 252 | the end of this defun is not usually exactly the same place as the | ||
| 253 | beginning of the following defun. (Whitespace, comments, and perhaps | ||
| 254 | declarations can separate them.) Likewise, @kbd{C-M-e} with a | ||
| 255 | negative argument moves back to an end of a defun, which is not quite | ||
| 256 | the same as @kbd{C-M-a} with a positive argument. | ||
| 257 | |||
| 258 | @kindex C-M-h @r{(C mode)} | ||
| 259 | @findex c-mark-function | ||
| 260 | To operate on the current defun, use @kbd{C-M-h} (@code{mark-defun}) | ||
| 261 | which puts point at the beginning and mark at the end of the current | ||
| 262 | defun. This is the easiest way to get ready to kill the defun in | ||
| 263 | order to move it to a different place in the file. If you use the | ||
| 264 | command while point is between defuns, it uses the following defun. | ||
| 265 | Successive uses of @kbd{C-M-h}, or using it in Transient Mark mode | ||
| 266 | when the mark is active, extends the end of the region to include one | ||
| 267 | more defun each time. | ||
| 268 | |||
| 269 | In C mode, @kbd{C-M-h} runs the function @code{c-mark-function}, | ||
| 270 | which is almost the same as @code{mark-defun}; the difference is that | ||
| 271 | it backs up over the argument declarations, function name and returned | ||
| 272 | data type so that the entire C function is inside the region. This is | ||
| 273 | an example of how major modes adjust the standard key bindings so that | ||
| 274 | they do their standard jobs in a way better fitting a particular | ||
| 275 | language. Other major modes may replace any or all of these key | ||
| 276 | bindings for that purpose. | ||
| 277 | |||
| 278 | @node Imenu | ||
| 279 | @subsection Imenu | ||
| 280 | @cindex index of buffer definitions | ||
| 281 | @cindex buffer definitions index | ||
| 282 | @cindex tags | ||
| 283 | |||
| 284 | The Imenu facility offers a way to find the major definitions in | ||
| 285 | a file by name. It is also useful in text formatter major modes, | ||
| 286 | where it treats each chapter, section, etc., as a definition. | ||
| 287 | (@xref{Tags}, for a more powerful feature that handles multiple files | ||
| 288 | together.) | ||
| 289 | |||
| 290 | @findex imenu | ||
| 291 | If you type @kbd{M-x imenu}, it reads the name of a definition using | ||
| 292 | the minibuffer, then moves point to that definition. You can use | ||
| 293 | completion to specify the name; the command always displays the whole | ||
| 294 | list of valid names. | ||
| 295 | |||
| 296 | @findex imenu-add-menubar-index | ||
| 297 | Alternatively, you can bind the command @code{imenu} to a mouse | ||
| 298 | click. Then it displays mouse menus for you to select a definition | ||
| 299 | name. You can also add the buffer's index to the menu bar by calling | ||
| 300 | @code{imenu-add-menubar-index}. If you want to have this menu bar | ||
| 301 | item available for all buffers in a certain major mode, you can do | ||
| 302 | this by adding @code{imenu-add-menubar-index} to its mode hook. But | ||
| 303 | if you have done that, you will have to wait a little while each time | ||
| 304 | you visit a file in that mode, while Emacs finds all the definitions | ||
| 305 | in that buffer. | ||
| 306 | |||
| 307 | @vindex imenu-auto-rescan | ||
| 308 | When you change the contents of a buffer, if you add or delete | ||
| 309 | definitions, you can update the buffer's index based on the | ||
| 310 | new contents by invoking the @samp{*Rescan*} item in the menu. | ||
| 311 | Rescanning happens automatically if you set @code{imenu-auto-rescan} to | ||
| 312 | a non-@code{nil} value. There is no need to rescan because of small | ||
| 313 | changes in the text. | ||
| 314 | |||
| 315 | @vindex imenu-sort-function | ||
| 316 | You can customize the way the menus are sorted by setting the | ||
| 317 | variable @code{imenu-sort-function}. By default, names are ordered as | ||
| 318 | they occur in the buffer; if you want alphabetic sorting, use the | ||
| 319 | symbol @code{imenu--sort-by-name} as the value. You can also | ||
| 320 | define your own comparison function by writing Lisp code. | ||
| 321 | |||
| 322 | Imenu provides the information to guide Which Function mode | ||
| 323 | @ifnottex | ||
| 324 | (@pxref{Which Function}). | ||
| 325 | @end ifnottex | ||
| 326 | @iftex | ||
| 327 | (see below). | ||
| 328 | @end iftex | ||
| 329 | The Speedbar can also use it (@pxref{Speedbar}). | ||
| 330 | |||
| 331 | @node Which Function | ||
| 332 | @subsection Which Function Mode | ||
| 333 | @cindex current function name in mode line | ||
| 334 | |||
| 335 | Which Function mode is a minor mode that displays the current | ||
| 336 | function name in the mode line, updating it as you move around in a | ||
| 337 | buffer. | ||
| 338 | |||
| 339 | @findex which-function-mode | ||
| 340 | @vindex which-func-modes | ||
| 341 | To either enable or disable Which Function mode, use the command | ||
| 342 | @kbd{M-x which-function-mode}. This command is global; it applies to | ||
| 343 | all buffers, both existing ones and those yet to be created. However, | ||
| 344 | it takes effect only in certain major modes, those listed in the value | ||
| 345 | of @code{which-func-modes}. If the value is @code{t}, then Which | ||
| 346 | Function mode applies to all major modes that know how to support | ||
| 347 | it---in other words, all the major modes that support Imenu. | ||
| 348 | |||
| 349 | @node Program Indent | ||
| 350 | @section Indentation for Programs | ||
| 351 | @cindex indentation for programs | ||
| 352 | |||
| 353 | The best way to keep a program properly indented is to use Emacs to | ||
| 354 | reindent it as you change it. Emacs has commands to indent properly | ||
| 355 | either a single line, a specified number of lines, or all of the lines | ||
| 356 | inside a single parenthetical grouping. | ||
| 357 | |||
| 358 | @menu | ||
| 359 | * Basic Indent:: Indenting a single line. | ||
| 360 | * Multi-line Indent:: Commands to reindent many lines at once. | ||
| 361 | * Lisp Indent:: Specifying how each Lisp function should be indented. | ||
| 362 | * C Indent:: Extra features for indenting C and related modes. | ||
| 363 | * Custom C Indent:: Controlling indentation style for C and related modes. | ||
| 364 | @end menu | ||
| 365 | |||
| 366 | @cindex pretty-printer | ||
| 367 | Emacs also provides a Lisp pretty-printer in the library @code{pp}. | ||
| 368 | This program reformats a Lisp object with indentation chosen to look nice. | ||
| 369 | |||
| 370 | @node Basic Indent | ||
| 371 | @subsection Basic Program Indentation Commands | ||
| 372 | |||
| 373 | The basic indentation commands indent a single line according to the | ||
| 374 | usual conventions of the language you are editing. | ||
| 375 | |||
| 376 | @need 1000 | ||
| 377 | @table @kbd | ||
| 378 | @item @key{TAB} | ||
| 379 | Adjust indentation of current line. | ||
| 380 | @item C-j | ||
| 381 | Insert a newline, then adjust indentation of following line | ||
| 382 | (@code{newline-and-indent}). | ||
| 383 | @end table | ||
| 384 | |||
| 385 | @kindex TAB @r{(programming modes)} | ||
| 386 | @findex c-indent-command | ||
| 387 | @findex indent-line-function | ||
| 388 | @findex indent-for-tab-command | ||
| 389 | The basic indentation command is @key{TAB}, which gives the current line | ||
| 390 | the correct indentation as determined from the previous lines. The | ||
| 391 | function that @key{TAB} runs depends on the major mode; it is | ||
| 392 | @code{lisp-indent-line} | ||
| 393 | in Lisp mode, @code{c-indent-command} in C mode, etc. These functions | ||
| 394 | understand the syntax and conventions of different languages, but they all do | ||
| 395 | conceptually the same job: @key{TAB} in any programming-language major mode | ||
| 396 | inserts or deletes whitespace at the beginning of the current line, | ||
| 397 | independent of where point is in the line. If point was inside the | ||
| 398 | whitespace at the beginning of the line, @key{TAB} puts it at the end of | ||
| 399 | that whitespace; otherwise, @key{TAB} keeps point fixed with respect to | ||
| 400 | the characters around it. | ||
| 401 | |||
| 402 | Use @kbd{C-q @key{TAB}} to insert a tab character at point. | ||
| 403 | |||
| 404 | @kindex C-j | ||
| 405 | @findex newline-and-indent | ||
| 406 | When entering lines of new code, use @kbd{C-j} | ||
| 407 | (@code{newline-and-indent}), which inserts a newline and then adjusts | ||
| 408 | indentation after it. (It also deletes any trailing whitespace which | ||
| 409 | remains before the new newline.) Thus, @kbd{C-j} at the end of a line | ||
| 410 | creates a blank line with appropriate indentation. In programming | ||
| 411 | language modes, it is equivalent to @key{RET} @key{TAB}. | ||
| 412 | |||
| 413 | @key{TAB} indents a line that starts within a parenthetical grouping | ||
| 414 | under the preceding line within the grouping, or the text after the | ||
| 415 | parenthesis. Therefore, if you manually give one of these lines a | ||
| 416 | nonstandard indentation, the lines below will tend to follow it. This | ||
| 417 | behavior is convenient in cases where you have overridden the standard | ||
| 418 | result of @key{TAB} because you find it unaesthetic for a particular | ||
| 419 | line. | ||
| 420 | |||
| 421 | In some modes, an open-parenthesis, open-brace or other opening | ||
| 422 | delimiter at the left margin is assumed by Emacs (including the | ||
| 423 | indentation routines) to be the start of a function. This speeds up | ||
| 424 | indentation commands. If you will be editing text which contains | ||
| 425 | opening delimiters in column zero that aren't the beginning of a | ||
| 426 | functions, even inside strings or comments, you must set | ||
| 427 | @code{open-paren-in-column-0-is-defun-start}. @xref{Left Margin | ||
| 428 | Paren}, for more information on this. | ||
| 429 | |||
| 430 | Normally, lines are indented with tabs and spaces. If you want Emacs | ||
| 431 | to use spaces only, set @code{indent-tabs-mode} (@pxref{Just Spaces}). | ||
| 432 | |||
| 433 | @node Multi-line Indent | ||
| 434 | @subsection Indenting Several Lines | ||
| 435 | |||
| 436 | When you wish to reindent several lines of code which have been | ||
| 437 | altered or moved to a different level in the parenthesis structure, | ||
| 438 | you have several commands available. | ||
| 439 | |||
| 440 | @table @kbd | ||
| 441 | @item C-M-q | ||
| 442 | Reindent all the lines within one parenthetical grouping (@code{indent-pp-sexp}). | ||
| 443 | @item C-M-\ | ||
| 444 | Reindent all lines in the region (@code{indent-region}). | ||
| 445 | @item C-u @key{TAB} | ||
| 446 | Shift an entire parenthetical grouping rigidly sideways so that its | ||
| 447 | first line is properly indented. | ||
| 448 | @item M-x indent-code-rigidly | ||
| 449 | Shift all the lines in the region rigidly sideways, but do not alter | ||
| 450 | lines that start inside comments and strings. | ||
| 451 | @end table | ||
| 452 | |||
| 453 | @kindex C-M-q | ||
| 454 | @findex indent-pp-sexp | ||
| 455 | You can reindent the contents of a single parenthetical grouping by | ||
| 456 | positioning point before the beginning of it and typing @kbd{C-M-q} | ||
| 457 | (@code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode; also | ||
| 458 | bound to other suitable commands in other modes). The indentation of | ||
| 459 | the line where the grouping starts is not changed; therefore this | ||
| 460 | changes only the relative indentation within the grouping, not its | ||
| 461 | overall indentation. To correct that as well, type @key{TAB} first. | ||
| 462 | |||
| 463 | Another way to specify the range to be reindented is with the | ||
| 464 | region. The command @kbd{C-M-\} (@code{indent-region}) applies | ||
| 465 | @key{TAB} to every line whose first character is between point and | ||
| 466 | mark. | ||
| 467 | |||
| 468 | @kindex C-u TAB | ||
| 469 | If you like the relative indentation within a grouping, but not the | ||
| 470 | indentation of its first line, you can type @kbd{C-u @key{TAB}} to | ||
| 471 | reindent the whole grouping as a rigid unit. (This works in Lisp | ||
| 472 | modes and C and related modes.) @key{TAB} with a numeric argument | ||
| 473 | reindents the current line as usual, then reindents by the same amount | ||
| 474 | all the lines in the parenthetical grouping starting on the current | ||
| 475 | line. It is clever, though, and does not alter lines that start | ||
| 476 | inside strings. Neither does it alter C preprocessor lines when in C | ||
| 477 | mode, but it does reindent any continuation lines that may be attached | ||
| 478 | to them. | ||
| 479 | |||
| 480 | @findex indent-code-rigidly | ||
| 481 | You can also perform this operation on the region, using the command | ||
| 482 | @kbd{M-x indent-code-rigidly}. It rigidly shifts all the lines in the | ||
| 483 | region sideways, like @code{indent-rigidly} does (@pxref{Indentation | ||
| 484 | Commands}). It doesn't alter the indentation of lines that start | ||
| 485 | inside a string, unless the region also starts inside that string. | ||
| 486 | The prefix arg specifies the number of columns to indent. | ||
| 487 | |||
| 488 | @node Lisp Indent | ||
| 489 | @subsection Customizing Lisp Indentation | ||
| 490 | @cindex customizing Lisp indentation | ||
| 491 | |||
| 492 | The indentation pattern for a Lisp expression can depend on the function | ||
| 493 | called by the expression. For each Lisp function, you can choose among | ||
| 494 | several predefined patterns of indentation, or define an arbitrary one with | ||
| 495 | a Lisp program. | ||
| 496 | |||
| 497 | The standard pattern of indentation is as follows: the second line of the | ||
| 498 | expression is indented under the first argument, if that is on the same | ||
| 499 | line as the beginning of the expression; otherwise, the second line is | ||
| 500 | indented underneath the function name. Each following line is indented | ||
| 501 | under the previous line whose nesting depth is the same. | ||
| 502 | |||
| 503 | @vindex lisp-indent-offset | ||
| 504 | If the variable @code{lisp-indent-offset} is non-@code{nil}, it overrides | ||
| 505 | the usual indentation pattern for the second line of an expression, so that | ||
| 506 | such lines are always indented @code{lisp-indent-offset} more columns than | ||
| 507 | the containing list. | ||
| 508 | |||
| 509 | @vindex lisp-body-indent | ||
| 510 | Certain functions override the standard pattern. Functions whose | ||
| 511 | names start with @code{def} treat the second lines as the start of | ||
| 512 | a @dfn{body}, by indenting the second line @code{lisp-body-indent} | ||
| 513 | additional columns beyond the open-parenthesis that starts the | ||
| 514 | expression. | ||
| 515 | |||
| 516 | @cindex @code{lisp-indent-function} property | ||
| 517 | You can override the standard pattern in various ways for individual | ||
| 518 | functions, according to the @code{lisp-indent-function} property of | ||
| 519 | the function name. Normally you would use this for macro definitions | ||
| 520 | and specify it using the @code{declare} construct (@pxref{Defining | ||
| 521 | Macros,,, elisp, the Emacs Lisp Reference Manual}). | ||
| 522 | |||
| 523 | @node C Indent | ||
| 524 | @subsection Commands for C Indentation | ||
| 525 | |||
| 526 | Here are special features for indentation in C mode and related modes: | ||
| 527 | |||
| 528 | @table @code | ||
| 529 | @item C-c C-q | ||
| 530 | @kindex C-c C-q @r{(C mode)} | ||
| 531 | @findex c-indent-defun | ||
| 532 | Reindent the current top-level function definition or aggregate type | ||
| 533 | declaration (@code{c-indent-defun}). | ||
| 534 | |||
| 535 | @item C-M-q | ||
| 536 | @kindex C-M-q @r{(C mode)} | ||
| 537 | @findex c-indent-exp | ||
| 538 | Reindent each line in the balanced expression that follows point | ||
| 539 | (@code{c-indent-exp}). A prefix argument inhibits warning messages | ||
| 540 | about invalid syntax. | ||
| 541 | |||
| 542 | @item @key{TAB} | ||
| 543 | @findex c-indent-command | ||
| 544 | Reindent the current line, and/or in some cases insert a tab character | ||
| 545 | (@code{c-indent-command}). | ||
| 546 | |||
| 547 | @vindex c-tab-always-indent | ||
| 548 | If @code{c-tab-always-indent} is @code{t}, this command always reindents | ||
| 549 | the current line and does nothing else. This is the default. | ||
| 550 | |||
| 551 | If that variable is @code{nil}, this command reindents the current line | ||
| 552 | only if point is at the left margin or in the line's indentation; | ||
| 553 | otherwise, it inserts a tab (or the equivalent number of spaces, | ||
| 554 | if @code{indent-tabs-mode} is @code{nil}). | ||
| 555 | |||
| 556 | Any other value (not @code{nil} or @code{t}) means always reindent the | ||
| 557 | line, and also insert a tab if within a comment or a string. | ||
| 558 | @end table | ||
| 559 | |||
| 560 | To reindent the whole current buffer, type @kbd{C-x h C-M-\}. This | ||
| 561 | first selects the whole buffer as the region, then reindents that | ||
| 562 | region. | ||
| 563 | |||
| 564 | To reindent the current block, use @kbd{C-M-u C-M-q}. This moves | ||
| 565 | to the front of the block and then reindents it all. | ||
| 566 | |||
| 567 | @node Custom C Indent | ||
| 568 | @subsection Customizing C Indentation | ||
| 569 | @cindex style (for indentation) | ||
| 570 | |||
| 571 | C mode and related modes use a flexible mechanism for customizing | ||
| 572 | indentation. C mode indents a source line in two steps: first it | ||
| 573 | classifies the line syntactically according to its contents and | ||
| 574 | context; second, it determines the indentation offset associated by | ||
| 575 | your selected @dfn{style} with the syntactic construct and adds this | ||
| 576 | onto the indentation of the @dfn{anchor statement}. | ||
| 577 | |||
| 578 | @table @kbd | ||
| 579 | @item C-c . @key{RET} @var{style} @key{RET} | ||
| 580 | Select a predefined style @var{style} (@code{c-set-style}). | ||
| 581 | @end table | ||
| 582 | |||
| 583 | A @dfn{style} is a named collection of customizations that can be | ||
| 584 | used in C mode and the related modes. @ref{Styles,,, ccmode, The CC | ||
| 585 | Mode Manual}, for a complete description. Emacs comes with several | ||
| 586 | predefined styles, including @code{gnu}, @code{k&r}, @code{bsd}, | ||
| 587 | @code{stroustrup}, @code{linux}, @code{python}, @code{java}, | ||
| 588 | @code{whitesmith}, @code{ellemtel}, and @code{awk}. Some of these | ||
| 589 | styles are primarily intended for one language, but any of them can be | ||
| 590 | used with any of the languages supported by these modes. To find out | ||
| 591 | what a style looks like, select it and reindent some code, e.g., by | ||
| 592 | typing @key{C-M-q} at the start of a function definition. | ||
| 593 | |||
| 594 | @kindex C-c . @r{(C mode)} | ||
| 595 | @findex c-set-style | ||
| 596 | To choose a style for the current buffer, use the command @w{@kbd{C-c | ||
| 597 | .}}. Specify a style name as an argument (case is not significant). | ||
| 598 | This command affects the current buffer only, and it affects only | ||
| 599 | future invocations of the indentation commands; it does not reindent | ||
| 600 | the code already in the buffer. To reindent the whole buffer in the | ||
| 601 | new style, you can type @kbd{C-x h C-M-\}. | ||
| 602 | |||
| 603 | @vindex c-default-style | ||
| 604 | You can also set the variable @code{c-default-style} to specify the | ||
| 605 | default style for various major modes. Its value should be either the | ||
| 606 | style's name (a string) or an alist, in which each element specifies | ||
| 607 | one major mode and which indentation style to use for it. For | ||
| 608 | example, | ||
| 609 | |||
| 610 | @example | ||
| 611 | (setq c-default-style | ||
| 612 | '((java-mode . "java") (awk-mode . "awk") (other . "gnu"))) | ||
| 613 | @end example | ||
| 614 | |||
| 615 | @noindent | ||
| 616 | specifies explicit choices for Java and AWK modes, and the default | ||
| 617 | @samp{gnu} style for the other C-like modes. (These settings are | ||
| 618 | actually the defaults.) This variable takes effect when you select | ||
| 619 | one of the C-like major modes; thus, if you specify a new default | ||
| 620 | style for Java mode, you can make it take effect in an existing Java | ||
| 621 | mode buffer by typing @kbd{M-x java-mode} there. | ||
| 622 | |||
| 623 | The @code{gnu} style specifies the formatting recommended by the GNU | ||
| 624 | Project for C; it is the default, so as to encourage use of our | ||
| 625 | recommended style. | ||
| 626 | |||
| 627 | @xref{Indentation Engine Basics,,, ccmode, the CC Mode Manual}, and | ||
| 628 | @ref{Customizing Indentation,,, ccmode, the CC Mode Manual}, for more | ||
| 629 | information on customizing indentation for C and related modes, | ||
| 630 | including how to override parts of an existing style and how to define | ||
| 631 | your own styles. | ||
| 632 | |||
| 633 | @node Parentheses | ||
| 634 | @section Commands for Editing with Parentheses | ||
| 635 | |||
| 636 | @findex check-parens | ||
| 637 | @cindex unbalanced parentheses and quotes | ||
| 638 | This section describes the commands and features that take advantage | ||
| 639 | of the parenthesis structure in a program, or help you keep it | ||
| 640 | balanced. | ||
| 641 | |||
| 642 | When talking about these facilities, the term ``parenthesis'' also | ||
| 643 | includes braces, brackets, or whatever delimiters are defined to match | ||
| 644 | in pairs. The major mode controls which delimiters are significant, | ||
| 645 | through the syntax table (@pxref{Syntax}). In Lisp, only parentheses | ||
| 646 | count; in C, these commands apply to braces and brackets too. | ||
| 647 | |||
| 648 | You can use @kbd{M-x check-parens} to find any unbalanced | ||
| 649 | parentheses and unbalanced string quotes in the buffer. | ||
| 650 | |||
| 651 | @menu | ||
| 652 | * Expressions:: Expressions with balanced parentheses. | ||
| 653 | * Moving by Parens:: Commands for moving up, down and across | ||
| 654 | in the structure of parentheses. | ||
| 655 | * Matching:: Insertion of a close-delimiter flashes matching open. | ||
| 656 | @end menu | ||
| 657 | |||
| 658 | @node Expressions | ||
| 659 | @subsection Expressions with Balanced Parentheses | ||
| 660 | |||
| 661 | @cindex sexp | ||
| 662 | @cindex expression | ||
| 663 | @cindex balanced expression | ||
| 664 | These commands deal with balanced expressions, also called | ||
| 665 | @dfn{sexps}@footnote{The word ``sexp'' is used to refer to an | ||
| 666 | expression in Lisp.}. | ||
| 667 | |||
| 668 | @table @kbd | ||
| 669 | @item C-M-f | ||
| 670 | Move forward over a balanced expression (@code{forward-sexp}). | ||
| 671 | @item C-M-b | ||
| 672 | Move backward over a balanced expression (@code{backward-sexp}). | ||
| 673 | @item C-M-k | ||
| 674 | Kill balanced expression forward (@code{kill-sexp}). | ||
| 675 | @item C-M-t | ||
| 676 | Transpose expressions (@code{transpose-sexps}). | ||
| 677 | @item C-M-@@ | ||
| 678 | @itemx C-M-@key{SPC} | ||
| 679 | Put mark after following expression (@code{mark-sexp}). | ||
| 680 | @end table | ||
| 681 | |||
| 682 | Each programming language major mode customizes the definition of | ||
| 683 | balanced expressions to suit that language. Balanced expressions | ||
| 684 | typically include symbols, numbers, and string constants, as well as | ||
| 685 | any pair of matching delimiters and their contents. Some languages | ||
| 686 | have obscure forms of expression syntax that nobody has bothered to | ||
| 687 | implement in Emacs. | ||
| 688 | |||
| 689 | @cindex Control-Meta | ||
| 690 | By convention, the keys for these commands are all Control-Meta | ||
| 691 | characters. They usually act on expressions just as the corresponding | ||
| 692 | Meta characters act on words. For instance, the command @kbd{C-M-b} | ||
| 693 | moves backward over a balanced expression, just as @kbd{M-b} moves | ||
| 694 | back over a word. | ||
| 695 | |||
| 696 | @kindex C-M-f | ||
| 697 | @kindex C-M-b | ||
| 698 | @findex forward-sexp | ||
| 699 | @findex backward-sexp | ||
| 700 | To move forward over a balanced expression, use @kbd{C-M-f} | ||
| 701 | (@code{forward-sexp}). If the first significant character after point | ||
| 702 | is an opening delimiter (@samp{(} in Lisp; @samp{(}, @samp{[} or | ||
| 703 | @samp{@{} in C), @kbd{C-M-f} moves past the matching closing | ||
| 704 | delimiter. If the character begins a symbol, string, or number, | ||
| 705 | @kbd{C-M-f} moves over that. | ||
| 706 | |||
| 707 | The command @kbd{C-M-b} (@code{backward-sexp}) moves backward over a | ||
| 708 | balanced expression. The detailed rules are like those above for | ||
| 709 | @kbd{C-M-f}, but with directions reversed. If there are prefix | ||
| 710 | characters (single-quote, backquote and comma, in Lisp) preceding the | ||
| 711 | expression, @kbd{C-M-b} moves back over them as well. The balanced | ||
| 712 | expression commands move across comments as if they were whitespace, | ||
| 713 | in most modes. | ||
| 714 | |||
| 715 | @kbd{C-M-f} or @kbd{C-M-b} with an argument repeats that operation the | ||
| 716 | specified number of times; with a negative argument, it moves in the | ||
| 717 | opposite direction. | ||
| 718 | |||
| 719 | @cindex killing expressions | ||
| 720 | @kindex C-M-k | ||
| 721 | @findex kill-sexp | ||
| 722 | Killing a whole balanced expression can be done with @kbd{C-M-k} | ||
| 723 | (@code{kill-sexp}). @kbd{C-M-k} kills the characters that @kbd{C-M-f} | ||
| 724 | would move over. | ||
| 725 | |||
| 726 | @cindex transposition of expressions | ||
| 727 | @kindex C-M-t | ||
| 728 | @findex transpose-sexps | ||
| 729 | A somewhat random-sounding command which is nevertheless handy is | ||
| 730 | @kbd{C-M-t} (@code{transpose-sexps}), which drags the previous | ||
| 731 | balanced expression across the next one. An argument serves as a | ||
| 732 | repeat count, moving the previous expression over that many following | ||
| 733 | ones. A negative argument drags the previous balanced expression | ||
| 734 | backwards across those before it (thus canceling out the effect of | ||
| 735 | @kbd{C-M-t} with a positive argument). An argument of zero, rather | ||
| 736 | than doing nothing, transposes the balanced expressions ending at or | ||
| 737 | after point and the mark. | ||
| 738 | |||
| 739 | @kindex C-M-@@ | ||
| 740 | @kindex C-M-@key{SPC} | ||
| 741 | @findex mark-sexp | ||
| 742 | To set the region around the next balanced expression in the buffer, | ||
| 743 | use @kbd{C-M-@@} (@code{mark-sexp}), which sets mark at the same place | ||
| 744 | that @kbd{C-M-f} would move to. @kbd{C-M-@@} takes arguments like | ||
| 745 | @kbd{C-M-f}. In particular, a negative argument is useful for putting | ||
| 746 | the mark at the beginning of the previous balanced expression. The | ||
| 747 | alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}. When you | ||
| 748 | repeat this command, or use it in Transient Mark mode when the mark is | ||
| 749 | active, it extends the end of the region by one sexp each time. | ||
| 750 | |||
| 751 | In languages that use infix operators, such as C, it is not possible | ||
| 752 | to recognize all balanced expressions as such because there can be | ||
| 753 | multiple possibilities at a given position. For example, C mode does | ||
| 754 | not treat @samp{foo + bar} as a single expression, even though it | ||
| 755 | @emph{is} one C expression; instead, it recognizes @samp{foo} as one | ||
| 756 | expression and @samp{bar} as another, with the @samp{+} as punctuation | ||
| 757 | between them. Both @samp{foo + bar} and @samp{foo} are legitimate | ||
| 758 | choices for ``the expression following point'' when point is at the | ||
| 759 | @samp{f}, so the expression commands must perforce choose one or the | ||
| 760 | other to operate on. Note that @samp{(foo + bar)} is recognized as a | ||
| 761 | single expression in C mode, because of the parentheses. | ||
| 762 | |||
| 763 | @node Moving by Parens | ||
| 764 | @subsection Moving in the Parenthesis Structure | ||
| 765 | |||
| 766 | @cindex parenthetical groupings | ||
| 767 | @cindex parentheses, moving across | ||
| 768 | @cindex matching parenthesis and braces, moving to | ||
| 769 | @cindex braces, moving across | ||
| 770 | @cindex list commands | ||
| 771 | The Emacs commands for handling parenthetical groupings see nothing | ||
| 772 | except parentheses (or whatever characters must balance in the | ||
| 773 | language you are working with), and the escape characters that might | ||
| 774 | be used to quote those. They are mainly intended for editing | ||
| 775 | programs, but can be useful for editing any text that has parentheses. | ||
| 776 | They are sometimes called ``list'' commands because in Lisp these | ||
| 777 | groupings are lists. | ||
| 778 | |||
| 779 | @table @kbd | ||
| 780 | @item C-M-n | ||
| 781 | Move forward over a parenthetical group (@code{forward-list}). | ||
| 782 | @item C-M-p | ||
| 783 | Move backward over a parenthetical group (@code{backward-list}). | ||
| 784 | @item C-M-u | ||
| 785 | Move up in parenthesis structure (@code{backward-up-list}). | ||
| 786 | @item C-M-d | ||
| 787 | Move down in parenthesis structure (@code{down-list}). | ||
| 788 | @end table | ||
| 789 | |||
| 790 | @kindex C-M-n | ||
| 791 | @kindex C-M-p | ||
| 792 | @findex forward-list | ||
| 793 | @findex backward-list | ||
| 794 | The ``list'' commands @kbd{C-M-n} (@code{forward-list}) and | ||
| 795 | @kbd{C-M-p} (@code{backward-list}) move over one (or @var{n}) | ||
| 796 | parenthetical groupings, skipping blithely over any amount of text | ||
| 797 | that doesn't include meaningful parentheses (symbols, strings, etc.). | ||
| 798 | |||
| 799 | @kindex C-M-u | ||
| 800 | @findex backward-up-list | ||
| 801 | @kbd{C-M-n} and @kbd{C-M-p} try to stay at the same level in the | ||
| 802 | parenthesis structure. To move @emph{up} one (or @var{n}) levels, use | ||
| 803 | @kbd{C-M-u} (@code{backward-up-list}). @kbd{C-M-u} moves backward up | ||
| 804 | past one unmatched opening delimiter. A positive argument serves as a | ||
| 805 | repeat count; a negative argument reverses the direction of motion, so | ||
| 806 | that the command moves forward and up one or more levels. | ||
| 807 | |||
| 808 | @kindex C-M-d | ||
| 809 | @findex down-list | ||
| 810 | To move @emph{down} in the parenthesis structure, use @kbd{C-M-d} | ||
| 811 | (@code{down-list}). In Lisp mode, where @samp{(} is the only opening | ||
| 812 | delimiter, this is nearly the same as searching for a @samp{(}. An | ||
| 813 | argument specifies the number of levels to go down. | ||
| 814 | |||
| 815 | @node Matching | ||
| 816 | @subsection Automatic Display Of Matching Parentheses | ||
| 817 | @cindex matching parentheses | ||
| 818 | @cindex parentheses, displaying matches | ||
| 819 | |||
| 820 | The Emacs parenthesis-matching feature is designed to show | ||
| 821 | automatically how parentheses (and other matching delimiters) match in | ||
| 822 | the text. Whenever you type a self-inserting character that is a | ||
| 823 | closing delimiter, the cursor moves momentarily to the location of the | ||
| 824 | matching opening delimiter, provided that is on the screen. If it is | ||
| 825 | not on the screen, Emacs displays some of the text near it in the echo | ||
| 826 | area. Either way, you can tell which grouping you are closing off. | ||
| 827 | |||
| 828 | If the opening delimiter and closing delimiter are mismatched---such | ||
| 829 | as in @samp{[x)}---a warning message is displayed in the echo area. | ||
| 830 | |||
| 831 | @vindex blink-matching-paren | ||
| 832 | @vindex blink-matching-paren-distance | ||
| 833 | @vindex blink-matching-delay | ||
| 834 | Three variables control parenthesis match display: | ||
| 835 | |||
| 836 | @code{blink-matching-paren} turns the feature on or off: @code{nil} | ||
| 837 | disables it, but the default is @code{t} to enable match display. | ||
| 838 | |||
| 839 | @code{blink-matching-delay} says how many seconds to leave the | ||
| 840 | cursor on the matching opening delimiter, before bringing it back to | ||
| 841 | the real location of point; the default is 1, but on some systems it | ||
| 842 | is useful to specify a fraction of a second. | ||
| 843 | |||
| 844 | @code{blink-matching-paren-distance} specifies how many characters | ||
| 845 | back to search to find the matching opening delimiter. If the match | ||
| 846 | is not found in that distance, scanning stops, and nothing is displayed. | ||
| 847 | This is to prevent the scan for the matching delimiter from wasting | ||
| 848 | lots of time when there is no match. The default is 25600. | ||
| 849 | |||
| 850 | @cindex Show Paren mode | ||
| 851 | @cindex highlighting matching parentheses | ||
| 852 | @findex show-paren-mode | ||
| 853 | Show Paren mode provides a more powerful kind of automatic matching. | ||
| 854 | Whenever point is after a closing delimiter, that delimiter and its | ||
| 855 | matching opening delimiter are both highlighted; otherwise, if point | ||
| 856 | is before an opening delimiter, the matching closing delimiter is | ||
| 857 | highlighted. (There is no need to highlight the opening delimiter in | ||
| 858 | that case, because the cursor appears on top of that character.) Use | ||
| 859 | the command @kbd{M-x show-paren-mode} to enable or disable this mode. | ||
| 860 | |||
| 861 | Show Paren mode uses the faces @code{show-paren-match} and | ||
| 862 | @code{show-paren-mismatch} to highlight parentheses; you can customize | ||
| 863 | them to control how highlighting looks. @xref{Face Customization}. | ||
| 864 | |||
| 865 | @node Comments | ||
| 866 | @section Manipulating Comments | ||
| 867 | @cindex comments | ||
| 868 | |||
| 869 | Because comments are such an important part of programming, Emacs | ||
| 870 | provides special commands for editing and inserting comments. It can | ||
| 871 | also do spell checking on comments with Flyspell Prog mode | ||
| 872 | (@pxref{Spelling}). | ||
| 873 | |||
| 874 | @menu | ||
| 875 | * Comment Commands:: Inserting, killing, and aligning comments. | ||
| 876 | * Multi-Line Comments:: Commands for adding and editing multi-line comments. | ||
| 877 | * Options for Comments::Customizing the comment features. | ||
| 878 | @end menu | ||
| 879 | |||
| 880 | @node Comment Commands | ||
| 881 | @subsection Comment Commands | ||
| 882 | @cindex indentation for comments | ||
| 883 | @cindex alignment for comments | ||
| 884 | |||
| 885 | The comment commands in this table insert, kill and align comments. | ||
| 886 | They are described in this section and following sections. | ||
| 887 | |||
| 888 | @table @asis | ||
| 889 | @item @kbd{M-;} | ||
| 890 | Insert or realign comment on current line; alternatively, comment or | ||
| 891 | uncomment the region (@code{comment-dwim}). | ||
| 892 | @item @kbd{C-u M-;} | ||
| 893 | Kill comment on current line (@code{comment-kill}). | ||
| 894 | @item @kbd{C-x ;} | ||
| 895 | Set comment column (@code{comment-set-column}). | ||
| 896 | @item @kbd{C-M-j} | ||
| 897 | @itemx @kbd{M-j} | ||
| 898 | Like @key{RET} followed by inserting and aligning a comment | ||
| 899 | (@code{comment-indent-new-line}). @xref{Multi-Line Comments}. | ||
| 900 | @item @kbd{M-x comment-region} | ||
| 901 | @itemx @kbd{C-c C-c} (in C-like modes) | ||
| 902 | Add or remove comment delimiters on all the lines in the region. | ||
| 903 | @end table | ||
| 904 | |||
| 905 | @kindex M-; | ||
| 906 | @findex comment-dwim | ||
| 907 | The command to create or align a comment is @kbd{M-;} | ||
| 908 | (@code{comment-dwim}). The word ``dwim'' is an acronym for ``Do What | ||
| 909 | I Mean''; it indicates that this command can be used for many | ||
| 910 | different jobs relating to comments, depending on the situation where | ||
| 911 | you use it. | ||
| 912 | |||
| 913 | If there is no comment already on the line, @kbd{M-;} inserts a new | ||
| 914 | comment, aligned at a specific column called the @dfn{comment column}. | ||
| 915 | The new comment begins with the string Emacs thinks comments should | ||
| 916 | start with (the value of @code{comment-start}; see below). Point is | ||
| 917 | after that string, so you can insert the text of the comment right | ||
| 918 | away. If the major mode has specified a string to terminate comments, | ||
| 919 | @kbd{M-;} inserts that after point, to keep the syntax valid. | ||
| 920 | |||
| 921 | If the text of the line extends past the comment column, this | ||
| 922 | command aligns the comment start string to a suitable boundary | ||
| 923 | (usually, at least one space is inserted). | ||
| 924 | |||
| 925 | You can also use @kbd{M-;} to align an existing comment. If a line | ||
| 926 | already contains the comment-start string, @kbd{M-;} realigns it to | ||
| 927 | the conventional alignment and moves point after it. (Exception: | ||
| 928 | comments starting in column 0 are not moved.) Even when an existing | ||
| 929 | comment is properly aligned, @kbd{M-;} is still useful for moving | ||
| 930 | directly to the start of the text inside the comment. | ||
| 931 | |||
| 932 | @findex comment-kill | ||
| 933 | @kindex C-u M-; | ||
| 934 | @kbd{C-u M-;} kills any comment on the current line, along with the | ||
| 935 | whitespace before it. To reinsert the comment on another line, move | ||
| 936 | to the end of that line, do @kbd{C-y}, and then do @kbd{M-;} to | ||
| 937 | realign it. | ||
| 938 | |||
| 939 | Note that @kbd{C-u M-;} is not a distinct key; it is @kbd{M-;} | ||
| 940 | (@code{comment-dwim}) with a prefix argument. That command is | ||
| 941 | programmed so that when it receives a prefix argument it calls | ||
| 942 | @code{comment-kill}. However, @code{comment-kill} is a valid command | ||
| 943 | in its own right, and you can bind it directly to a key if you wish. | ||
| 944 | |||
| 945 | @kbd{M-;} does two other jobs when used with an active region in | ||
| 946 | Transient Mark mode (@pxref{Transient Mark}). Then it either adds or | ||
| 947 | removes comment delimiters on each line of the region. (If every line | ||
| 948 | is a comment, it removes comment delimiters from each; otherwise, it | ||
| 949 | adds comment delimiters to each.) If you are not using Transient Mark | ||
| 950 | mode, then you should use the commands @code{comment-region} and | ||
| 951 | @code{uncomment-region} to do these jobs (@pxref{Multi-Line Comments}), | ||
| 952 | or else enable Transient Mark mode momentarily (@pxref{Momentary Mark}). | ||
| 953 | A prefix argument used in these circumstances specifies how many | ||
| 954 | comment delimiters to add or how many to delete. | ||
| 955 | |||
| 956 | Some major modes have special rules for aligning certain kinds of | ||
| 957 | comments in certain contexts. For example, in Lisp code, comments which | ||
| 958 | start with two semicolons are indented as if they were lines of code, | ||
| 959 | instead of at the comment column. Comments which start with three | ||
| 960 | semicolons are supposed to start at the left margin and are often used | ||
| 961 | for sectioning purposes. Emacs understands | ||
| 962 | these conventions by indenting a double-semicolon comment using @key{TAB}, | ||
| 963 | and by not changing the indentation of a triple-semicolon comment at all. | ||
| 964 | |||
| 965 | @example | ||
| 966 | ;; This function is just an example. | ||
| 967 | ;;; Here either two or three semicolons are appropriate. | ||
| 968 | (defun foo (x) | ||
| 969 | ;;; And now, the first part of the function: | ||
| 970 | ;; The following line adds one. | ||
| 971 | (1+ x)) ; This line adds one. | ||
| 972 | @end example | ||
| 973 | |||
| 974 | For C-like modes, you can configure the exact effect of @kbd{M-;} | ||
| 975 | more flexibly than for most buffers by setting the variables | ||
| 976 | @code{c-indent-comment-alist} and | ||
| 977 | @code{c-indent-comments-syntactically-p}. For example, on a line | ||
| 978 | ending in a closing brace, @kbd{M-;} puts the comment one space after | ||
| 979 | the brace rather than at @code{comment-column}. For full details see | ||
| 980 | @ref{Comment Commands,,, ccmode, The CC Mode Manual}. | ||
| 981 | |||
| 982 | @node Multi-Line Comments | ||
| 983 | @subsection Multiple Lines of Comments | ||
| 984 | |||
| 985 | @kindex C-M-j | ||
| 986 | @kindex M-j | ||
| 987 | @cindex blank lines in programs | ||
| 988 | @findex comment-indent-new-line | ||
| 989 | |||
| 990 | If you are typing a comment and wish to continue it on another line, | ||
| 991 | you can use the command @kbd{C-M-j} or @kbd{M-j} | ||
| 992 | (@code{comment-indent-new-line}). If @code{comment-multi-line} | ||
| 993 | (@pxref{Options for Comments}) is non-@code{nil}, it moves to a new | ||
| 994 | line within the comment. Otherwise it closes the comment and starts a | ||
| 995 | new comment on a new line. When Auto Fill mode is on, going past the | ||
| 996 | fill column while typing a comment causes the comment to be continued | ||
| 997 | in just this fashion. | ||
| 998 | |||
| 999 | @kindex C-c C-c (C mode) | ||
| 1000 | @findex comment-region | ||
| 1001 | To turn existing lines into comment lines, use the @kbd{M-x | ||
| 1002 | comment-region} command (or type @kbd{C-c C-c} in C-like modes). It | ||
| 1003 | adds comment delimiters to the lines that start in the region, thus | ||
| 1004 | commenting them out. With a negative argument, it does the | ||
| 1005 | opposite---it deletes comment delimiters from the lines in the region. | ||
| 1006 | |||
| 1007 | With a positive argument, @code{comment-region} duplicates the last | ||
| 1008 | character of the comment start sequence it adds; the argument | ||
| 1009 | specifies how many copies of the character to insert. Thus, in Lisp | ||
| 1010 | mode, @kbd{C-u 2 M-x comment-region} adds @samp{;;} to each line. | ||
| 1011 | Duplicating the comment delimiter is a way of calling attention to the | ||
| 1012 | comment. It can also affect how the comment is aligned or indented. | ||
| 1013 | In Lisp, for proper indentation, you should use an argument of two or | ||
| 1014 | three, if between defuns; if within a defun, it must be three. | ||
| 1015 | |||
| 1016 | You can configure C Mode such that when you type a @samp{/} at the | ||
| 1017 | start of a line in a multi-line block comment, this closes the | ||
| 1018 | comment. Enable the @code{comment-close-slash} clean-up for this. | ||
| 1019 | @xref{Clean-ups,,, ccmode, The CC Mode Manual}. | ||
| 1020 | |||
| 1021 | @node Options for Comments | ||
| 1022 | @subsection Options Controlling Comments | ||
| 1023 | |||
| 1024 | @vindex comment-column | ||
| 1025 | @kindex C-x ; | ||
| 1026 | @findex comment-set-column | ||
| 1027 | The @dfn{comment column}, the column at which Emacs tries to place | ||
| 1028 | comments, is stored in the variable @code{comment-column}. You can | ||
| 1029 | set it to a number explicitly. Alternatively, the command @kbd{C-x ;} | ||
| 1030 | (@code{comment-set-column}) sets the comment column to the column | ||
| 1031 | point is at. @kbd{C-u C-x ;} sets the comment column to match the | ||
| 1032 | last comment before point in the buffer, and then does a @kbd{M-;} to | ||
| 1033 | align the current line's comment under the previous one. | ||
| 1034 | |||
| 1035 | The variable @code{comment-column} is per-buffer: setting the variable | ||
| 1036 | in the normal fashion affects only the current buffer, but there is a | ||
| 1037 | default value which you can change with @code{setq-default}. | ||
| 1038 | @xref{Locals}. Many major modes initialize this variable for the | ||
| 1039 | current buffer. | ||
| 1040 | |||
| 1041 | @vindex comment-start-skip | ||
| 1042 | The comment commands recognize comments based on the regular | ||
| 1043 | expression that is the value of the variable @code{comment-start-skip}. | ||
| 1044 | Make sure this regexp does not match the null string. It may match more | ||
| 1045 | than the comment starting delimiter in the strictest sense of the word; | ||
| 1046 | for example, in C mode the value of the variable is | ||
| 1047 | @c This stops M-q from breaking the line inside that @code. | ||
| 1048 | @code{@w{"/\\*+ *\\|//+ *"}}, which matches extra stars and spaces | ||
| 1049 | after the @samp{/*} itself, and accepts C++ style comments also. | ||
| 1050 | (Note that @samp{\\} is needed in Lisp syntax to include a @samp{\} in | ||
| 1051 | the string, which is needed to deny the first star its special meaning | ||
| 1052 | in regexp syntax. @xref{Regexp Backslash}.) | ||
| 1053 | |||
| 1054 | @vindex comment-start | ||
| 1055 | @vindex comment-end | ||
| 1056 | When a comment command makes a new comment, it inserts the value of | ||
| 1057 | @code{comment-start} to begin it. The value of @code{comment-end} is | ||
| 1058 | inserted after point, so that it will follow the text that you will | ||
| 1059 | insert into the comment. When @code{comment-end} is non-empty, it | ||
| 1060 | should start with a space. For example, in C mode, | ||
| 1061 | @code{comment-start} has the value @w{@code{"/* "}} and | ||
| 1062 | @code{comment-end} has the value @w{@code{" */"}}. | ||
| 1063 | |||
| 1064 | @vindex comment-padding | ||
| 1065 | The variable @code{comment-padding} specifies how many spaces | ||
| 1066 | @code{comment-region} should insert on each line between the comment | ||
| 1067 | delimiter and the line's original text. The default is 1, to insert | ||
| 1068 | one space. @code{nil} means 0. Alternatively, @code{comment-padding} | ||
| 1069 | can hold the actual string to insert. | ||
| 1070 | |||
| 1071 | @vindex comment-multi-line | ||
| 1072 | The variable @code{comment-multi-line} controls how @kbd{C-M-j} | ||
| 1073 | (@code{indent-new-comment-line}) behaves when used inside a comment. | ||
| 1074 | Specifically, when @code{comment-multi-line} is @code{nil}, the | ||
| 1075 | command inserts a comment terminator, begins a new line, and finally | ||
| 1076 | inserts a comment starter. Otherwise it does not insert the | ||
| 1077 | terminator and starter, so it effectively continues the current | ||
| 1078 | comment across multiple lines. In languages that allow multi-line | ||
| 1079 | comments, the choice of value for this variable is a matter of taste. | ||
| 1080 | The default for this variable depends on the major mode. | ||
| 1081 | |||
| 1082 | @vindex comment-indent-function | ||
| 1083 | The variable @code{comment-indent-function} should contain a function | ||
| 1084 | that will be called to compute the alignment for a newly inserted | ||
| 1085 | comment or for aligning an existing comment. It is set differently by | ||
| 1086 | various major modes. The function is called with no arguments, but with | ||
| 1087 | point at the beginning of the comment, or at the end of a line if a new | ||
| 1088 | comment is to be inserted. It should return the column in which the | ||
| 1089 | comment ought to start. For example, in Lisp mode, the indent hook | ||
| 1090 | function bases its decision on how many semicolons begin an existing | ||
| 1091 | comment, and on the code in the preceding lines. | ||
| 1092 | |||
| 1093 | @node Documentation | ||
| 1094 | @section Documentation Lookup | ||
| 1095 | |||
| 1096 | Emacs provides several features you can use to look up the | ||
| 1097 | documentation of functions, variables and commands that you plan to | ||
| 1098 | use in your program. | ||
| 1099 | |||
| 1100 | @menu | ||
| 1101 | * Info Lookup:: Looking up library functions and commands | ||
| 1102 | in Info files. | ||
| 1103 | * Man Page:: Looking up man pages of library functions and commands. | ||
| 1104 | * Lisp Doc:: Looking up Emacs Lisp functions, etc. | ||
| 1105 | @end menu | ||
| 1106 | |||
| 1107 | @node Info Lookup | ||
| 1108 | @subsection Info Documentation Lookup | ||
| 1109 | |||
| 1110 | @findex info-lookup-symbol | ||
| 1111 | @findex info-lookup-file | ||
| 1112 | @kindex C-h S | ||
| 1113 | For many major modes, that apply to languages that have | ||
| 1114 | documentation in Info, you can use @kbd{C-h S} | ||
| 1115 | (@code{info-lookup-symbol}) to view the Info documentation for a | ||
| 1116 | symbol used in the program. You specify the symbol with the | ||
| 1117 | minibuffer; the default is the symbol appearing in the buffer at | ||
| 1118 | point. For example, in C mode this looks for the symbol in the C | ||
| 1119 | Library Manual. The command only works if the appropriate manual's | ||
| 1120 | Info files are installed. | ||
| 1121 | |||
| 1122 | The major mode determines where to look for documentation for the | ||
| 1123 | symbol---which Info files to look in, and which indices to search. | ||
| 1124 | You can also use @kbd{M-x info-lookup-file} to look for documentation | ||
| 1125 | for a file name. | ||
| 1126 | |||
| 1127 | If you use @kbd{C-h S} in a major mode that does not support it, | ||
| 1128 | it asks you to specify the ``symbol help mode.'' You should enter | ||
| 1129 | a command such as @code{c-mode} that would select a major | ||
| 1130 | mode which @kbd{C-h S} does support. | ||
| 1131 | |||
| 1132 | @node Man Page | ||
| 1133 | @subsection Man Page Lookup | ||
| 1134 | |||
| 1135 | @cindex manual page | ||
| 1136 | On Unix, the main form of on-line documentation was the @dfn{manual | ||
| 1137 | page} or @dfn{man page}. In the GNU operating system, we aim to | ||
| 1138 | replace man pages with better-organized manuals that you can browse | ||
| 1139 | with Info (@pxref{Misc Help}). This process is not finished, so it is | ||
| 1140 | still useful to read manual pages. | ||
| 1141 | |||
| 1142 | @findex manual-entry | ||
| 1143 | You can read the man page for an operating system command, library | ||
| 1144 | function, or system call, with the @kbd{M-x man} command. It | ||
| 1145 | runs the @code{man} program to format the man page; if the system | ||
| 1146 | permits, it runs @code{man} asynchronously, so that you can keep on | ||
| 1147 | editing while the page is being formatted. (On MS-DOS and MS-Windows | ||
| 1148 | 3, you cannot edit while Emacs waits for @code{man} to finish.) The | ||
| 1149 | result goes in a buffer named @samp{*Man @var{topic}*}. These buffers | ||
| 1150 | use a special major mode, Man mode, that facilitates scrolling and | ||
| 1151 | jumping to other manual pages. For details, type @kbd{C-h m} while in | ||
| 1152 | a man page buffer. | ||
| 1153 | |||
| 1154 | @cindex sections of manual pages | ||
| 1155 | Each man page belongs to one of ten or more @dfn{sections}, each | ||
| 1156 | named by a digit or by a digit and a letter. Sometimes there are | ||
| 1157 | multiple man pages with the same name in different sections. To read | ||
| 1158 | a man page from a specific section, type | ||
| 1159 | @samp{@var{topic}(@var{section})} or @samp{@var{section} @var{topic}} | ||
| 1160 | when @kbd{M-x manual-entry} prompts for the topic. For example, to | ||
| 1161 | read the man page for the C library function @code{chmod} (as opposed | ||
| 1162 | to a command of the same name), type @kbd{M-x manual-entry @key{RET} | ||
| 1163 | chmod(2) @key{RET}}. (@code{chmod} is a system call, so it is in | ||
| 1164 | section @samp{2}.) | ||
| 1165 | |||
| 1166 | @vindex Man-switches | ||
| 1167 | If you do not specify a section, the results depend on how the | ||
| 1168 | @code{man} program works on your system. Some of them display only | ||
| 1169 | the first man page they find. Others display all man pages that have | ||
| 1170 | the specified name, so you can move between them with the @kbd{M-n} | ||
| 1171 | and @kbd{M-p} keys@footnote{On some systems, the @code{man} program | ||
| 1172 | accepts a @samp{-a} command-line option which tells it to display all | ||
| 1173 | the man pages for the specified topic. If you want this behavior, you | ||
| 1174 | can add this option to the value of the variable @code{Man-switches}.}. | ||
| 1175 | The mode line shows how many manual pages are present in the Man buffer. | ||
| 1176 | |||
| 1177 | @vindex Man-fontify-manpage-flag | ||
| 1178 | By default, Emacs highlights the text in man pages. For a long man | ||
| 1179 | page, highlighting can take substantial time. You can turn off | ||
| 1180 | highlighting of man pages by setting the variable | ||
| 1181 | @code{Man-fontify-manpage-flag} to @code{nil}. | ||
| 1182 | |||
| 1183 | @findex Man-fontify-manpage | ||
| 1184 | If you insert the text of a man page into an Emacs buffer in some | ||
| 1185 | other fashion, you can use the command @kbd{M-x Man-fontify-manpage} to | ||
| 1186 | perform the same conversions that @kbd{M-x manual-entry} does. | ||
| 1187 | |||
| 1188 | @findex woman | ||
| 1189 | @cindex manual pages, on MS-DOS/MS-Windows | ||
| 1190 | An alternative way of reading manual pages is the @kbd{M-x woman} | ||
| 1191 | command@footnote{The name of the command, @code{woman}, is an acronym | ||
| 1192 | for ``w/o (without) man,'' since it doesn't use the @code{man} | ||
| 1193 | program.}. Unlike @kbd{M-x man}, it does not run any external | ||
| 1194 | programs to format and display the man pages; instead it does the job | ||
| 1195 | in Emacs Lisp, so it works on systems such as MS-Windows, where the | ||
| 1196 | @code{man} program (and other programs it uses) are not generally | ||
| 1197 | available. | ||
| 1198 | |||
| 1199 | @kbd{M-x woman} prompts for a name of a manual page, and provides | ||
| 1200 | completion based on the list of manual pages that are installed on | ||
| 1201 | your machine; the list of available manual pages is computed | ||
| 1202 | automatically the first time you invoke @code{woman}. The word at | ||
| 1203 | point in the current buffer is used to suggest the default for the | ||
| 1204 | name the manual page. | ||
| 1205 | |||
| 1206 | With a numeric argument, @kbd{M-x woman} recomputes the list of the | ||
| 1207 | manual pages used for completion. This is useful if you add or delete | ||
| 1208 | manual pages. | ||
| 1209 | |||
| 1210 | If you type a name of a manual page and @kbd{M-x woman} finds that | ||
| 1211 | several manual pages by the same name exist in different sections, it | ||
| 1212 | pops up a window with possible candidates asking you to choose one of | ||
| 1213 | them. | ||
| 1214 | |||
| 1215 | For more information about setting up and using @kbd{M-x woman}, see | ||
| 1216 | @ref{Top, WoMan, Browse UN*X Manual Pages WithOut Man, woman, The WoMan | ||
| 1217 | Manual}. | ||
| 1218 | |||
| 1219 | @node Lisp Doc | ||
| 1220 | @subsection Emacs Lisp Documentation Lookup | ||
| 1221 | |||
| 1222 | As you edit Lisp code to be run in Emacs, you can use the commands | ||
| 1223 | @kbd{C-h f} (@code{describe-function}) and @kbd{C-h v} | ||
| 1224 | (@code{describe-variable}) to view documentation of functions and | ||
| 1225 | variables that you want to use. These commands use the minibuffer to | ||
| 1226 | read the name of a function or variable to document, and display the | ||
| 1227 | documentation in a window. Their default arguments are based on the | ||
| 1228 | code in the neighborhood of point. For @kbd{C-h f}, the default is | ||
| 1229 | the function called in the innermost list containing point. @kbd{C-h | ||
| 1230 | v} uses the symbol name around or adjacent to point as its default. | ||
| 1231 | |||
| 1232 | @cindex Eldoc mode | ||
| 1233 | @findex eldoc-mode | ||
| 1234 | A more automatic but less powerful method is Eldoc mode. This minor | ||
| 1235 | mode constantly displays in the echo area the argument list for the | ||
| 1236 | function being called at point. (In other words, it finds the | ||
| 1237 | function call that point is contained in, and displays the argument | ||
| 1238 | list of that function.) If point is over a documented variable, it | ||
| 1239 | shows the first line of the variable's docstring. Eldoc mode applies | ||
| 1240 | in Emacs Lisp and Lisp Interaction modes, and perhaps a few others | ||
| 1241 | that provide special support for looking up doc strings. Use the | ||
| 1242 | command @kbd{M-x eldoc-mode} to enable or disable this feature. | ||
| 1243 | |||
| 1244 | @node Hideshow | ||
| 1245 | @section Hideshow minor mode | ||
| 1246 | |||
| 1247 | @findex hs-minor-mode | ||
| 1248 | Hideshow minor mode provides selective display of portions of a | ||
| 1249 | program, known as @dfn{blocks}. You can use @kbd{M-x hs-minor-mode} | ||
| 1250 | to enable or disable this mode, or add @code{hs-minor-mode} to the | ||
| 1251 | mode hook for certain major modes in order to enable it automatically | ||
| 1252 | for those modes. | ||
| 1253 | |||
| 1254 | Just what constitutes a block depends on the major mode. In C mode | ||
| 1255 | or C++ mode, they are delimited by braces, while in Lisp mode and | ||
| 1256 | similar modes they are delimited by parentheses. Multi-line comments | ||
| 1257 | also count as blocks. | ||
| 1258 | |||
| 1259 | @findex hs-hide-all | ||
| 1260 | @findex hs-hide-block | ||
| 1261 | @findex hs-show-all | ||
| 1262 | @findex hs-show-block | ||
| 1263 | @findex hs-show-region | ||
| 1264 | @findex hs-hide-level | ||
| 1265 | @findex hs-minor-mode | ||
| 1266 | @kindex C-c @@ C-h | ||
| 1267 | @kindex C-c @@ C-s | ||
| 1268 | @kindex C-c @@ C-M-h | ||
| 1269 | @kindex C-c @@ C-M-s | ||
| 1270 | @kindex C-c @@ C-r | ||
| 1271 | @kindex C-c @@ C-l | ||
| 1272 | @kindex S-Mouse-2 | ||
| 1273 | @table @kbd | ||
| 1274 | @item C-c @@ C-h | ||
| 1275 | Hide the current block (@code{hs-hide-block}). | ||
| 1276 | @item C-c @@ C-s | ||
| 1277 | Show the current block (@code{hs-show-block}). | ||
| 1278 | @item C-c @@ C-c | ||
| 1279 | Either hide or show the current block (@code{hs-toggle-hiding}). | ||
| 1280 | @item S-Mouse-2 | ||
| 1281 | Either hide or show the block you click on (@code{hs-mouse-toggle-hiding}). | ||
| 1282 | @item C-c @@ C-M-h | ||
| 1283 | Hide all top-level blocks (@code{hs-hide-all}). | ||
| 1284 | @item C-c @@ C-M-s | ||
| 1285 | Show everything in the buffer (@code{hs-show-all}). | ||
| 1286 | @item C-c @@ C-l | ||
| 1287 | Hide all blocks @var{n} levels below this block | ||
| 1288 | (@code{hs-hide-level}). | ||
| 1289 | @end table | ||
| 1290 | |||
| 1291 | @vindex hs-hide-comments-when-hiding-all | ||
| 1292 | @vindex hs-isearch-open | ||
| 1293 | @vindex hs-special-modes-alist | ||
| 1294 | These variables exist for customizing Hideshow mode. | ||
| 1295 | |||
| 1296 | @table @code | ||
| 1297 | @item hs-hide-comments-when-hiding-all | ||
| 1298 | Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too. | ||
| 1299 | |||
| 1300 | @item hs-isearch-open | ||
| 1301 | Specifies what kind of hidden blocks incremental search should make | ||
| 1302 | visible. The value should be one of these four symbols: | ||
| 1303 | |||
| 1304 | @table @code | ||
| 1305 | @item code | ||
| 1306 | Open only code blocks. | ||
| 1307 | @item comment | ||
| 1308 | Open only comments. | ||
| 1309 | @item t | ||
| 1310 | Open both code blocks and comments. | ||
| 1311 | @item nil | ||
| 1312 | Open neither code blocks nor comments. | ||
| 1313 | @end table | ||
| 1314 | |||
| 1315 | @item hs-special-modes-alist | ||
| 1316 | A list of elements, each specifying how to initialize Hideshow | ||
| 1317 | variables for one major mode. See the variable's documentation string | ||
| 1318 | for more information. | ||
| 1319 | @end table | ||
| 1320 | |||
| 1321 | @node Symbol Completion | ||
| 1322 | @section Completion for Symbol Names | ||
| 1323 | @cindex completion (symbol names) | ||
| 1324 | |||
| 1325 | In Emacs, completion is something you normally do in the minibuffer. | ||
| 1326 | But one kind of completion is available in all buffers: completion for | ||
| 1327 | symbol names. | ||
| 1328 | |||
| 1329 | @kindex M-TAB | ||
| 1330 | The character @kbd{M-@key{TAB}} runs a command to complete the | ||
| 1331 | partial symbol before point against the set of meaningful symbol | ||
| 1332 | names. This command inserts at point any additional characters that | ||
| 1333 | it can determine from the partial name. | ||
| 1334 | |||
| 1335 | If your window manager defines @kbd{M-@key{TAB}} to switch windows, | ||
| 1336 | you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead. | ||
| 1337 | However, most window managers let you customize these shortcuts, and | ||
| 1338 | we recommend that you change any that get in the way of use of Emacs. | ||
| 1339 | |||
| 1340 | If the partial name in the buffer has multiple possible completions | ||
| 1341 | that differ in the very next character, so that it is impossible to | ||
| 1342 | complete even one more character, @kbd{M-@key{TAB}} displays a list of | ||
| 1343 | all possible completions in another window. | ||
| 1344 | |||
| 1345 | @cindex tags-based completion | ||
| 1346 | @cindex Info index completion | ||
| 1347 | @findex complete-symbol | ||
| 1348 | In most programming language major modes, @kbd{M-@key{TAB}} runs the | ||
| 1349 | command @code{complete-symbol}, which provides two kinds of completion. | ||
| 1350 | Normally it does completion based on a tags table (@pxref{Tags}); with a | ||
| 1351 | numeric argument (regardless of the value), it does completion based on | ||
| 1352 | the names listed in the Info file indexes for your language. Thus, to | ||
| 1353 | complete the name of a symbol defined in your own program, use | ||
| 1354 | @kbd{M-@key{TAB}} with no argument; to complete the name of a standard | ||
| 1355 | library function, use @kbd{C-u M-@key{TAB}}. Of course, Info-based | ||
| 1356 | completion works only if there is an Info file for the standard library | ||
| 1357 | functions of your language, and only if it is installed at your site. | ||
| 1358 | |||
| 1359 | @cindex Lisp symbol completion | ||
| 1360 | @cindex completion (Lisp symbols) | ||
| 1361 | @findex lisp-complete-symbol | ||
| 1362 | In Emacs-Lisp mode, the name space for completion normally consists of | ||
| 1363 | nontrivial symbols present in Emacs---those that have function | ||
| 1364 | definitions, values or properties. However, if there is an | ||
| 1365 | open-parenthesis immediately before the beginning of the partial symbol, | ||
| 1366 | only symbols with function definitions are considered as completions. | ||
| 1367 | The command which implements this is @code{lisp-complete-symbol}. | ||
| 1368 | |||
| 1369 | In Text mode and related modes, @kbd{M-@key{TAB}} completes words | ||
| 1370 | based on the spell-checker's dictionary. @xref{Spelling}. | ||
| 1371 | |||
| 1372 | @node Glasses | ||
| 1373 | @section Glasses minor mode | ||
| 1374 | @cindex Glasses mode | ||
| 1375 | @cindex identifiers, making long ones readable | ||
| 1376 | @cindex StudlyCaps, making them readable | ||
| 1377 | @findex glasses-mode | ||
| 1378 | |||
| 1379 | Glasses minor mode makes @samp{unreadableIdentifiersLikeThis} | ||
| 1380 | readable by altering the way they display. It knows two different | ||
| 1381 | ways to do this: by displaying underscores between a lower-case letter | ||
| 1382 | and the following capital letter, and by emboldening the capital | ||
| 1383 | letters. It does not alter the buffer text, only the way they | ||
| 1384 | display, so you can use it even on read-only buffers. You can use the | ||
| 1385 | command @kbd{M-x glasses-mode} to enable or disable the mode in the | ||
| 1386 | current buffer; you can also add @code{glasses-mode} to the mode hook | ||
| 1387 | of the programming language major modes in which you normally want | ||
| 1388 | to use Glasses mode. | ||
| 1389 | |||
| 1390 | @node Misc for Programs | ||
| 1391 | @section Other Features Useful for Editing Programs | ||
| 1392 | |||
| 1393 | A number of Emacs commands that aren't designed specifically for | ||
| 1394 | editing programs are useful for that nonetheless. | ||
| 1395 | |||
| 1396 | The Emacs commands that operate on words, sentences and paragraphs | ||
| 1397 | are useful for editing code. Most symbols names contain words | ||
| 1398 | (@pxref{Words}); sentences can be found in strings and comments | ||
| 1399 | (@pxref{Sentences}). Paragraphs in the strict sense can be found in | ||
| 1400 | program code (in long comments), but the paragraph commands are useful | ||
| 1401 | in other places too, because programming language major modes define | ||
| 1402 | paragraphs to begin and end at blank lines (@pxref{Paragraphs}). | ||
| 1403 | Judicious use of blank lines to make the program clearer will also | ||
| 1404 | provide useful chunks of text for the paragraph commands to work on. | ||
| 1405 | Auto Fill mode, if enabled in a programming language major mode, | ||
| 1406 | indents the new lines which it creates. | ||
| 1407 | |||
| 1408 | The selective display feature is useful for looking at the overall | ||
| 1409 | structure of a function (@pxref{Selective Display}). This feature | ||
| 1410 | hides the lines that are indented more than a specified amount. | ||
| 1411 | Programming modes often support Outline minor mode (@pxref{Outline | ||
| 1412 | Mode}). The Foldout package provides folding-editor features | ||
| 1413 | (@pxref{Foldout}). | ||
| 1414 | |||
| 1415 | The ``automatic typing'' features may be useful for writing programs. | ||
| 1416 | @xref{Top,,Autotyping, autotype, Autotyping}. | ||
| 1417 | |||
| 1418 | @node C Modes | ||
| 1419 | @section C and Related Modes | ||
| 1420 | @cindex C mode | ||
| 1421 | @cindex Java mode | ||
| 1422 | @cindex Pike mode | ||
| 1423 | @cindex IDL mode | ||
| 1424 | @cindex CORBA IDL mode | ||
| 1425 | @cindex Objective C mode | ||
| 1426 | @cindex C++ mode | ||
| 1427 | @cindex AWK mode | ||
| 1428 | @cindex mode, Java | ||
| 1429 | @cindex mode, C | ||
| 1430 | @cindex mode, C++ | ||
| 1431 | @cindex mode, Objective C | ||
| 1432 | @cindex mode, CORBA IDL | ||
| 1433 | @cindex mode, Pike | ||
| 1434 | @cindex mode, AWK | ||
| 1435 | |||
| 1436 | This section gives a brief description of the special features | ||
| 1437 | available in C, C++, Objective-C, Java, CORBA IDL, Pike and AWK modes. | ||
| 1438 | (These are called ``C mode and related modes.'') @xref{Top, , CC Mode, | ||
| 1439 | ccmode, CC Mode}, for a more extensive description of these modes | ||
| 1440 | and their special features. | ||
| 1441 | |||
| 1442 | @menu | ||
| 1443 | * Motion in C:: Commands to move by C statements, etc. | ||
| 1444 | * Electric C:: Colon and other chars can automatically reindent. | ||
| 1445 | * Hungry Delete:: A more powerful DEL command. | ||
| 1446 | * Other C Commands:: Filling comments, viewing expansion of macros, | ||
| 1447 | and other neat features. | ||
| 1448 | @end menu | ||
| 1449 | |||
| 1450 | @node Motion in C | ||
| 1451 | @subsection C Mode Motion Commands | ||
| 1452 | |||
| 1453 | This section describes commands for moving point, in C mode and | ||
| 1454 | related modes. | ||
| 1455 | |||
| 1456 | @table @code | ||
| 1457 | @item M-x c-beginning-of-defun | ||
| 1458 | @itemx M-x c-end-of-defun | ||
| 1459 | @findex c-beginning-of-defun | ||
| 1460 | @findex c-end-of-defun | ||
| 1461 | Move point to the beginning or end of the current function or | ||
| 1462 | top-level definition. These are found by searching for the least | ||
| 1463 | enclosing braces. (By contrast, @code{beginning-of-defun} and | ||
| 1464 | @code{end-of-defun} search for braces in column zero.) If you are | ||
| 1465 | editing code where the opening brace of a function isn't placed in | ||
| 1466 | column zero, you may wish to bind @code{C-M-a} and @code{C-M-e} to | ||
| 1467 | these commands. @xref{Moving by Defuns}. | ||
| 1468 | |||
| 1469 | @item C-c C-u | ||
| 1470 | @kindex C-c C-u @r{(C mode)} | ||
| 1471 | @findex c-up-conditional | ||
| 1472 | Move point back to the containing preprocessor conditional, leaving the | ||
| 1473 | mark behind. A prefix argument acts as a repeat count. With a negative | ||
| 1474 | argument, move point forward to the end of the containing | ||
| 1475 | preprocessor conditional. | ||
| 1476 | |||
| 1477 | @samp{#elif} is equivalent to @samp{#else} followed by @samp{#if}, so | ||
| 1478 | the function will stop at a @samp{#elif} when going backward, but not | ||
| 1479 | when going forward. | ||
| 1480 | |||
| 1481 | @item C-c C-p | ||
| 1482 | @kindex C-c C-p @r{(C mode)} | ||
| 1483 | @findex c-backward-conditional | ||
| 1484 | Move point back over a preprocessor conditional, leaving the mark | ||
| 1485 | behind. A prefix argument acts as a repeat count. With a negative | ||
| 1486 | argument, move forward. | ||
| 1487 | |||
| 1488 | @item C-c C-n | ||
| 1489 | @kindex C-c C-n @r{(C mode)} | ||
| 1490 | @findex c-forward-conditional | ||
| 1491 | Move point forward across a preprocessor conditional, leaving the mark | ||
| 1492 | behind. A prefix argument acts as a repeat count. With a negative | ||
| 1493 | argument, move backward. | ||
| 1494 | |||
| 1495 | @item M-a | ||
| 1496 | @kindex M-a (C mode) | ||
| 1497 | @findex c-beginning-of-statement | ||
| 1498 | Move point to the beginning of the innermost C statement | ||
| 1499 | (@code{c-beginning-of-statement}). If point is already at the beginning | ||
| 1500 | of a statement, move to the beginning of the preceding statement. With | ||
| 1501 | prefix argument @var{n}, move back @var{n} @minus{} 1 statements. | ||
| 1502 | |||
| 1503 | In comments or in strings which span more than one line, this command | ||
| 1504 | moves by sentences instead of statements. | ||
| 1505 | |||
| 1506 | @item M-e | ||
| 1507 | @kindex M-e (C mode) | ||
| 1508 | @findex c-end-of-statement | ||
| 1509 | Move point to the end of the innermost C statement or sentence; like | ||
| 1510 | @kbd{M-a} except that it moves in the other direction | ||
| 1511 | (@code{c-end-of-statement}). | ||
| 1512 | @end table | ||
| 1513 | |||
| 1514 | @node Electric C | ||
| 1515 | @subsection Electric C Characters | ||
| 1516 | |||
| 1517 | In C mode and related modes, certain printing characters are | ||
| 1518 | @dfn{electric}---in addition to inserting themselves, they also | ||
| 1519 | reindent the current line, and optionally also insert newlines. The | ||
| 1520 | ``electric'' characters are @kbd{@{}, @kbd{@}}, @kbd{:}, @kbd{#}, | ||
| 1521 | @kbd{;}, @kbd{,}, @kbd{<}, @kbd{>}, @kbd{/}, @kbd{*}, @kbd{(}, and | ||
| 1522 | @kbd{)}. | ||
| 1523 | |||
| 1524 | You might find electric indentation inconvenient if you are editing | ||
| 1525 | chaotically indented code. If you are new to CC Mode, you might find | ||
| 1526 | it disconcerting. You can toggle electric action with the command | ||
| 1527 | @kbd{C-c C-l}; when it is enabled, @samp{/l} appears in the mode line | ||
| 1528 | after the mode name: | ||
| 1529 | |||
| 1530 | @table @kbd | ||
| 1531 | @item C-c C-l | ||
| 1532 | @kindex C-c C-l @r{(C mode)} | ||
| 1533 | @findex c-toggle-electric-state | ||
| 1534 | Toggle electric action (@code{c-toggle-electric-state}). With a | ||
| 1535 | prefix argument, this command enables electric action if the argument | ||
| 1536 | is positive, disables it if it is negative. | ||
| 1537 | @end table | ||
| 1538 | |||
| 1539 | Electric characters insert newlines only when, in addition to the | ||
| 1540 | electric state, the @dfn{auto-newline} feature is enabled (indicated | ||
| 1541 | by @samp{/la} in the mode line after the mode name). You can turn | ||
| 1542 | this feature on or off with the command @kbd{C-c C-a}: | ||
| 1543 | |||
| 1544 | @table @kbd | ||
| 1545 | @item C-c C-a | ||
| 1546 | @kindex C-c C-a @r{(C mode)} | ||
| 1547 | @findex c-toggle-auto-newline | ||
| 1548 | Toggle the auto-newline feature (@code{c-toggle-auto-newline}). With a | ||
| 1549 | prefix argument, this command turns the auto-newline feature on if the | ||
| 1550 | argument is positive, and off if it is negative. | ||
| 1551 | @end table | ||
| 1552 | |||
| 1553 | Usually the CC Mode style configures the exact circumstances in | ||
| 1554 | which Emacs inserts auto-newlines. You can also configure this | ||
| 1555 | directly. @xref{Custom Auto-newlines,,, ccmode, The CC Mode Manual}. | ||
| 1556 | |||
| 1557 | @node Hungry Delete | ||
| 1558 | @subsection Hungry Delete Feature in C | ||
| 1559 | @cindex hungry deletion (C Mode) | ||
| 1560 | |||
| 1561 | If you want to delete an entire block of whitespace at point, you | ||
| 1562 | can use @dfn{hungry deletion}. This deletes all the contiguous | ||
| 1563 | whitespace either before point or after point in a single operation. | ||
| 1564 | @dfn{Whitespace} here includes tabs and newlines, but not comments or | ||
| 1565 | preprocessor commands. | ||
| 1566 | |||
| 1567 | @table @kbd | ||
| 1568 | @item C-c C-@key{DEL} | ||
| 1569 | @itemx C-c @key{DEL} | ||
| 1570 | @findex c-hungry-delete-backwards | ||
| 1571 | @kindex C-c C-@key{DEL} (C Mode) | ||
| 1572 | @kindex C-c @key{DEL} (C Mode) | ||
| 1573 | @code{c-hungry-delete-backwards}---Delete the entire block of whitespace | ||
| 1574 | preceding point. | ||
| 1575 | |||
| 1576 | @item C-c C-d | ||
| 1577 | @itemx C-c C-@key{DELETE} | ||
| 1578 | @itemx C-c @key{DELETE} | ||
| 1579 | @findex c-hungry-delete-forward | ||
| 1580 | @kindex C-c C-d (C Mode) | ||
| 1581 | @kindex C-c C-@key{DELETE} (C Mode) | ||
| 1582 | @kindex C-c @key{DELETE} (C Mode) | ||
| 1583 | @code{c-hungry-delete-forward}---Delete the entire block of whitespace | ||
| 1584 | following point. | ||
| 1585 | @end table | ||
| 1586 | |||
| 1587 | As an alternative to the above commands, you can enable @dfn{hungry | ||
| 1588 | delete mode}. When this feature is enabled (indicated by @samp{/h} in | ||
| 1589 | the mode line after the mode name), a single @key{DEL} deletes all | ||
| 1590 | preceding whitespace, not just one space, and a single @kbd{C-c C-d} | ||
| 1591 | (but @emph{not} plain @key{DELETE}) deletes all following whitespace. | ||
| 1592 | |||
| 1593 | @table @kbd | ||
| 1594 | @item M-x c-toggle-hungry-state | ||
| 1595 | @findex c-toggle-hungry-state | ||
| 1596 | Toggle the hungry-delete feature | ||
| 1597 | (@code{c-toggle-hungry-state})@footnote{This command had the binding | ||
| 1598 | @kbd{C-c C-d} in earlier versions of Emacs. @kbd{C-c C-d} is now | ||
| 1599 | bound to @code{c-hungry-delete-forward}.}. With a prefix argument, | ||
| 1600 | this command turns the hungry-delete feature on if the argument is | ||
| 1601 | positive, and off if it is negative. | ||
| 1602 | @end table | ||
| 1603 | |||
| 1604 | @vindex c-hungry-delete-key | ||
| 1605 | The variable @code{c-hungry-delete-key} controls whether the | ||
| 1606 | hungry-delete feature is enabled. | ||
| 1607 | |||
| 1608 | @node Other C Commands | ||
| 1609 | @subsection Other Commands for C Mode | ||
| 1610 | |||
| 1611 | @table @kbd | ||
| 1612 | @item C-c C-w | ||
| 1613 | @itemx M-x c-subword-mode | ||
| 1614 | @findex c-subword-mode | ||
| 1615 | Enable (or disable) @dfn{subword mode}. In subword mode, Emacs's word | ||
| 1616 | commands recognize upper case letters in | ||
| 1617 | @samp{StudlyCapsIdentifiers} as word boundaries. This is indicated by | ||
| 1618 | the flag @samp{/w} on the mode line after the mode name | ||
| 1619 | (e.g. @samp{C/law}). You can even use @kbd{M-x c-subword-mode} in | ||
| 1620 | non-CC Mode buffers. | ||
| 1621 | |||
| 1622 | In the GNU project, we recommend using underscores to separate words | ||
| 1623 | within an identifier in C or C++, rather than using case distinctions. | ||
| 1624 | |||
| 1625 | @item M-x c-context-line-break | ||
| 1626 | @findex c-context-line-break | ||
| 1627 | This command inserts a line break and indents the new line in a manner | ||
| 1628 | appropriate to the context. In normal code, it does the work of | ||
| 1629 | @kbd{C-j} (@code{newline-and-indent}), in a C preprocessor line it | ||
| 1630 | additionally inserts a @samp{\} at the line break, and within comments | ||
| 1631 | it's like @kbd{M-j} (@code{c-indent-new-comment-line}). | ||
| 1632 | |||
| 1633 | @code{c-context-line-break} isn't bound to a key by default, but it | ||
| 1634 | needs a binding to be useful. The following code will bind it to | ||
| 1635 | @kbd{C-j}. We use @code{c-initialization-hook} here to make sure | ||
| 1636 | the keymap is loaded before we try to change it. | ||
| 1637 | |||
| 1638 | @smallexample | ||
| 1639 | (defun my-bind-clb () | ||
| 1640 | (define-key c-mode-base-map "\C-j" 'c-context-line-break)) | ||
| 1641 | (add-hook 'c-initialization-hook 'my-bind-clb) | ||
| 1642 | @end smallexample | ||
| 1643 | |||
| 1644 | @item C-M-h | ||
| 1645 | Put mark at the end of a function definition, and put point at the | ||
| 1646 | beginning (@code{c-mark-function}). | ||
| 1647 | |||
| 1648 | @item M-q | ||
| 1649 | @kindex M-q @r{(C mode)} | ||
| 1650 | @findex c-fill-paragraph | ||
| 1651 | Fill a paragraph, handling C and C++ comments (@code{c-fill-paragraph}). | ||
| 1652 | If any part of the current line is a comment or within a comment, this | ||
| 1653 | command fills the comment or the paragraph of it that point is in, | ||
| 1654 | preserving the comment indentation and comment delimiters. | ||
| 1655 | |||
| 1656 | @item C-c C-e | ||
| 1657 | @cindex macro expansion in C | ||
| 1658 | @cindex expansion of C macros | ||
| 1659 | @findex c-macro-expand | ||
| 1660 | @kindex C-c C-e @r{(C mode)} | ||
| 1661 | Run the C preprocessor on the text in the region, and show the result, | ||
| 1662 | which includes the expansion of all the macro calls | ||
| 1663 | (@code{c-macro-expand}). The buffer text before the region is also | ||
| 1664 | included in preprocessing, for the sake of macros defined there, but the | ||
| 1665 | output from this part isn't shown. | ||
| 1666 | |||
| 1667 | When you are debugging C code that uses macros, sometimes it is hard to | ||
| 1668 | figure out precisely how the macros expand. With this command, you | ||
| 1669 | don't have to figure it out; you can see the expansions. | ||
| 1670 | |||
| 1671 | @item C-c C-\ | ||
| 1672 | @findex c-backslash-region | ||
| 1673 | @kindex C-c C-\ @r{(C mode)} | ||
| 1674 | Insert or align @samp{\} characters at the ends of the lines of the | ||
| 1675 | region (@code{c-backslash-region}). This is useful after writing or | ||
| 1676 | editing a C macro definition. | ||
| 1677 | |||
| 1678 | If a line already ends in @samp{\}, this command adjusts the amount of | ||
| 1679 | whitespace before it. Otherwise, it inserts a new @samp{\}. However, | ||
| 1680 | the last line in the region is treated specially; no @samp{\} is | ||
| 1681 | inserted on that line, and any @samp{\} there is deleted. | ||
| 1682 | |||
| 1683 | @item M-x cpp-highlight-buffer | ||
| 1684 | @cindex preprocessor highlighting | ||
| 1685 | @findex cpp-highlight-buffer | ||
| 1686 | Highlight parts of the text according to its preprocessor conditionals. | ||
| 1687 | This command displays another buffer named @samp{*CPP Edit*}, which | ||
| 1688 | serves as a graphic menu for selecting how to display particular kinds | ||
| 1689 | of conditionals and their contents. After changing various settings, | ||
| 1690 | click on @samp{[A]pply these settings} (or go to that buffer and type | ||
| 1691 | @kbd{a}) to rehighlight the C mode buffer accordingly. | ||
| 1692 | |||
| 1693 | @item C-c C-s | ||
| 1694 | @findex c-show-syntactic-information | ||
| 1695 | @kindex C-c C-s @r{(C mode)} | ||
| 1696 | Display the syntactic information about the current source line | ||
| 1697 | (@code{c-show-syntactic-information}). This information directs how | ||
| 1698 | the line is indented. | ||
| 1699 | |||
| 1700 | @item M-x cwarn-mode | ||
| 1701 | @itemx M-x global-cwarn-mode | ||
| 1702 | @findex cwarn-mode | ||
| 1703 | @findex global-cwarn-mode | ||
| 1704 | @vindex global-cwarn-mode | ||
| 1705 | @cindex CWarn mode | ||
| 1706 | @cindex suspicious constructions in C, C++ | ||
| 1707 | CWarn minor mode highlights certain suspicious C and C++ constructions: | ||
| 1708 | |||
| 1709 | @itemize @bullet{} | ||
| 1710 | @item | ||
| 1711 | Assignments inside expressions. | ||
| 1712 | @item | ||
| 1713 | Semicolon following immediately after @samp{if}, @samp{for}, and @samp{while} | ||
| 1714 | (except after a @samp{do @dots{} while} statement); | ||
| 1715 | @item | ||
| 1716 | C++ functions with reference parameters. | ||
| 1717 | @end itemize | ||
| 1718 | |||
| 1719 | @noindent | ||
| 1720 | You can enable the mode for one buffer with the command @kbd{M-x | ||
| 1721 | cwarn-mode}, or for all suitable buffers with the command @kbd{M-x | ||
| 1722 | global-cwarn-mode} or by customizing the variable | ||
| 1723 | @code{global-cwarn-mode}. You must also enable Font Lock mode to make | ||
| 1724 | it work. | ||
| 1725 | |||
| 1726 | @item M-x hide-ifdef-mode | ||
| 1727 | @findex hide-ifdef-mode | ||
| 1728 | @cindex Hide-ifdef mode | ||
| 1729 | Hide-ifdef minor mode hides selected code within @samp{#if} and | ||
| 1730 | @samp{#ifdef} preprocessor blocks. See the documentation string of | ||
| 1731 | @code{hide-ifdef-mode} for more information. | ||
| 1732 | |||
| 1733 | @item M-x ff-find-related-file | ||
| 1734 | @cindex related files | ||
| 1735 | @findex ff-find-related-file | ||
| 1736 | @vindex ff-related-file-alist | ||
| 1737 | Find a file ``related'' in a special way to the file visited by the | ||
| 1738 | current buffer. Typically this will be the header file corresponding | ||
| 1739 | to a C/C++ source file, or vice versa. The variable | ||
| 1740 | @code{ff-related-file-alist} specifies how to compute related file | ||
| 1741 | names. | ||
| 1742 | @end table | ||
| 1743 | |||
| 1744 | @node Asm Mode | ||
| 1745 | @section Asm Mode | ||
| 1746 | |||
| 1747 | @cindex Asm mode | ||
| 1748 | @cindex assembler mode | ||
| 1749 | Asm mode is a major mode for editing files of assembler code. It | ||
| 1750 | defines these commands: | ||
| 1751 | |||
| 1752 | @table @kbd | ||
| 1753 | @item @key{TAB} | ||
| 1754 | @code{tab-to-tab-stop}. | ||
| 1755 | @item C-j | ||
| 1756 | Insert a newline and then indent using @code{tab-to-tab-stop}. | ||
| 1757 | @item : | ||
| 1758 | Insert a colon and then remove the indentation from before the label | ||
| 1759 | preceding colon. Then do @code{tab-to-tab-stop}. | ||
| 1760 | @item ; | ||
| 1761 | Insert or align a comment. | ||
| 1762 | @end table | ||
| 1763 | |||
| 1764 | The variable @code{asm-comment-char} specifies which character | ||
| 1765 | starts comments in assembler syntax. | ||
| 1766 | |||
| 1767 | @ifnottex | ||
| 1768 | @include fortran-xtra.texi | ||
| 1769 | @end ifnottex | ||
| 1770 | |||
| 1771 | @ignore | ||
| 1772 | arch-tag: c7ee7409-40a4-45c7-bfb7-ae7f2c74d0c0 | ||
| 1773 | @end ignore | ||
diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi new file mode 100644 index 00000000000..475a3b7b1b5 --- /dev/null +++ b/doc/emacs/regs.texi | |||
| @@ -0,0 +1,330 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Registers, Display, CUA Bindings, Top | ||
| 6 | @chapter Registers | ||
| 7 | @cindex registers | ||
| 8 | |||
| 9 | Emacs @dfn{registers} are compartments where you can save text, | ||
| 10 | rectangles, positions, and other things for later use. Once you save | ||
| 11 | text or a rectangle in a register, you can copy it into the buffer | ||
| 12 | once, or many times; you can move point to a position saved in a | ||
| 13 | register once, or many times. | ||
| 14 | |||
| 15 | @findex view-register | ||
| 16 | Each register has a name, which consists of a single character. A | ||
| 17 | register can store a number, a piece of text, a rectangle, a position, | ||
| 18 | a window configuration, or a file name, but only one thing at any | ||
| 19 | given time. Whatever you store in a register remains there until you | ||
| 20 | store something else in that register. To see what a register @var{r} | ||
| 21 | contains, use @kbd{M-x view-register}. | ||
| 22 | |||
| 23 | @table @kbd | ||
| 24 | @item M-x view-register @key{RET} @var{r} | ||
| 25 | Display a description of what register @var{r} contains. | ||
| 26 | @end table | ||
| 27 | |||
| 28 | @dfn{Bookmarks} record files and positions in them, so you can | ||
| 29 | return to those positions when you look at the file again. | ||
| 30 | Bookmarks are similar enough in spirit to registers that they | ||
| 31 | seem to belong in this chapter. | ||
| 32 | |||
| 33 | @menu | ||
| 34 | * Position: RegPos. Saving positions in registers. | ||
| 35 | * Text: RegText. Saving text in registers. | ||
| 36 | * Rectangle: RegRect. Saving rectangles in registers. | ||
| 37 | * Configurations: RegConfig. Saving window configurations in registers. | ||
| 38 | * Numbers: RegNumbers. Numbers in registers. | ||
| 39 | * Files: RegFiles. File names in registers. | ||
| 40 | * Bookmarks:: Bookmarks are like registers, but persistent. | ||
| 41 | @end menu | ||
| 42 | |||
| 43 | @node RegPos | ||
| 44 | @section Saving Positions in Registers | ||
| 45 | @cindex saving position in a register | ||
| 46 | |||
| 47 | Saving a position records a place in a buffer so that you can move | ||
| 48 | back there later. Moving to a saved position switches to that buffer | ||
| 49 | and moves point to that place in it. | ||
| 50 | |||
| 51 | @table @kbd | ||
| 52 | @item C-x r @key{SPC} @var{r} | ||
| 53 | Save position of point in register @var{r} (@code{point-to-register}). | ||
| 54 | @item C-x r j @var{r} | ||
| 55 | Jump to the position saved in register @var{r} (@code{jump-to-register}). | ||
| 56 | @end table | ||
| 57 | |||
| 58 | @kindex C-x r SPC | ||
| 59 | @findex point-to-register | ||
| 60 | To save the current position of point in a register, choose a name | ||
| 61 | @var{r} and type @kbd{C-x r @key{SPC} @var{r}}. The register @var{r} | ||
| 62 | retains the position thus saved until you store something else in that | ||
| 63 | register. | ||
| 64 | |||
| 65 | @kindex C-x r j | ||
| 66 | @findex jump-to-register | ||
| 67 | The command @kbd{C-x r j @var{r}} moves point to the position recorded | ||
| 68 | in register @var{r}. The register is not affected; it continues to | ||
| 69 | hold the same position. You can jump to the saved position any number | ||
| 70 | of times. | ||
| 71 | |||
| 72 | If you use @kbd{C-x r j} to go to a saved position, but the buffer it | ||
| 73 | was saved from has been killed, @kbd{C-x r j} tries to create the buffer | ||
| 74 | again by visiting the same file. Of course, this works only for buffers | ||
| 75 | that were visiting files. | ||
| 76 | |||
| 77 | @node RegText | ||
| 78 | @section Saving Text in Registers | ||
| 79 | @cindex saving text in a register | ||
| 80 | |||
| 81 | When you want to insert a copy of the same piece of text several | ||
| 82 | times, it may be inconvenient to yank it from the kill ring, since each | ||
| 83 | subsequent kill moves that entry further down the ring. An alternative | ||
| 84 | is to store the text in a register and later retrieve it. | ||
| 85 | |||
| 86 | @table @kbd | ||
| 87 | @item C-x r s @var{r} | ||
| 88 | Copy region into register @var{r} (@code{copy-to-register}). | ||
| 89 | @item C-x r i @var{r} | ||
| 90 | Insert text from register @var{r} (@code{insert-register}). | ||
| 91 | @item M-x append-to-register @key{RET} @var{r} | ||
| 92 | Append region to text in register @var{r}. | ||
| 93 | @item M-x prepend-to-register @key{RET} @var{r} | ||
| 94 | Prepend region to text in register @var{r}. | ||
| 95 | @end table | ||
| 96 | |||
| 97 | @kindex C-x r s | ||
| 98 | @kindex C-x r i | ||
| 99 | @findex copy-to-register | ||
| 100 | @findex insert-register | ||
| 101 | @kbd{C-x r s @var{r}} stores a copy of the text of the region into | ||
| 102 | the register named @var{r}. @kbd{C-u C-x r s @var{r}}, the same | ||
| 103 | command with a numeric argument, deletes the text from the buffer as | ||
| 104 | well; you can think of this as ``moving'' the region text into the register. | ||
| 105 | |||
| 106 | @findex append-to-register | ||
| 107 | @findex prepend-to-register | ||
| 108 | @kbd{M-x append-to-register @key{RET} @var{r}} appends the copy of | ||
| 109 | the text in the region to the text already stored in the register | ||
| 110 | named @var{r}. If invoked with a numeric argument, it deletes the | ||
| 111 | region after appending it to the register. The command | ||
| 112 | @code{prepend-to-register} is similar, except that it @emph{prepends} | ||
| 113 | the region text to the text in the register, rather than | ||
| 114 | @emph{appending} it. | ||
| 115 | |||
| 116 | @kbd{C-x r i @var{r}} inserts in the buffer the text from register | ||
| 117 | @var{r}. Normally it leaves point before the text and places the mark | ||
| 118 | after, but with a numeric argument (@kbd{C-u}) it puts point after the | ||
| 119 | text and the mark before. | ||
| 120 | |||
| 121 | @node RegRect | ||
| 122 | @section Saving Rectangles in Registers | ||
| 123 | @cindex saving rectangle in a register | ||
| 124 | |||
| 125 | A register can contain a rectangle instead of linear text. The | ||
| 126 | rectangle is represented as a list of strings. @xref{Rectangles}, for | ||
| 127 | basic information on how to specify a rectangle in the buffer. | ||
| 128 | |||
| 129 | @table @kbd | ||
| 130 | @findex copy-rectangle-to-register | ||
| 131 | @kindex C-x r r | ||
| 132 | @item C-x r r @var{r} | ||
| 133 | Copy the region-rectangle into register @var{r} | ||
| 134 | (@code{copy-rectangle-to-register}). With numeric argument, delete it as | ||
| 135 | well. | ||
| 136 | @item C-x r i @var{r} | ||
| 137 | Insert the rectangle stored in register @var{r} (if it contains a | ||
| 138 | rectangle) (@code{insert-register}). | ||
| 139 | @end table | ||
| 140 | |||
| 141 | The @kbd{C-x r i @var{r}} command inserts a text string if the | ||
| 142 | register contains one, and inserts a rectangle if the register contains | ||
| 143 | one. | ||
| 144 | |||
| 145 | See also the command @code{sort-columns}, which you can think of | ||
| 146 | as sorting a rectangle. @xref{Sorting}. | ||
| 147 | |||
| 148 | @node RegConfig | ||
| 149 | @section Saving Window Configurations in Registers | ||
| 150 | @cindex saving window configuration in a register | ||
| 151 | |||
| 152 | @findex window-configuration-to-register | ||
| 153 | @findex frame-configuration-to-register | ||
| 154 | @kindex C-x r w | ||
| 155 | @kindex C-x r f | ||
| 156 | You can save the window configuration of the selected frame in a | ||
| 157 | register, or even the configuration of all windows in all frames, and | ||
| 158 | restore the configuration later. | ||
| 159 | |||
| 160 | @table @kbd | ||
| 161 | @item C-x r w @var{r} | ||
| 162 | Save the state of the selected frame's windows in register @var{r} | ||
| 163 | (@code{window-configuration-to-register}). | ||
| 164 | @item C-x r f @var{r} | ||
| 165 | Save the state of all frames, including all their windows, in register | ||
| 166 | @var{r} (@code{frame-configuration-to-register}). | ||
| 167 | @end table | ||
| 168 | |||
| 169 | Use @kbd{C-x r j @var{r}} to restore a window or frame configuration. | ||
| 170 | This is the same command used to restore a cursor position. When you | ||
| 171 | restore a frame configuration, any existing frames not included in the | ||
| 172 | configuration become invisible. If you wish to delete these frames | ||
| 173 | instead, use @kbd{C-u C-x r j @var{r}}. | ||
| 174 | |||
| 175 | @node RegNumbers | ||
| 176 | @section Keeping Numbers in Registers | ||
| 177 | @cindex saving number in a register | ||
| 178 | |||
| 179 | There are commands to store a number in a register, to insert | ||
| 180 | the number in the buffer in decimal, and to increment it. These commands | ||
| 181 | can be useful in keyboard macros (@pxref{Keyboard Macros}). | ||
| 182 | |||
| 183 | @table @kbd | ||
| 184 | @item C-u @var{number} C-x r n @var{r} | ||
| 185 | @kindex C-x r n | ||
| 186 | @findex number-to-register | ||
| 187 | Store @var{number} into register @var{r} (@code{number-to-register}). | ||
| 188 | @item C-u @var{number} C-x r + @var{r} | ||
| 189 | @kindex C-x r + | ||
| 190 | @findex increment-register | ||
| 191 | Increment the number in register @var{r} by @var{number} | ||
| 192 | (@code{increment-register}). | ||
| 193 | @item C-x r i @var{r} | ||
| 194 | Insert the number from register @var{r} into the buffer. | ||
| 195 | @end table | ||
| 196 | |||
| 197 | @kbd{C-x r i} is the same command used to insert any other sort of | ||
| 198 | register contents into the buffer. @kbd{C-x r +} with no numeric | ||
| 199 | argument increments the register value by 1; @kbd{C-x r n} with no | ||
| 200 | numeric argument stores zero in the register. | ||
| 201 | |||
| 202 | @node RegFiles | ||
| 203 | @section Keeping File Names in Registers | ||
| 204 | @cindex saving file name in a register | ||
| 205 | |||
| 206 | If you visit certain file names frequently, you can visit them more | ||
| 207 | conveniently if you put their names in registers. Here's the Lisp code | ||
| 208 | used to put a file name in a register: | ||
| 209 | |||
| 210 | @smallexample | ||
| 211 | (set-register ?@var{r} '(file . @var{name})) | ||
| 212 | @end smallexample | ||
| 213 | |||
| 214 | @need 3000 | ||
| 215 | @noindent | ||
| 216 | For example, | ||
| 217 | |||
| 218 | @smallexample | ||
| 219 | (set-register ?z '(file . "/gd/gnu/emacs/19.0/src/ChangeLog")) | ||
| 220 | @end smallexample | ||
| 221 | |||
| 222 | @noindent | ||
| 223 | puts the file name shown in register @samp{z}. | ||
| 224 | |||
| 225 | To visit the file whose name is in register @var{r}, type @kbd{C-x r j | ||
| 226 | @var{r}}. (This is the same command used to jump to a position or | ||
| 227 | restore a frame configuration.) | ||
| 228 | |||
| 229 | @node Bookmarks | ||
| 230 | @section Bookmarks | ||
| 231 | @cindex bookmarks | ||
| 232 | |||
| 233 | @dfn{Bookmarks} are somewhat like registers in that they record | ||
| 234 | positions you can jump to. Unlike registers, they have long names, and | ||
| 235 | they persist automatically from one Emacs session to the next. The | ||
| 236 | prototypical use of bookmarks is to record ``where you were reading'' in | ||
| 237 | various files. | ||
| 238 | |||
| 239 | @table @kbd | ||
| 240 | @item C-x r m @key{RET} | ||
| 241 | Set the bookmark for the visited file, at point. | ||
| 242 | |||
| 243 | @item C-x r m @var{bookmark} @key{RET} | ||
| 244 | @findex bookmark-set | ||
| 245 | Set the bookmark named @var{bookmark} at point (@code{bookmark-set}). | ||
| 246 | |||
| 247 | @item C-x r b @var{bookmark} @key{RET} | ||
| 248 | @findex bookmark-jump | ||
| 249 | Jump to the bookmark named @var{bookmark} (@code{bookmark-jump}). | ||
| 250 | |||
| 251 | @item C-x r l | ||
| 252 | @findex list-bookmarks | ||
| 253 | List all bookmarks (@code{list-bookmarks}). | ||
| 254 | |||
| 255 | @item M-x bookmark-save | ||
| 256 | @findex bookmark-save | ||
| 257 | Save all the current bookmark values in the default bookmark file. | ||
| 258 | @end table | ||
| 259 | |||
| 260 | @kindex C-x r m | ||
| 261 | @findex bookmark-set | ||
| 262 | @kindex C-x r b | ||
| 263 | @findex bookmark-jump | ||
| 264 | The prototypical use for bookmarks is to record one current position | ||
| 265 | in each of several files. So the command @kbd{C-x r m}, which sets a | ||
| 266 | bookmark, uses the visited file name as the default for the bookmark | ||
| 267 | name. If you name each bookmark after the file it points to, then you | ||
| 268 | can conveniently revisit any of those files with @kbd{C-x r b}, and move | ||
| 269 | to the position of the bookmark at the same time. | ||
| 270 | |||
| 271 | @kindex C-x r l | ||
| 272 | To display a list of all your bookmarks in a separate buffer, type | ||
| 273 | @kbd{C-x r l} (@code{list-bookmarks}). If you switch to that buffer, | ||
| 274 | you can use it to edit your bookmark definitions or annotate the | ||
| 275 | bookmarks. Type @kbd{C-h m} in the bookmark buffer for more | ||
| 276 | information about its special editing commands. | ||
| 277 | |||
| 278 | When you kill Emacs, Emacs offers to save your bookmark values in your | ||
| 279 | default bookmark file, @file{~/.emacs.bmk}, if you have changed any | ||
| 280 | bookmark values. You can also save the bookmarks at any time with the | ||
| 281 | @kbd{M-x bookmark-save} command. The bookmark commands load your | ||
| 282 | default bookmark file automatically. This saving and loading is how | ||
| 283 | bookmarks persist from one Emacs session to the next. | ||
| 284 | |||
| 285 | @vindex bookmark-save-flag | ||
| 286 | If you set the variable @code{bookmark-save-flag} to 1, then each | ||
| 287 | command that sets a bookmark will also save your bookmarks; this way, | ||
| 288 | you don't lose any bookmark values even if Emacs crashes. (The value, | ||
| 289 | if a number, says how many bookmark modifications should go by between | ||
| 290 | saving.) | ||
| 291 | |||
| 292 | @vindex bookmark-search-size | ||
| 293 | Bookmark position values are saved with surrounding context, so that | ||
| 294 | @code{bookmark-jump} can find the proper position even if the file is | ||
| 295 | modified slightly. The variable @code{bookmark-search-size} says how | ||
| 296 | many characters of context to record on each side of the bookmark's | ||
| 297 | position. | ||
| 298 | |||
| 299 | Here are some additional commands for working with bookmarks: | ||
| 300 | |||
| 301 | @table @kbd | ||
| 302 | @item M-x bookmark-load @key{RET} @var{filename} @key{RET} | ||
| 303 | @findex bookmark-load | ||
| 304 | Load a file named @var{filename} that contains a list of bookmark | ||
| 305 | values. You can use this command, as well as @code{bookmark-write}, to | ||
| 306 | work with other files of bookmark values in addition to your default | ||
| 307 | bookmark file. | ||
| 308 | |||
| 309 | @item M-x bookmark-write @key{RET} @var{filename} @key{RET} | ||
| 310 | @findex bookmark-write | ||
| 311 | Save all the current bookmark values in the file @var{filename}. | ||
| 312 | |||
| 313 | @item M-x bookmark-delete @key{RET} @var{bookmark} @key{RET} | ||
| 314 | @findex bookmark-delete | ||
| 315 | Delete the bookmark named @var{bookmark}. | ||
| 316 | |||
| 317 | @item M-x bookmark-insert-location @key{RET} @var{bookmark} @key{RET} | ||
| 318 | @findex bookmark-insert-location | ||
| 319 | Insert in the buffer the name of the file that bookmark @var{bookmark} | ||
| 320 | points to. | ||
| 321 | |||
| 322 | @item M-x bookmark-insert @key{RET} @var{bookmark} @key{RET} | ||
| 323 | @findex bookmark-insert | ||
| 324 | Insert in the buffer the @emph{contents} of the file that bookmark | ||
| 325 | @var{bookmark} points to. | ||
| 326 | @end table | ||
| 327 | |||
| 328 | @ignore | ||
| 329 | arch-tag: b00af991-ebc3-4b3a-8e82-a3ac81ff2e64 | ||
| 330 | @end ignore | ||
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi new file mode 100644 index 00000000000..7c36a31ff18 --- /dev/null +++ b/doc/emacs/rmail.texi | |||
| @@ -0,0 +1,1430 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Rmail, Dired, Sending Mail, Top | ||
| 6 | @chapter Reading Mail with Rmail | ||
| 7 | @cindex Rmail | ||
| 8 | @cindex reading mail | ||
| 9 | @findex rmail | ||
| 10 | @findex rmail-mode | ||
| 11 | @vindex rmail-mode-hook | ||
| 12 | |||
| 13 | Rmail is an Emacs subsystem for reading and disposing of mail that | ||
| 14 | you receive. Rmail stores mail messages in files called Rmail files | ||
| 15 | which use a special format. Reading the message in an Rmail file is | ||
| 16 | done in a special major mode, Rmail mode, which redefines most letters | ||
| 17 | to run commands for managing mail. | ||
| 18 | @menu | ||
| 19 | * Basic: Rmail Basics. Basic concepts of Rmail, and simple use. | ||
| 20 | * Scroll: Rmail Scrolling. Scrolling through a message. | ||
| 21 | * Motion: Rmail Motion. Moving to another message. | ||
| 22 | * Deletion: Rmail Deletion. Deleting and expunging messages. | ||
| 23 | * Inbox: Rmail Inbox. How mail gets into the Rmail file. | ||
| 24 | * Files: Rmail Files. Using multiple Rmail files. | ||
| 25 | * Output: Rmail Output. Copying message out to files. | ||
| 26 | * Labels: Rmail Labels. Classifying messages by labeling them. | ||
| 27 | * Attrs: Rmail Attributes. Certain standard labels, called attributes. | ||
| 28 | * Reply: Rmail Reply. Sending replies to messages you are viewing. | ||
| 29 | * Summary: Rmail Summary. Summaries show brief info on many messages. | ||
| 30 | * Sort: Rmail Sorting. Sorting messages in Rmail. | ||
| 31 | * Display: Rmail Display. How Rmail displays a message; customization. | ||
| 32 | * Coding: Rmail Coding. How Rmail handles decoding character sets. | ||
| 33 | * Editing: Rmail Editing. Editing message text and headers in Rmail. | ||
| 34 | * Digest: Rmail Digest. Extracting the messages from a digest message. | ||
| 35 | * Out of Rmail:: Converting an Rmail file to mailbox format. | ||
| 36 | * Rot13: Rmail Rot13. Reading messages encoded in the rot13 code. | ||
| 37 | * Movemail:: More details of fetching new mail. | ||
| 38 | * Remote Mailboxes:: Retrieving Mail from Remote Mailboxes. | ||
| 39 | * Other Mailbox Formats:: Retrieving Mail from Local Mailboxes in | ||
| 40 | Various Formats | ||
| 41 | @end menu | ||
| 42 | |||
| 43 | @node Rmail Basics | ||
| 44 | @section Basic Concepts of Rmail | ||
| 45 | |||
| 46 | @cindex primary Rmail file | ||
| 47 | @vindex rmail-file-name | ||
| 48 | Using Rmail in the simplest fashion, you have one Rmail file | ||
| 49 | @file{~/RMAIL} in which all of your mail is saved. It is called your | ||
| 50 | @dfn{primary Rmail file}. The command @kbd{M-x rmail} reads your primary | ||
| 51 | Rmail file, merges new mail in from your inboxes, displays the first | ||
| 52 | message you haven't read yet, and lets you begin reading. The variable | ||
| 53 | @code{rmail-file-name} specifies the name of the primary Rmail file. | ||
| 54 | |||
| 55 | Rmail uses narrowing to hide all but one message in the Rmail file. | ||
| 56 | The message that is shown is called the @dfn{current message}. Rmail | ||
| 57 | mode's special commands can do such things as delete the current | ||
| 58 | message, copy it into another file, send a reply, or move to another | ||
| 59 | message. You can also create multiple Rmail files and use Rmail to move | ||
| 60 | messages between them. | ||
| 61 | |||
| 62 | @cindex message number | ||
| 63 | Within the Rmail file, messages are normally arranged sequentially in | ||
| 64 | order of receipt; you can specify other ways to sort them. Messages are | ||
| 65 | identified by consecutive integers which are their @dfn{message numbers}. | ||
| 66 | The number of the current message is displayed in Rmail's mode line, | ||
| 67 | followed by the total number of messages in the file. You can move to | ||
| 68 | a message by specifying its message number with the @kbd{j} key | ||
| 69 | (@pxref{Rmail Motion}). | ||
| 70 | |||
| 71 | @kindex s @r{(Rmail)} | ||
| 72 | @findex rmail-expunge-and-save | ||
| 73 | Following the usual conventions of Emacs, changes in an Rmail file | ||
| 74 | become permanent only when you save the file. You can save it with | ||
| 75 | @kbd{s} (@code{rmail-expunge-and-save}), which also expunges deleted | ||
| 76 | messages from the file first (@pxref{Rmail Deletion}). To save the | ||
| 77 | file without expunging, use @kbd{C-x C-s}. Rmail also saves the Rmail | ||
| 78 | file after merging new mail from an inbox file (@pxref{Rmail Inbox}). | ||
| 79 | |||
| 80 | @kindex q @r{(Rmail)} | ||
| 81 | @findex rmail-quit | ||
| 82 | @kindex b @r{(Rmail)} | ||
| 83 | @findex rmail-bury | ||
| 84 | You can exit Rmail with @kbd{q} (@code{rmail-quit}); this expunges | ||
| 85 | and saves the Rmail file, then buries the Rmail buffer as well as its | ||
| 86 | summary buffer, if present (@pxref{Rmail Summary}). But there is no | ||
| 87 | need to ``exit'' formally. If you switch from Rmail to editing in | ||
| 88 | other buffers, and never switch back, you have exited. Just make sure | ||
| 89 | to save the Rmail file eventually (like any other file you have | ||
| 90 | changed). @kbd{C-x s} is a suitable way to do this (@pxref{Save | ||
| 91 | Commands}). The Rmail command @kbd{b}, @code{rmail-bury}, buries the | ||
| 92 | Rmail buffer and its summary buffer without expunging and saving the | ||
| 93 | Rmail file. | ||
| 94 | |||
| 95 | @node Rmail Scrolling | ||
| 96 | @section Scrolling Within a Message | ||
| 97 | |||
| 98 | When Rmail displays a message that does not fit on the screen, you | ||
| 99 | must scroll through it to read the rest. You could do this with | ||
| 100 | @kbd{C-v}, @kbd{M-v} and @kbd{M-<}, but in Rmail scrolling is so | ||
| 101 | frequent that it deserves to be easier. | ||
| 102 | |||
| 103 | @table @kbd | ||
| 104 | @item @key{SPC} | ||
| 105 | Scroll forward (@code{scroll-up}). | ||
| 106 | @item @key{DEL} | ||
| 107 | Scroll backward (@code{scroll-down}). | ||
| 108 | @item . | ||
| 109 | Scroll to start of message (@code{rmail-beginning-of-message}). | ||
| 110 | @item / | ||
| 111 | Scroll to end of message (@code{rmail-end-of-message}). | ||
| 112 | @end table | ||
| 113 | |||
| 114 | @kindex SPC @r{(Rmail)} | ||
| 115 | @kindex DEL @r{(Rmail)} | ||
| 116 | Since the most common thing to do while reading a message is to scroll | ||
| 117 | through it by screenfuls, Rmail makes @key{SPC} and @key{DEL} synonyms of | ||
| 118 | @kbd{C-v} (@code{scroll-up}) and @kbd{M-v} (@code{scroll-down}) | ||
| 119 | |||
| 120 | @kindex . @r{(Rmail)} | ||
| 121 | @kindex / @r{(Rmail)} | ||
| 122 | @findex rmail-beginning-of-message | ||
| 123 | @findex rmail-end-of-message | ||
| 124 | The command @kbd{.} (@code{rmail-beginning-of-message}) scrolls back to the | ||
| 125 | beginning of the selected message. This is not quite the same as @kbd{M-<}: | ||
| 126 | for one thing, it does not set the mark; for another, it resets the buffer | ||
| 127 | boundaries to the current message if you have changed them. Similarly, | ||
| 128 | the command @kbd{/} (@code{rmail-end-of-message}) scrolls forward to the end | ||
| 129 | of the selected message. | ||
| 130 | |||
| 131 | @node Rmail Motion | ||
| 132 | @section Moving Among Messages | ||
| 133 | |||
| 134 | The most basic thing to do with a message is to read it. The way to | ||
| 135 | do this in Rmail is to make the message current. The usual practice is | ||
| 136 | to move sequentially through the file, since this is the order of | ||
| 137 | receipt of messages. When you enter Rmail, you are positioned at the | ||
| 138 | first message that you have not yet made current (that is, the first one | ||
| 139 | that has the @samp{unseen} attribute; @pxref{Rmail Attributes}). Move | ||
| 140 | forward to see the other new messages; move backward to re-examine old | ||
| 141 | messages. | ||
| 142 | |||
| 143 | @table @kbd | ||
| 144 | @item n | ||
| 145 | Move to the next nondeleted message, skipping any intervening deleted | ||
| 146 | messages (@code{rmail-next-undeleted-message}). | ||
| 147 | @item p | ||
| 148 | Move to the previous nondeleted message | ||
| 149 | (@code{rmail-previous-undeleted-message}). | ||
| 150 | @item M-n | ||
| 151 | Move to the next message, including deleted messages | ||
| 152 | (@code{rmail-next-message}). | ||
| 153 | @item M-p | ||
| 154 | Move to the previous message, including deleted messages | ||
| 155 | (@code{rmail-previous-message}). | ||
| 156 | @item j | ||
| 157 | Move to the first message. With argument @var{n}, move to | ||
| 158 | message number @var{n} (@code{rmail-show-message}). | ||
| 159 | @item > | ||
| 160 | Move to the last message (@code{rmail-last-message}). | ||
| 161 | @item < | ||
| 162 | Move to the first message (@code{rmail-first-message}). | ||
| 163 | |||
| 164 | @item M-s @var{regexp} @key{RET} | ||
| 165 | Move to the next message containing a match for @var{regexp} | ||
| 166 | (@code{rmail-search}). | ||
| 167 | |||
| 168 | @item - M-s @var{regexp} @key{RET} | ||
| 169 | Move to the previous message containing a match for @var{regexp}. | ||
| 170 | @end table | ||
| 171 | |||
| 172 | @kindex n @r{(Rmail)} | ||
| 173 | @kindex p @r{(Rmail)} | ||
| 174 | @kindex M-n @r{(Rmail)} | ||
| 175 | @kindex M-p @r{(Rmail)} | ||
| 176 | @findex rmail-next-undeleted-message | ||
| 177 | @findex rmail-previous-undeleted-message | ||
| 178 | @findex rmail-next-message | ||
| 179 | @findex rmail-previous-message | ||
| 180 | @kbd{n} and @kbd{p} are the usual way of moving among messages in | ||
| 181 | Rmail. They move through the messages sequentially, but skip over | ||
| 182 | deleted messages, which is usually what you want to do. Their command | ||
| 183 | definitions are named @code{rmail-next-undeleted-message} and | ||
| 184 | @code{rmail-previous-undeleted-message}. If you do not want to skip | ||
| 185 | deleted messages---for example, if you want to move to a message to | ||
| 186 | undelete it---use the variants @kbd{M-n} and @kbd{M-p} | ||
| 187 | (@code{rmail-next-message} and @code{rmail-previous-message}). A | ||
| 188 | numeric argument to any of these commands serves as a repeat | ||
| 189 | count. | ||
| 190 | |||
| 191 | In Rmail, you can specify a numeric argument by typing just the | ||
| 192 | digits. You don't need to type @kbd{C-u} first. | ||
| 193 | |||
| 194 | @kindex M-s @r{(Rmail)} | ||
| 195 | @findex rmail-search | ||
| 196 | @cindex searching in Rmail | ||
| 197 | The @kbd{M-s} (@code{rmail-search}) command is Rmail's version of | ||
| 198 | search. The usual incremental search command @kbd{C-s} works in Rmail, | ||
| 199 | but it searches only within the current message. The purpose of | ||
| 200 | @kbd{M-s} is to search for another message. It reads a regular | ||
| 201 | expression (@pxref{Regexps}) nonincrementally, then searches starting at | ||
| 202 | the beginning of the following message for a match. It then selects | ||
| 203 | that message. If @var{regexp} is empty, @kbd{M-s} reuses the regexp | ||
| 204 | used the previous time. | ||
| 205 | |||
| 206 | To search backward in the file for another message, give @kbd{M-s} a | ||
| 207 | negative argument. In Rmail you can do this with @kbd{- M-s}. | ||
| 208 | |||
| 209 | It is also possible to search for a message based on labels. | ||
| 210 | @xref{Rmail Labels}. | ||
| 211 | |||
| 212 | @kindex j @r{(Rmail)} | ||
| 213 | @kindex > @r{(Rmail)} | ||
| 214 | @kindex < @r{(Rmail)} | ||
| 215 | @findex rmail-show-message | ||
| 216 | @findex rmail-last-message | ||
| 217 | @findex rmail-first-message | ||
| 218 | To move to a message specified by absolute message number, use @kbd{j} | ||
| 219 | (@code{rmail-show-message}) with the message number as argument. With | ||
| 220 | no argument, @kbd{j} selects the first message. @kbd{<} | ||
| 221 | (@code{rmail-first-message}) also selects the first message. @kbd{>} | ||
| 222 | (@code{rmail-last-message}) selects the last message. | ||
| 223 | |||
| 224 | @node Rmail Deletion | ||
| 225 | @section Deleting Messages | ||
| 226 | |||
| 227 | @cindex deletion (Rmail) | ||
| 228 | When you no longer need to keep a message, you can @dfn{delete} it. This | ||
| 229 | flags it as ignorable, and some Rmail commands pretend it is no longer | ||
| 230 | present; but it still has its place in the Rmail file, and still has its | ||
| 231 | message number. | ||
| 232 | |||
| 233 | @cindex expunging (Rmail) | ||
| 234 | @dfn{Expunging} the Rmail file actually removes the deleted messages. | ||
| 235 | The remaining messages are renumbered consecutively. Expunging is the only | ||
| 236 | action that changes the message number of any message, except for | ||
| 237 | undigestifying (@pxref{Rmail Digest}). | ||
| 238 | |||
| 239 | @table @kbd | ||
| 240 | @item d | ||
| 241 | Delete the current message, and move to the next nondeleted message | ||
| 242 | (@code{rmail-delete-forward}). | ||
| 243 | @item C-d | ||
| 244 | Delete the current message, and move to the previous nondeleted | ||
| 245 | message (@code{rmail-delete-backward}). | ||
| 246 | @item u | ||
| 247 | Undelete the current message, or move back to a deleted message and | ||
| 248 | undelete it (@code{rmail-undelete-previous-message}). | ||
| 249 | @item x | ||
| 250 | Expunge the Rmail file (@code{rmail-expunge}). | ||
| 251 | @end table | ||
| 252 | |||
| 253 | @kindex d @r{(Rmail)} | ||
| 254 | @kindex C-d @r{(Rmail)} | ||
| 255 | @findex rmail-delete-forward | ||
| 256 | @findex rmail-delete-backward | ||
| 257 | There are two Rmail commands for deleting messages. Both delete the | ||
| 258 | current message and select another message. @kbd{d} | ||
| 259 | (@code{rmail-delete-forward}) moves to the following message, skipping | ||
| 260 | messages already deleted, while @kbd{C-d} (@code{rmail-delete-backward}) | ||
| 261 | moves to the previous nondeleted message. If there is no nondeleted | ||
| 262 | message to move to in the specified direction, the message that was just | ||
| 263 | deleted remains current. @kbd{d} with a numeric argument is | ||
| 264 | equivalent to @kbd{C-d}. | ||
| 265 | |||
| 266 | @vindex rmail-delete-message-hook | ||
| 267 | Whenever Rmail deletes a message, it runs the hook | ||
| 268 | @code{rmail-delete-message-hook}. When the hook functions are invoked, | ||
| 269 | the message has been marked deleted, but it is still the current message | ||
| 270 | in the Rmail buffer. | ||
| 271 | |||
| 272 | @cindex undeletion (Rmail) | ||
| 273 | @kindex x @r{(Rmail)} | ||
| 274 | @findex rmail-expunge | ||
| 275 | @kindex u @r{(Rmail)} | ||
| 276 | @findex rmail-undelete-previous-message | ||
| 277 | To make all the deleted messages finally vanish from the Rmail file, | ||
| 278 | type @kbd{x} (@code{rmail-expunge}). Until you do this, you can still | ||
| 279 | @dfn{undelete} the deleted messages. The undeletion command, @kbd{u} | ||
| 280 | (@code{rmail-undelete-previous-message}), is designed to cancel the | ||
| 281 | effect of a @kbd{d} command in most cases. It undeletes the current | ||
| 282 | message if the current message is deleted. Otherwise it moves backward | ||
| 283 | to previous messages until a deleted message is found, and undeletes | ||
| 284 | that message. | ||
| 285 | |||
| 286 | You can usually undo a @kbd{d} with a @kbd{u} because the @kbd{u} | ||
| 287 | moves back to and undeletes the message that the @kbd{d} deleted. But | ||
| 288 | this does not work when the @kbd{d} skips a few already-deleted messages | ||
| 289 | that follow the message being deleted; then the @kbd{u} command | ||
| 290 | undeletes the last of the messages that were skipped. There is no clean | ||
| 291 | way to avoid this problem. However, by repeating the @kbd{u} command, | ||
| 292 | you can eventually get back to the message that you intend to | ||
| 293 | undelete. You can also select a particular deleted message with | ||
| 294 | the @kbd{M-p} command, then type @kbd{u} to undelete it. | ||
| 295 | |||
| 296 | A deleted message has the @samp{deleted} attribute, and as a result | ||
| 297 | @samp{deleted} appears in the mode line when the current message is | ||
| 298 | deleted. In fact, deleting or undeleting a message is nothing more than | ||
| 299 | adding or removing this attribute. @xref{Rmail Attributes}. | ||
| 300 | |||
| 301 | @node Rmail Inbox | ||
| 302 | @section Rmail Files and Inboxes | ||
| 303 | @cindex inbox file | ||
| 304 | |||
| 305 | When you receive mail locally, the operating system places incoming | ||
| 306 | mail for you in a file that we call your @dfn{inbox}. When you start | ||
| 307 | up Rmail, it runs a C program called @code{movemail} to copy the new | ||
| 308 | messages from your local inbox into your primary Rmail file, which | ||
| 309 | also contains other messages saved from previous Rmail sessions. It | ||
| 310 | is in this file that you actually read the mail with Rmail. This | ||
| 311 | operation is called @dfn{getting new mail}. You can get new mail at | ||
| 312 | any time in Rmail by typing @kbd{g}. | ||
| 313 | |||
| 314 | @vindex rmail-primary-inbox-list | ||
| 315 | @cindex @env{MAIL} environment variable | ||
| 316 | The variable @code{rmail-primary-inbox-list} contains a list of the | ||
| 317 | files which are inboxes for your primary Rmail file. If you don't set | ||
| 318 | this variable explicitly, it is initialized from the @env{MAIL} | ||
| 319 | environment variable, or, as a last resort, set to @code{nil}, which | ||
| 320 | means to use the default inbox. The default inbox file depends on | ||
| 321 | your operating system; often it is @file{/var/mail/@var{username}}, | ||
| 322 | @file{/usr/spool/mail/@var{username}}, or | ||
| 323 | @file{/usr/mail/@var{username}}. | ||
| 324 | |||
| 325 | You can specify the inbox file(s) for any Rmail file with the | ||
| 326 | command @code{set-rmail-inbox-list}; see @ref{Rmail Files}. | ||
| 327 | |||
| 328 | There are two reasons for having separate Rmail files and inboxes. | ||
| 329 | |||
| 330 | @enumerate | ||
| 331 | @item | ||
| 332 | The inbox file format varies between operating systems and according to | ||
| 333 | the other mail software in use. Only one part of Rmail needs to know | ||
| 334 | about the alternatives, and it need only understand how to convert all | ||
| 335 | of them to Rmail's own format. | ||
| 336 | |||
| 337 | @item | ||
| 338 | It is very cumbersome to access an inbox file without danger of losing | ||
| 339 | mail, because it is necessary to interlock with mail delivery. | ||
| 340 | Moreover, different operating systems use different interlocking | ||
| 341 | techniques. The strategy of moving mail out of the inbox once and for | ||
| 342 | all into a separate Rmail file avoids the need for interlocking in all | ||
| 343 | the rest of Rmail, since only Rmail operates on the Rmail file. | ||
| 344 | @end enumerate | ||
| 345 | |||
| 346 | Rmail was written to use Babyl format as its internal format. Since | ||
| 347 | then, we have recognized that the usual inbox format on Unix and GNU | ||
| 348 | systems is adequate for the job, and we plan to change Rmail to use that | ||
| 349 | as its internal format. However, the Rmail file will still be separate | ||
| 350 | from the inbox file, even when their format is the same. | ||
| 351 | |||
| 352 | @vindex rmail-preserve-inbox | ||
| 353 | When getting new mail, Rmail first copies the new mail from the | ||
| 354 | inbox file to the Rmail file; then it saves the Rmail file; then it | ||
| 355 | clears out the inbox file. This way, a system crash may cause | ||
| 356 | duplication of mail between the inbox and the Rmail file, but cannot | ||
| 357 | lose mail. If @code{rmail-preserve-inbox} is non-@code{nil}, then | ||
| 358 | Rmail does not clear out the inbox file when it gets new mail. You | ||
| 359 | may wish to set this, for example, on a portable computer you use to | ||
| 360 | check your mail via POP while traveling, so that your mail will remain | ||
| 361 | on the server and you can save it later on your workstation. | ||
| 362 | |||
| 363 | In some cases, Rmail copies the new mail from the inbox file | ||
| 364 | indirectly. First it runs the @code{movemail} program to move the mail | ||
| 365 | from the inbox to an intermediate file called | ||
| 366 | @file{~/.newmail-@var{inboxname}}. Then Rmail merges the new mail from | ||
| 367 | that file, saves the Rmail file, and only then deletes the intermediate | ||
| 368 | file. If there is a crash at the wrong time, this file continues to | ||
| 369 | exist, and Rmail will use it again the next time it gets new mail from | ||
| 370 | that inbox. | ||
| 371 | |||
| 372 | If Rmail is unable to convert the data in | ||
| 373 | @file{~/.newmail-@var{inboxname}} into Babyl format, it renames the file | ||
| 374 | to @file{~/RMAILOSE.@var{n}} (@var{n} is an integer chosen to make the | ||
| 375 | name unique) so that Rmail will not have trouble with the data again. | ||
| 376 | You should look at the file, find whatever message confuses Rmail | ||
| 377 | (probably one that includes the control-underscore character, octal code | ||
| 378 | 037), and delete it. Then you can use @kbd{1 g} to get new mail from | ||
| 379 | the corrected file. | ||
| 380 | |||
| 381 | @node Rmail Files | ||
| 382 | @section Multiple Rmail Files | ||
| 383 | |||
| 384 | Rmail operates by default on your @dfn{primary Rmail file}, which is named | ||
| 385 | @file{~/RMAIL} and receives your incoming mail from your system inbox file. | ||
| 386 | But you can also have other Rmail files and edit them with Rmail. These | ||
| 387 | files can receive mail through their own inboxes, or you can move messages | ||
| 388 | into them with explicit Rmail commands (@pxref{Rmail Output}). | ||
| 389 | |||
| 390 | @table @kbd | ||
| 391 | @item i @var{file} @key{RET} | ||
| 392 | Read @var{file} into Emacs and run Rmail on it (@code{rmail-input}). | ||
| 393 | |||
| 394 | @item M-x set-rmail-inbox-list @key{RET} @var{files} @key{RET} | ||
| 395 | Specify inbox file names for current Rmail file to get mail from. | ||
| 396 | |||
| 397 | @item g | ||
| 398 | Merge new mail from current Rmail file's inboxes | ||
| 399 | (@code{rmail-get-new-mail}). | ||
| 400 | |||
| 401 | @item C-u g @var{file} @key{RET} | ||
| 402 | Merge new mail from inbox file @var{file}. | ||
| 403 | @end table | ||
| 404 | |||
| 405 | @kindex i @r{(Rmail)} | ||
| 406 | @findex rmail-input | ||
| 407 | To run Rmail on a file other than your primary Rmail file, you can use | ||
| 408 | the @kbd{i} (@code{rmail-input}) command in Rmail. This visits the file | ||
| 409 | in Rmail mode. You can use @kbd{M-x rmail-input} even when not in | ||
| 410 | Rmail, but it is easier to type @kbd{C-u M-x rmail}, which does the | ||
| 411 | same thing. | ||
| 412 | |||
| 413 | The file you read with @kbd{i} should normally be a valid Rmail file. | ||
| 414 | If it is not, Rmail tries to decompose it into a stream of messages in | ||
| 415 | various known formats. If it succeeds, it converts the whole file to an | ||
| 416 | Rmail file. If you specify a file name that doesn't exist, @kbd{i} | ||
| 417 | initializes a new buffer for creating a new Rmail file. | ||
| 418 | |||
| 419 | @vindex rmail-secondary-file-directory | ||
| 420 | @vindex rmail-secondary-file-regexp | ||
| 421 | You can also select an Rmail file from a menu. In the Classify menu, | ||
| 422 | choose the Input Rmail File item; then choose the Rmail file you want. | ||
| 423 | The variables @code{rmail-secondary-file-directory} and | ||
| 424 | @code{rmail-secondary-file-regexp} specify which files to offer in the | ||
| 425 | menu: the first variable says which directory to find them in; the | ||
| 426 | second says which files in that directory to offer (all those that | ||
| 427 | match the regular expression). These variables also apply to choosing | ||
| 428 | a file for output (@pxref{Rmail Output}). | ||
| 429 | |||
| 430 | @findex set-rmail-inbox-list | ||
| 431 | Each Rmail file can contain a list of inbox file names; you can specify | ||
| 432 | this list with @kbd{M-x set-rmail-inbox-list @key{RET} @var{files} | ||
| 433 | @key{RET}}. The argument can contain any number of file names, separated | ||
| 434 | by commas. It can also be empty, which specifies that this file should | ||
| 435 | have no inboxes. Once you specify a list of inboxes in an Rmail file, | ||
| 436 | the Rmail file remembers it permanently until you specify a different list. | ||
| 437 | |||
| 438 | As a special exception, if your primary Rmail file does not specify any | ||
| 439 | inbox files, it uses your standard system inbox. | ||
| 440 | |||
| 441 | @kindex g @r{(Rmail)} | ||
| 442 | @findex rmail-get-new-mail | ||
| 443 | The @kbd{g} command (@code{rmail-get-new-mail}) merges mail into the | ||
| 444 | current Rmail file from its inboxes. If the Rmail file has no | ||
| 445 | inboxes, @kbd{g} does nothing. The command @kbd{M-x rmail} also | ||
| 446 | merges new mail into your primary Rmail file. | ||
| 447 | |||
| 448 | To merge mail from a file that is not the usual inbox, give the | ||
| 449 | @kbd{g} key a numeric argument, as in @kbd{C-u g}. Then it reads a file | ||
| 450 | name and merges mail from that file. The inbox file is not deleted or | ||
| 451 | changed in any way when @kbd{g} with an argument is used. This is, | ||
| 452 | therefore, a general way of merging one file of messages into another. | ||
| 453 | |||
| 454 | @node Rmail Output | ||
| 455 | @section Copying Messages Out to Files | ||
| 456 | |||
| 457 | These commands copy messages from an Rmail file into another file. | ||
| 458 | |||
| 459 | @table @kbd | ||
| 460 | @item o @var{file} @key{RET} | ||
| 461 | Append a copy of the current message to the file @var{file}, using Rmail | ||
| 462 | file format by default (@code{rmail-output-to-rmail-file}). | ||
| 463 | |||
| 464 | @item C-o @var{file} @key{RET} | ||
| 465 | Append a copy of the current message to the file @var{file}, using | ||
| 466 | system inbox file format by default (@code{rmail-output}). | ||
| 467 | |||
| 468 | @item w @var{file} @key{RET} | ||
| 469 | Output just the message body to the file @var{file}, taking the default | ||
| 470 | file name from the message @samp{Subject} header. | ||
| 471 | @end table | ||
| 472 | |||
| 473 | @kindex o @r{(Rmail)} | ||
| 474 | @findex rmail-output-to-rmail-file | ||
| 475 | @kindex C-o @r{(Rmail)} | ||
| 476 | @findex rmail-output | ||
| 477 | The commands @kbd{o} and @kbd{C-o} copy the current message into a | ||
| 478 | specified file. This file may be an Rmail file or it may be in system | ||
| 479 | inbox format; the output commands ascertain the file's format and write | ||
| 480 | the copied message in that format. | ||
| 481 | |||
| 482 | The @kbd{o} and @kbd{C-o} commands differ in two ways: each has its | ||
| 483 | own separate default file name, and each specifies a choice of format to | ||
| 484 | use when the file does not already exist. The @kbd{o} command uses | ||
| 485 | Rmail format when it creates a new file, while @kbd{C-o} uses system | ||
| 486 | inbox format for a new file. The default file name for @kbd{o} is the | ||
| 487 | file name used last with @kbd{o}, and the default file name for | ||
| 488 | @kbd{C-o} is the file name used last with @kbd{C-o}. | ||
| 489 | |||
| 490 | If the output file is an Rmail file currently visited in an Emacs buffer, | ||
| 491 | the output commands copy the message into that buffer. It is up to you | ||
| 492 | to save the buffer eventually in its file. | ||
| 493 | |||
| 494 | @kindex w @r{(Rmail)} | ||
| 495 | @findex rmail-output-body-to-file | ||
| 496 | Sometimes you may receive a message whose body holds the contents of a | ||
| 497 | file. You can save the body to a file (excluding the message header) | ||
| 498 | with the @kbd{w} command (@code{rmail-output-body-to-file}). Often | ||
| 499 | these messages contain the intended file name in the @samp{Subject} | ||
| 500 | field, so the @kbd{w} command uses the @samp{Subject} field as the | ||
| 501 | default for the output file name. However, the file name is read using | ||
| 502 | the minibuffer, so you can specify a different name if you wish. | ||
| 503 | |||
| 504 | You can also output a message to an Rmail file chosen with a menu. | ||
| 505 | In the Classify menu, choose the Output Rmail File menu item; then | ||
| 506 | choose the Rmail file you want. This outputs the current message to | ||
| 507 | that file, like the @kbd{o} command. The variables | ||
| 508 | @code{rmail-secondary-file-directory} and | ||
| 509 | @code{rmail-secondary-file-regexp} specify which files to offer in the | ||
| 510 | menu: the first variable says which directory to find them in; the | ||
| 511 | second says which files in that directory to offer (all those that | ||
| 512 | match the regular expression). | ||
| 513 | |||
| 514 | @vindex rmail-delete-after-output | ||
| 515 | Copying a message with @kbd{o} or @kbd{C-o} gives the original copy | ||
| 516 | of the message the @samp{filed} attribute, so that @samp{filed} | ||
| 517 | appears in the mode line when such a message is current. @kbd{w} | ||
| 518 | gives it the @samp{stored} attribute. If you like to keep just a | ||
| 519 | single copy of every mail message, set the variable | ||
| 520 | @code{rmail-delete-after-output} to @code{t}; then the @kbd{o}, | ||
| 521 | @kbd{C-o} and @kbd{w} commands delete the original message after | ||
| 522 | copying it. (You can undelete the original afterward if you wish.) | ||
| 523 | |||
| 524 | Copying messages into files in system inbox format uses the header | ||
| 525 | fields that are displayed in Rmail at the time. Thus, if you use the | ||
| 526 | @kbd{t} command to view the entire header and then copy the message, the | ||
| 527 | entire header is copied. @xref{Rmail Display}. | ||
| 528 | |||
| 529 | @vindex rmail-output-file-alist | ||
| 530 | The variable @code{rmail-output-file-alist} lets you specify | ||
| 531 | intelligent defaults for the output file, based on the contents of the | ||
| 532 | current message. The value should be a list whose elements have this | ||
| 533 | form: | ||
| 534 | |||
| 535 | @example | ||
| 536 | (@var{regexp} . @var{name-exp}) | ||
| 537 | @end example | ||
| 538 | |||
| 539 | @noindent | ||
| 540 | If there's a match for @var{regexp} in the current message, then the | ||
| 541 | default file name for output is @var{name-exp}. If multiple elements | ||
| 542 | match the message, the first matching element decides the default file | ||
| 543 | name. The subexpression @var{name-exp} may be a string constant giving | ||
| 544 | the file name to use, or more generally it may be any Lisp expression | ||
| 545 | that returns a file name as a string. @code{rmail-output-file-alist} | ||
| 546 | applies to both @kbd{o} and @kbd{C-o}. | ||
| 547 | |||
| 548 | @node Rmail Labels | ||
| 549 | @section Labels | ||
| 550 | @cindex label (Rmail) | ||
| 551 | @cindex attribute (Rmail) | ||
| 552 | |||
| 553 | Each message can have various @dfn{labels} assigned to it as a means | ||
| 554 | of classification. Each label has a name; different names are different | ||
| 555 | labels. Any given label is either present or absent on a particular | ||
| 556 | message. A few label names have standard meanings and are given to | ||
| 557 | messages automatically by Rmail when appropriate; these special labels | ||
| 558 | are called @dfn{attributes}. | ||
| 559 | @ifnottex | ||
| 560 | (@xref{Rmail Attributes}.) | ||
| 561 | @end ifnottex | ||
| 562 | All other labels are assigned only by users. | ||
| 563 | |||
| 564 | @table @kbd | ||
| 565 | @item a @var{label} @key{RET} | ||
| 566 | Assign the label @var{label} to the current message (@code{rmail-add-label}). | ||
| 567 | @item k @var{label} @key{RET} | ||
| 568 | Remove the label @var{label} from the current message (@code{rmail-kill-label}). | ||
| 569 | @item C-M-n @var{labels} @key{RET} | ||
| 570 | Move to the next message that has one of the labels @var{labels} | ||
| 571 | (@code{rmail-next-labeled-message}). | ||
| 572 | @item C-M-p @var{labels} @key{RET} | ||
| 573 | Move to the previous message that has one of the labels @var{labels} | ||
| 574 | (@code{rmail-previous-labeled-message}). | ||
| 575 | @item l @var{labels} @key{RET} | ||
| 576 | @itemx C-M-l @var{labels} @key{RET} | ||
| 577 | Make a summary of all messages containing any of the labels @var{labels} | ||
| 578 | (@code{rmail-summary-by-labels}). | ||
| 579 | @end table | ||
| 580 | |||
| 581 | @kindex a @r{(Rmail)} | ||
| 582 | @kindex k @r{(Rmail)} | ||
| 583 | @findex rmail-add-label | ||
| 584 | @findex rmail-kill-label | ||
| 585 | The @kbd{a} (@code{rmail-add-label}) and @kbd{k} | ||
| 586 | (@code{rmail-kill-label}) commands allow you to assign or remove any | ||
| 587 | label on the current message. If the @var{label} argument is empty, it | ||
| 588 | means to assign or remove the same label most recently assigned or | ||
| 589 | removed. | ||
| 590 | |||
| 591 | Once you have given messages labels to classify them as you wish, there | ||
| 592 | are two ways to use the labels: in moving and in summaries. | ||
| 593 | |||
| 594 | @kindex C-M-n @r{(Rmail)} | ||
| 595 | @kindex C-M-p @r{(Rmail)} | ||
| 596 | @findex rmail-next-labeled-message | ||
| 597 | @findex rmail-previous-labeled-message | ||
| 598 | The command @kbd{C-M-n @var{labels} @key{RET}} | ||
| 599 | (@code{rmail-next-labeled-message}) moves to the next message that has | ||
| 600 | one of the labels @var{labels}. The argument @var{labels} specifies one | ||
| 601 | or more label names, separated by commas. @kbd{C-M-p} | ||
| 602 | (@code{rmail-previous-labeled-message}) is similar, but moves backwards | ||
| 603 | to previous messages. A numeric argument to either command serves as a | ||
| 604 | repeat count. | ||
| 605 | |||
| 606 | The command @kbd{C-M-l @var{labels} @key{RET}} | ||
| 607 | (@code{rmail-summary-by-labels}) displays a summary containing only the | ||
| 608 | messages that have at least one of a specified set of labels. The | ||
| 609 | argument @var{labels} is one or more label names, separated by commas. | ||
| 610 | @xref{Rmail Summary}, for information on summaries. | ||
| 611 | |||
| 612 | If the @var{labels} argument to @kbd{C-M-n}, @kbd{C-M-p} or | ||
| 613 | @kbd{C-M-l} is empty, it means to use the last set of labels specified | ||
| 614 | for any of these commands. | ||
| 615 | |||
| 616 | @node Rmail Attributes | ||
| 617 | @section Rmail Attributes | ||
| 618 | |||
| 619 | Some labels such as @samp{deleted} and @samp{filed} have built-in | ||
| 620 | meanings, and Rmail assigns them to messages automatically at | ||
| 621 | appropriate times; these labels are called @dfn{attributes}. Here is | ||
| 622 | a list of Rmail attributes: | ||
| 623 | |||
| 624 | @table @samp | ||
| 625 | @item unseen | ||
| 626 | Means the message has never been current. Assigned to messages when | ||
| 627 | they come from an inbox file, and removed when a message is made | ||
| 628 | current. When you start Rmail, it initially shows the first message | ||
| 629 | that has this attribute. | ||
| 630 | @item deleted | ||
| 631 | Means the message is deleted. Assigned by deletion commands and | ||
| 632 | removed by undeletion commands (@pxref{Rmail Deletion}). | ||
| 633 | @item filed | ||
| 634 | Means the message has been copied to some other file. Assigned by the | ||
| 635 | @kbd{o} and @kbd{C-o} file output commands (@pxref{Rmail Output}). | ||
| 636 | @item stored | ||
| 637 | Assigned by the @kbd{w} file output command (@pxref{Rmail Output}). | ||
| 638 | @item answered | ||
| 639 | Means you have mailed an answer to the message. Assigned by the @kbd{r} | ||
| 640 | command (@code{rmail-reply}). @xref{Rmail Reply}. | ||
| 641 | @item forwarded | ||
| 642 | Means you have forwarded the message. Assigned by the @kbd{f} command | ||
| 643 | (@code{rmail-forward}). @xref{Rmail Reply}. | ||
| 644 | @item edited | ||
| 645 | Means you have edited the text of the message within Rmail. | ||
| 646 | @xref{Rmail Editing}. | ||
| 647 | @item resent | ||
| 648 | Means you have resent the message. Assigned by the command @kbd{M-x | ||
| 649 | rmail-resend}. @xref{Rmail Reply}. | ||
| 650 | @end table | ||
| 651 | |||
| 652 | All other labels are assigned or removed only by users, and have no | ||
| 653 | standard meaning. | ||
| 654 | |||
| 655 | @node Rmail Reply | ||
| 656 | @section Sending Replies | ||
| 657 | |||
| 658 | Rmail has several commands that use Mail mode to send outgoing mail. | ||
| 659 | @xref{Sending Mail}, for information on using Mail mode, including | ||
| 660 | certain features meant to work with Rmail. What this section documents | ||
| 661 | are the special commands of Rmail for entering Mail mode. Note that the | ||
| 662 | usual keys for sending mail---@kbd{C-x m}, @kbd{C-x 4 m}, and @kbd{C-x 5 | ||
| 663 | m}---also work normally in Rmail mode. | ||
| 664 | |||
| 665 | @table @kbd | ||
| 666 | @item m | ||
| 667 | Send a message (@code{rmail-mail}). | ||
| 668 | @item c | ||
| 669 | Continue editing the already started outgoing message (@code{rmail-continue}). | ||
| 670 | @item r | ||
| 671 | Send a reply to the current Rmail message (@code{rmail-reply}). | ||
| 672 | @item f | ||
| 673 | Forward the current message to other users (@code{rmail-forward}). | ||
| 674 | @item C-u f | ||
| 675 | Resend the current message to other users (@code{rmail-resend}). | ||
| 676 | @item M-m | ||
| 677 | Try sending a bounced message a second time (@code{rmail-retry-failure}). | ||
| 678 | @end table | ||
| 679 | |||
| 680 | @kindex r @r{(Rmail)} | ||
| 681 | @findex rmail-reply | ||
| 682 | @cindex reply to a message | ||
| 683 | The most common reason to send a message while in Rmail is to reply | ||
| 684 | to the message you are reading. To do this, type @kbd{r} | ||
| 685 | (@code{rmail-reply}). This displays the @samp{*mail*} buffer in | ||
| 686 | another window, much like @kbd{C-x 4 m}, but preinitializes the | ||
| 687 | @samp{Subject}, @samp{To}, @samp{CC}, @samp{In-reply-to} and | ||
| 688 | @samp{References} header fields based on the message you are replying | ||
| 689 | to. The @samp{To} field starts out as the address of the person who | ||
| 690 | sent the message you received, and the @samp{CC} field starts out with | ||
| 691 | all the other recipients of that message. | ||
| 692 | |||
| 693 | @vindex rmail-dont-reply-to-names | ||
| 694 | You can exclude certain recipients from being placed automatically in | ||
| 695 | the @samp{CC}, using the variable @code{rmail-dont-reply-to-names}. Its | ||
| 696 | value should be a regular expression (as a string); any recipient that | ||
| 697 | the regular expression matches, is excluded from the @samp{CC} field. | ||
| 698 | The default value matches your own name, and any name starting with | ||
| 699 | @samp{info-}. (Those names are excluded because there is a convention | ||
| 700 | of using them for large mailing lists to broadcast announcements.) | ||
| 701 | |||
| 702 | To omit the @samp{CC} field completely for a particular reply, enter | ||
| 703 | the reply command with a numeric argument: @kbd{C-u r} or @kbd{1 r}. | ||
| 704 | This means to reply only to the sender of the original message. | ||
| 705 | |||
| 706 | Once the @samp{*mail*} buffer has been initialized, editing and | ||
| 707 | sending the mail goes as usual (@pxref{Sending Mail}). You can edit the | ||
| 708 | presupplied header fields if they are not what you want. You can also | ||
| 709 | use the commands of Mail mode (@pxref{Mail Mode}), including @kbd{C-c | ||
| 710 | C-y} which yanks in the message that you are replying to. You can | ||
| 711 | also switch to the Rmail buffer, select a different message there, switch | ||
| 712 | back, and yank the new current message. | ||
| 713 | |||
| 714 | @kindex M-m @r{(Rmail)} | ||
| 715 | @findex rmail-retry-failure | ||
| 716 | @cindex retrying a failed message | ||
| 717 | @vindex rmail-retry-ignored-headers | ||
| 718 | Sometimes a message does not reach its destination. Mailers usually | ||
| 719 | send the failed message back to you, enclosed in a @dfn{failure | ||
| 720 | message}. The Rmail command @kbd{M-m} (@code{rmail-retry-failure}) | ||
| 721 | prepares to send the same message a second time: it sets up a | ||
| 722 | @samp{*mail*} buffer with the same text and header fields as before. If | ||
| 723 | you type @kbd{C-c C-c} right away, you send the message again exactly | ||
| 724 | the same as the first time. Alternatively, you can edit the text or | ||
| 725 | headers and then send it. The variable | ||
| 726 | @code{rmail-retry-ignored-headers}, in the same format as | ||
| 727 | @code{rmail-ignored-headers} (@pxref{Rmail Display}), controls which | ||
| 728 | headers are stripped from the failed message when retrying it. | ||
| 729 | |||
| 730 | @kindex f @r{(Rmail)} | ||
| 731 | @findex rmail-forward | ||
| 732 | @cindex forwarding a message | ||
| 733 | Another frequent reason to send mail in Rmail is to @dfn{forward} the | ||
| 734 | current message to other users. @kbd{f} (@code{rmail-forward}) makes | ||
| 735 | this easy by preinitializing the @samp{*mail*} buffer with the current | ||
| 736 | message as the text, and a subject designating a forwarded message. All | ||
| 737 | you have to do is fill in the recipients and send. When you forward a | ||
| 738 | message, recipients get a message which is ``from'' you, and which has | ||
| 739 | the original message in its contents. | ||
| 740 | |||
| 741 | @findex unforward-rmail-message | ||
| 742 | Forwarding a message encloses it between two delimiter lines. It also | ||
| 743 | modifies every line that starts with a dash, by inserting @w{@samp{- }} | ||
| 744 | at the start of the line. When you receive a forwarded message, if it | ||
| 745 | contains something besides ordinary text---for example, program source | ||
| 746 | code---you might find it useful to undo that transformation. You can do | ||
| 747 | this by selecting the forwarded message and typing @kbd{M-x | ||
| 748 | unforward-rmail-message}. This command extracts the original forwarded | ||
| 749 | message, deleting the inserted @w{@samp{- }} strings, and inserts it | ||
| 750 | into the Rmail file as a separate message immediately following the | ||
| 751 | current one. | ||
| 752 | |||
| 753 | @findex rmail-resend | ||
| 754 | @dfn{Resending} is an alternative similar to forwarding; the | ||
| 755 | difference is that resending sends a message that is ``from'' the | ||
| 756 | original sender, just as it reached you---with a few added header fields | ||
| 757 | @samp{Resent-From} and @samp{Resent-To} to indicate that it came via | ||
| 758 | you. To resend a message in Rmail, use @kbd{C-u f}. (@kbd{f} runs | ||
| 759 | @code{rmail-forward}, which is programmed to invoke @code{rmail-resend} | ||
| 760 | if you provide a numeric argument.) | ||
| 761 | |||
| 762 | @kindex m @r{(Rmail)} | ||
| 763 | @findex rmail-mail | ||
| 764 | The @kbd{m} (@code{rmail-mail}) command is used to start editing an | ||
| 765 | outgoing message that is not a reply. It leaves the header fields empty. | ||
| 766 | Its only difference from @kbd{C-x 4 m} is that it makes the Rmail buffer | ||
| 767 | accessible for @kbd{C-c C-y}, just as @kbd{r} does. Thus, @kbd{m} can be | ||
| 768 | used to reply to or forward a message; it can do anything @kbd{r} or @kbd{f} | ||
| 769 | can do. | ||
| 770 | |||
| 771 | @kindex c @r{(Rmail)} | ||
| 772 | @findex rmail-continue | ||
| 773 | The @kbd{c} (@code{rmail-continue}) command resumes editing the | ||
| 774 | @samp{*mail*} buffer, to finish editing an outgoing message you were | ||
| 775 | already composing, or to alter a message you have sent. | ||
| 776 | |||
| 777 | @vindex rmail-mail-new-frame | ||
| 778 | If you set the variable @code{rmail-mail-new-frame} to a | ||
| 779 | non-@code{nil} value, then all the Rmail commands to start sending a | ||
| 780 | message create a new frame to edit it in. This frame is deleted when | ||
| 781 | you send the message, or when you use the @samp{Cancel} item in the | ||
| 782 | @samp{Mail} menu. | ||
| 783 | |||
| 784 | All the Rmail commands to send a message use the mail-composition | ||
| 785 | method that you have chosen (@pxref{Mail Methods}). | ||
| 786 | |||
| 787 | @node Rmail Summary | ||
| 788 | @section Summaries | ||
| 789 | @cindex summary (Rmail) | ||
| 790 | |||
| 791 | A @dfn{summary} is a buffer containing one line per message to give | ||
| 792 | you an overview of the mail in an Rmail file. Each line shows the | ||
| 793 | message number and date, the sender, the line count, the labels, and | ||
| 794 | the subject. Moving point in the summary buffer selects messages as | ||
| 795 | you move to their summary lines. Almost all Rmail commands are valid | ||
| 796 | in the summary buffer also; when used there, they apply to the message | ||
| 797 | described by the current line of the summary. | ||
| 798 | |||
| 799 | A summary buffer applies to a single Rmail file only; if you are | ||
| 800 | editing multiple Rmail files, each one can have its own summary buffer. | ||
| 801 | The summary buffer name is made by appending @samp{-summary} to the | ||
| 802 | Rmail buffer's name. Normally only one summary buffer is displayed at a | ||
| 803 | time. | ||
| 804 | |||
| 805 | @menu | ||
| 806 | * Rmail Make Summary:: Making various sorts of summaries. | ||
| 807 | * Rmail Summary Edit:: Manipulating messages from the summary. | ||
| 808 | @end menu | ||
| 809 | |||
| 810 | @node Rmail Make Summary | ||
| 811 | @subsection Making Summaries | ||
| 812 | |||
| 813 | Here are the commands to create a summary for the current Rmail file. | ||
| 814 | Once the Rmail file has a summary buffer, changes in the Rmail file | ||
| 815 | (such as deleting or expunging messages, and getting new mail) | ||
| 816 | automatically update the summary. | ||
| 817 | |||
| 818 | @table @kbd | ||
| 819 | @item h | ||
| 820 | @itemx C-M-h | ||
| 821 | Summarize all messages (@code{rmail-summary}). | ||
| 822 | @item l @var{labels} @key{RET} | ||
| 823 | @itemx C-M-l @var{labels} @key{RET} | ||
| 824 | Summarize messages that have one or more of the specified labels | ||
| 825 | (@code{rmail-summary-by-labels}). | ||
| 826 | @item C-M-r @var{rcpts} @key{RET} | ||
| 827 | Summarize messages that have one or more of the specified recipients | ||
| 828 | (@code{rmail-summary-by-recipients}). | ||
| 829 | @item C-M-t @var{topic} @key{RET} | ||
| 830 | Summarize messages that have a match for the specified regexp | ||
| 831 | @var{topic} in their subjects (@code{rmail-summary-by-topic}). | ||
| 832 | @item C-M-s @var{regexp} | ||
| 833 | Summarize messages whose headers and the subject line match the | ||
| 834 | specified regular expression @var{regexp} | ||
| 835 | (@code{rmail-summary-by-regexp}). | ||
| 836 | @end table | ||
| 837 | |||
| 838 | @kindex h @r{(Rmail)} | ||
| 839 | @findex rmail-summary | ||
| 840 | The @kbd{h} or @kbd{C-M-h} (@code{rmail-summary}) command fills the summary buffer | ||
| 841 | for the current Rmail file with a summary of all the messages in the file. | ||
| 842 | It then displays and selects the summary buffer in another window. | ||
| 843 | |||
| 844 | @kindex l @r{(Rmail)} | ||
| 845 | @kindex C-M-l @r{(Rmail)} | ||
| 846 | @findex rmail-summary-by-labels | ||
| 847 | @kbd{C-M-l @var{labels} @key{RET}} (@code{rmail-summary-by-labels}) makes | ||
| 848 | a partial summary mentioning only the messages that have one or more of the | ||
| 849 | labels @var{labels}. @var{labels} should contain label names separated by | ||
| 850 | commas. | ||
| 851 | |||
| 852 | @kindex C-M-r @r{(Rmail)} | ||
| 853 | @findex rmail-summary-by-recipients | ||
| 854 | @kbd{C-M-r @var{rcpts} @key{RET}} (@code{rmail-summary-by-recipients}) | ||
| 855 | makes a partial summary mentioning only the messages that have one or more | ||
| 856 | of the recipients @var{rcpts}. @var{rcpts} should contain mailing | ||
| 857 | addresses separated by commas. | ||
| 858 | |||
| 859 | @kindex C-M-t @r{(Rmail)} | ||
| 860 | @findex rmail-summary-by-topic | ||
| 861 | @kbd{C-M-t @var{topic} @key{RET}} (@code{rmail-summary-by-topic}) | ||
| 862 | makes a partial summary mentioning only the messages whose subjects have | ||
| 863 | a match for the regular expression @var{topic}. | ||
| 864 | |||
| 865 | @kindex C-M-s @r{(Rmail)} | ||
| 866 | @findex rmail-summary-by-regexp | ||
| 867 | @kbd{C-M-s @var{regexp} @key{RET}} (@code{rmail-summary-by-regexp}) | ||
| 868 | makes a partial summary which mentions only the messages whose headers | ||
| 869 | (including the date and the subject lines) match the regular | ||
| 870 | expression @var{regexp}. | ||
| 871 | |||
| 872 | Note that there is only one summary buffer for any Rmail file; | ||
| 873 | making any kind of summary discards any previous summary. | ||
| 874 | |||
| 875 | @vindex rmail-summary-window-size | ||
| 876 | @vindex rmail-summary-line-count-flag | ||
| 877 | The variable @code{rmail-summary-window-size} says how many lines to | ||
| 878 | use for the summary window. The variable | ||
| 879 | @code{rmail-summary-line-count-flag} controls whether the summary line | ||
| 880 | for a message should include the line count of the message. | ||
| 881 | |||
| 882 | @node Rmail Summary Edit | ||
| 883 | @subsection Editing in Summaries | ||
| 884 | |||
| 885 | You can use the Rmail summary buffer to do almost anything you can do | ||
| 886 | in the Rmail buffer itself. In fact, once you have a summary buffer, | ||
| 887 | there's no need to switch back to the Rmail buffer. | ||
| 888 | |||
| 889 | You can select and display various messages in the Rmail buffer, from | ||
| 890 | the summary buffer, just by moving point in the summary buffer to | ||
| 891 | different lines. It doesn't matter what Emacs command you use to move | ||
| 892 | point; whichever line point is on at the end of the command, that | ||
| 893 | message is selected in the Rmail buffer. | ||
| 894 | |||
| 895 | Almost all Rmail commands work in the summary buffer as well as in the | ||
| 896 | Rmail buffer. Thus, @kbd{d} in the summary buffer deletes the current | ||
| 897 | message, @kbd{u} undeletes, and @kbd{x} expunges. (However, in the | ||
| 898 | summary buffer, a numeric argument to @kbd{d}, @kbd{C-d} and @kbd{u} | ||
| 899 | serves as a repeat count. A negative argument reverses the meaning of | ||
| 900 | @kbd{d} and @kbd{C-d}.) @kbd{o} and @kbd{C-o} output the current | ||
| 901 | message to a file; @kbd{r} starts a reply to it. You can scroll the | ||
| 902 | current message while remaining in the summary buffer using @key{SPC} | ||
| 903 | and @key{DEL}. | ||
| 904 | |||
| 905 | The Rmail commands to move between messages also work in the summary | ||
| 906 | buffer, but with a twist: they move through the set of messages included | ||
| 907 | in the summary. They also ensure the Rmail buffer appears on the screen | ||
| 908 | (unlike cursor motion commands, which update the contents of the Rmail | ||
| 909 | buffer but don't display it in a window unless it already appears). | ||
| 910 | Here is a list of these commands: | ||
| 911 | |||
| 912 | @table @kbd | ||
| 913 | @item n | ||
| 914 | Move to next line, skipping lines saying `deleted', and select its | ||
| 915 | message. | ||
| 916 | @item p | ||
| 917 | Move to previous line, skipping lines saying `deleted', and select | ||
| 918 | its message. | ||
| 919 | @item M-n | ||
| 920 | Move to next line and select its message. | ||
| 921 | @item M-p | ||
| 922 | Move to previous line and select its message. | ||
| 923 | @item > | ||
| 924 | Move to the last line, and select its message. | ||
| 925 | @item < | ||
| 926 | Move to the first line, and select its message. | ||
| 927 | @item j | ||
| 928 | @itemx @key{RET} | ||
| 929 | Select the message on the current line (ensuring that the RMAIL buffer | ||
| 930 | appears on the screen). With argument @var{n}, select message number | ||
| 931 | @var{n} and move to its line in the summary buffer; this signals an | ||
| 932 | error if the message is not listed in the summary buffer. | ||
| 933 | @item M-s @var{pattern} @key{RET} | ||
| 934 | Search through messages for @var{pattern} starting with the current | ||
| 935 | message; select the message found, and move point in the summary buffer | ||
| 936 | to that message's line. | ||
| 937 | @end table | ||
| 938 | |||
| 939 | @vindex rmail-redisplay-summary | ||
| 940 | Deletion, undeletion, and getting new mail, and even selection of a | ||
| 941 | different message all update the summary buffer when you do them in the | ||
| 942 | Rmail buffer. If the variable @code{rmail-redisplay-summary} is | ||
| 943 | non-@code{nil}, these actions also bring the summary buffer back onto | ||
| 944 | the screen. | ||
| 945 | |||
| 946 | @kindex Q @r{(Rmail summary)} | ||
| 947 | @findex rmail-summary-wipe | ||
| 948 | @kindex q @r{(Rmail summary)} | ||
| 949 | @findex rmail-summary-quit | ||
| 950 | When you are finished using the summary, type @kbd{Q} | ||
| 951 | (@code{rmail-summary-wipe}) to delete the summary buffer's window. You | ||
| 952 | can also exit Rmail while in the summary: @kbd{q} | ||
| 953 | (@code{rmail-summary-quit}) deletes the summary window, then exits from | ||
| 954 | Rmail by saving the Rmail file and switching to another buffer. | ||
| 955 | |||
| 956 | @node Rmail Sorting | ||
| 957 | @section Sorting the Rmail File | ||
| 958 | |||
| 959 | @table @kbd | ||
| 960 | @item M-x rmail-sort-by-date | ||
| 961 | Sort messages of current Rmail file by date. | ||
| 962 | |||
| 963 | @item M-x rmail-sort-by-subject | ||
| 964 | Sort messages of current Rmail file by subject. | ||
| 965 | |||
| 966 | @item M-x rmail-sort-by-author | ||
| 967 | Sort messages of current Rmail file by author's name. | ||
| 968 | |||
| 969 | @item M-x rmail-sort-by-recipient | ||
| 970 | Sort messages of current Rmail file by recipient's names. | ||
| 971 | |||
| 972 | @item M-x rmail-sort-by-correspondent | ||
| 973 | Sort messages of current Rmail file by the name of the other | ||
| 974 | correspondent. | ||
| 975 | |||
| 976 | @item M-x rmail-sort-by-lines | ||
| 977 | Sort messages of current Rmail file by size (number of lines). | ||
| 978 | |||
| 979 | @item M-x rmail-sort-by-keywords @key{RET} @var{labels} @key{RET} | ||
| 980 | Sort messages of current Rmail file by labels. The argument | ||
| 981 | @var{labels} should be a comma-separated list of labels. The order of | ||
| 982 | these labels specifies the order of messages; messages with the first | ||
| 983 | label come first, messages with the second label come second, and so on. | ||
| 984 | Messages which have none of these labels come last. | ||
| 985 | @end table | ||
| 986 | |||
| 987 | The Rmail sort commands perform a @emph{stable sort}: if there is no | ||
| 988 | reason to prefer either one of two messages, their order remains | ||
| 989 | unchanged. You can use this to sort by more than one criterion. For | ||
| 990 | example, if you use @code{rmail-sort-by-date} and then | ||
| 991 | @code{rmail-sort-by-author}, messages from the same author appear in | ||
| 992 | order by date. | ||
| 993 | |||
| 994 | With a numeric argument, all these commands reverse the order of | ||
| 995 | comparison. This means they sort messages from newest to oldest, from | ||
| 996 | biggest to smallest, or in reverse alphabetical order. | ||
| 997 | |||
| 998 | @node Rmail Display | ||
| 999 | @section Display of Messages | ||
| 1000 | |||
| 1001 | Rmail reformats the header of each message before displaying it for | ||
| 1002 | the first time. Reformatting hides uninteresting header fields to | ||
| 1003 | reduce clutter. You can use the @kbd{t} command to show the entire | ||
| 1004 | header or to repeat the header reformatting operation. | ||
| 1005 | |||
| 1006 | @table @kbd | ||
| 1007 | @item t | ||
| 1008 | Toggle display of complete header (@code{rmail-toggle-header}). | ||
| 1009 | @end table | ||
| 1010 | |||
| 1011 | @vindex rmail-ignored-headers | ||
| 1012 | @vindex rmail-nonignored-headers | ||
| 1013 | Reformatting the header involves deleting most header fields, on the | ||
| 1014 | grounds that they are not interesting. The variable | ||
| 1015 | @code{rmail-ignored-headers} holds a regular expression that specifies | ||
| 1016 | which header fields to hide in this way---if it matches the beginning | ||
| 1017 | of a header field, that whole field is hidden. However, the variable | ||
| 1018 | @code{rmail-nonignored-headers} provides a further override: a header | ||
| 1019 | matching that regular expression is shown even if it matches | ||
| 1020 | @code{rmail-ignored-headers} too. | ||
| 1021 | |||
| 1022 | @kindex t @r{(Rmail)} | ||
| 1023 | @findex rmail-toggle-header | ||
| 1024 | Rmail saves the complete original header before reformatting; to see | ||
| 1025 | it, use the @kbd{t} command (@code{rmail-toggle-header}). This | ||
| 1026 | discards the reformatted headers of the current message and displays | ||
| 1027 | it with the original header. Repeating @kbd{t} reformats the message | ||
| 1028 | again, which shows only the interesting headers according to the | ||
| 1029 | current values of those variable. Selecting the message again also | ||
| 1030 | reformats it if necessary. | ||
| 1031 | |||
| 1032 | One consequence of this is that if you edit the reformatted header | ||
| 1033 | (using @kbd{e}; @pxref{Rmail Editing}), subsequent use of @kbd{t} will | ||
| 1034 | discard your edits. On the other hand, if you use @kbd{e} after | ||
| 1035 | @kbd{t}, to edit the original (unreformatted) header, those changes are | ||
| 1036 | permanent. | ||
| 1037 | |||
| 1038 | When the @kbd{t} command has a prefix argument, a positive argument | ||
| 1039 | means to show the reformatted header, and a zero or negative argument | ||
| 1040 | means to show the full header. | ||
| 1041 | |||
| 1042 | @vindex rmail-highlighted-headers | ||
| 1043 | When the terminal supports multiple fonts or colors, Rmail | ||
| 1044 | highlights certain header fields that are especially interesting---by | ||
| 1045 | default, the @samp{From} and @samp{Subject} fields. The variable | ||
| 1046 | @code{rmail-highlighted-headers} holds a regular expression that | ||
| 1047 | specifies the header fields to highlight; if it matches the beginning | ||
| 1048 | of a header field, that whole field is highlighted. | ||
| 1049 | |||
| 1050 | If you specify unusual colors for your text foreground and | ||
| 1051 | background, the colors used for highlighting may not go well with | ||
| 1052 | them. If so, specify different colors by setting the variable | ||
| 1053 | @code{rmail-highlight-face} to a suitable face. To turn off | ||
| 1054 | highlighting entirely in Rmail, set @code{rmail-highlighted-headers} | ||
| 1055 | to @code{nil}. | ||
| 1056 | |||
| 1057 | You can highlight and activate URLs in incoming messages by adding | ||
| 1058 | the function @code{goto-address} to the hook | ||
| 1059 | @code{rmail-show-message-hook}. Then you can browse these URLs by | ||
| 1060 | clicking on them with @kbd{Mouse-2} (or @kbd{Mouse-1} quickly) or by | ||
| 1061 | moving to one and typing @kbd{C-c @key{RET}}. @xref{Goto-address, | ||
| 1062 | Activating URLs, Activating URLs}. | ||
| 1063 | |||
| 1064 | @node Rmail Coding | ||
| 1065 | @section Rmail and Coding Systems | ||
| 1066 | |||
| 1067 | @cindex decoding mail messages (Rmail) | ||
| 1068 | Rmail automatically decodes messages which contain non-@acronym{ASCII} | ||
| 1069 | characters, just as Emacs does with files you visit and with subprocess | ||
| 1070 | output. Rmail uses the standard @samp{charset=@var{charset}} header in | ||
| 1071 | the message, if any, to determine how the message was encoded by the | ||
| 1072 | sender. It maps @var{charset} into the corresponding Emacs coding | ||
| 1073 | system (@pxref{Coding Systems}), and uses that coding system to decode | ||
| 1074 | message text. If the message header doesn't have the @samp{charset} | ||
| 1075 | specification, or if @var{charset} is not recognized, | ||
| 1076 | Rmail chooses the coding system with the usual Emacs heuristics and | ||
| 1077 | defaults (@pxref{Recognize Coding}). | ||
| 1078 | |||
| 1079 | @cindex fixing incorrectly decoded mail messages | ||
| 1080 | Occasionally, a message is decoded incorrectly, either because Emacs | ||
| 1081 | guessed the wrong coding system in the absence of the @samp{charset} | ||
| 1082 | specification, or because the specification was inaccurate. For | ||
| 1083 | example, a misconfigured mailer could send a message with a | ||
| 1084 | @samp{charset=iso-8859-1} header when the message is actually encoded | ||
| 1085 | in @code{koi8-r}. When you see the message text garbled, or some of | ||
| 1086 | its characters displayed as empty boxes, this may have happened. | ||
| 1087 | |||
| 1088 | @findex rmail-redecode-body | ||
| 1089 | You can correct the problem by decoding the message again using the | ||
| 1090 | right coding system, if you can figure out or guess which one is | ||
| 1091 | right. To do this, invoke the @kbd{M-x rmail-redecode-body} command. | ||
| 1092 | It reads the name of a coding system, encodes the message body using | ||
| 1093 | whichever coding system was used to decode it before, then redecodes | ||
| 1094 | it using the coding system you specified. If you specified the right | ||
| 1095 | coding system, the result should be readable. | ||
| 1096 | |||
| 1097 | Decoding and encoding using the wrong coding system is lossless for | ||
| 1098 | most encodings, in particular with 8-bit encodings such as iso-8859 or | ||
| 1099 | koi8. So, if the initial attempt to redecode the message didn't | ||
| 1100 | result in a legible text, you can try other coding systems until you | ||
| 1101 | succeed. | ||
| 1102 | |||
| 1103 | With some coding systems, notably those from the iso-2022 family, | ||
| 1104 | information can be lost in decoding, so that encoding the message | ||
| 1105 | again won't bring back the original incoming text. In such a case, | ||
| 1106 | @code{rmail-redecode-body} cannot work. However, the problems that | ||
| 1107 | call for use of @code{rmail-redecode-body} rarely occur with those | ||
| 1108 | coding systems. So in practice the command works when you need it. | ||
| 1109 | |||
| 1110 | @node Rmail Editing | ||
| 1111 | @section Editing Within a Message | ||
| 1112 | |||
| 1113 | Most of the usual Emacs commands are available in Rmail mode, though a | ||
| 1114 | few, such as @kbd{C-M-n} and @kbd{C-M-h}, are redefined by Rmail for | ||
| 1115 | other purposes. However, the Rmail buffer is normally read only, and | ||
| 1116 | most of the letters are redefined as Rmail commands. If you want to | ||
| 1117 | edit the text of a message, you must use the Rmail command @kbd{e}. | ||
| 1118 | |||
| 1119 | @table @kbd | ||
| 1120 | @item e | ||
| 1121 | Edit the current message as ordinary text. | ||
| 1122 | @end table | ||
| 1123 | |||
| 1124 | @kindex e @r{(Rmail)} | ||
| 1125 | @findex rmail-edit-current-message | ||
| 1126 | The @kbd{e} command (@code{rmail-edit-current-message}) switches from | ||
| 1127 | Rmail mode into Rmail Edit mode, another major mode which is nearly the | ||
| 1128 | same as Text mode. The mode line indicates this change. | ||
| 1129 | |||
| 1130 | In Rmail Edit mode, letters insert themselves as usual and the Rmail | ||
| 1131 | commands are not available. When you are finished editing the message and | ||
| 1132 | are ready to go back to Rmail, type @kbd{C-c C-c}, which switches back to | ||
| 1133 | Rmail mode. Alternatively, you can return to Rmail mode but cancel all the | ||
| 1134 | editing that you have done, by typing @kbd{C-c C-]}. | ||
| 1135 | |||
| 1136 | @vindex rmail-edit-mode-hook | ||
| 1137 | Entering Rmail Edit mode runs the hook @code{text-mode-hook}; then it | ||
| 1138 | runs the hook @code{rmail-edit-mode-hook} (@pxref{Hooks}). It adds the | ||
| 1139 | attribute @samp{edited} to the message. It also displays the full | ||
| 1140 | headers of the message, so that you can edit the headers as well as the | ||
| 1141 | body of the message, and your changes in the headers will be | ||
| 1142 | permanent. | ||
| 1143 | |||
| 1144 | @node Rmail Digest | ||
| 1145 | @section Digest Messages | ||
| 1146 | @cindex digest message | ||
| 1147 | @cindex undigestify | ||
| 1148 | |||
| 1149 | A @dfn{digest message} is a message which exists to contain and carry | ||
| 1150 | several other messages. Digests are used on some moderated mailing | ||
| 1151 | lists; all the messages that arrive for the list during a period of time | ||
| 1152 | such as one day are put inside a single digest which is then sent to the | ||
| 1153 | subscribers. Transmitting the single digest uses much less computer | ||
| 1154 | time than transmitting the individual messages even though the total | ||
| 1155 | size is the same, because the per-message overhead in network mail | ||
| 1156 | transmission is considerable. | ||
| 1157 | |||
| 1158 | @findex undigestify-rmail-message | ||
| 1159 | When you receive a digest message, the most convenient way to read it is | ||
| 1160 | to @dfn{undigestify} it: to turn it back into many individual messages. | ||
| 1161 | Then you can read and delete the individual messages as it suits you. | ||
| 1162 | To do this, select the digest message and type the command @kbd{M-x | ||
| 1163 | undigestify-rmail-message}. This extracts the submessages as separate | ||
| 1164 | Rmail messages, and inserts them following the digest. The digest | ||
| 1165 | message itself is flagged as deleted. | ||
| 1166 | |||
| 1167 | @node Out of Rmail | ||
| 1168 | @section Converting an Rmail File to Inbox Format | ||
| 1169 | @cindex Babyl format to Inbox format | ||
| 1170 | @cindex converting Rmail file to mailbox format | ||
| 1171 | |||
| 1172 | @findex unrmail | ||
| 1173 | The command @kbd{M-x unrmail} converts a file in Rmail format to inbox | ||
| 1174 | format (also known as the system mailbox, or mbox, format), so that | ||
| 1175 | you can use it with other mail-editing tools. You must specify two | ||
| 1176 | arguments, the name of the Rmail file and the name to use for the | ||
| 1177 | converted file. @kbd{M-x unrmail} does not alter the Rmail file itself. | ||
| 1178 | |||
| 1179 | @pindex b2m | ||
| 1180 | @kbd{M-x unrmail} is useful if you can run Emacs on the machine | ||
| 1181 | where the Rmail file resides, or can access the Rmail file remotely | ||
| 1182 | (@pxref{Remote Files}) from a machine where Emacs is installed. If | ||
| 1183 | accessing Rmail files from Emacs is impossible, you can use the | ||
| 1184 | @command{b2m} program instead. @command{b2m} is part of the Emacs | ||
| 1185 | distribution, it is installed into the same directory where all the | ||
| 1186 | other auxiliary programs (@command{etags} etc.) are installed, and its | ||
| 1187 | source is available in the Emacs source distribution, so that you | ||
| 1188 | could copy the source to the target machine and compile it there. | ||
| 1189 | |||
| 1190 | To convert a file @file{@var{babyl-file}} into @file{@var{mbox-file}}, | ||
| 1191 | invoke @command{b2m} like this: | ||
| 1192 | |||
| 1193 | @example | ||
| 1194 | b2m < @var{babyl-file} > @var{mbox-file} | ||
| 1195 | @end example | ||
| 1196 | |||
| 1197 | @node Rmail Rot13 | ||
| 1198 | @section Reading Rot13 Messages | ||
| 1199 | @cindex rot13 code | ||
| 1200 | |||
| 1201 | Mailing list messages that might offend some readers are sometimes | ||
| 1202 | encoded in a simple code called @dfn{rot13}---so named because it | ||
| 1203 | rotates the alphabet by 13 letters. This code is not for secrecy, as it | ||
| 1204 | provides none; rather, it enables those who might be offended to avoid | ||
| 1205 | seeing the real text of the message. | ||
| 1206 | |||
| 1207 | @findex rot13-other-window | ||
| 1208 | To view a buffer which uses the rot13 code, use the command @kbd{M-x | ||
| 1209 | rot13-other-window}. This displays the current buffer in another window | ||
| 1210 | which applies the code when displaying the text. | ||
| 1211 | |||
| 1212 | @node Movemail | ||
| 1213 | @section @code{movemail} program | ||
| 1214 | @cindex @code{movemail} program | ||
| 1215 | |||
| 1216 | When invoked for the first time, Rmail attempts to locate the | ||
| 1217 | @code{movemail} program and determine its version. There are two | ||
| 1218 | versions of @code{movemail} program: the native one, shipped with GNU | ||
| 1219 | Emacs (the ``emacs version'') and the one included in GNU mailutils | ||
| 1220 | (the ``mailutils version,'' @pxref{movemail,,,mailutils,GNU | ||
| 1221 | mailutils}). They support the same command line syntax and the same | ||
| 1222 | basic subset of options. However, the Mailutils version offers | ||
| 1223 | additional features. | ||
| 1224 | |||
| 1225 | The Emacs version of @code{movemail} is able to retrieve mail from | ||
| 1226 | usual UNIX mailbox formats and from remote mailboxes using the POP3 | ||
| 1227 | protocol. | ||
| 1228 | |||
| 1229 | The Mailutils version is able to handle a wide set of mailbox | ||
| 1230 | formats, such as plain UNIX mailboxes, @code{maildir} and @code{MH} | ||
| 1231 | mailboxes, etc. It is able to retrieve remote mail using POP3 or | ||
| 1232 | IMAP4 protocol, and can retrieve mail from them using a TLS encrypted | ||
| 1233 | channel. It also accepts mailbox argument in the @acronym{URL} form. | ||
| 1234 | The detailed description of mailbox @acronym{URL}s can be found in | ||
| 1235 | @ref{URL,,,mailutils,Mailbox URL Formats}. In short, a @acronym{URL} | ||
| 1236 | is: | ||
| 1237 | |||
| 1238 | @smallexample | ||
| 1239 | @var{proto}://[@var{user}[:@var{password}]@@]@var{host-or-file-name} | ||
| 1240 | @end smallexample | ||
| 1241 | |||
| 1242 | @noindent | ||
| 1243 | where square brackets denote optional elements. | ||
| 1244 | |||
| 1245 | @table @var | ||
| 1246 | @item proto | ||
| 1247 | Specifies the @dfn{mailbox protocol}, or @dfn{format} to | ||
| 1248 | use. The exact semantics of the rest of @acronym{URL} elements depends | ||
| 1249 | on the actual value of @var{proto} (see below). | ||
| 1250 | |||
| 1251 | @item user | ||
| 1252 | User name to access the remote mailbox. | ||
| 1253 | |||
| 1254 | @item password | ||
| 1255 | User password to access the remote mailbox. | ||
| 1256 | |||
| 1257 | @item host-or-file-name | ||
| 1258 | Hostname of the remote server for remote mailboxes or file name of a | ||
| 1259 | local mailbox. | ||
| 1260 | @end table | ||
| 1261 | |||
| 1262 | @noindent | ||
| 1263 | @var{Proto} can be one of: | ||
| 1264 | |||
| 1265 | @table @code | ||
| 1266 | @item mbox | ||
| 1267 | Usual UNIX mailbox format. In this case, neither @var{user} nor | ||
| 1268 | @var{pass} are used, and @var{host-or-file-name} denotes the file name of | ||
| 1269 | the mailbox file, e.g., @code{mbox://var/spool/mail/smith}. | ||
| 1270 | |||
| 1271 | @item mh | ||
| 1272 | A local mailbox in the @acronym{MH} format. @var{User} and | ||
| 1273 | @var{pass} are not used. @var{Host-or-file-name} denotes the name of | ||
| 1274 | @acronym{MH} folder, e.g., @code{mh://Mail/inbox}. | ||
| 1275 | |||
| 1276 | @item maildir | ||
| 1277 | A local mailbox in the @acronym{maildir} format. @var{User} and | ||
| 1278 | @var{pass} are not used, and @var{host-or-file-name} denotes the name of | ||
| 1279 | @code{maildir} mailbox, e.g., @code{maildir://mail/inbox}. | ||
| 1280 | |||
| 1281 | @item file | ||
| 1282 | Any local mailbox format. Its actual format is detected automatically | ||
| 1283 | by @code{movemail}. | ||
| 1284 | |||
| 1285 | @item pop | ||
| 1286 | A remote mailbox to be accessed via POP3 protocol. @var{User} | ||
| 1287 | specifies the remote user name to use, @var{pass} may be used to | ||
| 1288 | specify the user password, @var{host-or-file-name} is the name or IP | ||
| 1289 | address of the remote mail server to connect to; e.g., | ||
| 1290 | @code{pop://smith:guessme@@remote.server.net}. | ||
| 1291 | |||
| 1292 | @item imap | ||
| 1293 | A remote mailbox to be accessed via IMAP4 protocol. @var{User} | ||
| 1294 | specifies the remote user name to use, @var{pass} may be used to | ||
| 1295 | specify the user password, @var{host-or-file-name} is the name or IP | ||
| 1296 | address of the remote mail server to connect to; | ||
| 1297 | e.g., @code{imap://smith:guessme@@remote.server.net}. | ||
| 1298 | @end table | ||
| 1299 | |||
| 1300 | Alternatively, you can specify the file name of the mailbox to use. | ||
| 1301 | This is equivalent to specifying the @samp{file} protocol: | ||
| 1302 | |||
| 1303 | @smallexample | ||
| 1304 | /var/spool/mail/@var{user} @equiv{} file://var/spool/mail/@var{user} | ||
| 1305 | @end smallexample | ||
| 1306 | |||
| 1307 | @vindex rmail-movemail-program | ||
| 1308 | @vindex rmail-movemail-search-path | ||
| 1309 | The variable @code{rmail-movemail-program} controls which version of | ||
| 1310 | @code{movemail} to use. If that is a string, it specifies the | ||
| 1311 | absolute file name of the @code{movemail} executable. If it is | ||
| 1312 | @code{nil}, Rmail searches for @code{movemail} in the directories | ||
| 1313 | listed in @code{rmail-movemail-search-path} and @code{exec-path}, then | ||
| 1314 | in @code{exec-directory}. | ||
| 1315 | |||
| 1316 | @node Remote Mailboxes | ||
| 1317 | @section Retrieving Mail from Remote Mailboxes | ||
| 1318 | @pindex movemail | ||
| 1319 | |||
| 1320 | Some sites use a method called POP for accessing users' inbox data | ||
| 1321 | instead of storing the data in inbox files. The @code{Emacs | ||
| 1322 | movemail} can work with POP if you compile it with the macro | ||
| 1323 | @code{MAIL_USE_POP} defined. (You can achieve that by specifying | ||
| 1324 | @samp{--with-pop} when you run @code{configure} during the | ||
| 1325 | installation of Emacs.) | ||
| 1326 | |||
| 1327 | The Mailutils @code{movemail} by default supports POP, unless it was | ||
| 1328 | configured with @samp{--disable-pop} option. | ||
| 1329 | |||
| 1330 | Both versions of @code{movemail} only work with POP3, not with older | ||
| 1331 | versions of POP. | ||
| 1332 | |||
| 1333 | @cindex @env{MAILHOST} environment variable | ||
| 1334 | @cindex POP mailboxes | ||
| 1335 | No matter which flavor of @code{movemail} you use, you can specify | ||
| 1336 | POP inbox by using POP @dfn{URL} (@pxref{Movemail}). A POP | ||
| 1337 | @acronym{URL} is a ``file name'' of the form | ||
| 1338 | @samp{pop://@var{username}@@@var{hostname}}, where | ||
| 1339 | @var{hostname} is the host name or IP address of the remote mail | ||
| 1340 | server and @var{username} is the user name on that server. | ||
| 1341 | Additionally, you may specify the password in the mailbox @acronym{URL}: | ||
| 1342 | @samp{pop://@var{username}:@var{password}@@@var{hostname}}. In this | ||
| 1343 | case, @var{password} takes preference over the one set by | ||
| 1344 | @code{rmail-remote-password}. This is especially useful if you have | ||
| 1345 | several remote mailboxes with different passwords. | ||
| 1346 | |||
| 1347 | For backward compatibility, Rmail also supports two alternative ways | ||
| 1348 | of specifying remote POP mailboxes. First, specifying an inbox name | ||
| 1349 | in the form @samp{po:@var{username}:@var{hostname}} is equivalent to | ||
| 1350 | @samp{pop://@var{username}@@@var{hostname}}. Alternatively, you may | ||
| 1351 | set a ``file name'' of @samp{po:@var{username}} in the inbox list of | ||
| 1352 | an Rmail file. @code{movemail} will handle such a name by opening a | ||
| 1353 | connection to the POP server. In this case, the @env{MAILHOST} | ||
| 1354 | environment variable specifies the machine on which to look for the | ||
| 1355 | POP server. | ||
| 1356 | |||
| 1357 | @cindex IMAP mailboxes | ||
| 1358 | Another method for accessing remote mailboxes is IMAP. This method is | ||
| 1359 | supported only by the Mailutils @code{movemail}. To specify an IMAP | ||
| 1360 | mailbox in the inbox list, use the following mailbox @acronym{URL}: | ||
| 1361 | @samp{imap://@var{username}[:@var{password}]@@@var{hostname}}. The | ||
| 1362 | @var{password} part is optional, as described above. | ||
| 1363 | |||
| 1364 | @vindex rmail-remote-password | ||
| 1365 | @vindex rmail-remote-password-required | ||
| 1366 | @vindex rmail-pop-password | ||
| 1367 | @vindex rmail-pop-password-required | ||
| 1368 | Accessing a remote mailbox may require a password. Rmail uses the | ||
| 1369 | following algorithm to retrieve it: | ||
| 1370 | |||
| 1371 | @enumerate | ||
| 1372 | @item | ||
| 1373 | If the @var{password} is present in mailbox URL (see above), it is | ||
| 1374 | used. | ||
| 1375 | @item | ||
| 1376 | If the variable @code{rmail-remote-password} is non-@code{nil}, its | ||
| 1377 | value is used. | ||
| 1378 | @item | ||
| 1379 | Otherwise, if @code{rmail-remote-password-required} is non-@code{nil}, | ||
| 1380 | then Rmail will ask you for the password to use. | ||
| 1381 | @item | ||
| 1382 | Otherwise, Rmail assumes no password is required. | ||
| 1383 | @end enumerate | ||
| 1384 | |||
| 1385 | For compatibility with previous versions, the variables | ||
| 1386 | @code{rmail-pop-password} and @code{rmail-pop-password-required} may | ||
| 1387 | be used instead of @code{rmail-remote-password} and | ||
| 1388 | @code{rmail-remote-password-required}. | ||
| 1389 | |||
| 1390 | @vindex rmail-movemail-flags | ||
| 1391 | If you need to pass additional command-line flags to @code{movemail}, | ||
| 1392 | set the variable @code{rmail-movemail-flags} a list of the flags you | ||
| 1393 | wish to use. Do not use this variable to pass the @samp{-p} flag to | ||
| 1394 | preserve your inbox contents; use @code{rmail-preserve-inbox} instead. | ||
| 1395 | |||
| 1396 | @cindex Kerberos POP authentication | ||
| 1397 | The @code{movemail} program installed at your site may support | ||
| 1398 | Kerberos authentication. If it is | ||
| 1399 | supported, it is used by default whenever you attempt to retrieve | ||
| 1400 | POP mail when @code{rmail-pop-password} and | ||
| 1401 | @code{rmail-pop-password-required} are unset. | ||
| 1402 | |||
| 1403 | @cindex reverse order in POP inboxes | ||
| 1404 | Some POP servers store messages in reverse order. If your server does | ||
| 1405 | this, and you would rather read your mail in the order in which it was | ||
| 1406 | received, you can tell @code{movemail} to reverse the order of | ||
| 1407 | downloaded messages by adding the @samp{-r} flag to | ||
| 1408 | @code{rmail-movemail-flags}. | ||
| 1409 | |||
| 1410 | @cindex TLS encryption (Rmail) | ||
| 1411 | Mailutils @code{movemail} supports TLS encryption. If you wish to | ||
| 1412 | use it, add the @samp{--tls} flag to @code{rmail-movemail-flags}. | ||
| 1413 | |||
| 1414 | @node Other Mailbox Formats | ||
| 1415 | @section Retrieving Mail from Local Mailboxes in Various Formats | ||
| 1416 | |||
| 1417 | If your incoming mail is stored on a local machine in a format other | ||
| 1418 | than UNIX mailbox, you will need the Mailutils @code{movemail} to | ||
| 1419 | retrieve it. @xref{Movemail}, for the detailed description of | ||
| 1420 | @code{movemail} versions. For example, to access mail from a inbox in | ||
| 1421 | @code{maildir} format located in @file{/var/spool/mail/in}, you would | ||
| 1422 | include the following in the Rmail inbox list: | ||
| 1423 | |||
| 1424 | @smallexample | ||
| 1425 | maildir://var/spool/mail/in | ||
| 1426 | @end smallexample | ||
| 1427 | |||
| 1428 | @ignore | ||
| 1429 | arch-tag: 034965f6-38df-47a2-a9f1-b8bc8ab37e23 | ||
| 1430 | @end ignore | ||
diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi new file mode 100644 index 00000000000..90ec645a26f --- /dev/null +++ b/doc/emacs/screen.texi | |||
| @@ -0,0 +1,359 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Screen, User Input, Acknowledgments, Top | ||
| 6 | @chapter The Organization of the Screen | ||
| 7 | @cindex screen | ||
| 8 | @cindex parts of the screen | ||
| 9 | |||
| 10 | On a text-only terminal, the Emacs display occupies the whole | ||
| 11 | screen. On a graphical display, such as on GNU/Linux using the X | ||
| 12 | Window System, Emacs creates its own windows to use. We use the term | ||
| 13 | @dfn{frame} to mean the entire text-only screen or an entire | ||
| 14 | system-level window used by Emacs. Emacs uses both kinds of frames, | ||
| 15 | in the same way, to display your editing. Emacs normally starts out | ||
| 16 | with just one frame, but you can create additional frames if you wish. | ||
| 17 | @xref{Frames}. | ||
| 18 | |||
| 19 | When you start Emacs, the main central area of the frame, all except | ||
| 20 | for the top and bottom and sides, displays the text you are editing. | ||
| 21 | This area is called @dfn{the window}. At the top there is normally a | ||
| 22 | @dfn{menu bar} where you can access a series of menus; then there may | ||
| 23 | be a @dfn{tool bar}, a row of icons that perform editing commands if | ||
| 24 | you click on them. Below this, the window begins, often with a | ||
| 25 | @dfn{scroll bar} on one side. Below the window comes the last line of | ||
| 26 | the frame, a special @dfn{echo area} or @dfn{minibuffer window}, where | ||
| 27 | prompts appear and you enter information when Emacs asks for it. See | ||
| 28 | following sections for more information about these special lines. | ||
| 29 | |||
| 30 | You can subdivide the window horizontally or vertically to make | ||
| 31 | multiple text windows, each of which can independently display some | ||
| 32 | file or text (@pxref{Windows}). In this manual, the word ``window'' | ||
| 33 | refers to the initial large window if not subdivided, or any one of | ||
| 34 | the multiple windows you have subdivided it into. | ||
| 35 | |||
| 36 | At any time, one window is the @dfn{selected window}. On graphical | ||
| 37 | displays, the selected window normally shows a more prominent cursor | ||
| 38 | (usually solid and blinking) while other windows show a weaker cursor | ||
| 39 | (such as a hollow box). Text terminals have just one cursor, so it | ||
| 40 | always appears in the selected window. | ||
| 41 | |||
| 42 | Most Emacs commands implicitly apply to the text in the selected | ||
| 43 | window; the text in unselected windows is mostly visible for | ||
| 44 | reference. However, mouse commands generally operate on whatever | ||
| 45 | window you click them in, whether selected or not. If you use | ||
| 46 | multiple frames on a graphical display, then giving the input focus to | ||
| 47 | a particular frame selects a window in that frame. | ||
| 48 | |||
| 49 | Each window's last line is a @dfn{mode line}, which describes what | ||
| 50 | is going on in that window. It appears in different color and/or a ``3D'' | ||
| 51 | box if the terminal supports them; its contents normally begin with | ||
| 52 | @w{@samp{--:-- @ *scratch*}} when Emacs starts. The mode line | ||
| 53 | displays status information such as what buffer is being displayed | ||
| 54 | above it in the window, what major and minor modes are in use, and | ||
| 55 | whether the buffer contains unsaved changes. | ||
| 56 | |||
| 57 | @menu | ||
| 58 | * Point:: The place in the text where editing commands operate. | ||
| 59 | * Echo Area:: Short messages appear at the bottom of the screen. | ||
| 60 | * Mode Line:: Interpreting the mode line. | ||
| 61 | * Menu Bar:: How to use the menu bar. | ||
| 62 | @end menu | ||
| 63 | |||
| 64 | @node Point | ||
| 65 | @section Point | ||
| 66 | @cindex point | ||
| 67 | @cindex cursor | ||
| 68 | |||
| 69 | Within Emacs, the active cursor shows the location at which | ||
| 70 | editing commands will take effect. This location is called @dfn{point}. | ||
| 71 | Many Emacs commands move point through the text, so that you can edit at | ||
| 72 | different places in it. You can also place point by clicking mouse | ||
| 73 | button 1 (normally the left button). | ||
| 74 | |||
| 75 | While the cursor appears to be @emph{on} a character, you should | ||
| 76 | think of point as @emph{between} two characters; it points @emph{before} | ||
| 77 | the character that appears under the cursor. For example, if your text | ||
| 78 | looks like @samp{frob} with the cursor over the @samp{b}, then point is | ||
| 79 | between the @samp{o} and the @samp{b}. If you insert the character | ||
| 80 | @samp{!} at that position, the result is @samp{fro!b}, with point | ||
| 81 | between the @samp{!} and the @samp{b}. Thus, the cursor remains over | ||
| 82 | the @samp{b}, as before. | ||
| 83 | |||
| 84 | Sometimes people speak of ``the cursor'' when they mean ``point,'' or | ||
| 85 | speak of commands that move point as ``cursor motion'' commands. | ||
| 86 | |||
| 87 | If you are editing several files in Emacs, each in its own buffer, | ||
| 88 | each buffer has its own point location. A buffer that is not | ||
| 89 | currently displayed remembers its point location in case you display | ||
| 90 | it again later. When Emacs displays multiple windows, each window has | ||
| 91 | its own point location. If the same buffer appears in more than one | ||
| 92 | window, each window has its own point position in that buffer, and (when | ||
| 93 | possible) its own cursor. | ||
| 94 | |||
| 95 | A text-only terminal has just one cursor, in the selected window. | ||
| 96 | The other windows do not show a cursor, even though they do have their | ||
| 97 | own position of point. When Emacs updates the screen on a text-only | ||
| 98 | terminal, it has to put the cursor temporarily at the place the output | ||
| 99 | goes. This doesn't mean point is there, though. Once display | ||
| 100 | updating finishes, Emacs puts the cursor where point is. | ||
| 101 | |||
| 102 | On graphical displays, Emacs shows a cursor in each window; the | ||
| 103 | selected window's cursor is solid and blinking, and the other cursors | ||
| 104 | are just hollow. Thus, the most prominent cursor always shows you the | ||
| 105 | selected window, on all kinds of terminals. | ||
| 106 | |||
| 107 | @xref{Cursor Display}, for customizable variables that control display | ||
| 108 | of the cursor or cursors. | ||
| 109 | |||
| 110 | The term ``point'' comes from the character @samp{.}, which was the | ||
| 111 | command in TECO (the language in which the original Emacs was written) | ||
| 112 | for accessing the value now called ``point.'' | ||
| 113 | |||
| 114 | @node Echo Area | ||
| 115 | @section The Echo Area | ||
| 116 | @cindex echo area | ||
| 117 | |||
| 118 | The line at the bottom of the frame (below the mode line) is the | ||
| 119 | @dfn{echo area}. It is used to display small amounts of text for | ||
| 120 | various purposes. | ||
| 121 | |||
| 122 | @dfn{Echoing} means displaying the characters that you type. At the | ||
| 123 | command line, the operating system normally echoes all your input. | ||
| 124 | Emacs handles echoing differently. | ||
| 125 | |||
| 126 | Single-character commands do not echo in Emacs, and multi-character | ||
| 127 | commands echo only if you pause while typing them. As soon as you pause | ||
| 128 | for more than a second in the middle of a command, Emacs echoes all the | ||
| 129 | characters of the command so far. This is to @dfn{prompt} you for the | ||
| 130 | rest of the command. Once echoing has started, the rest of the command | ||
| 131 | echoes immediately as you type it. This behavior is designed to give | ||
| 132 | confident users fast response, while giving hesitant users maximum | ||
| 133 | feedback. You can change this behavior by setting a variable | ||
| 134 | (@pxref{Display Custom}). | ||
| 135 | |||
| 136 | @cindex error message in the echo area | ||
| 137 | If a command cannot do its job, it may display an @dfn{error | ||
| 138 | message} in the echo area. Error messages are accompanied by beeping | ||
| 139 | or by flashing the screen. The error also discards any input you have | ||
| 140 | typed ahead. | ||
| 141 | |||
| 142 | Some commands display informative messages in the echo area. These | ||
| 143 | messages look much like error messages, but they are not announced | ||
| 144 | with a beep and do not throw away input. Sometimes the message tells | ||
| 145 | you what the command has done, when this is not obvious from looking | ||
| 146 | at the text being edited. Sometimes the sole purpose of a command is | ||
| 147 | to show you a message giving you specific information---for example, | ||
| 148 | @kbd{C-x =} (hold down @key{CTRL} and type @kbd{x}, then let go of | ||
| 149 | @key{CTRL} and type @kbd{=}) displays a message describing the | ||
| 150 | character position of point in the text and its current column in the | ||
| 151 | window. Commands that take a long time often display messages ending | ||
| 152 | in @samp{...} while they are working, and add @samp{done} at the end | ||
| 153 | when they are finished. They may also indicate progress with | ||
| 154 | percentages. | ||
| 155 | |||
| 156 | @cindex @samp{*Messages*} buffer | ||
| 157 | @cindex saved echo area messages | ||
| 158 | @cindex messages saved from echo area | ||
| 159 | Echo-area informative messages are saved in an editor buffer named | ||
| 160 | @samp{*Messages*}. (We have not explained buffers yet; see | ||
| 161 | @ref{Buffers}, for more information about them.) If you miss a message | ||
| 162 | that appears briefly on the screen, you can switch to the | ||
| 163 | @samp{*Messages*} buffer to see it again. (Successive progress messages | ||
| 164 | are often collapsed into one in that buffer.) | ||
| 165 | |||
| 166 | @vindex message-log-max | ||
| 167 | The size of @samp{*Messages*} is limited to a certain number of | ||
| 168 | lines. The variable @code{message-log-max} specifies how many lines. | ||
| 169 | Once the buffer has that many lines, adding lines at the end deletes lines | ||
| 170 | from the beginning, to keep the size constant. @xref{Variables}, for | ||
| 171 | how to set variables such as @code{message-log-max}. | ||
| 172 | |||
| 173 | The echo area is also used to display the @dfn{minibuffer}, a window | ||
| 174 | where you can input arguments to commands, such as the name of a file | ||
| 175 | to be edited. When the minibuffer is in use, the echo area begins | ||
| 176 | with a prompt string that usually ends with a colon; also, the cursor | ||
| 177 | appears in that line because it is the selected window. You can | ||
| 178 | always get out of the minibuffer by typing @kbd{C-g}. | ||
| 179 | @xref{Minibuffer}. | ||
| 180 | |||
| 181 | @node Mode Line | ||
| 182 | @section The Mode Line | ||
| 183 | @cindex mode line | ||
| 184 | @cindex top level | ||
| 185 | @c | ||
| 186 | |||
| 187 | Each text window's last line is a @dfn{mode line}, which describes | ||
| 188 | what is going on in that window. The mode line starts and ends with | ||
| 189 | dashes. When there is only one text window, the mode line appears | ||
| 190 | right above the echo area; it is the next-to-last line in the frame. | ||
| 191 | On a text-only terminal, the mode line is in inverse video if the | ||
| 192 | terminal supports that; on a graphics display, the mode line has a 3D | ||
| 193 | box appearance to help it stand out. The mode line of the selected | ||
| 194 | window is highlighted if possible; see @ref{Optional Mode Line}, for | ||
| 195 | more information. | ||
| 196 | |||
| 197 | Normally, the mode line looks like this: | ||
| 198 | |||
| 199 | @example | ||
| 200 | -@var{cs}:@var{ch}@var{R}-@var{fr} @var{buf} @var{pos} @var{line} (@var{major} @var{minor})------ | ||
| 201 | @end example | ||
| 202 | |||
| 203 | @noindent | ||
| 204 | This gives information about the window and the buffer it displays: the | ||
| 205 | buffer's name, what major and minor modes are in use, whether the | ||
| 206 | buffer's text has been changed, and how far down the buffer you are | ||
| 207 | currently looking. | ||
| 208 | |||
| 209 | @var{ch} contains two stars @samp{**} if the text in the buffer has | ||
| 210 | been edited (the buffer is ``modified''), or @samp{--} if the buffer has | ||
| 211 | not been edited. For a read-only buffer, it is @samp{%*} if the buffer | ||
| 212 | is modified, and @samp{%%} otherwise. | ||
| 213 | |||
| 214 | @var{R} is @samp{@@} if the default-directory for the current buffer | ||
| 215 | is on a remote machine, or a hyphen otherwise. | ||
| 216 | |||
| 217 | @var{fr} gives the selected frame name (@pxref{Frames}). It appears | ||
| 218 | only on text-only terminals. The initial frame's name is @samp{F1}. | ||
| 219 | |||
| 220 | @var{buf} is the name of the window's @dfn{buffer}. Usually this is | ||
| 221 | the same as the name of a file you are editing. @xref{Buffers}. | ||
| 222 | |||
| 223 | The buffer displayed in the selected window (the window with the | ||
| 224 | cursor) is the @dfn{current buffer}, where editing happens. When a | ||
| 225 | command's effect applies to ``the buffer,'' we mean it does those | ||
| 226 | things to the current buffer. | ||
| 227 | |||
| 228 | @var{pos} tells you whether there is additional text above the top of | ||
| 229 | the window, or below the bottom. If your buffer is small and it is all | ||
| 230 | visible in the window, @var{pos} is @samp{All}. Otherwise, it is | ||
| 231 | @samp{Top} if you are looking at the beginning of the buffer, @samp{Bot} | ||
| 232 | if you are looking at the end of the buffer, or @samp{@var{nn}%}, where | ||
| 233 | @var{nn} is the percentage of the buffer above the top of the window. | ||
| 234 | With Size Indication mode, you can display the size of the buffer as | ||
| 235 | well. @xref{Optional Mode Line}. | ||
| 236 | |||
| 237 | @var{line} is @samp{L} followed by the current line number of point. | ||
| 238 | This is present when Line Number mode is enabled (it normally is). | ||
| 239 | You can display the current column number too, by turning on Column | ||
| 240 | Number mode. It is not enabled by default because it is somewhat | ||
| 241 | slower. @xref{Optional Mode Line}. | ||
| 242 | |||
| 243 | @var{major} is the name of the @dfn{major mode} in effect in the | ||
| 244 | buffer. A buffer can only be in one major mode at a time. The major | ||
| 245 | modes available include Fundamental mode (the least specialized), Text | ||
| 246 | mode, Lisp mode, C mode, Texinfo mode, and many others. @xref{Major | ||
| 247 | Modes}, for details of how the modes differ and how to select | ||
| 248 | them. | ||
| 249 | |||
| 250 | Some major modes display additional information after the major mode | ||
| 251 | name. For example, Rmail buffers display the current message number and | ||
| 252 | the total number of messages. Compilation buffers and Shell buffers | ||
| 253 | display the status of the subprocess. | ||
| 254 | |||
| 255 | @var{minor} is a list of some of the @dfn{minor modes} that are | ||
| 256 | turned on at the moment in the window's chosen buffer. For example, | ||
| 257 | @samp{Fill} means that Auto Fill mode is on. @samp{Abbrev} means that | ||
| 258 | Word Abbrev mode is on. @samp{Ovwrt} means that Overwrite mode is on. | ||
| 259 | @xref{Minor Modes}, for more information. | ||
| 260 | |||
| 261 | @samp{Narrow} means that the buffer being displayed has editing | ||
| 262 | restricted to only a portion of its text. (This is not really a minor | ||
| 263 | mode, but is like one.) @xref{Narrowing}. @samp{Def} means that a | ||
| 264 | keyboard macro is being defined. @xref{Keyboard Macros}. | ||
| 265 | |||
| 266 | In addition, if Emacs is inside a recursive editing level, square | ||
| 267 | brackets (@samp{[@dots{}]}) appear around the parentheses that | ||
| 268 | surround the modes. If Emacs is in one recursive editing level within | ||
| 269 | another, double square brackets appear, and so on. Since recursive | ||
| 270 | editing levels affect Emacs globally, not just one buffer, the square | ||
| 271 | brackets appear in every window's mode line or not in any of them. | ||
| 272 | @xref{Recursive Edit}.@refill | ||
| 273 | |||
| 274 | @var{cs} states the coding system used for the file you are editing. | ||
| 275 | A dash indicates the default state of affairs: no code conversion, | ||
| 276 | except for end-of-line translation if the file contents call for that. | ||
| 277 | @samp{=} means no conversion whatsoever. Nontrivial code conversions | ||
| 278 | are represented by various letters---for example, @samp{1} refers to ISO | ||
| 279 | Latin-1. @xref{Coding Systems}, for more information. | ||
| 280 | |||
| 281 | On a text-only terminal, @var{cs} includes two additional characters | ||
| 282 | which describe the coding system for keyboard input and the coding | ||
| 283 | system for terminal output. They come right before the coding system | ||
| 284 | used for the file you are editing. | ||
| 285 | |||
| 286 | If you are using an input method, a string of the form | ||
| 287 | @samp{@var{i}>} is added to the beginning of @var{cs}; @var{i} | ||
| 288 | identifies the input method. (Some input methods show @samp{+} or | ||
| 289 | @samp{@@} instead of @samp{>}.) @xref{Input Methods}. | ||
| 290 | |||
| 291 | When multibyte characters are not enabled, @var{cs} does not appear at | ||
| 292 | all. @xref{Enabling Multibyte}. | ||
| 293 | |||
| 294 | @cindex end-of-line conversion, mode-line indication | ||
| 295 | The colon after @var{cs} changes to another string in some cases. | ||
| 296 | Emacs uses newline characters to separate lines in the buffer. Some | ||
| 297 | files use different conventions for separating lines: either | ||
| 298 | carriage-return linefeed (the MS-DOS convention) or just | ||
| 299 | carriage-return (the Macintosh convention). If the buffer's file uses | ||
| 300 | carriage-return linefeed, the colon changes to either a backslash | ||
| 301 | (@samp{\}) or @samp{(DOS)}, depending on the operating system. If the | ||
| 302 | file uses just carriage-return, the colon indicator changes to either | ||
| 303 | a forward slash (@samp{/}) or @samp{(Mac)}. On some systems, Emacs | ||
| 304 | displays @samp{(Unix)} instead of the colon for files that use newline | ||
| 305 | as the line separator. | ||
| 306 | |||
| 307 | @xref{Optional Mode Line}, to add other handy information to the | ||
| 308 | mode line, such as the size of the buffer, the current column number | ||
| 309 | of point, and whether new mail for you has arrived. | ||
| 310 | |||
| 311 | The mode line is mouse-sensitive; when you move the mouse across | ||
| 312 | various parts of it, Emacs displays help text to say what a click in | ||
| 313 | that place will do. @xref{Mode Line Mouse}. | ||
| 314 | |||
| 315 | @node Menu Bar | ||
| 316 | @section The Menu Bar | ||
| 317 | @cindex menu bar | ||
| 318 | |||
| 319 | Each Emacs frame normally has a @dfn{menu bar} at the top which you | ||
| 320 | can use to perform common operations. There's no need to list them | ||
| 321 | here, as you can more easily see them yourself. | ||
| 322 | |||
| 323 | @kindex M-` | ||
| 324 | @kindex F10 | ||
| 325 | @findex tmm-menubar | ||
| 326 | @findex menu-bar-open | ||
| 327 | On a graphical display, you can use the mouse to choose a command | ||
| 328 | from the menu bar. A right-arrow at the end of the menu item means it | ||
| 329 | leads to a subsidiary menu; @samp{...} at the end means that the | ||
| 330 | command invoked will read arguments (further input from you) before it | ||
| 331 | actually does anything. | ||
| 332 | |||
| 333 | You can also invoke the first menu bar item by pressing @key{F10} (to run | ||
| 334 | the command @code{menu-bar-open}). You can then navigate the menus with | ||
| 335 | the arrow keys. You select an item by pressing @key{RET} and cancel menu | ||
| 336 | navigation with @key{ESC}. | ||
| 337 | |||
| 338 | To view the full command name and documentation for a menu item, type | ||
| 339 | @kbd{C-h k}, and then select the menu bar with the mouse in the usual | ||
| 340 | way (@pxref{Key Help}). | ||
| 341 | |||
| 342 | On text-only terminals with no mouse, you can use the menu bar by | ||
| 343 | typing @kbd{M-`} or @key{F10} (these run the command | ||
| 344 | @code{tmm-menubar}). This lets you select a menu item with the | ||
| 345 | keyboard. A provisional choice appears in the echo area. You can use | ||
| 346 | the up and down arrow keys to move through the menu to different | ||
| 347 | items, and then you can type @key{RET} to select the item. | ||
| 348 | |||
| 349 | Each menu item also has an assigned letter or digit which designates | ||
| 350 | that item; it is usually the initial of some word in the item's name. | ||
| 351 | This letter or digit is separated from the item name by @samp{=>}. You | ||
| 352 | can type the item's letter or digit to select the item. | ||
| 353 | |||
| 354 | Some of the commands in the menu bar have ordinary key bindings as | ||
| 355 | well; one such binding is shown in parentheses after the item itself. | ||
| 356 | |||
| 357 | @ignore | ||
| 358 | arch-tag: 104ba40e-d972-4866-a542-a98be94bdf2f | ||
| 359 | @end ignore | ||
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi new file mode 100644 index 00000000000..1a8a6372ba2 --- /dev/null +++ b/doc/emacs/search.texi | |||
| @@ -0,0 +1,1361 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Search, Fixit, Display, Top | ||
| 6 | @chapter Searching and Replacement | ||
| 7 | @cindex searching | ||
| 8 | @cindex finding strings within text | ||
| 9 | |||
| 10 | Like other editors, Emacs has commands for searching for occurrences of | ||
| 11 | a string. The principal search command is unusual in that it is | ||
| 12 | @dfn{incremental}; it begins to search before you have finished typing the | ||
| 13 | search string. There are also nonincremental search commands more like | ||
| 14 | those of other editors. | ||
| 15 | |||
| 16 | Besides the usual @code{replace-string} command that finds all | ||
| 17 | occurrences of one string and replaces them with another, Emacs has a | ||
| 18 | more flexible replacement command called @code{query-replace}, which | ||
| 19 | asks interactively which occurrences to replace. There are also | ||
| 20 | commands to find and operate on all matches for a pattern. | ||
| 21 | |||
| 22 | You can also search multiple files under control of a tags | ||
| 23 | table (@pxref{Tags Search}) or through the Dired @kbd{A} command | ||
| 24 | (@pxref{Operating on Files}), or ask the @code{grep} program to do it | ||
| 25 | (@pxref{Grep Searching}). | ||
| 26 | |||
| 27 | |||
| 28 | @menu | ||
| 29 | * Incremental Search:: Search happens as you type the string. | ||
| 30 | * Nonincremental Search:: Specify entire string and then search. | ||
| 31 | * Word Search:: Search for sequence of words. | ||
| 32 | * Regexp Search:: Search for match for a regexp. | ||
| 33 | * Regexps:: Syntax of regular expressions. | ||
| 34 | * Regexp Backslash:: Regular expression constructs starting with `\'. | ||
| 35 | * Regexp Example:: A complex regular expression explained. | ||
| 36 | * Search Case:: To ignore case while searching, or not. | ||
| 37 | * Replace:: Search, and replace some or all matches. | ||
| 38 | * Other Repeating Search:: Operating on all matches for some regexp. | ||
| 39 | @end menu | ||
| 40 | |||
| 41 | @node Incremental Search | ||
| 42 | @section Incremental Search | ||
| 43 | @cindex incremental search | ||
| 44 | @cindex isearch | ||
| 45 | |||
| 46 | An incremental search begins searching as soon as you type the first | ||
| 47 | character of the search string. As you type in the search string, Emacs | ||
| 48 | shows you where the string (as you have typed it so far) would be | ||
| 49 | found. When you have typed enough characters to identify the place you | ||
| 50 | want, you can stop. Depending on what you plan to do next, you may or | ||
| 51 | may not need to terminate the search explicitly with @key{RET}. | ||
| 52 | |||
| 53 | @table @kbd | ||
| 54 | @item C-s | ||
| 55 | Incremental search forward (@code{isearch-forward}). | ||
| 56 | @item C-r | ||
| 57 | Incremental search backward (@code{isearch-backward}). | ||
| 58 | @end table | ||
| 59 | |||
| 60 | @menu | ||
| 61 | * Basic Isearch:: Basic incremental search commands. | ||
| 62 | * Repeat Isearch:: Searching for the same string again. | ||
| 63 | * Error in Isearch:: When your string is not found. | ||
| 64 | * Special Isearch:: Special input in incremental search. | ||
| 65 | * Non-ASCII Isearch:: How to search for non-ASCII characters. | ||
| 66 | * Isearch Yank:: Commands that grab text into the search string | ||
| 67 | or else edit the search string. | ||
| 68 | * Highlight Isearch:: Isearch highlights the other possible matches. | ||
| 69 | * Isearch Scroll:: Scrolling during an incremental search. | ||
| 70 | * Slow Isearch:: Incremental search features for slow terminals. | ||
| 71 | @end menu | ||
| 72 | |||
| 73 | @node Basic Isearch | ||
| 74 | @subsection Basics of Incremental Search | ||
| 75 | |||
| 76 | @kindex C-s | ||
| 77 | @findex isearch-forward | ||
| 78 | @kbd{C-s} starts a forward incremental search. It reads characters | ||
| 79 | from the keyboard, and moves point past the next occurrence of those | ||
| 80 | characters. If you type @kbd{C-s} and then @kbd{F}, that puts the | ||
| 81 | cursor after the first @samp{F} (the first following the starting point, since | ||
| 82 | this is a forward search). Then if you type an @kbd{O}, you will see | ||
| 83 | the cursor move to just after the first @samp{FO} (the @samp{F} in that | ||
| 84 | @samp{FO} may or may not be the first @samp{F}). After another | ||
| 85 | @kbd{O}, the cursor moves to just after the first @samp{FOO} after the place | ||
| 86 | where you started the search. At each step, the buffer text that | ||
| 87 | matches the search string is highlighted, if the terminal can do that; | ||
| 88 | the current search string is always displayed in the echo area. | ||
| 89 | |||
| 90 | If you make a mistake in typing the search string, you can cancel | ||
| 91 | characters with @key{DEL}. Each @key{DEL} cancels the last character of | ||
| 92 | search string. This does not happen until Emacs is ready to read another | ||
| 93 | input character; first it must either find, or fail to find, the character | ||
| 94 | you want to erase. If you do not want to wait for this to happen, use | ||
| 95 | @kbd{C-g} as described below. | ||
| 96 | |||
| 97 | When you are satisfied with the place you have reached, you can type | ||
| 98 | @key{RET}, which stops searching, leaving the cursor where the search | ||
| 99 | brought it. Also, any command not specially meaningful in searches | ||
| 100 | stops the searching and is then executed. Thus, typing @kbd{C-a} | ||
| 101 | would exit the search and then move to the beginning of the line. | ||
| 102 | @key{RET} is necessary only if the next command you want to type is a | ||
| 103 | printing character, @key{DEL}, @key{RET}, or another character that is | ||
| 104 | special within searches (@kbd{C-q}, @kbd{C-w}, @kbd{C-r}, @kbd{C-s}, | ||
| 105 | @kbd{C-y}, @kbd{M-y}, @kbd{M-r}, @kbd{M-c}, @kbd{M-e}, and some other | ||
| 106 | meta-characters). | ||
| 107 | |||
| 108 | When you exit the incremental search, it sets the mark where point | ||
| 109 | @emph{was} before the search. That is convenient for moving back | ||
| 110 | there. In Transient Mark mode, incremental search sets the mark | ||
| 111 | without activating it, and does so only if the mark is not already | ||
| 112 | active. | ||
| 113 | |||
| 114 | @node Repeat Isearch | ||
| 115 | @subsection Repeating Incremental Search | ||
| 116 | |||
| 117 | Sometimes you search for @samp{FOO} and find one, but not the one you | ||
| 118 | expected to find. There was a second @samp{FOO} that you forgot | ||
| 119 | about, before the one you were aiming for. In this event, type | ||
| 120 | another @kbd{C-s} to move to the next occurrence of the search string. | ||
| 121 | You can repeat this any number of times. If you overshoot, you can | ||
| 122 | cancel some @kbd{C-s} characters with @key{DEL}. | ||
| 123 | |||
| 124 | After you exit a search, you can search for the same string again by | ||
| 125 | typing just @kbd{C-s C-s}: the first @kbd{C-s} is the key that invokes | ||
| 126 | incremental search, and the second @kbd{C-s} means ``search again.'' | ||
| 127 | |||
| 128 | If a search is failing and you ask to repeat it by typing another | ||
| 129 | @kbd{C-s}, it starts again from the beginning of the buffer. | ||
| 130 | Repeating a failing reverse search with @kbd{C-r} starts again from | ||
| 131 | the end. This is called @dfn{wrapping around}, and @samp{Wrapped} | ||
| 132 | appears in the search prompt once this has happened. If you keep on | ||
| 133 | going past the original starting point of the search, it changes to | ||
| 134 | @samp{Overwrapped}, which means that you are revisiting matches that | ||
| 135 | you have already seen. | ||
| 136 | |||
| 137 | To reuse earlier search strings, use the @dfn{search ring}. The | ||
| 138 | commands @kbd{M-p} and @kbd{M-n} move through the ring to pick a search | ||
| 139 | string to reuse. These commands leave the selected search ring element | ||
| 140 | in the minibuffer, where you can edit it. To edit the current search | ||
| 141 | string in the minibuffer without replacing it with items from the | ||
| 142 | search ring, type @kbd{M-e}. Type @kbd{C-s} or @kbd{C-r} | ||
| 143 | to terminate editing the string and search for it. | ||
| 144 | |||
| 145 | You can change to searching backwards with @kbd{C-r}. For instance, | ||
| 146 | if you are searching forward but you realize you were looking for | ||
| 147 | something above the starting point, you can do this. Repeated | ||
| 148 | @kbd{C-r} keeps looking for more occurrences backwards. A @kbd{C-s} | ||
| 149 | starts going forwards again. @kbd{C-r} in a search can be canceled | ||
| 150 | with @key{DEL}. | ||
| 151 | |||
| 152 | @kindex C-r | ||
| 153 | @findex isearch-backward | ||
| 154 | If you know initially that you want to search backwards, you can use | ||
| 155 | @kbd{C-r} instead of @kbd{C-s} to start the search, because @kbd{C-r} | ||
| 156 | as a key runs a command (@code{isearch-backward}) to search backward. | ||
| 157 | A backward search finds matches that end before the starting point, | ||
| 158 | just as a forward search finds matches that begin after it. | ||
| 159 | |||
| 160 | @node Error in Isearch | ||
| 161 | @subsection Errors in Incremental Search | ||
| 162 | |||
| 163 | If your string is not found at all, the echo area says @samp{Failing | ||
| 164 | I-Search}. The cursor is after the place where Emacs found as much of your | ||
| 165 | string as it could. Thus, if you search for @samp{FOOT}, and there is no | ||
| 166 | @samp{FOOT}, you might see the cursor after the @samp{FOO} in @samp{FOOL}. | ||
| 167 | At this point there are several things you can do. If your string was | ||
| 168 | mistyped, you can rub some of it out and correct it. If you like the place | ||
| 169 | you have found, you can type @key{RET} or some other Emacs command to | ||
| 170 | remain there. Or you can type @kbd{C-g}, which | ||
| 171 | removes from the search string the characters that could not be found (the | ||
| 172 | @samp{T} in @samp{FOOT}), leaving those that were found (the @samp{FOO} in | ||
| 173 | @samp{FOOT}). A second @kbd{C-g} at that point cancels the search | ||
| 174 | entirely, returning point to where it was when the search started. | ||
| 175 | |||
| 176 | @cindex quitting (in search) | ||
| 177 | The @kbd{C-g} ``quit'' character does special things during searches; | ||
| 178 | just what it does depends on the status of the search. If the search has | ||
| 179 | found what you specified and is waiting for input, @kbd{C-g} cancels the | ||
| 180 | entire search. The cursor moves back to where you started the search. If | ||
| 181 | @kbd{C-g} is typed when there are characters in the search string that have | ||
| 182 | not been found---because Emacs is still searching for them, or because it | ||
| 183 | has failed to find them---then the search string characters which have not | ||
| 184 | been found are discarded from the search string. With them gone, the | ||
| 185 | search is now successful and waiting for more input, so a second @kbd{C-g} | ||
| 186 | will cancel the entire search. | ||
| 187 | |||
| 188 | @node Special Isearch | ||
| 189 | @subsection Special Input for Incremental Search | ||
| 190 | |||
| 191 | An upper-case letter in the search string makes the search | ||
| 192 | case-sensitive. If you delete the upper-case character from the search | ||
| 193 | string, it ceases to have this effect. @xref{Search Case}. | ||
| 194 | |||
| 195 | To search for a newline, type @kbd{C-j}. To search for another | ||
| 196 | control character, such as control-S or carriage return, you must quote | ||
| 197 | it by typing @kbd{C-q} first. This function of @kbd{C-q} is analogous | ||
| 198 | to its use for insertion (@pxref{Inserting Text}): it causes the | ||
| 199 | following character to be treated the way any ``ordinary'' character is | ||
| 200 | treated in the same context. You can also specify a character by its | ||
| 201 | octal code: enter @kbd{C-q} followed by a sequence of octal digits. | ||
| 202 | |||
| 203 | @kbd{M-%} typed in incremental search invokes @code{query-replace} | ||
| 204 | or @code{query-replace-regexp} (depending on search mode) with the | ||
| 205 | current search string used as the string to replace. @xref{Query | ||
| 206 | Replace}. | ||
| 207 | |||
| 208 | Entering @key{RET} when the search string is empty launches | ||
| 209 | nonincremental search (@pxref{Nonincremental Search}). | ||
| 210 | |||
| 211 | @vindex isearch-mode-map | ||
| 212 | To customize the special characters that incremental search understands, | ||
| 213 | alter their bindings in the keymap @code{isearch-mode-map}. For a list | ||
| 214 | of bindings, look at the documentation of @code{isearch-mode} with | ||
| 215 | @kbd{C-h f isearch-mode @key{RET}}. | ||
| 216 | |||
| 217 | @node Non-ASCII Isearch | ||
| 218 | @subsection Isearch for Non-@acronym{ASCII} Characters | ||
| 219 | @cindex searching for non-@acronym{ASCII} characters | ||
| 220 | @cindex input method, during incremental search | ||
| 221 | |||
| 222 | To enter non-@acronym{ASCII} characters in an incremental search, | ||
| 223 | you can use @kbd{C-q} (see the previous section), but it is easier to | ||
| 224 | use an input method (@pxref{Input Methods}). If an input method is | ||
| 225 | enabled in the current buffer when you start the search, you can use | ||
| 226 | it in the search string also. Emacs indicates that by including the | ||
| 227 | input method mnemonic in its prompt, like this: | ||
| 228 | |||
| 229 | @example | ||
| 230 | I-search [@var{im}]: | ||
| 231 | @end example | ||
| 232 | |||
| 233 | @noindent | ||
| 234 | @findex isearch-toggle-input-method | ||
| 235 | @findex isearch-toggle-specified-input-method | ||
| 236 | where @var{im} is the mnemonic of the active input method. | ||
| 237 | |||
| 238 | You can toggle (enable or disable) the input method while you type | ||
| 239 | the search string with @kbd{C-\} (@code{isearch-toggle-input-method}). | ||
| 240 | You can turn on a certain (non-default) input method with @kbd{C-^} | ||
| 241 | (@code{isearch-toggle-specified-input-method}), which prompts for the | ||
| 242 | name of the input method. The input method you enable during | ||
| 243 | incremental search remains enabled in the current buffer afterwards. | ||
| 244 | |||
| 245 | @node Isearch Yank | ||
| 246 | @subsection Isearch Yanking | ||
| 247 | |||
| 248 | The characters @kbd{C-w} and @kbd{C-y} can be used in incremental | ||
| 249 | search to grab text from the buffer into the search string. This | ||
| 250 | makes it convenient to search for another occurrence of text at point. | ||
| 251 | @kbd{C-w} copies the character or word after point as part of the | ||
| 252 | search string, advancing point over it. (The decision, whether to | ||
| 253 | copy a character or a word, is heuristic.) Another @kbd{C-s} to | ||
| 254 | repeat the search will then search for a string including that | ||
| 255 | character or word. | ||
| 256 | |||
| 257 | @kbd{C-y} is similar to @kbd{C-w} but copies all the rest of the | ||
| 258 | current line into the search string. If point is already at the end | ||
| 259 | of a line, it grabs the entire next line. Both @kbd{C-y} and | ||
| 260 | @kbd{C-w} convert the text they copy to lower case if the search is | ||
| 261 | currently not case-sensitive; this is so the search remains | ||
| 262 | case-insensitive. | ||
| 263 | |||
| 264 | @kbd{C-M-w} and @kbd{C-M-y} modify the search string by only one | ||
| 265 | character at a time: @kbd{C-M-w} deletes the last character from the | ||
| 266 | search string and @kbd{C-M-y} copies the character after point to the | ||
| 267 | end of the search string. An alternative method to add the character | ||
| 268 | after point into the search string is to enter the minibuffer by | ||
| 269 | @kbd{M-e} and to type @kbd{C-f} at the end of the search string in the | ||
| 270 | minibuffer. | ||
| 271 | |||
| 272 | The character @kbd{M-y} copies text from the kill ring into the search | ||
| 273 | string. It uses the same text that @kbd{C-y} as a command would yank. | ||
| 274 | @kbd{Mouse-2} in the echo area does the same. | ||
| 275 | @xref{Yanking}. | ||
| 276 | |||
| 277 | @node Highlight Isearch | ||
| 278 | @subsection Lazy Search Highlighting | ||
| 279 | @cindex lazy search highlighting | ||
| 280 | @vindex isearch-lazy-highlight | ||
| 281 | |||
| 282 | When you pause for a little while during incremental search, it | ||
| 283 | highlights all other possible matches for the search string. This | ||
| 284 | makes it easier to anticipate where you can get to by typing @kbd{C-s} | ||
| 285 | or @kbd{C-r} to repeat the search. The short delay before highlighting | ||
| 286 | other matches helps indicate which match is the current one. | ||
| 287 | If you don't like this feature, you can turn it off by setting | ||
| 288 | @code{isearch-lazy-highlight} to @code{nil}. | ||
| 289 | |||
| 290 | @cindex faces for highlighting search matches | ||
| 291 | You can control how this highlighting looks by customizing the faces | ||
| 292 | @code{isearch} (used for the current match) and @code{lazy-highlight} | ||
| 293 | (for all the other matches). | ||
| 294 | |||
| 295 | @node Isearch Scroll | ||
| 296 | @subsection Scrolling During Incremental Search | ||
| 297 | |||
| 298 | You can enable the use of vertical scrolling during incremental | ||
| 299 | search (without exiting the search) by setting the customizable | ||
| 300 | variable @code{isearch-allow-scroll} to a non-@code{nil} value. This | ||
| 301 | applies to using the vertical scroll-bar and to certain keyboard | ||
| 302 | commands such as @kbd{@key{PRIOR}} (@code{scroll-down}), | ||
| 303 | @kbd{@key{NEXT}} (@code{scroll-up}) and @kbd{C-l} (@code{recenter}). | ||
| 304 | You must run these commands via their key sequences to stay in the | ||
| 305 | search---typing @kbd{M-x} will terminate the search. You can give | ||
| 306 | prefix arguments to these commands in the usual way. | ||
| 307 | |||
| 308 | This feature won't let you scroll the current match out of visibility, | ||
| 309 | however. | ||
| 310 | |||
| 311 | The feature also affects some other commands, such as @kbd{C-x 2} | ||
| 312 | (@code{split-window-vertically}) and @kbd{C-x ^} | ||
| 313 | (@code{enlarge-window}) which don't exactly scroll but do affect where | ||
| 314 | the text appears on the screen. In general, it applies to any command | ||
| 315 | whose name has a non-@code{nil} @code{isearch-scroll} property. So you | ||
| 316 | can control which commands are affected by changing these properties. | ||
| 317 | |||
| 318 | For example, to make @kbd{C-h l} usable within an incremental search | ||
| 319 | in all future Emacs sessions, use @kbd{C-h c} to find what command it | ||
| 320 | runs. (You type @kbd{C-h c C-h l}; it says @code{view-lossage}.) | ||
| 321 | Then you can put the following line in your @file{.emacs} file | ||
| 322 | (@pxref{Init File}): | ||
| 323 | |||
| 324 | @example | ||
| 325 | (put 'view-lossage 'isearch-scroll t) | ||
| 326 | @end example | ||
| 327 | |||
| 328 | @noindent | ||
| 329 | This feature can be applied to any command that doesn't permanently | ||
| 330 | change point, the buffer contents, the match data, the current buffer, | ||
| 331 | or the selected window and frame. The command must not itself attempt | ||
| 332 | an incremental search. | ||
| 333 | |||
| 334 | @node Slow Isearch | ||
| 335 | @subsection Slow Terminal Incremental Search | ||
| 336 | |||
| 337 | Incremental search on a slow terminal uses a modified style of display | ||
| 338 | that is designed to take less time. Instead of redisplaying the buffer at | ||
| 339 | each place the search gets to, it creates a new single-line window and uses | ||
| 340 | that to display the line that the search has found. The single-line window | ||
| 341 | comes into play as soon as point moves outside of the text that is already | ||
| 342 | on the screen. | ||
| 343 | |||
| 344 | When you terminate the search, the single-line window is removed. | ||
| 345 | Emacs then redisplays the window in which the search was done, to show | ||
| 346 | its new position of point. | ||
| 347 | |||
| 348 | @vindex search-slow-speed | ||
| 349 | The slow terminal style of display is used when the terminal baud rate is | ||
| 350 | less than or equal to the value of the variable @code{search-slow-speed}, | ||
| 351 | initially 1200. See also the discussion of the variable @code{baud-rate} | ||
| 352 | (@pxref{baud-rate,, Customization of Display}). | ||
| 353 | |||
| 354 | @vindex search-slow-window-lines | ||
| 355 | The number of lines to use in slow terminal search display is controlled | ||
| 356 | by the variable @code{search-slow-window-lines}. Its normal value is 1. | ||
| 357 | |||
| 358 | @node Nonincremental Search | ||
| 359 | @section Nonincremental Search | ||
| 360 | @cindex nonincremental search | ||
| 361 | |||
| 362 | Emacs also has conventional nonincremental search commands, which require | ||
| 363 | you to type the entire search string before searching begins. | ||
| 364 | |||
| 365 | @table @kbd | ||
| 366 | @item C-s @key{RET} @var{string} @key{RET} | ||
| 367 | Search for @var{string}. | ||
| 368 | @item C-r @key{RET} @var{string} @key{RET} | ||
| 369 | Search backward for @var{string}. | ||
| 370 | @end table | ||
| 371 | |||
| 372 | To do a nonincremental search, first type @kbd{C-s @key{RET}}. This | ||
| 373 | enters the minibuffer to read the search string; terminate the string | ||
| 374 | with @key{RET}, and then the search takes place. If the string is not | ||
| 375 | found, the search command signals an error. | ||
| 376 | |||
| 377 | When you type @kbd{C-s @key{RET}}, the @kbd{C-s} invokes incremental | ||
| 378 | search as usual. That command is specially programmed to invoke | ||
| 379 | nonincremental search, @code{search-forward}, if the string you | ||
| 380 | specify is empty. (Such an empty argument would otherwise be | ||
| 381 | useless.) But it does not call @code{search-forward} right away. First | ||
| 382 | it checks the next input character to see if is @kbd{C-w}, | ||
| 383 | which specifies a word search. | ||
| 384 | @ifnottex | ||
| 385 | @xref{Word Search}. | ||
| 386 | @end ifnottex | ||
| 387 | @kbd{C-r @key{RET}} does likewise, for a reverse incremental search. | ||
| 388 | |||
| 389 | @findex search-forward | ||
| 390 | @findex search-backward | ||
| 391 | Forward and backward nonincremental searches are implemented by the | ||
| 392 | commands @code{search-forward} and @code{search-backward}. These | ||
| 393 | commands may be bound to keys in the usual manner. The feature that you | ||
| 394 | can get to them via the incremental search commands exists for | ||
| 395 | historical reasons, and to avoid the need to find separate key sequences | ||
| 396 | for them. | ||
| 397 | |||
| 398 | @node Word Search | ||
| 399 | @section Word Search | ||
| 400 | @cindex word search | ||
| 401 | |||
| 402 | Word search searches for a sequence of words without regard to how the | ||
| 403 | words are separated. More precisely, you type a string of many words, | ||
| 404 | using single spaces to separate them, and the string can be found even | ||
| 405 | if there are multiple spaces, newlines, or other punctuation characters | ||
| 406 | between these words. | ||
| 407 | |||
| 408 | Word search is useful for editing a printed document made with a text | ||
| 409 | formatter. If you edit while looking at the printed, formatted version, | ||
| 410 | you can't tell where the line breaks are in the source file. With word | ||
| 411 | search, you can search without having to know them. | ||
| 412 | |||
| 413 | @table @kbd | ||
| 414 | @item C-s @key{RET} C-w @var{words} @key{RET} | ||
| 415 | Search for @var{words}, ignoring details of punctuation. | ||
| 416 | @item C-r @key{RET} C-w @var{words} @key{RET} | ||
| 417 | Search backward for @var{words}, ignoring details of punctuation. | ||
| 418 | @end table | ||
| 419 | |||
| 420 | Word search as a special case of nonincremental search is invoked | ||
| 421 | with @kbd{C-s @key{RET} C-w}. This is followed by the search string, | ||
| 422 | which must always be terminated with @key{RET}. Being nonincremental, | ||
| 423 | this search does not start until the argument is terminated. It works | ||
| 424 | by constructing a regular expression and searching for that; see | ||
| 425 | @ref{Regexp Search}. | ||
| 426 | |||
| 427 | Use @kbd{C-r @key{RET} C-w} to do backward word search. | ||
| 428 | |||
| 429 | You can also invoke word search with @kbd{C-s M-e C-w} or @kbd{C-r | ||
| 430 | M-e C-w} followed by the search string and terminated with @key{RET}, | ||
| 431 | @kbd{C-s} or @kbd{C-r}. This puts word search into incremental mode | ||
| 432 | where you can use all keys available for incremental search. However, | ||
| 433 | when you type more words in incremental word search, it will fail | ||
| 434 | until you type complete words. | ||
| 435 | |||
| 436 | @findex word-search-forward | ||
| 437 | @findex word-search-backward | ||
| 438 | Forward and backward word searches are implemented by the commands | ||
| 439 | @code{word-search-forward} and @code{word-search-backward}. These | ||
| 440 | commands may be bound to keys in the usual manner. They are available | ||
| 441 | via the incremental search commands both for historical reasons and | ||
| 442 | to avoid the need to find separate key sequences for them. | ||
| 443 | |||
| 444 | @node Regexp Search | ||
| 445 | @section Regular Expression Search | ||
| 446 | @cindex regular expression | ||
| 447 | @cindex regexp | ||
| 448 | |||
| 449 | A @dfn{regular expression} (@dfn{regexp}, for short) is a pattern | ||
| 450 | that denotes a class of alternative strings to match, possibly | ||
| 451 | infinitely many. GNU Emacs provides both incremental and | ||
| 452 | nonincremental ways to search for a match for a regexp. The syntax of | ||
| 453 | regular expressions is explained in the following section. | ||
| 454 | |||
| 455 | @kindex C-M-s | ||
| 456 | @findex isearch-forward-regexp | ||
| 457 | @kindex C-M-r | ||
| 458 | @findex isearch-backward-regexp | ||
| 459 | Incremental search for a regexp is done by typing @kbd{C-M-s} | ||
| 460 | (@code{isearch-forward-regexp}), by invoking @kbd{C-s} with a | ||
| 461 | prefix argument (whose value does not matter), or by typing @kbd{M-r} | ||
| 462 | within a forward incremental search. This command reads a | ||
| 463 | search string incrementally just like @kbd{C-s}, but it treats the | ||
| 464 | search string as a regexp rather than looking for an exact match | ||
| 465 | against the text in the buffer. Each time you add text to the search | ||
| 466 | string, you make the regexp longer, and the new regexp is searched | ||
| 467 | for. To search backward for a regexp, use @kbd{C-M-r} | ||
| 468 | (@code{isearch-backward-regexp}), @kbd{C-r} with a prefix argument, | ||
| 469 | or @kbd{M-r} within a backward incremental search. | ||
| 470 | |||
| 471 | All of the control characters that do special things within an | ||
| 472 | ordinary incremental search have the same function in incremental regexp | ||
| 473 | search. Typing @kbd{C-s} or @kbd{C-r} immediately after starting the | ||
| 474 | search retrieves the last incremental search regexp used; that is to | ||
| 475 | say, incremental regexp and non-regexp searches have independent | ||
| 476 | defaults. They also have separate search rings that you can access with | ||
| 477 | @kbd{M-p} and @kbd{M-n}. | ||
| 478 | |||
| 479 | @vindex search-whitespace-regexp | ||
| 480 | If you type @key{SPC} in incremental regexp search, it matches any | ||
| 481 | sequence of whitespace characters, including newlines. If you want to | ||
| 482 | match just a space, type @kbd{C-q @key{SPC}}. You can control what a | ||
| 483 | bare space matches by setting the variable | ||
| 484 | @code{search-whitespace-regexp} to the desired regexp. | ||
| 485 | |||
| 486 | In some cases, adding characters to the regexp in an incremental regexp | ||
| 487 | search can make the cursor move back and start again. For example, if | ||
| 488 | you have searched for @samp{foo} and you add @samp{\|bar}, the cursor | ||
| 489 | backs up in case the first @samp{bar} precedes the first @samp{foo}. | ||
| 490 | |||
| 491 | Forward and backward regexp search are not symmetrical, because | ||
| 492 | regexp matching in Emacs always operates forward, starting with the | ||
| 493 | beginning of the regexp. Thus, forward regexp search scans forward, | ||
| 494 | trying a forward match at each possible starting position. Backward | ||
| 495 | regexp search scans backward, trying a forward match at each possible | ||
| 496 | starting position. These search methods are not mirror images. | ||
| 497 | |||
| 498 | @findex re-search-forward | ||
| 499 | @findex re-search-backward | ||
| 500 | Nonincremental search for a regexp is done by the functions | ||
| 501 | @code{re-search-forward} and @code{re-search-backward}. You can invoke | ||
| 502 | these with @kbd{M-x}, or bind them to keys, or invoke them by way of | ||
| 503 | incremental regexp search with @kbd{C-M-s @key{RET}} and @kbd{C-M-r | ||
| 504 | @key{RET}}. | ||
| 505 | |||
| 506 | If you use the incremental regexp search commands with a prefix | ||
| 507 | argument, they perform ordinary string search, like | ||
| 508 | @code{isearch-forward} and @code{isearch-backward}. @xref{Incremental | ||
| 509 | Search}. | ||
| 510 | |||
| 511 | @node Regexps | ||
| 512 | @section Syntax of Regular Expressions | ||
| 513 | @cindex syntax of regexps | ||
| 514 | |||
| 515 | This manual describes regular expression features that users | ||
| 516 | typically want to use. There are additional features that are | ||
| 517 | mainly used in Lisp programs; see @ref{Regular Expressions,,, | ||
| 518 | elisp, The Emacs Lisp Reference Manual}. | ||
| 519 | |||
| 520 | Regular expressions have a syntax in which a few characters are | ||
| 521 | special constructs and the rest are @dfn{ordinary}. An ordinary | ||
| 522 | character is a simple regular expression which matches that same | ||
| 523 | character and nothing else. The special characters are @samp{$}, | ||
| 524 | @samp{^}, @samp{.}, @samp{*}, @samp{+}, @samp{?}, @samp{[}, and | ||
| 525 | @samp{\}. The character @samp{]} is special if it ends a character | ||
| 526 | alternative (see later). The character @samp{-} is special inside a | ||
| 527 | character alternative. Any other character appearing in a regular | ||
| 528 | expression is ordinary, unless a @samp{\} precedes it. (When you use | ||
| 529 | regular expressions in a Lisp program, each @samp{\} must be doubled, | ||
| 530 | see the example near the end of this section.) | ||
| 531 | |||
| 532 | For example, @samp{f} is not a special character, so it is ordinary, and | ||
| 533 | therefore @samp{f} is a regular expression that matches the string | ||
| 534 | @samp{f} and no other string. (It does @emph{not} match the string | ||
| 535 | @samp{ff}.) Likewise, @samp{o} is a regular expression that matches | ||
| 536 | only @samp{o}. (When case distinctions are being ignored, these regexps | ||
| 537 | also match @samp{F} and @samp{O}, but we consider this a generalization | ||
| 538 | of ``the same string,'' rather than an exception.) | ||
| 539 | |||
| 540 | Any two regular expressions @var{a} and @var{b} can be concatenated. The | ||
| 541 | result is a regular expression which matches a string if @var{a} matches | ||
| 542 | some amount of the beginning of that string and @var{b} matches the rest of | ||
| 543 | the string.@refill | ||
| 544 | |||
| 545 | As a simple example, we can concatenate the regular expressions @samp{f} | ||
| 546 | and @samp{o} to get the regular expression @samp{fo}, which matches only | ||
| 547 | the string @samp{fo}. Still trivial. To do something nontrivial, you | ||
| 548 | need to use one of the special characters. Here is a list of them. | ||
| 549 | |||
| 550 | @table @asis | ||
| 551 | @item @kbd{.}@: @r{(Period)} | ||
| 552 | is a special character that matches any single character except a newline. | ||
| 553 | Using concatenation, we can make regular expressions like @samp{a.b}, which | ||
| 554 | matches any three-character string that begins with @samp{a} and ends with | ||
| 555 | @samp{b}.@refill | ||
| 556 | |||
| 557 | @item @kbd{*} | ||
| 558 | is not a construct by itself; it is a postfix operator that means to | ||
| 559 | match the preceding regular expression repetitively as many times as | ||
| 560 | possible. Thus, @samp{o*} matches any number of @samp{o}s (including no | ||
| 561 | @samp{o}s). | ||
| 562 | |||
| 563 | @samp{*} always applies to the @emph{smallest} possible preceding | ||
| 564 | expression. Thus, @samp{fo*} has a repeating @samp{o}, not a repeating | ||
| 565 | @samp{fo}. It matches @samp{f}, @samp{fo}, @samp{foo}, and so on. | ||
| 566 | |||
| 567 | The matcher processes a @samp{*} construct by matching, immediately, | ||
| 568 | as many repetitions as can be found. Then it continues with the rest | ||
| 569 | of the pattern. If that fails, backtracking occurs, discarding some | ||
| 570 | of the matches of the @samp{*}-modified construct in case that makes | ||
| 571 | it possible to match the rest of the pattern. For example, in matching | ||
| 572 | @samp{ca*ar} against the string @samp{caaar}, the @samp{a*} first | ||
| 573 | tries to match all three @samp{a}s; but the rest of the pattern is | ||
| 574 | @samp{ar} and there is only @samp{r} left to match, so this try fails. | ||
| 575 | The next alternative is for @samp{a*} to match only two @samp{a}s. | ||
| 576 | With this choice, the rest of the regexp matches successfully.@refill | ||
| 577 | |||
| 578 | @item @kbd{+} | ||
| 579 | is a postfix operator, similar to @samp{*} except that it must match | ||
| 580 | the preceding expression at least once. So, for example, @samp{ca+r} | ||
| 581 | matches the strings @samp{car} and @samp{caaaar} but not the string | ||
| 582 | @samp{cr}, whereas @samp{ca*r} matches all three strings. | ||
| 583 | |||
| 584 | @item @kbd{?} | ||
| 585 | is a postfix operator, similar to @samp{*} except that it can match the | ||
| 586 | preceding expression either once or not at all. For example, | ||
| 587 | @samp{ca?r} matches @samp{car} or @samp{cr}; nothing else. | ||
| 588 | |||
| 589 | @item @kbd{*?}, @kbd{+?}, @kbd{??} | ||
| 590 | @cindex non-greedy regexp matching | ||
| 591 | are non-greedy variants of the operators above. The normal operators | ||
| 592 | @samp{*}, @samp{+}, @samp{?} are @dfn{greedy} in that they match as | ||
| 593 | much as they can, as long as the overall regexp can still match. With | ||
| 594 | a following @samp{?}, they are non-greedy: they will match as little | ||
| 595 | as possible. | ||
| 596 | |||
| 597 | Thus, both @samp{ab*} and @samp{ab*?} can match the string @samp{a} | ||
| 598 | and the string @samp{abbbb}; but if you try to match them both against | ||
| 599 | the text @samp{abbb}, @samp{ab*} will match it all (the longest valid | ||
| 600 | match), while @samp{ab*?} will match just @samp{a} (the shortest | ||
| 601 | valid match). | ||
| 602 | |||
| 603 | Non-greedy operators match the shortest possible string starting at a | ||
| 604 | given starting point; in a forward search, though, the earliest | ||
| 605 | possible starting point for match is always the one chosen. Thus, if | ||
| 606 | you search for @samp{a.*?$} against the text @samp{abbab} followed by | ||
| 607 | a newline, it matches the whole string. Since it @emph{can} match | ||
| 608 | starting at the first @samp{a}, it does. | ||
| 609 | |||
| 610 | @item @kbd{\@{@var{n}\@}} | ||
| 611 | is a postfix operator that specifies repetition @var{n} times---that | ||
| 612 | is, the preceding regular expression must match exactly @var{n} times | ||
| 613 | in a row. For example, @samp{x\@{4\@}} matches the string @samp{xxxx} | ||
| 614 | and nothing else. | ||
| 615 | |||
| 616 | @item @kbd{\@{@var{n},@var{m}\@}} | ||
| 617 | is a postfix operator that specifies repetition between @var{n} and | ||
| 618 | @var{m} times---that is, the preceding regular expression must match | ||
| 619 | at least @var{n} times, but no more than @var{m} times. If @var{m} is | ||
| 620 | omitted, then there is no upper limit, but the preceding regular | ||
| 621 | expression must match at least @var{n} times.@* @samp{\@{0,1\@}} is | ||
| 622 | equivalent to @samp{?}. @* @samp{\@{0,\@}} is equivalent to | ||
| 623 | @samp{*}. @* @samp{\@{1,\@}} is equivalent to @samp{+}. | ||
| 624 | |||
| 625 | @item @kbd{[ @dots{} ]} | ||
| 626 | is a @dfn{character set}, which begins with @samp{[} and is terminated | ||
| 627 | by @samp{]}. In the simplest case, the characters between the two | ||
| 628 | brackets are what this set can match. | ||
| 629 | |||
| 630 | Thus, @samp{[ad]} matches either one @samp{a} or one @samp{d}, and | ||
| 631 | @samp{[ad]*} matches any string composed of just @samp{a}s and @samp{d}s | ||
| 632 | (including the empty string), from which it follows that @samp{c[ad]*r} | ||
| 633 | matches @samp{cr}, @samp{car}, @samp{cdr}, @samp{caddaar}, etc. | ||
| 634 | |||
| 635 | You can also include character ranges in a character set, by writing the | ||
| 636 | starting and ending characters with a @samp{-} between them. Thus, | ||
| 637 | @samp{[a-z]} matches any lower-case @acronym{ASCII} letter. Ranges may be | ||
| 638 | intermixed freely with individual characters, as in @samp{[a-z$%.]}, | ||
| 639 | which matches any lower-case @acronym{ASCII} letter or @samp{$}, @samp{%} or | ||
| 640 | period. | ||
| 641 | |||
| 642 | Note that the usual regexp special characters are not special inside a | ||
| 643 | character set. A completely different set of special characters exists | ||
| 644 | inside character sets: @samp{]}, @samp{-} and @samp{^}. | ||
| 645 | |||
| 646 | To include a @samp{]} in a character set, you must make it the first | ||
| 647 | character. For example, @samp{[]a]} matches @samp{]} or @samp{a}. To | ||
| 648 | include a @samp{-}, write @samp{-} as the first or last character of the | ||
| 649 | set, or put it after a range. Thus, @samp{[]-]} matches both @samp{]} | ||
| 650 | and @samp{-}. | ||
| 651 | |||
| 652 | To include @samp{^} in a set, put it anywhere but at the beginning of | ||
| 653 | the set. (At the beginning, it complements the set---see below.) | ||
| 654 | |||
| 655 | When you use a range in case-insensitive search, you should write both | ||
| 656 | ends of the range in upper case, or both in lower case, or both should | ||
| 657 | be non-letters. The behavior of a mixed-case range such as @samp{A-z} | ||
| 658 | is somewhat ill-defined, and it may change in future Emacs versions. | ||
| 659 | |||
| 660 | @item @kbd{[^ @dots{} ]} | ||
| 661 | @samp{[^} begins a @dfn{complemented character set}, which matches any | ||
| 662 | character except the ones specified. Thus, @samp{[^a-z0-9A-Z]} matches | ||
| 663 | all characters @emph{except} @acronym{ASCII} letters and digits. | ||
| 664 | |||
| 665 | @samp{^} is not special in a character set unless it is the first | ||
| 666 | character. The character following the @samp{^} is treated as if it | ||
| 667 | were first (in other words, @samp{-} and @samp{]} are not special there). | ||
| 668 | |||
| 669 | A complemented character set can match a newline, unless newline is | ||
| 670 | mentioned as one of the characters not to match. This is in contrast to | ||
| 671 | the handling of regexps in programs such as @code{grep}. | ||
| 672 | |||
| 673 | @item @kbd{^} | ||
| 674 | is a special character that matches the empty string, but only at the | ||
| 675 | beginning of a line in the text being matched. Otherwise it fails to | ||
| 676 | match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs at | ||
| 677 | the beginning of a line. | ||
| 678 | |||
| 679 | For historical compatibility reasons, @samp{^} can be used with this | ||
| 680 | meaning only at the beginning of the regular expression, or after | ||
| 681 | @samp{\(} or @samp{\|}. | ||
| 682 | |||
| 683 | @item @kbd{$} | ||
| 684 | is similar to @samp{^} but matches only at the end of a line. Thus, | ||
| 685 | @samp{x+$} matches a string of one @samp{x} or more at the end of a line. | ||
| 686 | |||
| 687 | For historical compatibility reasons, @samp{$} can be used with this | ||
| 688 | meaning only at the end of the regular expression, or before @samp{\)} | ||
| 689 | or @samp{\|}. | ||
| 690 | |||
| 691 | @item @kbd{\} | ||
| 692 | has two functions: it quotes the special characters (including | ||
| 693 | @samp{\}), and it introduces additional special constructs. | ||
| 694 | |||
| 695 | Because @samp{\} quotes special characters, @samp{\$} is a regular | ||
| 696 | expression that matches only @samp{$}, and @samp{\[} is a regular | ||
| 697 | expression that matches only @samp{[}, and so on. | ||
| 698 | |||
| 699 | See the following section for the special constructs that begin | ||
| 700 | with @samp{\}. | ||
| 701 | @end table | ||
| 702 | |||
| 703 | Note: for historical compatibility, special characters are treated as | ||
| 704 | ordinary ones if they are in contexts where their special meanings make no | ||
| 705 | sense. For example, @samp{*foo} treats @samp{*} as ordinary since there is | ||
| 706 | no preceding expression on which the @samp{*} can act. It is poor practice | ||
| 707 | to depend on this behavior; it is better to quote the special character anyway, | ||
| 708 | regardless of where it appears. | ||
| 709 | |||
| 710 | As a @samp{\} is not special inside a character alternative, it can | ||
| 711 | never remove the special meaning of @samp{-} or @samp{]}. So you | ||
| 712 | should not quote these characters when they have no special meaning | ||
| 713 | either. This would not clarify anything, since backslashes can | ||
| 714 | legitimately precede these characters where they @emph{have} special | ||
| 715 | meaning, as in @samp{[^\]} (@code{"[^\\]"} for Lisp string syntax), | ||
| 716 | which matches any single character except a backslash. | ||
| 717 | |||
| 718 | @node Regexp Backslash | ||
| 719 | @section Backslash in Regular Expressions | ||
| 720 | |||
| 721 | For the most part, @samp{\} followed by any character matches only | ||
| 722 | that character. However, there are several exceptions: two-character | ||
| 723 | sequences starting with @samp{\} that have special meanings. The | ||
| 724 | second character in the sequence is always an ordinary character when | ||
| 725 | used on its own. Here is a table of @samp{\} constructs. | ||
| 726 | |||
| 727 | @table @kbd | ||
| 728 | @item \| | ||
| 729 | specifies an alternative. Two regular expressions @var{a} and @var{b} | ||
| 730 | with @samp{\|} in between form an expression that matches some text if | ||
| 731 | either @var{a} matches it or @var{b} matches it. It works by trying to | ||
| 732 | match @var{a}, and if that fails, by trying to match @var{b}. | ||
| 733 | |||
| 734 | Thus, @samp{foo\|bar} matches either @samp{foo} or @samp{bar} | ||
| 735 | but no other string.@refill | ||
| 736 | |||
| 737 | @samp{\|} applies to the largest possible surrounding expressions. Only a | ||
| 738 | surrounding @samp{\( @dots{} \)} grouping can limit the grouping power of | ||
| 739 | @samp{\|}.@refill | ||
| 740 | |||
| 741 | Full backtracking capability exists to handle multiple uses of @samp{\|}. | ||
| 742 | |||
| 743 | @item \( @dots{} \) | ||
| 744 | is a grouping construct that serves three purposes: | ||
| 745 | |||
| 746 | @enumerate | ||
| 747 | @item | ||
| 748 | To enclose a set of @samp{\|} alternatives for other operations. | ||
| 749 | Thus, @samp{\(foo\|bar\)x} matches either @samp{foox} or @samp{barx}. | ||
| 750 | |||
| 751 | @item | ||
| 752 | To enclose a complicated expression for the postfix operators @samp{*}, | ||
| 753 | @samp{+} and @samp{?} to operate on. Thus, @samp{ba\(na\)*} matches | ||
| 754 | @samp{bananana}, etc., with any (zero or more) number of @samp{na} | ||
| 755 | strings.@refill | ||
| 756 | |||
| 757 | @item | ||
| 758 | To record a matched substring for future reference. | ||
| 759 | @end enumerate | ||
| 760 | |||
| 761 | This last application is not a consequence of the idea of a | ||
| 762 | parenthetical grouping; it is a separate feature that is assigned as a | ||
| 763 | second meaning to the same @samp{\( @dots{} \)} construct. In practice | ||
| 764 | there is usually no conflict between the two meanings; when there is | ||
| 765 | a conflict, you can use a ``shy'' group. | ||
| 766 | |||
| 767 | @item \(?: @dots{} \) | ||
| 768 | @cindex shy group, in regexp | ||
| 769 | specifies a ``shy'' group that does not record the matched substring; | ||
| 770 | you can't refer back to it with @samp{\@var{d}}. This is useful | ||
| 771 | in mechanically combining regular expressions, so that you | ||
| 772 | can add groups for syntactic purposes without interfering with | ||
| 773 | the numbering of the groups that are meant to be referred to. | ||
| 774 | |||
| 775 | @item \@var{d} | ||
| 776 | @cindex back reference, in regexp | ||
| 777 | matches the same text that matched the @var{d}th occurrence of a | ||
| 778 | @samp{\( @dots{} \)} construct. This is called a @dfn{back | ||
| 779 | reference}. | ||
| 780 | |||
| 781 | After the end of a @samp{\( @dots{} \)} construct, the matcher remembers | ||
| 782 | the beginning and end of the text matched by that construct. Then, | ||
| 783 | later on in the regular expression, you can use @samp{\} followed by the | ||
| 784 | digit @var{d} to mean ``match the same text matched the @var{d}th time | ||
| 785 | by the @samp{\( @dots{} \)} construct.'' | ||
| 786 | |||
| 787 | The strings matching the first nine @samp{\( @dots{} \)} constructs | ||
| 788 | appearing in a regular expression are assigned numbers 1 through 9 in | ||
| 789 | the order that the open-parentheses appear in the regular expression. | ||
| 790 | So you can use @samp{\1} through @samp{\9} to refer to the text matched | ||
| 791 | by the corresponding @samp{\( @dots{} \)} constructs. | ||
| 792 | |||
| 793 | For example, @samp{\(.*\)\1} matches any newline-free string that is | ||
| 794 | composed of two identical halves. The @samp{\(.*\)} matches the first | ||
| 795 | half, which may be anything, but the @samp{\1} that follows must match | ||
| 796 | the same exact text. | ||
| 797 | |||
| 798 | If a particular @samp{\( @dots{} \)} construct matches more than once | ||
| 799 | (which can easily happen if it is followed by @samp{*}), only the last | ||
| 800 | match is recorded. | ||
| 801 | |||
| 802 | @item \` | ||
| 803 | matches the empty string, but only at the beginning of the string or | ||
| 804 | buffer (or its accessible portion) being matched against. | ||
| 805 | |||
| 806 | @item \' | ||
| 807 | matches the empty string, but only at the end of the string or buffer | ||
| 808 | (or its accessible portion) being matched against. | ||
| 809 | |||
| 810 | @item \= | ||
| 811 | matches the empty string, but only at point. | ||
| 812 | |||
| 813 | @item \b | ||
| 814 | matches the empty string, but only at the beginning or | ||
| 815 | end of a word. Thus, @samp{\bfoo\b} matches any occurrence of | ||
| 816 | @samp{foo} as a separate word. @samp{\bballs?\b} matches | ||
| 817 | @samp{ball} or @samp{balls} as a separate word.@refill | ||
| 818 | |||
| 819 | @samp{\b} matches at the beginning or end of the buffer | ||
| 820 | regardless of what text appears next to it. | ||
| 821 | |||
| 822 | @item \B | ||
| 823 | matches the empty string, but @emph{not} at the beginning or | ||
| 824 | end of a word. | ||
| 825 | |||
| 826 | @item \< | ||
| 827 | matches the empty string, but only at the beginning of a word. | ||
| 828 | @samp{\<} matches at the beginning of the buffer only if a | ||
| 829 | word-constituent character follows. | ||
| 830 | |||
| 831 | @item \> | ||
| 832 | matches the empty string, but only at the end of a word. @samp{\>} | ||
| 833 | matches at the end of the buffer only if the contents end with a | ||
| 834 | word-constituent character. | ||
| 835 | |||
| 836 | @item \w | ||
| 837 | matches any word-constituent character. The syntax table | ||
| 838 | determines which characters these are. @xref{Syntax}. | ||
| 839 | |||
| 840 | @item \W | ||
| 841 | matches any character that is not a word-constituent. | ||
| 842 | |||
| 843 | @item \_< | ||
| 844 | matches the empty string, but only at the beginning of a symbol. | ||
| 845 | A symbol is a sequence of one or more symbol-constituent characters. | ||
| 846 | A symbol-constituent character is a character whose syntax is either | ||
| 847 | @samp{w} or @samp{_}. @samp{\_<} matches at the beginning of the | ||
| 848 | buffer only if a symbol-constituent character follows. | ||
| 849 | |||
| 850 | @item \_> | ||
| 851 | matches the empty string, but only at the end of a symbol. @samp{\_>} | ||
| 852 | matches at the end of the buffer only if the contents end with a | ||
| 853 | symbol-constituent character. | ||
| 854 | |||
| 855 | @item \s@var{c} | ||
| 856 | matches any character whose syntax is @var{c}. Here @var{c} is a | ||
| 857 | character that designates a particular syntax class: thus, @samp{w} | ||
| 858 | for word constituent, @samp{-} or @samp{ } for whitespace, @samp{.} | ||
| 859 | for ordinary punctuation, etc. @xref{Syntax}. | ||
| 860 | |||
| 861 | @item \S@var{c} | ||
| 862 | matches any character whose syntax is not @var{c}. | ||
| 863 | |||
| 864 | @cindex categories of characters | ||
| 865 | @cindex characters which belong to a specific language | ||
| 866 | @findex describe-categories | ||
| 867 | @item \c@var{c} | ||
| 868 | matches any character that belongs to the category @var{c}. For | ||
| 869 | example, @samp{\cc} matches Chinese characters, @samp{\cg} matches | ||
| 870 | Greek characters, etc. For the description of the known categories, | ||
| 871 | type @kbd{M-x describe-categories @key{RET}}. | ||
| 872 | |||
| 873 | @item \C@var{c} | ||
| 874 | matches any character that does @emph{not} belong to category | ||
| 875 | @var{c}. | ||
| 876 | @end table | ||
| 877 | |||
| 878 | The constructs that pertain to words and syntax are controlled by the | ||
| 879 | setting of the syntax table (@pxref{Syntax}). | ||
| 880 | |||
| 881 | @node Regexp Example | ||
| 882 | @section Regular Expression Example | ||
| 883 | |||
| 884 | Here is a complicated regexp---a simplified version of the regexp | ||
| 885 | that Emacs uses, by default, to recognize the end of a sentence | ||
| 886 | together with any whitespace that follows. We show its Lisp syntax to | ||
| 887 | distinguish the spaces from the tab characters. In Lisp syntax, the | ||
| 888 | string constant begins and ends with a double-quote. @samp{\"} stands | ||
| 889 | for a double-quote as part of the regexp, @samp{\\} for a backslash as | ||
| 890 | part of the regexp, @samp{\t} for a tab, and @samp{\n} for a newline. | ||
| 891 | |||
| 892 | @example | ||
| 893 | "[.?!][]\"')]*\\($\\| $\\|\t\\| \\)[ \t\n]*" | ||
| 894 | @end example | ||
| 895 | |||
| 896 | @noindent | ||
| 897 | This contains four parts in succession: a character set matching | ||
| 898 | period, @samp{?}, or @samp{!}; a character set matching | ||
| 899 | close-brackets, quotes, or parentheses, repeated zero or more times; a | ||
| 900 | set of alternatives within backslash-parentheses that matches either | ||
| 901 | end-of-line, a space at the end of a line, a tab, or two spaces; and a | ||
| 902 | character set matching whitespace characters, repeated any number of | ||
| 903 | times. | ||
| 904 | |||
| 905 | To enter the same regexp in incremental search, you would type | ||
| 906 | @key{TAB} to enter a tab, and @kbd{C-j} to enter a newline. You would | ||
| 907 | also type single backslashes as themselves, instead of doubling them | ||
| 908 | for Lisp syntax. In commands that use ordinary minibuffer input to | ||
| 909 | read a regexp, you would quote the @kbd{C-j} by preceding it with a | ||
| 910 | @kbd{C-q} to prevent @kbd{C-j} from exiting the minibuffer. | ||
| 911 | |||
| 912 | @node Search Case | ||
| 913 | @section Searching and Case | ||
| 914 | |||
| 915 | Incremental searches in Emacs normally ignore the case of the text | ||
| 916 | they are searching through, if you specify the text in lower case. | ||
| 917 | Thus, if you specify searching for @samp{foo}, then @samp{Foo} and | ||
| 918 | @samp{foo} are also considered a match. Regexps, and in particular | ||
| 919 | character sets, are included: @samp{[ab]} would match @samp{a} or | ||
| 920 | @samp{A} or @samp{b} or @samp{B}.@refill | ||
| 921 | |||
| 922 | An upper-case letter anywhere in the incremental search string makes | ||
| 923 | the search case-sensitive. Thus, searching for @samp{Foo} does not find | ||
| 924 | @samp{foo} or @samp{FOO}. This applies to regular expression search as | ||
| 925 | well as to string search. The effect ceases if you delete the | ||
| 926 | upper-case letter from the search string. | ||
| 927 | |||
| 928 | Typing @kbd{M-c} within an incremental search toggles the case | ||
| 929 | sensitivity of that search. The effect does not extend beyond the | ||
| 930 | current incremental search to the next one, but it does override the | ||
| 931 | effect of including an upper-case letter in the current search. | ||
| 932 | |||
| 933 | @vindex case-fold-search | ||
| 934 | @vindex default-case-fold-search | ||
| 935 | If you set the variable @code{case-fold-search} to @code{nil}, then | ||
| 936 | all letters must match exactly, including case. This is a per-buffer | ||
| 937 | variable; altering the variable affects only the current buffer, but | ||
| 938 | there is a default value in @code{default-case-fold-search} that you | ||
| 939 | can also set. @xref{Locals}. This variable applies to nonincremental | ||
| 940 | searches also, including those performed by the replace commands | ||
| 941 | (@pxref{Replace}) and the minibuffer history matching commands | ||
| 942 | (@pxref{Minibuffer History}). | ||
| 943 | |||
| 944 | Several related variables control case-sensitivity of searching and | ||
| 945 | matching for specific commands or activities. For instance, | ||
| 946 | @code{tags-case-fold-search} controls case sensitivity for | ||
| 947 | @code{find-tag}. To find these variables, do @kbd{M-x | ||
| 948 | apropos-variable @key{RET} case-fold-search @key{RET}}. | ||
| 949 | |||
| 950 | @node Replace | ||
| 951 | @section Replacement Commands | ||
| 952 | @cindex replacement | ||
| 953 | @cindex search-and-replace commands | ||
| 954 | @cindex string substitution | ||
| 955 | @cindex global substitution | ||
| 956 | |||
| 957 | Global search-and-replace operations are not needed often in Emacs, | ||
| 958 | but they are available. In addition to the simple @kbd{M-x | ||
| 959 | replace-string} command which replaces all occurrences, | ||
| 960 | there is @kbd{M-%} (@code{query-replace}), which presents each occurrence | ||
| 961 | of the pattern and asks you whether to replace it. | ||
| 962 | |||
| 963 | The replace commands normally operate on the text from point to the | ||
| 964 | end of the buffer; however, in Transient Mark mode (@pxref{Transient | ||
| 965 | Mark}), when the mark is active, they operate on the region. The | ||
| 966 | basic replace commands replace one string (or regexp) with one | ||
| 967 | replacement string. It is possible to perform several replacements in | ||
| 968 | parallel using the command @code{expand-region-abbrevs} | ||
| 969 | (@pxref{Expanding Abbrevs}). | ||
| 970 | |||
| 971 | @menu | ||
| 972 | * Unconditional Replace:: Replacing all matches for a string. | ||
| 973 | * Regexp Replace:: Replacing all matches for a regexp. | ||
| 974 | * Replacement and Case:: How replacements preserve case of letters. | ||
| 975 | * Query Replace:: How to use querying. | ||
| 976 | @end menu | ||
| 977 | |||
| 978 | @node Unconditional Replace, Regexp Replace, Replace, Replace | ||
| 979 | @subsection Unconditional Replacement | ||
| 980 | @findex replace-string | ||
| 981 | |||
| 982 | @table @kbd | ||
| 983 | @item M-x replace-string @key{RET} @var{string} @key{RET} @var{newstring} @key{RET} | ||
| 984 | Replace every occurrence of @var{string} with @var{newstring}. | ||
| 985 | @end table | ||
| 986 | |||
| 987 | To replace every instance of @samp{foo} after point with @samp{bar}, | ||
| 988 | use the command @kbd{M-x replace-string} with the two arguments | ||
| 989 | @samp{foo} and @samp{bar}. Replacement happens only in the text after | ||
| 990 | point, so if you want to cover the whole buffer you must go to the | ||
| 991 | beginning first. All occurrences up to the end of the buffer are | ||
| 992 | replaced; to limit replacement to part of the buffer, narrow to that | ||
| 993 | part of the buffer before doing the replacement (@pxref{Narrowing}). | ||
| 994 | In Transient Mark mode, when the region is active, replacement is | ||
| 995 | limited to the region (@pxref{Transient Mark}). | ||
| 996 | |||
| 997 | When @code{replace-string} exits, it leaves point at the last | ||
| 998 | occurrence replaced. It sets the mark to the prior position of point | ||
| 999 | (where the @code{replace-string} command was issued); use @kbd{C-u | ||
| 1000 | C-@key{SPC}} to move back there. | ||
| 1001 | |||
| 1002 | A numeric argument restricts replacement to matches that are surrounded | ||
| 1003 | by word boundaries. The argument's value doesn't matter. | ||
| 1004 | |||
| 1005 | @xref{Replacement and Case}, for details about case-sensitivity in | ||
| 1006 | replace commands. | ||
| 1007 | |||
| 1008 | What if you want to exchange @samp{x} and @samp{y}: replace every @samp{x} with a @samp{y} and vice versa? You can do it this way: | ||
| 1009 | |||
| 1010 | @example | ||
| 1011 | M-x replace-string @key{RET} x @key{RET} @@TEMP@@ @key{RET} | ||
| 1012 | M-< M-x replace-string @key{RET} y @key{RET} x @key{RET} | ||
| 1013 | M-< M-x replace-string @key{RET} @@TEMP@@ @key{RET} y @key{RET} | ||
| 1014 | @end example | ||
| 1015 | |||
| 1016 | @noindent | ||
| 1017 | This works provided the string @samp{@@TEMP@@} does not appear | ||
| 1018 | in your text. | ||
| 1019 | |||
| 1020 | @node Regexp Replace, Replacement and Case, Unconditional Replace, Replace | ||
| 1021 | @subsection Regexp Replacement | ||
| 1022 | @findex replace-regexp | ||
| 1023 | |||
| 1024 | The @kbd{M-x replace-string} command replaces exact matches for a | ||
| 1025 | single string. The similar command @kbd{M-x replace-regexp} replaces | ||
| 1026 | any match for a specified pattern. | ||
| 1027 | |||
| 1028 | @table @kbd | ||
| 1029 | @item M-x replace-regexp @key{RET} @var{regexp} @key{RET} @var{newstring} @key{RET} | ||
| 1030 | Replace every match for @var{regexp} with @var{newstring}. | ||
| 1031 | @end table | ||
| 1032 | |||
| 1033 | @cindex back reference, in regexp replacement | ||
| 1034 | In @code{replace-regexp}, the @var{newstring} need not be constant: | ||
| 1035 | it can refer to all or part of what is matched by the @var{regexp}. | ||
| 1036 | @samp{\&} in @var{newstring} stands for the entire match being | ||
| 1037 | replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a | ||
| 1038 | digit, stands for whatever matched the @var{d}th parenthesized | ||
| 1039 | grouping in @var{regexp}. (This is called a ``back reference.'') | ||
| 1040 | @samp{\#} refers to the count of replacements already made in this | ||
| 1041 | command, as a decimal number. In the first replacement, @samp{\#} | ||
| 1042 | stands for @samp{0}; in the second, for @samp{1}; and so on. For | ||
| 1043 | example, | ||
| 1044 | |||
| 1045 | @example | ||
| 1046 | M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET} | ||
| 1047 | @end example | ||
| 1048 | |||
| 1049 | @noindent | ||
| 1050 | replaces (for example) @samp{cadr} with @samp{cadr-safe} and @samp{cddr} | ||
| 1051 | with @samp{cddr-safe}. | ||
| 1052 | |||
| 1053 | @example | ||
| 1054 | M-x replace-regexp @key{RET} \(c[ad]+r\)-safe @key{RET} \1 @key{RET} | ||
| 1055 | @end example | ||
| 1056 | |||
| 1057 | @noindent | ||
| 1058 | performs the inverse transformation. To include a @samp{\} in the | ||
| 1059 | text to replace with, you must enter @samp{\\}. | ||
| 1060 | |||
| 1061 | If you want to enter part of the replacement string by hand each | ||
| 1062 | time, use @samp{\?} in the replacement string. Each replacement will | ||
| 1063 | ask you to edit the replacement string in the minibuffer, putting | ||
| 1064 | point where the @samp{\?} was. | ||
| 1065 | |||
| 1066 | The remainder of this subsection is intended for specialized tasks | ||
| 1067 | and requires knowledge of Lisp. Most readers can skip it. | ||
| 1068 | |||
| 1069 | You can use Lisp expressions to calculate parts of the | ||
| 1070 | replacement string. To do this, write @samp{\,} followed by the | ||
| 1071 | expression in the replacement string. Each replacement calculates the | ||
| 1072 | value of the expression and converts it to text without quoting (if | ||
| 1073 | it's a string, this means using the string's contents), and uses it in | ||
| 1074 | the replacement string in place of the expression itself. If the | ||
| 1075 | expression is a symbol, one space in the replacement string after the | ||
| 1076 | symbol name goes with the symbol name, so the value replaces them | ||
| 1077 | both. | ||
| 1078 | |||
| 1079 | Inside such an expression, you can use some special sequences. | ||
| 1080 | @samp{\&} and @samp{\@var{n}} refer here, as usual, to the entire | ||
| 1081 | match as a string, and to a submatch as a string. @var{n} may be | ||
| 1082 | multiple digits, and the value of @samp{\@var{n}} is @code{nil} if | ||
| 1083 | subexpression @var{n} did not match. You can also use @samp{\#&} and | ||
| 1084 | @samp{\#@var{n}} to refer to those matches as numbers (this is valid | ||
| 1085 | when the match or submatch has the form of a numeral). @samp{\#} here | ||
| 1086 | too stands for the number of already-completed replacements. | ||
| 1087 | |||
| 1088 | Repeating our example to exchange @samp{x} and @samp{y}, we can thus | ||
| 1089 | do it also this way: | ||
| 1090 | |||
| 1091 | @example | ||
| 1092 | M-x replace-regexp @key{RET} \(x\)\|y @key{RET} | ||
| 1093 | \,(if \1 "y" "x") @key{RET} | ||
| 1094 | @end example | ||
| 1095 | |||
| 1096 | For computing replacement strings for @samp{\,}, the @code{format} | ||
| 1097 | function is often useful (@pxref{Formatting Strings,,, elisp, The Emacs | ||
| 1098 | Lisp Reference Manual}). For example, to add consecutively numbered | ||
| 1099 | strings like @samp{ABC00042} to columns 73 @w{to 80} (unless they are | ||
| 1100 | already occupied), you can use | ||
| 1101 | |||
| 1102 | @example | ||
| 1103 | M-x replace-regexp @key{RET} ^.\@{0,72\@}$ @key{RET} | ||
| 1104 | \,(format "%-72sABC%05d" \& \#) @key{RET} | ||
| 1105 | @end example | ||
| 1106 | |||
| 1107 | @node Replacement and Case, Query Replace, Regexp Replace, Replace | ||
| 1108 | @subsection Replace Commands and Case | ||
| 1109 | |||
| 1110 | If the first argument of a replace command is all lower case, the | ||
| 1111 | command ignores case while searching for occurrences to | ||
| 1112 | replace---provided @code{case-fold-search} is non-@code{nil}. If | ||
| 1113 | @code{case-fold-search} is set to @code{nil}, case is always significant | ||
| 1114 | in all searches. | ||
| 1115 | |||
| 1116 | @vindex case-replace | ||
| 1117 | In addition, when the @var{newstring} argument is all or partly lower | ||
| 1118 | case, replacement commands try to preserve the case pattern of each | ||
| 1119 | occurrence. Thus, the command | ||
| 1120 | |||
| 1121 | @example | ||
| 1122 | M-x replace-string @key{RET} foo @key{RET} bar @key{RET} | ||
| 1123 | @end example | ||
| 1124 | |||
| 1125 | @noindent | ||
| 1126 | replaces a lower case @samp{foo} with a lower case @samp{bar}, an | ||
| 1127 | all-caps @samp{FOO} with @samp{BAR}, and a capitalized @samp{Foo} with | ||
| 1128 | @samp{Bar}. (These three alternatives---lower case, all caps, and | ||
| 1129 | capitalized, are the only ones that @code{replace-string} can | ||
| 1130 | distinguish.) | ||
| 1131 | |||
| 1132 | If upper-case letters are used in the replacement string, they remain | ||
| 1133 | upper case every time that text is inserted. If upper-case letters are | ||
| 1134 | used in the first argument, the second argument is always substituted | ||
| 1135 | exactly as given, with no case conversion. Likewise, if either | ||
| 1136 | @code{case-replace} or @code{case-fold-search} is set to @code{nil}, | ||
| 1137 | replacement is done without case conversion. | ||
| 1138 | |||
| 1139 | @node Query Replace,, Replacement and Case, Replace | ||
| 1140 | @subsection Query Replace | ||
| 1141 | @cindex query replace | ||
| 1142 | |||
| 1143 | @table @kbd | ||
| 1144 | @item M-% @var{string} @key{RET} @var{newstring} @key{RET} | ||
| 1145 | @itemx M-x query-replace @key{RET} @var{string} @key{RET} @var{newstring} @key{RET} | ||
| 1146 | Replace some occurrences of @var{string} with @var{newstring}. | ||
| 1147 | @item C-M-% @var{regexp} @key{RET} @var{newstring} @key{RET} | ||
| 1148 | @itemx M-x query-replace-regexp @key{RET} @var{regexp} @key{RET} @var{newstring} @key{RET} | ||
| 1149 | Replace some matches for @var{regexp} with @var{newstring}. | ||
| 1150 | @end table | ||
| 1151 | |||
| 1152 | @kindex M-% | ||
| 1153 | @findex query-replace | ||
| 1154 | If you want to change only some of the occurrences of @samp{foo} to | ||
| 1155 | @samp{bar}, not all of them, then you cannot use an ordinary | ||
| 1156 | @code{replace-string}. Instead, use @kbd{M-%} (@code{query-replace}). | ||
| 1157 | This command finds occurrences of @samp{foo} one by one, displays each | ||
| 1158 | occurrence and asks you whether to replace it. Aside from querying, | ||
| 1159 | @code{query-replace} works just like @code{replace-string}. It | ||
| 1160 | preserves case, like @code{replace-string}, provided | ||
| 1161 | @code{case-replace} is non-@code{nil}, as it normally is | ||
| 1162 | (@pxref{Replacement and Case}). A numeric argument means consider | ||
| 1163 | only occurrences that are bounded by word-delimiter characters. | ||
| 1164 | |||
| 1165 | @kindex C-M-% | ||
| 1166 | @findex query-replace-regexp | ||
| 1167 | @kbd{C-M-%} performs regexp search and replace (@code{query-replace-regexp}). | ||
| 1168 | It works like @code{replace-regexp} except that it queries | ||
| 1169 | like @code{query-replace}. | ||
| 1170 | |||
| 1171 | @cindex faces for highlighting query replace | ||
| 1172 | These commands highlight the current match using the face | ||
| 1173 | @code{query-replace}. They highlight other matches using | ||
| 1174 | @code{lazy-highlight} just like incremental search (@pxref{Incremental | ||
| 1175 | Search}). | ||
| 1176 | |||
| 1177 | The characters you can type when you are shown a match for the string | ||
| 1178 | or regexp are: | ||
| 1179 | |||
| 1180 | @ignore @c Not worth it. | ||
| 1181 | @kindex SPC @r{(query-replace)} | ||
| 1182 | @kindex DEL @r{(query-replace)} | ||
| 1183 | @kindex , @r{(query-replace)} | ||
| 1184 | @kindex RET @r{(query-replace)} | ||
| 1185 | @kindex . @r{(query-replace)} | ||
| 1186 | @kindex ! @r{(query-replace)} | ||
| 1187 | @kindex ^ @r{(query-replace)} | ||
| 1188 | @kindex C-r @r{(query-replace)} | ||
| 1189 | @kindex C-w @r{(query-replace)} | ||
| 1190 | @kindex C-l @r{(query-replace)} | ||
| 1191 | @end ignore | ||
| 1192 | |||
| 1193 | @c WideCommands | ||
| 1194 | @table @kbd | ||
| 1195 | @item @key{SPC} | ||
| 1196 | to replace the occurrence with @var{newstring}. | ||
| 1197 | |||
| 1198 | @item @key{DEL} | ||
| 1199 | to skip to the next occurrence without replacing this one. | ||
| 1200 | |||
| 1201 | @item , @r{(Comma)} | ||
| 1202 | to replace this occurrence and display the result. You are then asked | ||
| 1203 | for another input character to say what to do next. Since the | ||
| 1204 | replacement has already been made, @key{DEL} and @key{SPC} are | ||
| 1205 | equivalent in this situation; both move to the next occurrence. | ||
| 1206 | |||
| 1207 | You can type @kbd{C-r} at this point (see below) to alter the replaced | ||
| 1208 | text. You can also type @kbd{C-x u} to undo the replacement; this exits | ||
| 1209 | the @code{query-replace}, so if you want to do further replacement you | ||
| 1210 | must use @kbd{C-x @key{ESC} @key{ESC} @key{RET}} to restart | ||
| 1211 | (@pxref{Repetition}). | ||
| 1212 | |||
| 1213 | @item @key{RET} | ||
| 1214 | to exit without doing any more replacements. | ||
| 1215 | |||
| 1216 | @item .@: @r{(Period)} | ||
| 1217 | to replace this occurrence and then exit without searching for more | ||
| 1218 | occurrences. | ||
| 1219 | |||
| 1220 | @item ! | ||
| 1221 | to replace all remaining occurrences without asking again. | ||
| 1222 | |||
| 1223 | @item ^ | ||
| 1224 | to go back to the position of the previous occurrence (or what used to | ||
| 1225 | be an occurrence), in case you changed it by mistake or want to | ||
| 1226 | reexamine it. | ||
| 1227 | |||
| 1228 | @item C-r | ||
| 1229 | to enter a recursive editing level, in case the occurrence needs to be | ||
| 1230 | edited rather than just replaced with @var{newstring}. When you are | ||
| 1231 | done, exit the recursive editing level with @kbd{C-M-c} to proceed to | ||
| 1232 | the next occurrence. @xref{Recursive Edit}. | ||
| 1233 | |||
| 1234 | @item C-w | ||
| 1235 | to delete the occurrence, and then enter a recursive editing level as in | ||
| 1236 | @kbd{C-r}. Use the recursive edit to insert text to replace the deleted | ||
| 1237 | occurrence of @var{string}. When done, exit the recursive editing level | ||
| 1238 | with @kbd{C-M-c} to proceed to the next occurrence. | ||
| 1239 | |||
| 1240 | @item e | ||
| 1241 | to edit the replacement string in the minibuffer. When you exit the | ||
| 1242 | minibuffer by typing @key{RET}, the minibuffer contents replace the | ||
| 1243 | current occurrence of the pattern. They also become the new | ||
| 1244 | replacement string for any further occurrences. | ||
| 1245 | |||
| 1246 | @item C-l | ||
| 1247 | to redisplay the screen. Then you must type another character to | ||
| 1248 | specify what to do with this occurrence. | ||
| 1249 | |||
| 1250 | @item C-h | ||
| 1251 | to display a message summarizing these options. Then you must type | ||
| 1252 | another character to specify what to do with this occurrence. | ||
| 1253 | @end table | ||
| 1254 | |||
| 1255 | Some other characters are aliases for the ones listed above: @kbd{y}, | ||
| 1256 | @kbd{n} and @kbd{q} are equivalent to @key{SPC}, @key{DEL} and | ||
| 1257 | @key{RET}. | ||
| 1258 | |||
| 1259 | Aside from this, any other character exits the @code{query-replace}, | ||
| 1260 | and is then reread as part of a key sequence. Thus, if you type | ||
| 1261 | @kbd{C-k}, it exits the @code{query-replace} and then kills to end of | ||
| 1262 | line. | ||
| 1263 | |||
| 1264 | To restart a @code{query-replace} once it is exited, use @kbd{C-x | ||
| 1265 | @key{ESC} @key{ESC}}, which repeats the @code{query-replace} because it | ||
| 1266 | used the minibuffer to read its arguments. @xref{Repetition, C-x ESC | ||
| 1267 | ESC}. | ||
| 1268 | |||
| 1269 | @xref{Operating on Files}, for the Dired @kbd{Q} command which | ||
| 1270 | performs query replace on selected files. See also @ref{Transforming | ||
| 1271 | File Names}, for Dired commands to rename, copy, or link files by | ||
| 1272 | replacing regexp matches in file names. | ||
| 1273 | |||
| 1274 | @node Other Repeating Search | ||
| 1275 | @section Other Search-and-Loop Commands | ||
| 1276 | |||
| 1277 | Here are some other commands that find matches for a regular | ||
| 1278 | expression. They all ignore case in matching, if the pattern contains | ||
| 1279 | no upper-case letters and @code{case-fold-search} is non-@code{nil}. | ||
| 1280 | Aside from @code{occur} and its variants, all operate on the text from | ||
| 1281 | point to the end of the buffer, or on the active region in Transient | ||
| 1282 | Mark mode. | ||
| 1283 | |||
| 1284 | @findex list-matching-lines | ||
| 1285 | @findex occur | ||
| 1286 | @findex multi-occur | ||
| 1287 | @findex multi-occur-in-matching-buffers | ||
| 1288 | @findex how-many | ||
| 1289 | @findex delete-non-matching-lines | ||
| 1290 | @findex delete-matching-lines | ||
| 1291 | @findex flush-lines | ||
| 1292 | @findex keep-lines | ||
| 1293 | |||
| 1294 | @table @kbd | ||
| 1295 | @item M-x occur @key{RET} @var{regexp} @key{RET} | ||
| 1296 | Display a list showing each line in the buffer that contains a match | ||
| 1297 | for @var{regexp}. To limit the search to part of the buffer, narrow | ||
| 1298 | to that part (@pxref{Narrowing}). A numeric argument @var{n} | ||
| 1299 | specifies that @var{n} lines of context are to be displayed before and | ||
| 1300 | after each matching line. Currently, @code{occur} can not correctly | ||
| 1301 | handle multiline matches. | ||
| 1302 | |||
| 1303 | @kindex RET @r{(Occur mode)} | ||
| 1304 | @kindex o @r{(Occur mode)} | ||
| 1305 | @kindex C-o @r{(Occur mode)} | ||
| 1306 | The buffer @samp{*Occur*} containing the output serves as a menu for | ||
| 1307 | finding the occurrences in their original context. Click | ||
| 1308 | @kbd{Mouse-2} on an occurrence listed in @samp{*Occur*}, or position | ||
| 1309 | point there and type @key{RET}; this switches to the buffer that was | ||
| 1310 | searched and moves point to the original of the chosen occurrence. | ||
| 1311 | @kbd{o} and @kbd{C-o} display the match in another window; @kbd{C-o} | ||
| 1312 | does not select it. | ||
| 1313 | |||
| 1314 | After using @kbd{M-x occur}, you can use @code{next-error} to visit | ||
| 1315 | the occurrences found, one by one. @ref{Compilation Mode}. | ||
| 1316 | |||
| 1317 | @item M-x list-matching-lines | ||
| 1318 | Synonym for @kbd{M-x occur}. | ||
| 1319 | |||
| 1320 | @item M-x multi-occur @key{RET} @var{buffers} @key{RET} @var{regexp} @key{RET} | ||
| 1321 | This function is just like @code{occur}, except it is able to search | ||
| 1322 | through multiple buffers. It asks you to specify the buffer names one by one. | ||
| 1323 | |||
| 1324 | @item M-x multi-occur-in-matching-buffers @key{RET} @var{bufregexp} @key{RET} @var{regexp} @key{RET} | ||
| 1325 | This function is similar to @code{multi-occur}, except the buffers to | ||
| 1326 | search are specified by a regular expression that matches visited | ||
| 1327 | file names. With a prefix argument, it uses the regular expression to match | ||
| 1328 | buffer names instead. | ||
| 1329 | |||
| 1330 | @item M-x how-many @key{RET} @var{regexp} @key{RET} | ||
| 1331 | Print the number of matches for @var{regexp} that exist in the buffer | ||
| 1332 | after point. In Transient Mark mode, if the region is active, the | ||
| 1333 | command operates on the region instead. | ||
| 1334 | |||
| 1335 | @item M-x flush-lines @key{RET} @var{regexp} @key{RET} | ||
| 1336 | This command deletes each line that contains a match for @var{regexp}, | ||
| 1337 | operating on the text after point; it deletes the current line | ||
| 1338 | if it contains a match starting after point. In Transient Mark mode, | ||
| 1339 | if the region is active, the command operates on the region instead; | ||
| 1340 | it deletes a line partially contained in the region if it contains a | ||
| 1341 | match entirely contained in the region. | ||
| 1342 | |||
| 1343 | If a match is split across lines, @code{flush-lines} deletes all those | ||
| 1344 | lines. It deletes the lines before starting to look for the next | ||
| 1345 | match; hence, it ignores a match starting on the same line at which | ||
| 1346 | another match ended. | ||
| 1347 | |||
| 1348 | @item M-x keep-lines @key{RET} @var{regexp} @key{RET} | ||
| 1349 | This command deletes each line that @emph{does not} contain a match for | ||
| 1350 | @var{regexp}, operating on the text after point; if point is not at the | ||
| 1351 | beginning of a line, it always keeps the current line. In Transient | ||
| 1352 | Mark mode, if the region is active, the command operates on the region | ||
| 1353 | instead; it never deletes lines that are only partially contained in | ||
| 1354 | the region (a newline that ends a line counts as part of that line). | ||
| 1355 | |||
| 1356 | If a match is split across lines, this command keeps all those lines. | ||
| 1357 | @end table | ||
| 1358 | |||
| 1359 | @ignore | ||
| 1360 | arch-tag: fd9d8e77-66af-491c-b212-d80999613e3e | ||
| 1361 | @end ignore | ||
diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi new file mode 100644 index 00000000000..5d6a7c83f3e --- /dev/null +++ b/doc/emacs/sending.texi | |||
| @@ -0,0 +1,724 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Sending Mail | ||
| 6 | @chapter Sending Mail | ||
| 7 | @cindex sending mail | ||
| 8 | @cindex mail | ||
| 9 | @cindex message | ||
| 10 | |||
| 11 | To send a message in Emacs, you start by typing a command (@kbd{C-x m}) | ||
| 12 | to select and initialize the @samp{*mail*} buffer. Then you edit the text | ||
| 13 | and headers of the message in this buffer, and type another command | ||
| 14 | (@kbd{C-c C-s} or @kbd{C-c C-c}) to send the message. | ||
| 15 | |||
| 16 | @table @kbd | ||
| 17 | @item C-x m | ||
| 18 | Begin composing a message to send (@code{compose-mail}). | ||
| 19 | @item C-x 4 m | ||
| 20 | Likewise, but display the message in another window | ||
| 21 | (@code{compose-mail-other-window}). | ||
| 22 | @item C-x 5 m | ||
| 23 | Likewise, but make a new frame (@code{compose-mail-other-frame}). | ||
| 24 | @item C-c C-s | ||
| 25 | In Mail mode, send the message (@code{mail-send}). | ||
| 26 | @item C-c C-c | ||
| 27 | Send the message and bury the mail buffer (@code{mail-send-and-exit}). | ||
| 28 | @end table | ||
| 29 | |||
| 30 | @kindex C-x m | ||
| 31 | @findex compose-mail | ||
| 32 | @kindex C-x 4 m | ||
| 33 | @findex compose-mail-other-window | ||
| 34 | @kindex C-x 5 m | ||
| 35 | @findex compose-mail-other-frame | ||
| 36 | The command @kbd{C-x m} (@code{compose-mail}) selects a buffer named | ||
| 37 | @samp{*mail*} and initializes it with the skeleton of an outgoing | ||
| 38 | message. @kbd{C-x 4 m} (@code{compose-mail-other-window}) selects the | ||
| 39 | @samp{*mail*} buffer in a different window, leaving the previous current | ||
| 40 | buffer visible. @kbd{C-x 5 m} (@code{compose-mail-other-frame}) creates | ||
| 41 | a new frame to select the @samp{*mail*} buffer. | ||
| 42 | |||
| 43 | Because the mail-composition buffer is an ordinary Emacs buffer, you can | ||
| 44 | switch to other buffers while in the middle of composing mail, and switch | ||
| 45 | back later (or never). If you use the @kbd{C-x m} command again when you | ||
| 46 | have been composing another message but have not sent it, you are asked to | ||
| 47 | confirm before the old message is erased. If you answer @kbd{n}, the | ||
| 48 | @samp{*mail*} buffer remains selected with its old contents, so you can | ||
| 49 | finish the old message and send it. @kbd{C-u C-x m} is another way to do | ||
| 50 | this. Sending the message marks the @samp{*mail*} buffer ``unmodified,'' | ||
| 51 | which avoids the need for confirmation when @kbd{C-x m} is next used. | ||
| 52 | |||
| 53 | If you are composing a message in the @samp{*mail*} buffer and want to | ||
| 54 | send another message before finishing the first, rename the | ||
| 55 | @samp{*mail*} buffer using @kbd{M-x rename-uniquely} (@pxref{Misc | ||
| 56 | Buffer}). Then you can use @kbd{C-x m} or its variants described above | ||
| 57 | to make a new @samp{*mail*} buffer. Once you've done that, you can work | ||
| 58 | with each mail buffer independently. | ||
| 59 | |||
| 60 | @vindex mail-default-directory | ||
| 61 | The variable @code{mail-default-directory} controls the default | ||
| 62 | directory for mail buffers, and also says where to put their auto-save | ||
| 63 | files. | ||
| 64 | |||
| 65 | @ignore | ||
| 66 | @c Commented out because it is not user-oriented; | ||
| 67 | @c it doesn't say how to do some job. -- rms. | ||
| 68 | @cindex directory servers | ||
| 69 | @cindex LDAP | ||
| 70 | @cindex PH/QI | ||
| 71 | @cindex names and addresses | ||
| 72 | There is an interface to directory servers using various protocols such | ||
| 73 | as LDAP or the CCSO white pages directory system (PH/QI), described in a | ||
| 74 | separate manual. It may be useful for looking up names and addresses. | ||
| 75 | @xref{Top,,EUDC, eudc, EUDC Manual}. | ||
| 76 | @end ignore | ||
| 77 | |||
| 78 | @menu | ||
| 79 | * Format: Mail Format. Format of the mail being composed. | ||
| 80 | * Headers: Mail Headers. Details of permitted mail header fields. | ||
| 81 | * Aliases: Mail Aliases. Abbreviating and grouping mail addresses. | ||
| 82 | * Mode: Mail Mode. Special commands for editing mail being composed. | ||
| 83 | * Amuse: Mail Amusements. Distracting the NSA; adding fortune messages. | ||
| 84 | * Methods: Mail Methods. Using alternative mail-composition methods. | ||
| 85 | @end menu | ||
| 86 | |||
| 87 | @node Mail Format | ||
| 88 | @section The Format of the Mail Buffer | ||
| 89 | |||
| 90 | In addition to the @dfn{text} or @dfn{body}, a message has @dfn{header | ||
| 91 | fields} which say who sent it, when, to whom, why, and so on. Some | ||
| 92 | header fields, such as @samp{Date} and @samp{Sender}, are created | ||
| 93 | automatically when you send the message. Others, such as the recipient | ||
| 94 | names, must be specified by you in order to send the message properly. | ||
| 95 | |||
| 96 | In the mail buffer, you can insert and edit header fields using | ||
| 97 | ordinary editing commands. Mail mode provides a commands to help you | ||
| 98 | edit some header fields, and some are preinitialized in the buffer | ||
| 99 | automatically when appropriate. | ||
| 100 | |||
| 101 | The line in the buffer that says | ||
| 102 | |||
| 103 | @example | ||
| 104 | --text follows this line-- | ||
| 105 | @end example | ||
| 106 | |||
| 107 | @noindent | ||
| 108 | is a special delimiter that separates the headers you have specified from | ||
| 109 | the text. Whatever follows this line is the text of the message; the | ||
| 110 | headers precede it. The delimiter line itself does not appear in the | ||
| 111 | message actually sent. The text used for the delimiter line is controlled | ||
| 112 | by the variable @code{mail-header-separator}. | ||
| 113 | |||
| 114 | Here is an example of what the headers and text in the mail buffer | ||
| 115 | might look like. | ||
| 116 | |||
| 117 | @example | ||
| 118 | To: gnu@@gnu.org | ||
| 119 | CC: lungfish@@spam.org, byob@@spam.org | ||
| 120 | Subject: The Emacs Manual | ||
| 121 | --Text follows this line-- | ||
| 122 | Please ignore this message. | ||
| 123 | @end example | ||
| 124 | |||
| 125 | @node Mail Headers | ||
| 126 | @section Mail Header Fields | ||
| 127 | @cindex headers (of mail message) | ||
| 128 | |||
| 129 | A header field in the mail buffer starts with a field name at the | ||
| 130 | beginning of a line, terminated by a colon. Upper and lower case are | ||
| 131 | equivalent in field names (and in mailing addresses also). After the | ||
| 132 | colon and optional whitespace comes the contents of the field. | ||
| 133 | |||
| 134 | You can use any name you like for a header field, but normally people | ||
| 135 | use only standard field names with accepted meanings. Here is a table | ||
| 136 | of fields commonly used in outgoing messages. | ||
| 137 | |||
| 138 | @table @samp | ||
| 139 | @item To | ||
| 140 | This field contains the mailing addresses to which the message is | ||
| 141 | addressed. If you list more than one address, use commas, not spaces, | ||
| 142 | to separate them. | ||
| 143 | |||
| 144 | @item Subject | ||
| 145 | The contents of the @samp{Subject} field should be a piece of text | ||
| 146 | that says what the message is about. The reason @samp{Subject} fields | ||
| 147 | are useful is that most mail-reading programs can provide a summary of | ||
| 148 | messages, listing the subject of each message but not its text. | ||
| 149 | |||
| 150 | @item CC | ||
| 151 | This field contains additional mailing addresses to send the message to, | ||
| 152 | like @samp{To} except that these readers should not regard the message | ||
| 153 | as directed at them. | ||
| 154 | |||
| 155 | @item BCC | ||
| 156 | This field contains additional mailing addresses to send the message to, | ||
| 157 | which should not appear in the header of the message actually sent. | ||
| 158 | Copies sent this way are called @dfn{blind carbon copies}. | ||
| 159 | |||
| 160 | @vindex mail-self-blind | ||
| 161 | @cindex copy of every outgoing message | ||
| 162 | To send a blind carbon copy of every outgoing message to yourself, set | ||
| 163 | the variable @code{mail-self-blind} to @code{t}. To send a blind carbon | ||
| 164 | copy of every message to some other @var{address}, set the variable | ||
| 165 | @code{mail-default-headers} to @code{"Bcc: @var{address}\n"}. | ||
| 166 | |||
| 167 | @item FCC | ||
| 168 | This field contains the name of one file and directs Emacs to append a | ||
| 169 | copy of the message to that file when you send the message. If the file | ||
| 170 | is in Rmail format, Emacs writes the message in Rmail format; otherwise, | ||
| 171 | Emacs writes the message in system mail file format. To specify | ||
| 172 | more than one file, use several @samp{FCC} fields, with one file | ||
| 173 | name in each field. | ||
| 174 | |||
| 175 | @vindex mail-archive-file-name | ||
| 176 | To put a fixed file name in the @samp{FCC} field each time you start | ||
| 177 | editing an outgoing message, set the variable | ||
| 178 | @code{mail-archive-file-name} to that file name. Unless you remove the | ||
| 179 | @samp{FCC} field before sending, the message will be written into that | ||
| 180 | file when it is sent. | ||
| 181 | |||
| 182 | @item From | ||
| 183 | Use the @samp{From} field to say who you are, when the account you are | ||
| 184 | using to send the mail is not your own. The contents of the @samp{From} | ||
| 185 | field should be a valid mailing address, since replies will normally go | ||
| 186 | there. If you don't specify the @samp{From} field yourself, Emacs uses | ||
| 187 | the value of @code{user-mail-address} as the default. | ||
| 188 | |||
| 189 | @item Reply-to | ||
| 190 | Use this field to direct replies to a different address. Most | ||
| 191 | mail-reading programs (including Rmail) automatically send replies to | ||
| 192 | the @samp{Reply-to} address in preference to the @samp{From} address. | ||
| 193 | By adding a @samp{Reply-to} field to your header, you can work around | ||
| 194 | any problems your @samp{From} address may cause for replies. | ||
| 195 | |||
| 196 | @cindex @env{REPLYTO} environment variable | ||
| 197 | @vindex mail-default-reply-to | ||
| 198 | To put a fixed @samp{Reply-to} address into every outgoing message, set | ||
| 199 | the variable @code{mail-default-reply-to} to that address (as a string). | ||
| 200 | Then @code{mail} initializes the message with a @samp{Reply-to} field as | ||
| 201 | specified. You can delete or alter that header field before you send | ||
| 202 | the message, if you wish. When Emacs starts up, if the environment | ||
| 203 | variable @env{REPLYTO} is set, @code{mail-default-reply-to} is | ||
| 204 | initialized from that environment variable. | ||
| 205 | |||
| 206 | @item In-reply-to | ||
| 207 | This field contains a piece of text describing the message you are | ||
| 208 | replying to. Some mail systems can use this information to correlate | ||
| 209 | related pieces of mail. Normally this field is filled in by Rmail | ||
| 210 | when you reply to a message in Rmail, and you never need to | ||
| 211 | think about it (@pxref{Rmail}). | ||
| 212 | |||
| 213 | @item References | ||
| 214 | This field lists the message IDs of related previous messages. Rmail | ||
| 215 | sets up this field automatically when you reply to a message. | ||
| 216 | @end table | ||
| 217 | |||
| 218 | The @samp{To}, @samp{CC}, and @samp{BCC} header fields can appear | ||
| 219 | any number of times, and each such header field can contain multiple | ||
| 220 | addresses, separated by commas. This way, you can specify any number | ||
| 221 | of places to send the message. These fields can also have | ||
| 222 | continuation lines: one or more lines starting with whitespace, | ||
| 223 | following the starting line of the field, are considered part of the | ||
| 224 | field. Here's an example of a @samp{To} field with a continuation | ||
| 225 | line: | ||
| 226 | |||
| 227 | @example | ||
| 228 | @group | ||
| 229 | To: foo@@here.net, this@@there.net, | ||
| 230 | me@@gnu.cambridge.mass.usa.earth.spiral3281 | ||
| 231 | @end group | ||
| 232 | @end example | ||
| 233 | |||
| 234 | @vindex mail-from-style | ||
| 235 | When you send the message, if you didn't write a @samp{From} field | ||
| 236 | yourself, Emacs puts in one for you. The variable | ||
| 237 | @code{mail-from-style} controls the format: | ||
| 238 | |||
| 239 | @table @code | ||
| 240 | @item nil | ||
| 241 | Use just the email address, as in @samp{king@@grassland.com}. | ||
| 242 | @item parens | ||
| 243 | Use both email address and full name, as in:@* | ||
| 244 | @samp{king@@grassland.com (Elvis Parsley)}. | ||
| 245 | @item angles | ||
| 246 | Use both email address and full name, as in:@* | ||
| 247 | @samp{Elvis Parsley <king@@grassland.com>}. | ||
| 248 | @item system-default | ||
| 249 | Allow the system to insert the @samp{From} field. | ||
| 250 | @end table | ||
| 251 | |||
| 252 | @vindex mail-default-headers | ||
| 253 | You can direct Emacs to insert certain default headers into the | ||
| 254 | outgoing message by setting the variable @code{mail-default-headers} | ||
| 255 | to a string. Then @code{C-x m} inserts this string into the message | ||
| 256 | headers. If the default header fields are not appropriate for a | ||
| 257 | particular message, edit them as appropriate before sending the | ||
| 258 | message. | ||
| 259 | |||
| 260 | @node Mail Aliases | ||
| 261 | @section Mail Aliases | ||
| 262 | @cindex mail aliases | ||
| 263 | @cindex @file{.mailrc} file | ||
| 264 | @cindex mailrc file | ||
| 265 | |||
| 266 | You can define @dfn{mail aliases} in a file named @file{~/.mailrc}. | ||
| 267 | These are short mnemonic names which stand for mail addresses or groups of | ||
| 268 | mail addresses. Like many other mail programs, Emacs expands aliases | ||
| 269 | when they occur in the @samp{To}, @samp{From}, @samp{CC}, @samp{BCC}, and | ||
| 270 | @samp{Reply-to} fields, plus their @samp{Resent-} variants. | ||
| 271 | |||
| 272 | To define an alias in @file{~/.mailrc}, write a line in the following | ||
| 273 | format: | ||
| 274 | |||
| 275 | @example | ||
| 276 | alias @var{shortaddress} @var{fulladdresses} | ||
| 277 | @end example | ||
| 278 | |||
| 279 | @noindent | ||
| 280 | Here @var{fulladdresses} stands for one or more mail addresses for | ||
| 281 | @var{shortaddress} to expand into. Separate multiple addresses with | ||
| 282 | spaces; if an address contains a space, quote the whole address with a | ||
| 283 | pair of double-quotes. | ||
| 284 | |||
| 285 | For instance, to make @code{maingnu} stand for | ||
| 286 | @code{gnu@@gnu.org} plus a local address of your own, put in | ||
| 287 | this line:@refill | ||
| 288 | |||
| 289 | @example | ||
| 290 | alias maingnu gnu@@gnu.org local-gnu | ||
| 291 | @end example | ||
| 292 | |||
| 293 | @noindent | ||
| 294 | Addresses specified in this way should use doublequotes around an | ||
| 295 | entire address when the address contains spaces. But you need not | ||
| 296 | include doublequotes around parts of the address, such as the person's | ||
| 297 | full name. Emacs puts them in if they are needed. For example, | ||
| 298 | |||
| 299 | @example | ||
| 300 | alias chief-torturer "George W. Bush <bush@@whitehouse.gov>" | ||
| 301 | @end example | ||
| 302 | |||
| 303 | @noindent | ||
| 304 | is correct in @samp{.mailrc}. Emacs will insert the address as | ||
| 305 | @samp{"George W. Bush" <bush@@whitehouse.gov>}. | ||
| 306 | |||
| 307 | Emacs also recognizes ``include'' commands in @samp{.mailrc} files. | ||
| 308 | They look like this: | ||
| 309 | |||
| 310 | @example | ||
| 311 | source @var{filename} | ||
| 312 | @end example | ||
| 313 | |||
| 314 | @noindent | ||
| 315 | The file @file{~/.mailrc} is used primarily by other mail-reading | ||
| 316 | programs; it can contain various other commands. Emacs ignores | ||
| 317 | everything in it except for alias definitions and include commands. | ||
| 318 | |||
| 319 | @findex define-mail-alias | ||
| 320 | Another way to define a mail alias, within Emacs alone, is with the | ||
| 321 | @code{define-mail-alias} command. It prompts for the alias and then the | ||
| 322 | full address. You can use it to define aliases in your @file{.emacs} | ||
| 323 | file, like this: | ||
| 324 | |||
| 325 | @example | ||
| 326 | (define-mail-alias "maingnu" "gnu@@gnu.org") | ||
| 327 | @end example | ||
| 328 | |||
| 329 | @vindex mail-aliases | ||
| 330 | @code{define-mail-alias} records aliases by adding them to a | ||
| 331 | variable named @code{mail-aliases}. If you are comfortable with | ||
| 332 | manipulating Lisp lists, you can set @code{mail-aliases} directly. The | ||
| 333 | initial value of @code{mail-aliases} is @code{t}, which means that | ||
| 334 | Emacs should read @file{.mailrc} to get the proper value. | ||
| 335 | |||
| 336 | @vindex mail-personal-alias-file | ||
| 337 | You can specify a different file name to use instead of | ||
| 338 | @file{~/.mailrc} by setting the variable | ||
| 339 | @code{mail-personal-alias-file}. | ||
| 340 | |||
| 341 | @findex expand-mail-aliases | ||
| 342 | Normally, Emacs expands aliases when you send the message. You do not | ||
| 343 | need to expand mail aliases before sending the message, but you can | ||
| 344 | expand them if you want to see where the mail will actually go. To do | ||
| 345 | this, use the command @kbd{M-x expand-mail-aliases}; it expands all mail | ||
| 346 | aliases currently present in the mail headers that hold addresses. | ||
| 347 | |||
| 348 | If you like, you can have mail aliases expand as abbrevs, as soon as | ||
| 349 | you type them in (@pxref{Abbrevs}). To enable this feature, execute the | ||
| 350 | following: | ||
| 351 | |||
| 352 | @example | ||
| 353 | (add-hook 'mail-mode-hook 'mail-abbrevs-setup) | ||
| 354 | @end example | ||
| 355 | |||
| 356 | @noindent | ||
| 357 | @findex define-mail-abbrev | ||
| 358 | @vindex mail-abbrevs | ||
| 359 | This can go in your @file{.emacs} file. @xref{Hooks}. If you use this | ||
| 360 | feature, you must use @code{define-mail-abbrev} instead of | ||
| 361 | @code{define-mail-alias}; the latter does not work with this package. | ||
| 362 | Note that the mail abbreviation package uses the variable | ||
| 363 | @code{mail-abbrevs} instead of @code{mail-aliases}, and that all alias | ||
| 364 | names are converted to lower case. | ||
| 365 | |||
| 366 | @kindex C-c C-a @r{(Mail mode)} | ||
| 367 | @findex mail-interactive-insert-alias | ||
| 368 | The mail abbreviation package also provides the @kbd{C-c C-a} | ||
| 369 | (@code{mail-interactive-insert-alias}) command, which reads an alias | ||
| 370 | name (with completion) and inserts its definition at point. This is | ||
| 371 | useful when editing the message text itself or a header field such as | ||
| 372 | @samp{Subject} in which Emacs does not normally expand aliases. | ||
| 373 | |||
| 374 | Note that abbrevs expand only if you insert a word-separator character | ||
| 375 | afterward. However, you can rebind @kbd{C-n} and @kbd{M->} to cause | ||
| 376 | expansion as well. Here's how to do that: | ||
| 377 | |||
| 378 | @smallexample | ||
| 379 | (add-hook 'mail-mode-hook | ||
| 380 | (lambda () | ||
| 381 | (define-key | ||
| 382 | mail-mode-map [remap next-line] 'mail-abbrev-next-line) | ||
| 383 | (define-key | ||
| 384 | mail-mode-map [remap end-of-buffer] 'mail-abbrev-end-of-buffer))) | ||
| 385 | @end smallexample | ||
| 386 | |||
| 387 | @node Mail Mode | ||
| 388 | @section Mail Mode | ||
| 389 | @cindex Mail mode | ||
| 390 | @cindex mode, Mail | ||
| 391 | |||
| 392 | The major mode used in the mail buffer is Mail mode, which is much | ||
| 393 | like Text mode except that various special commands are provided on the | ||
| 394 | @kbd{C-c} prefix. These commands all have to do specifically with | ||
| 395 | editing or sending the message. In addition, Mail mode defines the | ||
| 396 | character @samp{%} as a word separator; this is helpful for using the | ||
| 397 | word commands to edit mail addresses. | ||
| 398 | |||
| 399 | Mail mode is normally used in buffers set up automatically by the | ||
| 400 | @code{mail} command and related commands. However, you can also switch | ||
| 401 | to Mail mode in a file-visiting buffer. This is a useful thing to do if | ||
| 402 | you have saved the text of a draft message in a file. | ||
| 403 | |||
| 404 | @menu | ||
| 405 | * Mail Sending:: Commands to send the message. | ||
| 406 | * Header Editing:: Commands to move to header fields and edit them. | ||
| 407 | * Citing Mail:: Copying all or part of a message you are replying to. | ||
| 408 | * Mail Mode Misc:: Spell checking, signatures, etc. | ||
| 409 | @end menu | ||
| 410 | |||
| 411 | @node Mail Sending | ||
| 412 | @subsection Mail Sending | ||
| 413 | |||
| 414 | Mail mode has two commands for sending the message you have been | ||
| 415 | editing: | ||
| 416 | |||
| 417 | @table @kbd | ||
| 418 | @item C-c C-s | ||
| 419 | Send the message, and leave the mail buffer selected (@code{mail-send}). | ||
| 420 | @item C-c C-c | ||
| 421 | Send the message, and select some other buffer (@code{mail-send-and-exit}). | ||
| 422 | @end table | ||
| 423 | |||
| 424 | @kindex C-c C-s @r{(Mail mode)} | ||
| 425 | @kindex C-c C-c @r{(Mail mode)} | ||
| 426 | @findex mail-send | ||
| 427 | @findex mail-send-and-exit | ||
| 428 | @kbd{C-c C-s} (@code{mail-send}) sends the message and marks the mail | ||
| 429 | buffer unmodified, but leaves that buffer selected so that you can | ||
| 430 | modify the message (perhaps with new recipients) and send it again. | ||
| 431 | @kbd{C-c C-c} (@code{mail-send-and-exit}) sends and then deletes the | ||
| 432 | window or switches to another buffer. It puts the mail buffer at the | ||
| 433 | lowest priority for reselection by default, since you are finished with | ||
| 434 | using it. This is the usual way to send the message. | ||
| 435 | |||
| 436 | In a file-visiting buffer, sending the message does not clear the | ||
| 437 | modified flag, because only saving the file should do that. Also, you | ||
| 438 | don't get a warning if you try to send the same message twice. | ||
| 439 | |||
| 440 | @c This is indexed in mule.texi, node "Recognize Coding". | ||
| 441 | @c @vindex sendmail-coding-system | ||
| 442 | When you send a message that contains non-@acronym{ASCII} characters, they need | ||
| 443 | to be encoded with a coding system (@pxref{Coding Systems}). Usually | ||
| 444 | the coding system is specified automatically by your chosen language | ||
| 445 | environment (@pxref{Language Environments}). You can explicitly specify | ||
| 446 | the coding system for outgoing mail by setting the variable | ||
| 447 | @code{sendmail-coding-system} (@pxref{Recognize Coding}). | ||
| 448 | |||
| 449 | If the coding system thus determined does not handle the characters in | ||
| 450 | a particular message, Emacs asks you to select the coding system to use, | ||
| 451 | showing a list of possible coding systems. | ||
| 452 | |||
| 453 | @cindex SMTP | ||
| 454 | @cindex Feedmail | ||
| 455 | @cindex Sendmail | ||
| 456 | @vindex send-mail-function | ||
| 457 | The variable @code{send-mail-function} controls how the default mail | ||
| 458 | user agent sends mail. It should be set to a function. The default | ||
| 459 | is @code{sendmail-send-it}, which delivers mail using the Sendmail | ||
| 460 | installation on the local host. To send mail through a SMTP server, | ||
| 461 | set it to @code{smtpmail-send-it} and set up the Emacs SMTP library | ||
| 462 | (@pxref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}). A | ||
| 463 | third option is @code{feedmail-send-it}, see the commentary section of | ||
| 464 | the @file{feedmail.el} package for more information. | ||
| 465 | |||
| 466 | @node Header Editing | ||
| 467 | @subsection Mail Header Editing | ||
| 468 | |||
| 469 | Mail mode provides special commands to move to particular header | ||
| 470 | fields and to complete addresses in headers. | ||
| 471 | |||
| 472 | @table @kbd | ||
| 473 | @item C-c C-f C-t | ||
| 474 | Move to the @samp{To} header field, creating one if there is none | ||
| 475 | (@code{mail-to}). | ||
| 476 | @item C-c C-f C-s | ||
| 477 | Move to the @samp{Subject} header field, creating one if there is | ||
| 478 | none (@code{mail-subject}). | ||
| 479 | @item C-c C-f C-c | ||
| 480 | Move to the @samp{CC} header field, creating one if there is none | ||
| 481 | (@code{mail-cc}). | ||
| 482 | @item C-c C-f C-b | ||
| 483 | Move to the @samp{BCC} header field, creating one if there is none | ||
| 484 | (@code{mail-bcc}). | ||
| 485 | @item C-c C-f C-f | ||
| 486 | Move to the @samp{FCC} header field, creating one if there is none | ||
| 487 | (@code{mail-fcc}). | ||
| 488 | @item M-@key{TAB} | ||
| 489 | Complete a mailing address (@code{mail-complete}). | ||
| 490 | @end table | ||
| 491 | |||
| 492 | @kindex C-c C-f C-t @r{(Mail mode)} | ||
| 493 | @findex mail-to | ||
| 494 | @kindex C-c C-f C-s @r{(Mail mode)} | ||
| 495 | @findex mail-subject | ||
| 496 | @kindex C-c C-f C-c @r{(Mail mode)} | ||
| 497 | @findex mail-cc | ||
| 498 | @kindex C-c C-f C-b @r{(Mail mode)} | ||
| 499 | @findex mail-bcc | ||
| 500 | @kindex C-c C-f C-f @r{(Mail mode)} | ||
| 501 | @findex mail-fcc | ||
| 502 | There are five commands to move point to particular header fields, all | ||
| 503 | based on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). They | ||
| 504 | are listed in the table above. If the field in question does not exist, | ||
| 505 | these commands create one. We provide special motion commands for these | ||
| 506 | particular fields because they are the fields users most often want to | ||
| 507 | edit. | ||
| 508 | |||
| 509 | @findex mail-complete | ||
| 510 | @kindex M-TAB @r{(Mail mode)} | ||
| 511 | While editing a header field that contains mailing addresses, such | ||
| 512 | as @samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing | ||
| 513 | address by typing @kbd{M-@key{TAB}} (@code{mail-complete}). It | ||
| 514 | inserts the full name corresponding to the address, if it can | ||
| 515 | determine the full name. The variable @code{mail-complete-style} | ||
| 516 | controls whether to insert the full name, and what style to use, as in | ||
| 517 | @code{mail-from-style} (@pxref{Mail Headers}). (If your window | ||
| 518 | manager defines @kbd{M-@key{TAB}} to switch windows, you can type | ||
| 519 | @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.) | ||
| 520 | |||
| 521 | For completion purposes, the valid mailing addresses are taken to be | ||
| 522 | the local users' names plus your personal mail aliases. You can | ||
| 523 | specify additional sources of valid addresses; see the customization | ||
| 524 | group @samp{mailalias} to see the variables for customizing this | ||
| 525 | feature (@pxref{Customization Groups}). | ||
| 526 | |||
| 527 | If you type @kbd{M-@key{TAB}} in the body of the message, | ||
| 528 | @code{mail-complete} invokes @code{ispell-complete-word}, as in Text | ||
| 529 | mode. | ||
| 530 | |||
| 531 | @node Citing Mail | ||
| 532 | @subsection Citing Mail | ||
| 533 | @cindex citing mail | ||
| 534 | |||
| 535 | Mail mode also has commands for yanking or @dfn{citing} all or part of | ||
| 536 | a message that you are replying to. These commands are active only when | ||
| 537 | you started sending a message using an Rmail command. | ||
| 538 | |||
| 539 | @table @kbd | ||
| 540 | @item C-c C-y | ||
| 541 | Yank the selected message from Rmail (@code{mail-yank-original}). | ||
| 542 | @item C-c C-r | ||
| 543 | Yank the region from the Rmail buffer (@code{mail-yank-region}). | ||
| 544 | @item C-c C-q | ||
| 545 | Fill each paragraph cited from another message | ||
| 546 | (@code{mail-fill-yanked-message}). | ||
| 547 | @end table | ||
| 548 | |||
| 549 | @kindex C-c C-y @r{(Mail mode)} | ||
| 550 | @findex mail-yank-original | ||
| 551 | When mail sending is invoked from the Rmail mail reader using an Rmail | ||
| 552 | command, @kbd{C-c C-y} can be used inside the mail buffer to insert | ||
| 553 | the text of the message you are replying to. Normally it indents each line | ||
| 554 | of that message three spaces and eliminates most header fields. A numeric | ||
| 555 | argument specifies the number of spaces to indent. An argument of just | ||
| 556 | @kbd{C-u} says not to indent at all and not to eliminate anything. | ||
| 557 | @kbd{C-c C-y} always uses the current message from the Rmail buffer, | ||
| 558 | so you can insert several old messages by selecting one in Rmail, | ||
| 559 | switching to @samp{*mail*} and yanking it, then switching back to | ||
| 560 | Rmail to select another. | ||
| 561 | |||
| 562 | @vindex mail-yank-prefix | ||
| 563 | You can specify the text for @kbd{C-c C-y} to insert at the beginning | ||
| 564 | of each line: set @code{mail-yank-prefix} to the desired string. (A | ||
| 565 | value of @code{nil} means to use indentation; this is the default.) | ||
| 566 | However, @kbd{C-u C-c C-y} never adds anything at the beginning of the | ||
| 567 | inserted lines, regardless of the value of @code{mail-yank-prefix}. | ||
| 568 | |||
| 569 | @kindex C-c C-r @r{(Mail mode)} | ||
| 570 | @findex mail-yank-region | ||
| 571 | To yank just a part of an incoming message, set the region in Rmail to | ||
| 572 | the part you want; then go to the @samp{*Mail*} message and type | ||
| 573 | @kbd{C-c C-r} (@code{mail-yank-region}). Each line that is copied is | ||
| 574 | indented or prefixed according to @code{mail-yank-prefix}. | ||
| 575 | |||
| 576 | @kindex C-c C-q @r{(Mail mode)} | ||
| 577 | @findex mail-fill-yanked-message | ||
| 578 | After using @kbd{C-c C-y} or @kbd{C-c C-r}, you can type @kbd{C-c C-q} | ||
| 579 | (@code{mail-fill-yanked-message}) to fill the paragraphs of the yanked | ||
| 580 | old message or messages. One use of @kbd{C-c C-q} fills all such | ||
| 581 | paragraphs, each one individually. To fill a single paragraph of the | ||
| 582 | quoted message, use @kbd{M-q}. If filling does not automatically | ||
| 583 | handle the type of citation prefix you use, try setting the fill prefix | ||
| 584 | explicitly. @xref{Filling}. | ||
| 585 | |||
| 586 | @node Mail Mode Misc | ||
| 587 | @subsection Mail Mode Miscellany | ||
| 588 | |||
| 589 | @table @kbd | ||
| 590 | @item C-c C-t | ||
| 591 | Move to the beginning of the message body text (@code{mail-text}). | ||
| 592 | @item C-c C-w | ||
| 593 | Insert the file @file{~/.signature} at the end of the message text | ||
| 594 | (@code{mail-signature}). | ||
| 595 | @item C-c C-i @var{file} @key{RET} | ||
| 596 | Insert the contents of @var{file} at the end of the outgoing message | ||
| 597 | (@code{mail-attach-file}). | ||
| 598 | @item M-x ispell-message | ||
| 599 | Perform spelling correction on the message text, but not on citations from | ||
| 600 | other messages. | ||
| 601 | @end table | ||
| 602 | |||
| 603 | @kindex C-c C-t @r{(Mail mode)} | ||
| 604 | @findex mail-text | ||
| 605 | @kbd{C-c C-t} (@code{mail-text}) moves point to just after the header | ||
| 606 | separator line---that is, to the beginning of the message body text. | ||
| 607 | |||
| 608 | @kindex C-c C-w @r{(Mail mode)} | ||
| 609 | @findex mail-signature | ||
| 610 | @vindex mail-signature | ||
| 611 | @kbd{C-c C-w} (@code{mail-signature}) adds a standard piece of text at | ||
| 612 | the end of the message to say more about who you are. The text comes | ||
| 613 | from the file @file{~/.signature} in your home directory. To insert | ||
| 614 | your signature automatically, set the variable @code{mail-signature} to | ||
| 615 | @code{t}; after that, starting a mail message automatically inserts the | ||
| 616 | contents of your @file{~/.signature} file. If you want to omit your | ||
| 617 | signature from a particular message, delete it from the buffer before | ||
| 618 | you send the message. | ||
| 619 | |||
| 620 | You can also set @code{mail-signature} to a string; then that string | ||
| 621 | is inserted automatically as your signature when you start editing a | ||
| 622 | message to send. If you set it to some other Lisp expression, the | ||
| 623 | expression is evaluated each time, and its value (which should be a | ||
| 624 | string) specifies the signature. | ||
| 625 | |||
| 626 | @findex ispell-message | ||
| 627 | You can do spelling correction on the message text you have written | ||
| 628 | with the command @kbd{M-x ispell-message}. If you have yanked an | ||
| 629 | incoming message into the outgoing draft, this command skips what was | ||
| 630 | yanked, but it checks the text that you yourself inserted. (It looks | ||
| 631 | for indentation or @code{mail-yank-prefix} to distinguish the cited | ||
| 632 | lines from your input.) @xref{Spelling}. | ||
| 633 | |||
| 634 | @kindex C-c C-i @r{(Mail mode)} | ||
| 635 | @findex mail-attach-file | ||
| 636 | To include a file in the outgoing message, you can use @kbd{C-x i}, | ||
| 637 | the usual command to insert a file in the current buffer. But it is | ||
| 638 | often more convenient to use a special command, @kbd{C-c C-i} | ||
| 639 | (@code{mail-attach-file}). This command inserts the file contents at | ||
| 640 | the end of the buffer, after your signature if any, with a delimiter | ||
| 641 | line that includes the file name. Note that this is not a MIME | ||
| 642 | attachment. | ||
| 643 | |||
| 644 | @vindex mail-mode-hook | ||
| 645 | @vindex mail-setup-hook | ||
| 646 | Turning on Mail mode (which @kbd{C-x m} does automatically) runs the | ||
| 647 | normal hooks @code{text-mode-hook} and @code{mail-mode-hook}. | ||
| 648 | Initializing a new outgoing message runs the normal hook | ||
| 649 | @code{mail-setup-hook}; if you want to add special fields to your mail | ||
| 650 | header or make other changes to the appearance of the mail buffer, use | ||
| 651 | that hook. @xref{Hooks}. | ||
| 652 | |||
| 653 | The main difference between these hooks is just when they are | ||
| 654 | invoked. Whenever you type @kbd{M-x mail}, @code{mail-mode-hook} runs | ||
| 655 | as soon as the @samp{*mail*} buffer is created. Then the | ||
| 656 | @code{mail-setup} function inserts the default contents of the buffer. | ||
| 657 | After these default contents are inserted, @code{mail-setup-hook} runs. | ||
| 658 | |||
| 659 | @node Mail Amusements | ||
| 660 | @section Mail Amusements | ||
| 661 | |||
| 662 | @findex spook | ||
| 663 | @cindex NSA | ||
| 664 | @kbd{M-x spook} adds a line of randomly chosen keywords to an outgoing | ||
| 665 | mail message. The keywords are chosen from a list of words that suggest | ||
| 666 | you are discussing something subversive. | ||
| 667 | |||
| 668 | The idea behind this feature is the suspicion that the | ||
| 669 | NSA@footnote{The US National Security Agency.} snoops on | ||
| 670 | all electronic mail messages that contain keywords suggesting they might | ||
| 671 | find them interesting. (The NSA says they don't, but that's what they | ||
| 672 | @emph{would} say.) The idea is that if lots of people add suspicious | ||
| 673 | words to their messages, the NSA will get so busy with spurious input | ||
| 674 | that they will have to give up reading it all. | ||
| 675 | |||
| 676 | Here's how to insert spook keywords automatically whenever you start | ||
| 677 | entering an outgoing message: | ||
| 678 | |||
| 679 | @example | ||
| 680 | (add-hook 'mail-setup-hook 'spook) | ||
| 681 | @end example | ||
| 682 | |||
| 683 | Whether or not this confuses the NSA, it at least amuses people. | ||
| 684 | |||
| 685 | @findex fortune-to-signature | ||
| 686 | @cindex fortune cookies | ||
| 687 | You can use the @code{fortune} program to put a ``fortune cookie'' | ||
| 688 | message into outgoing mail. To do this, add | ||
| 689 | @code{fortune-to-signature} to @code{mail-setup-hook}: | ||
| 690 | |||
| 691 | @example | ||
| 692 | (add-hook 'mail-setup-hook 'fortune-to-signature) | ||
| 693 | @end example | ||
| 694 | |||
| 695 | @node Mail Methods | ||
| 696 | @section Mail-Composition Methods | ||
| 697 | @cindex mail-composition methods | ||
| 698 | |||
| 699 | @cindex MH mail interface | ||
| 700 | @cindex Message mode for sending mail | ||
| 701 | In this chapter we have described the usual Emacs mode for editing | ||
| 702 | and sending mail---Mail mode. Emacs has alternative facilities for | ||
| 703 | editing and sending mail, including | ||
| 704 | MH-E and Message mode, not documented in this manual. | ||
| 705 | @xref{Top,,MH-E,mh-e, The Emacs Interface to MH}. @xref{Top,,Message,message, | ||
| 706 | Message Manual}. You can choose any of them as your preferred method. | ||
| 707 | The commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use | ||
| 708 | whichever agent you have specified, as do various other Emacs commands | ||
| 709 | and facilities that send mail. | ||
| 710 | |||
| 711 | @vindex mail-user-agent | ||
| 712 | To specify your mail-composition method, customize the variable | ||
| 713 | @code{mail-user-agent}. Currently legitimate values include | ||
| 714 | @code{sendmail-user-agent} (Mail mode), @code{mh-e-user-agent}, | ||
| 715 | @code{message-user-agent} and @code{gnus-user-agent}. | ||
| 716 | |||
| 717 | If you select a different mail-composition method, the information | ||
| 718 | in this chapter about the @samp{*mail*} buffer and Mail mode does not | ||
| 719 | apply; the other methods use a different format of text in a different | ||
| 720 | buffer, and their commands are different as well. | ||
| 721 | |||
| 722 | @ignore | ||
| 723 | arch-tag: d8a3dfc3-5d87-45c5-a7f2-69871b8e4fd6 | ||
| 724 | @end ignore | ||
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi new file mode 100644 index 00000000000..3a0e091ea40 --- /dev/null +++ b/doc/emacs/text.texi | |||
| @@ -0,0 +1,2901 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Text, Programs, Indentation, Top | ||
| 6 | @chapter Commands for Human Languages | ||
| 7 | @cindex text | ||
| 8 | @cindex manipulating text | ||
| 9 | |||
| 10 | The term @dfn{text} has two widespread meanings in our area of the | ||
| 11 | computer field. One is data that is a sequence of characters. Any file | ||
| 12 | that you edit with Emacs is text, in this sense of the word. The other | ||
| 13 | meaning is more restrictive: a sequence of characters in a human language | ||
| 14 | for humans to read (possibly after processing by a text formatter), as | ||
| 15 | opposed to a program or binary data. This chapter is concerned with | ||
| 16 | editing text in the narrower sense. | ||
| 17 | |||
| 18 | Human languages have syntactic/stylistic conventions that can be | ||
| 19 | supported or used to advantage by editor commands: conventions involving | ||
| 20 | words, sentences, paragraphs, and capital letters. This chapter | ||
| 21 | describes Emacs commands for all of these things. There are also | ||
| 22 | commands for @dfn{filling}, which means rearranging the lines of a | ||
| 23 | paragraph to be approximately equal in length. The commands for moving | ||
| 24 | over and killing words, sentences and paragraphs, while intended | ||
| 25 | primarily for editing text, are also often useful for editing programs. | ||
| 26 | |||
| 27 | Emacs has several major modes for editing human-language text. If the | ||
| 28 | file contains text pure and simple, use Text mode, which customizes | ||
| 29 | Emacs in small ways for the syntactic conventions of text. Outline mode | ||
| 30 | provides special commands for operating on text with an outline | ||
| 31 | structure. | ||
| 32 | @iftex | ||
| 33 | @xref{Outline Mode}. | ||
| 34 | @end iftex | ||
| 35 | |||
| 36 | For text which contains embedded commands for text formatters, Emacs | ||
| 37 | has other major modes, each for a particular formatter. Thus, for | ||
| 38 | input to @TeX{}, you would use @TeX{} | ||
| 39 | @iftex | ||
| 40 | mode (@pxref{TeX Mode,,@TeX{} Mode}). | ||
| 41 | @end iftex | ||
| 42 | @ifnottex | ||
| 43 | mode. | ||
| 44 | @end ifnottex | ||
| 45 | For input to groff or nroff, use Nroff mode. | ||
| 46 | |||
| 47 | Instead of using a text formatter, you can edit formatted text in | ||
| 48 | WYSIWYG style (``what you see is what you get''), with Enriched mode. | ||
| 49 | Then the formatting appears on the screen in Emacs while you edit. | ||
| 50 | @iftex | ||
| 51 | @xref{Formatted Text}. | ||
| 52 | @end iftex | ||
| 53 | |||
| 54 | @cindex ASCII art | ||
| 55 | If you need to edit pictures made out of text characters (commonly | ||
| 56 | referred to as ``ASCII art''), use @kbd{M-x edit-picture} to enter | ||
| 57 | Picture mode, a special major mode for editing such pictures. | ||
| 58 | @iftex | ||
| 59 | @xref{Picture Mode,,, emacs-xtra, Specialized Emacs Features}. | ||
| 60 | @end iftex | ||
| 61 | @ifnottex | ||
| 62 | @xref{Picture Mode}. | ||
| 63 | @end ifnottex | ||
| 64 | |||
| 65 | |||
| 66 | @cindex skeletons | ||
| 67 | @cindex templates | ||
| 68 | @cindex autotyping | ||
| 69 | @cindex automatic typing | ||
| 70 | The ``automatic typing'' features may be useful when writing text. | ||
| 71 | @inforef{Top,, autotype}. | ||
| 72 | |||
| 73 | @menu | ||
| 74 | * Words:: Moving over and killing words. | ||
| 75 | * Sentences:: Moving over and killing sentences. | ||
| 76 | * Paragraphs:: Moving over paragraphs. | ||
| 77 | * Pages:: Moving over pages. | ||
| 78 | * Filling:: Filling or justifying text. | ||
| 79 | * Case:: Changing the case of text. | ||
| 80 | * Text Mode:: The major modes for editing text files. | ||
| 81 | * Outline Mode:: Editing outlines. | ||
| 82 | * TeX Mode:: Editing input to the formatter TeX. | ||
| 83 | * HTML Mode:: Editing HTML, SGML, and XML files. | ||
| 84 | * Nroff Mode:: Editing input to the formatter nroff. | ||
| 85 | * Formatted Text:: Editing formatted text directly in WYSIWYG fashion. | ||
| 86 | * Text Based Tables:: Editing text-based tables in WYSIWYG fashion. | ||
| 87 | @end menu | ||
| 88 | |||
| 89 | @node Words | ||
| 90 | @section Words | ||
| 91 | @cindex words | ||
| 92 | @cindex Meta commands and words | ||
| 93 | |||
| 94 | Emacs has commands for moving over or operating on words. By convention, | ||
| 95 | the keys for them are all Meta characters. | ||
| 96 | |||
| 97 | @table @kbd | ||
| 98 | @item M-f | ||
| 99 | Move forward over a word (@code{forward-word}). | ||
| 100 | @item M-b | ||
| 101 | Move backward over a word (@code{backward-word}). | ||
| 102 | @item M-d | ||
| 103 | Kill up to the end of a word (@code{kill-word}). | ||
| 104 | @item M-@key{DEL} | ||
| 105 | Kill back to the beginning of a word (@code{backward-kill-word}). | ||
| 106 | @item M-@@ | ||
| 107 | Mark the end of the next word (@code{mark-word}). | ||
| 108 | @item M-t | ||
| 109 | Transpose two words or drag a word across others | ||
| 110 | (@code{transpose-words}). | ||
| 111 | @end table | ||
| 112 | |||
| 113 | Notice how these keys form a series that parallels the character-based | ||
| 114 | @kbd{C-f}, @kbd{C-b}, @kbd{C-d}, @key{DEL} and @kbd{C-t}. @kbd{M-@@} is | ||
| 115 | cognate to @kbd{C-@@}, which is an alias for @kbd{C-@key{SPC}}. | ||
| 116 | |||
| 117 | @kindex M-f | ||
| 118 | @kindex M-b | ||
| 119 | @findex forward-word | ||
| 120 | @findex backward-word | ||
| 121 | The commands @kbd{M-f} (@code{forward-word}) and @kbd{M-b} | ||
| 122 | (@code{backward-word}) move forward and backward over words. These | ||
| 123 | Meta characters are thus analogous to the corresponding control | ||
| 124 | characters, @kbd{C-f} and @kbd{C-b}, which move over single characters | ||
| 125 | in the text. The analogy extends to numeric arguments, which serve as | ||
| 126 | repeat counts. @kbd{M-f} with a negative argument moves backward, and | ||
| 127 | @kbd{M-b} with a negative argument moves forward. Forward motion | ||
| 128 | stops right after the last letter of the word, while backward motion | ||
| 129 | stops right before the first letter. | ||
| 130 | |||
| 131 | @kindex M-d | ||
| 132 | @findex kill-word | ||
| 133 | @kbd{M-d} (@code{kill-word}) kills the word after point. To be | ||
| 134 | precise, it kills everything from point to the place @kbd{M-f} would | ||
| 135 | move to. Thus, if point is in the middle of a word, @kbd{M-d} kills | ||
| 136 | just the part after point. If some punctuation comes between point and the | ||
| 137 | next word, it is killed along with the word. (If you wish to kill only the | ||
| 138 | next word but not the punctuation before it, simply do @kbd{M-f} to get | ||
| 139 | the end, and kill the word backwards with @kbd{M-@key{DEL}}.) | ||
| 140 | @kbd{M-d} takes arguments just like @kbd{M-f}. | ||
| 141 | |||
| 142 | @findex backward-kill-word | ||
| 143 | @kindex M-DEL | ||
| 144 | @kbd{M-@key{DEL}} (@code{backward-kill-word}) kills the word before | ||
| 145 | point. It kills everything from point back to where @kbd{M-b} would | ||
| 146 | move to. For instance, if point is after the space in @w{@samp{FOO, | ||
| 147 | BAR}}, it kills @w{@samp{FOO, }}. If you wish to kill just | ||
| 148 | @samp{FOO}, and not the comma and the space, use @kbd{M-b M-d} instead | ||
| 149 | of @kbd{M-@key{DEL}}. | ||
| 150 | |||
| 151 | @c Don't index M-t and transpose-words here, they are indexed in | ||
| 152 | @c fixit.texi, in the node "Transpose". | ||
| 153 | @c @kindex M-t | ||
| 154 | @c @findex transpose-words | ||
| 155 | @kbd{M-t} (@code{transpose-words}) exchanges the word before or | ||
| 156 | containing point with the following word. The delimiter characters between | ||
| 157 | the words do not move. For example, @w{@samp{FOO, BAR}} transposes into | ||
| 158 | @w{@samp{BAR, FOO}} rather than @samp{@w{BAR FOO,}}. @xref{Transpose}, for | ||
| 159 | more on transposition. | ||
| 160 | |||
| 161 | @kindex M-@@ | ||
| 162 | @findex mark-word | ||
| 163 | To operate on the next @var{n} words with an operation which applies | ||
| 164 | between point and mark, you can either set the mark at point and then move | ||
| 165 | over the words, or you can use the command @kbd{M-@@} (@code{mark-word}) | ||
| 166 | which does not move point, but sets the mark where @kbd{M-f} would move | ||
| 167 | to. @kbd{M-@@} accepts a numeric argument that says how many words to | ||
| 168 | scan for the place to put the mark. In Transient Mark mode, this command | ||
| 169 | activates the mark. | ||
| 170 | |||
| 171 | The word commands' understanding of word boundaries is controlled | ||
| 172 | by the syntax table. Any character can, for example, be declared to | ||
| 173 | be a word delimiter. @xref{Syntax}. | ||
| 174 | |||
| 175 | @node Sentences | ||
| 176 | @section Sentences | ||
| 177 | @cindex sentences | ||
| 178 | @cindex manipulating sentences | ||
| 179 | |||
| 180 | The Emacs commands for manipulating sentences and paragraphs are mostly | ||
| 181 | on Meta keys, so as to be like the word-handling commands. | ||
| 182 | |||
| 183 | @table @kbd | ||
| 184 | @item M-a | ||
| 185 | Move back to the beginning of the sentence (@code{backward-sentence}). | ||
| 186 | @item M-e | ||
| 187 | Move forward to the end of the sentence (@code{forward-sentence}). | ||
| 188 | @item M-k | ||
| 189 | Kill forward to the end of the sentence (@code{kill-sentence}). | ||
| 190 | @item C-x @key{DEL} | ||
| 191 | Kill back to the beginning of the sentence (@code{backward-kill-sentence}). | ||
| 192 | @end table | ||
| 193 | |||
| 194 | @kindex M-a | ||
| 195 | @kindex M-e | ||
| 196 | @findex backward-sentence | ||
| 197 | @findex forward-sentence | ||
| 198 | The commands @kbd{M-a} and @kbd{M-e} (@code{backward-sentence} and | ||
| 199 | @code{forward-sentence}) move to the beginning and end of the current | ||
| 200 | sentence, respectively. They were chosen to resemble @kbd{C-a} and | ||
| 201 | @kbd{C-e}, which move to the beginning and end of a line. Unlike | ||
| 202 | them, @kbd{M-a} and @kbd{M-e} move over successive sentences if | ||
| 203 | repeated. | ||
| 204 | |||
| 205 | Moving backward over a sentence places point just before the first | ||
| 206 | character of the sentence; moving forward places point right after the | ||
| 207 | punctuation that ends the sentence. Neither one moves over the | ||
| 208 | whitespace at the sentence boundary. | ||
| 209 | |||
| 210 | @kindex M-k | ||
| 211 | @kindex C-x DEL | ||
| 212 | @findex kill-sentence | ||
| 213 | @findex backward-kill-sentence | ||
| 214 | Just as @kbd{C-a} and @kbd{C-e} have a kill command, @kbd{C-k}, to go | ||
| 215 | with them, so @kbd{M-a} and @kbd{M-e} have a corresponding kill command | ||
| 216 | @kbd{M-k} (@code{kill-sentence}) which kills from point to the end of | ||
| 217 | the sentence. With minus one as an argument it kills back to the | ||
| 218 | beginning of the sentence. Larger arguments serve as a repeat count. | ||
| 219 | There is also a command, @kbd{C-x @key{DEL}} | ||
| 220 | (@code{backward-kill-sentence}), for killing back to the beginning of a | ||
| 221 | sentence. This command is useful when you change your mind in the | ||
| 222 | middle of composing text. | ||
| 223 | |||
| 224 | The sentence commands assume that you follow the American typist's | ||
| 225 | convention of putting two spaces at the end of a sentence; they consider | ||
| 226 | a sentence to end wherever there is a @samp{.}, @samp{?} or @samp{!} | ||
| 227 | followed by the end of a line or two spaces, with any number of | ||
| 228 | @samp{)}, @samp{]}, @samp{'}, or @samp{"} characters allowed in between. | ||
| 229 | A sentence also begins or ends wherever a paragraph begins or ends. | ||
| 230 | It is useful to follow this convention, because it makes a distinction | ||
| 231 | between periods that end a sentence and periods that indicate | ||
| 232 | abbreviations; that enables the Emacs sentence commands to distinguish, | ||
| 233 | too. These commands do not stop for periods that indicate abbreviations. | ||
| 234 | |||
| 235 | @vindex sentence-end-double-space | ||
| 236 | If you want to use just one space between sentences, you can set the | ||
| 237 | variable @code{sentence-end-double-space} to @code{nil} to make the | ||
| 238 | sentence commands stop for single spaces. However, this mode has a | ||
| 239 | drawback: there is no way to distinguish between periods that end | ||
| 240 | sentences and those that indicate abbreviations. For convenient and | ||
| 241 | reliable editing, we therefore recommend you follow the two-space | ||
| 242 | convention. The variable @code{sentence-end-double-space} also | ||
| 243 | affects filling (@pxref{Fill Commands}) in related ways. | ||
| 244 | |||
| 245 | @vindex sentence-end | ||
| 246 | The variable @code{sentence-end} controls how to recognize the end | ||
| 247 | of a sentence. If non-@code{nil}, it is a regexp that matches the | ||
| 248 | last few characters of a sentence, together with the whitespace | ||
| 249 | following the sentence. If the value is @code{nil}, the default, then | ||
| 250 | Emacs computes the regexp according to various criteria such as the | ||
| 251 | value of @code{sentence-end-double-space}. @xref{Regexp Example}, for | ||
| 252 | a detailed explanation of one of the regular expressions Emacs uses | ||
| 253 | for this purpose. | ||
| 254 | |||
| 255 | @vindex sentence-end-without-period | ||
| 256 | Some languages do not use periods to indicate the end of a sentence. | ||
| 257 | For example, sentences in Thai end with a double space but without a | ||
| 258 | period. Set the variable @code{sentence-end-without-period} to | ||
| 259 | @code{t} in such cases. | ||
| 260 | |||
| 261 | @node Paragraphs | ||
| 262 | @section Paragraphs | ||
| 263 | @cindex paragraphs | ||
| 264 | @cindex manipulating paragraphs | ||
| 265 | @kindex M-@{ | ||
| 266 | @kindex M-@} | ||
| 267 | @findex backward-paragraph | ||
| 268 | @findex forward-paragraph | ||
| 269 | |||
| 270 | The Emacs commands for manipulating paragraphs are also on Meta keys. | ||
| 271 | |||
| 272 | @table @kbd | ||
| 273 | @item M-@{ | ||
| 274 | Move back to previous paragraph beginning (@code{backward-paragraph}). | ||
| 275 | @item M-@} | ||
| 276 | Move forward to next paragraph end (@code{forward-paragraph}). | ||
| 277 | @item M-h | ||
| 278 | Put point and mark around this or next paragraph (@code{mark-paragraph}). | ||
| 279 | @end table | ||
| 280 | |||
| 281 | @kbd{M-@{} moves to the beginning of the current or previous | ||
| 282 | paragraph, while @kbd{M-@}} moves to the end of the current or next | ||
| 283 | paragraph. Blank lines and text-formatter command lines separate | ||
| 284 | paragraphs and are not considered part of any paragraph. If there is | ||
| 285 | a blank line before the paragraph, @kbd{M-@{} moves to the blank line, | ||
| 286 | because that is convenient in practice. | ||
| 287 | |||
| 288 | In Text mode, an indented line is not a paragraph break. If you | ||
| 289 | want indented lines to have this effect, use Paragraph-Indent Text | ||
| 290 | mode instead. @xref{Text Mode}. | ||
| 291 | |||
| 292 | In major modes for programs, paragraphs begin and end only at blank | ||
| 293 | lines. This makes the paragraph commands useful, even though there | ||
| 294 | are no paragraphs as such in a program. | ||
| 295 | |||
| 296 | When you have set a fill prefix, then paragraphs are delimited by | ||
| 297 | all lines which don't start with the fill prefix. @xref{Filling}. | ||
| 298 | |||
| 299 | @kindex M-h | ||
| 300 | @findex mark-paragraph | ||
| 301 | When you wish to operate on a paragraph, you can use the command | ||
| 302 | @kbd{M-h} (@code{mark-paragraph}) to set the region around it. Thus, | ||
| 303 | for example, @kbd{M-h C-w} kills the paragraph around or after point. | ||
| 304 | The @kbd{M-h} command puts point at the beginning and mark at the end of | ||
| 305 | the paragraph point was in. In Transient Mark mode, it activates the | ||
| 306 | mark. If point is between paragraphs (in a run of blank lines, or at a | ||
| 307 | boundary), the paragraph following point is surrounded by point and | ||
| 308 | mark. If there are blank lines preceding the first line of the | ||
| 309 | paragraph, one of these blank lines is included in the region. | ||
| 310 | |||
| 311 | @vindex paragraph-start | ||
| 312 | @vindex paragraph-separate | ||
| 313 | The precise definition of a paragraph boundary is controlled by the | ||
| 314 | variables @code{paragraph-separate} and @code{paragraph-start}. The | ||
| 315 | value of @code{paragraph-start} is a regexp that should match any line | ||
| 316 | that either starts or separates paragraphs. The value of | ||
| 317 | @code{paragraph-separate} is another regexp that should match only lines | ||
| 318 | that separate paragraphs without being part of any paragraph (for | ||
| 319 | example, blank lines). Lines that start a new paragraph and are | ||
| 320 | contained in it must match only @code{paragraph-start}, not | ||
| 321 | @code{paragraph-separate}. Each regular expression must match at the | ||
| 322 | left margin. For example, in Fundamental mode, @code{paragraph-start} | ||
| 323 | is @w{@code{"\f\\|[ \t]*$"}}, and @code{paragraph-separate} is | ||
| 324 | @w{@code{"[ \t\f]*$"}}. | ||
| 325 | |||
| 326 | Normally it is desirable for page boundaries to separate paragraphs. | ||
| 327 | The default values of these variables recognize the usual separator for | ||
| 328 | pages. | ||
| 329 | |||
| 330 | @node Pages | ||
| 331 | @section Pages | ||
| 332 | |||
| 333 | @cindex pages | ||
| 334 | @cindex formfeed | ||
| 335 | Files are often thought of as divided into @dfn{pages} by the | ||
| 336 | @dfn{formfeed} character (@acronym{ASCII} control-L, octal code 014). | ||
| 337 | When you print hardcopy for a file, this character forces a page break; | ||
| 338 | thus, each page of the file goes on a separate page on paper. Most Emacs | ||
| 339 | commands treat the page-separator character just like any other | ||
| 340 | character: you can insert it with @kbd{C-q C-l}, and delete it with | ||
| 341 | @key{DEL}. Thus, you are free to paginate your file or not. However, | ||
| 342 | since pages are often meaningful divisions of the file, Emacs provides | ||
| 343 | commands to move over them and operate on them. | ||
| 344 | |||
| 345 | @table @kbd | ||
| 346 | @item C-x [ | ||
| 347 | Move point to previous page boundary (@code{backward-page}). | ||
| 348 | @item C-x ] | ||
| 349 | Move point to next page boundary (@code{forward-page}). | ||
| 350 | @item C-x C-p | ||
| 351 | Put point and mark around this page (or another page) (@code{mark-page}). | ||
| 352 | @item C-x l | ||
| 353 | Count the lines in this page (@code{count-lines-page}). | ||
| 354 | @end table | ||
| 355 | |||
| 356 | @kindex C-x [ | ||
| 357 | @kindex C-x ] | ||
| 358 | @findex forward-page | ||
| 359 | @findex backward-page | ||
| 360 | The @kbd{C-x [} (@code{backward-page}) command moves point to immediately | ||
| 361 | after the previous page delimiter. If point is already right after a page | ||
| 362 | delimiter, it skips that one and stops at the previous one. A numeric | ||
| 363 | argument serves as a repeat count. The @kbd{C-x ]} (@code{forward-page}) | ||
| 364 | command moves forward past the next page delimiter. | ||
| 365 | |||
| 366 | @kindex C-x C-p | ||
| 367 | @findex mark-page | ||
| 368 | The @kbd{C-x C-p} command (@code{mark-page}) puts point at the | ||
| 369 | beginning of the current page and the mark at the end. The page | ||
| 370 | delimiter at the end is included (the mark follows it). The page | ||
| 371 | delimiter at the front is excluded (point follows it). In Transient | ||
| 372 | Mark mode, this command activates the mark. | ||
| 373 | |||
| 374 | @kbd{C-x C-p C-w} is a handy way to kill a page to move it | ||
| 375 | elsewhere. If you move to another page delimiter with @kbd{C-x [} and | ||
| 376 | @kbd{C-x ]}, then yank the killed page, all the pages will be properly | ||
| 377 | delimited once again. The reason @kbd{C-x C-p} includes only the | ||
| 378 | following page delimiter in the region is to ensure that. | ||
| 379 | |||
| 380 | A numeric argument to @kbd{C-x C-p} is used to specify which page to go | ||
| 381 | to, relative to the current one. Zero means the current page. One means | ||
| 382 | the next page, and @minus{}1 means the previous one. | ||
| 383 | |||
| 384 | @kindex C-x l | ||
| 385 | @findex count-lines-page | ||
| 386 | The @kbd{C-x l} command (@code{count-lines-page}) is good for deciding | ||
| 387 | where to break a page in two. It displays in the echo area the total number | ||
| 388 | of lines in the current page, and then divides it up into those preceding | ||
| 389 | the current line and those following, as in | ||
| 390 | |||
| 391 | @example | ||
| 392 | Page has 96 (72+25) lines | ||
| 393 | @end example | ||
| 394 | |||
| 395 | @noindent | ||
| 396 | Notice that the sum is off by one; this is correct if point is not at the | ||
| 397 | beginning of a line. | ||
| 398 | |||
| 399 | @vindex page-delimiter | ||
| 400 | The variable @code{page-delimiter} controls where pages begin. Its | ||
| 401 | value is a regexp that matches the beginning of a line that separates | ||
| 402 | pages. The normal value of this variable is @code{"^\f"}, which | ||
| 403 | matches a formfeed character at the beginning of a line. | ||
| 404 | |||
| 405 | @node Filling | ||
| 406 | @section Filling Text | ||
| 407 | @cindex filling text | ||
| 408 | |||
| 409 | @dfn{Filling} text means breaking it up into lines that fit a | ||
| 410 | specified width. Emacs does filling in two ways. In Auto Fill mode, | ||
| 411 | inserting text with self-inserting characters also automatically fills | ||
| 412 | it. There are also explicit fill commands that you can use when editing | ||
| 413 | text leaves it unfilled. When you edit formatted text, you can specify | ||
| 414 | a style of filling for each portion of the text (@pxref{Formatted | ||
| 415 | Text}). | ||
| 416 | |||
| 417 | @menu | ||
| 418 | * Auto Fill:: Auto Fill mode breaks long lines automatically. | ||
| 419 | * Fill Commands:: Commands to refill paragraphs and center lines. | ||
| 420 | * Fill Prefix:: Filling paragraphs that are indented | ||
| 421 | or in a comment, etc. | ||
| 422 | * Adaptive Fill:: How Emacs can determine the fill prefix automatically. | ||
| 423 | * Refill:: Keeping paragraphs filled. | ||
| 424 | * Longlines:: Editing text with very long lines. | ||
| 425 | @end menu | ||
| 426 | |||
| 427 | @node Auto Fill | ||
| 428 | @subsection Auto Fill Mode | ||
| 429 | @cindex Auto Fill mode | ||
| 430 | @cindex mode, Auto Fill | ||
| 431 | |||
| 432 | @dfn{Auto Fill} mode is a minor mode in which lines are broken | ||
| 433 | automatically when they become too wide. Breaking happens only when | ||
| 434 | you type a @key{SPC} or @key{RET}. | ||
| 435 | |||
| 436 | @table @kbd | ||
| 437 | @item M-x auto-fill-mode | ||
| 438 | Enable or disable Auto Fill mode. | ||
| 439 | @item @key{SPC} | ||
| 440 | @itemx @key{RET} | ||
| 441 | In Auto Fill mode, break lines when appropriate. | ||
| 442 | @end table | ||
| 443 | |||
| 444 | @findex auto-fill-mode | ||
| 445 | @kbd{M-x auto-fill-mode} turns Auto Fill mode on if it was off, or off | ||
| 446 | if it was on. With a positive numeric argument it always turns Auto | ||
| 447 | Fill mode on, and with a negative argument always turns it off. You can | ||
| 448 | see when Auto Fill mode is in effect by the presence of the word | ||
| 449 | @samp{Fill} in the mode line, inside the parentheses. Auto Fill mode is | ||
| 450 | a minor mode which is enabled or disabled for each buffer individually. | ||
| 451 | @xref{Minor Modes}. | ||
| 452 | |||
| 453 | In Auto Fill mode, lines are broken automatically at spaces when they | ||
| 454 | get longer than the desired width. Line breaking and rearrangement | ||
| 455 | takes place only when you type @key{SPC} or @key{RET}. If you wish to | ||
| 456 | insert a space or newline without permitting line-breaking, type | ||
| 457 | @kbd{C-q @key{SPC}} or @kbd{C-q C-j} (recall that a newline is really a | ||
| 458 | control-J). Also, @kbd{C-o} inserts a newline without line breaking. | ||
| 459 | |||
| 460 | Auto Fill mode works well with programming-language modes, because it | ||
| 461 | indents new lines with @key{TAB}. If a line ending in a comment gets | ||
| 462 | too long, the text of the comment is split into two comment lines. | ||
| 463 | Optionally, new comment delimiters are inserted at the end of the first | ||
| 464 | line and the beginning of the second so that each line is a separate | ||
| 465 | comment; the variable @code{comment-multi-line} controls the choice | ||
| 466 | (@pxref{Comments}). | ||
| 467 | |||
| 468 | Adaptive filling (@pxref{Adaptive Fill}) works for Auto Filling as | ||
| 469 | well as for explicit fill commands. It takes a fill prefix | ||
| 470 | automatically from the second or first line of a paragraph. | ||
| 471 | |||
| 472 | Auto Fill mode does not refill entire paragraphs; it can break lines but | ||
| 473 | cannot merge lines. So editing in the middle of a paragraph can result in | ||
| 474 | a paragraph that is not correctly filled. The easiest way to make the | ||
| 475 | paragraph properly filled again is usually with the explicit fill commands. | ||
| 476 | @ifnottex | ||
| 477 | @xref{Fill Commands}. | ||
| 478 | @end ifnottex | ||
| 479 | |||
| 480 | Many users like Auto Fill mode and want to use it in all text files. | ||
| 481 | The section on init files says how to arrange this permanently for yourself. | ||
| 482 | @xref{Init File}. | ||
| 483 | |||
| 484 | @node Fill Commands | ||
| 485 | @subsection Explicit Fill Commands | ||
| 486 | |||
| 487 | @table @kbd | ||
| 488 | @item M-q | ||
| 489 | Fill current paragraph (@code{fill-paragraph}). | ||
| 490 | @item C-x f | ||
| 491 | Set the fill column (@code{set-fill-column}). | ||
| 492 | @item M-x fill-region | ||
| 493 | Fill each paragraph in the region (@code{fill-region}). | ||
| 494 | @item M-x fill-region-as-paragraph | ||
| 495 | Fill the region, considering it as one paragraph. | ||
| 496 | @item M-s | ||
| 497 | Center a line. | ||
| 498 | @end table | ||
| 499 | |||
| 500 | @kindex M-q | ||
| 501 | @findex fill-paragraph | ||
| 502 | To refill a paragraph, use the command @kbd{M-q} | ||
| 503 | (@code{fill-paragraph}). This operates on the paragraph that point is | ||
| 504 | inside, or the one after point if point is between paragraphs. | ||
| 505 | Refilling works by removing all the line-breaks, then inserting new ones | ||
| 506 | where necessary. | ||
| 507 | |||
| 508 | @findex fill-region | ||
| 509 | To refill many paragraphs, use @kbd{M-x fill-region}, which | ||
| 510 | finds the paragraphs in the region and fills each of them. | ||
| 511 | |||
| 512 | @findex fill-region-as-paragraph | ||
| 513 | @kbd{M-q} and @code{fill-region} use the same criteria as @kbd{M-h} | ||
| 514 | for finding paragraph boundaries (@pxref{Paragraphs}). For more | ||
| 515 | control, you can use @kbd{M-x fill-region-as-paragraph}, which refills | ||
| 516 | everything between point and mark as a single paragraph. This command | ||
| 517 | deletes any blank lines within the region, so separate blocks of text | ||
| 518 | end up combined into one block. | ||
| 519 | |||
| 520 | @cindex justification | ||
| 521 | A numeric argument to @kbd{M-q} tells it to @dfn{justify} the text | ||
| 522 | as well as filling it. This means that extra spaces are inserted to | ||
| 523 | make the right margin line up exactly at the fill column. To remove | ||
| 524 | the extra spaces, use @kbd{M-q} with no argument. (Likewise for | ||
| 525 | @code{fill-region}.) Another way to control justification, and choose | ||
| 526 | other styles of filling, is with the @code{justification} text | ||
| 527 | property; see @ref{Format Justification}. | ||
| 528 | |||
| 529 | @kindex M-s @r{(Text mode)} | ||
| 530 | @cindex centering | ||
| 531 | @findex center-line | ||
| 532 | The command @kbd{M-s} (@code{center-line}) centers the current line | ||
| 533 | within the current fill column. With an argument @var{n}, it centers | ||
| 534 | @var{n} lines individually and moves past them. This binding is | ||
| 535 | made by Text mode and is available only in that and related modes | ||
| 536 | (@pxref{Text Mode}). | ||
| 537 | |||
| 538 | @vindex fill-column | ||
| 539 | @kindex C-x f | ||
| 540 | @findex set-fill-column | ||
| 541 | The maximum line width for filling is in the variable | ||
| 542 | @code{fill-column}. Altering the value of @code{fill-column} makes it | ||
| 543 | local to the current buffer; until that time, the default value is in | ||
| 544 | effect. The default is initially 70. @xref{Locals}. The easiest way | ||
| 545 | to set @code{fill-column} is to use the command @kbd{C-x f} | ||
| 546 | (@code{set-fill-column}). With a numeric argument, it uses that as the | ||
| 547 | new fill column. With just @kbd{C-u} as argument, it sets | ||
| 548 | @code{fill-column} to the current horizontal position of point. | ||
| 549 | |||
| 550 | Emacs commands normally consider a period followed by two spaces or by | ||
| 551 | a newline as the end of a sentence; a period followed by just one space | ||
| 552 | indicates an abbreviation and not the end of a sentence. To preserve | ||
| 553 | the distinction between these two ways of using a period, the fill | ||
| 554 | commands do not break a line after a period followed by just one space. | ||
| 555 | |||
| 556 | If the variable @code{sentence-end-double-space} is @code{nil}, the | ||
| 557 | fill commands expect and leave just one space at the end of a sentence. | ||
| 558 | Ordinarily this variable is @code{t}, so the fill commands insist on | ||
| 559 | two spaces for the end of a sentence, as explained above. @xref{Sentences}. | ||
| 560 | |||
| 561 | @vindex colon-double-space | ||
| 562 | If the variable @code{colon-double-space} is non-@code{nil}, the | ||
| 563 | fill commands put two spaces after a colon. | ||
| 564 | |||
| 565 | @vindex fill-nobreak-predicate | ||
| 566 | The variable @code{fill-nobreak-predicate} is a hook (an abnormal | ||
| 567 | hook, @pxref{Hooks}) specifying additional conditions where | ||
| 568 | line-breaking is not allowed. Each function is called with no | ||
| 569 | arguments, with point at a place where Emacs is considering breaking | ||
| 570 | the line. If a function returns a non-@code{nil} value, then that's | ||
| 571 | a bad place to break the line. Two standard functions you can use are | ||
| 572 | @code{fill-single-word-nobreak-p} (don't break after the first word of | ||
| 573 | a sentence or before the last) and @code{fill-french-nobreak-p} (don't | ||
| 574 | break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}). | ||
| 575 | |||
| 576 | @node Fill Prefix | ||
| 577 | @subsection The Fill Prefix | ||
| 578 | |||
| 579 | @cindex fill prefix | ||
| 580 | To fill a paragraph in which each line starts with a special marker | ||
| 581 | (which might be a few spaces, giving an indented paragraph), you can use | ||
| 582 | the @dfn{fill prefix} feature. The fill prefix is a string that Emacs | ||
| 583 | expects every line to start with, and which is not included in filling. | ||
| 584 | You can specify a fill prefix explicitly; Emacs can also deduce the | ||
| 585 | fill prefix automatically (@pxref{Adaptive Fill}). | ||
| 586 | |||
| 587 | @table @kbd | ||
| 588 | @item C-x . | ||
| 589 | Set the fill prefix (@code{set-fill-prefix}). | ||
| 590 | @item M-q | ||
| 591 | Fill a paragraph using current fill prefix (@code{fill-paragraph}). | ||
| 592 | @item M-x fill-individual-paragraphs | ||
| 593 | Fill the region, considering each change of indentation as starting a | ||
| 594 | new paragraph. | ||
| 595 | @item M-x fill-nonuniform-paragraphs | ||
| 596 | Fill the region, considering only paragraph-separator lines as starting | ||
| 597 | a new paragraph. | ||
| 598 | @end table | ||
| 599 | |||
| 600 | @kindex C-x . | ||
| 601 | @findex set-fill-prefix | ||
| 602 | To specify a fill prefix for the current buffer, move to a line that | ||
| 603 | starts with the desired prefix, put point at the end of the prefix, | ||
| 604 | and type @w{@kbd{C-x .}}@: (@code{set-fill-prefix}). (That's a period | ||
| 605 | after the @kbd{C-x}.) To turn off the fill prefix, specify an empty | ||
| 606 | prefix: type @w{@kbd{C-x .}}@: with point at the beginning of a line. | ||
| 607 | |||
| 608 | When a fill prefix is in effect, the fill commands remove the fill | ||
| 609 | prefix from each line of the paragraph before filling and insert it on | ||
| 610 | each line after filling. (The beginning of the first line of the | ||
| 611 | paragraph is left unchanged, since often that is intentionally | ||
| 612 | different.) Auto Fill mode also inserts the fill prefix automatically | ||
| 613 | when it makes a new line. The @kbd{C-o} command inserts the fill | ||
| 614 | prefix on new lines it creates, when you use it at the beginning of a | ||
| 615 | line (@pxref{Blank Lines}). Conversely, the command @kbd{M-^} deletes | ||
| 616 | the prefix (if it occurs) after the newline that it deletes | ||
| 617 | (@pxref{Indentation}). | ||
| 618 | |||
| 619 | For example, if @code{fill-column} is 40 and you set the fill prefix | ||
| 620 | to @samp{;; }, then @kbd{M-q} in the following text | ||
| 621 | |||
| 622 | @example | ||
| 623 | ;; This is an | ||
| 624 | ;; example of a paragraph | ||
| 625 | ;; inside a Lisp-style comment. | ||
| 626 | @end example | ||
| 627 | |||
| 628 | @noindent | ||
| 629 | produces this: | ||
| 630 | |||
| 631 | @example | ||
| 632 | ;; This is an example of a paragraph | ||
| 633 | ;; inside a Lisp-style comment. | ||
| 634 | @end example | ||
| 635 | |||
| 636 | Lines that do not start with the fill prefix are considered to start | ||
| 637 | paragraphs, both in @kbd{M-q} and the paragraph commands; this gives | ||
| 638 | good results for paragraphs with hanging indentation (every line | ||
| 639 | indented except the first one). Lines which are blank or indented once | ||
| 640 | the prefix is removed also separate or start paragraphs; this is what | ||
| 641 | you want if you are writing multi-paragraph comments with a comment | ||
| 642 | delimiter on each line. | ||
| 643 | |||
| 644 | @findex fill-individual-paragraphs | ||
| 645 | You can use @kbd{M-x fill-individual-paragraphs} to set the fill | ||
| 646 | prefix for each paragraph automatically. This command divides the | ||
| 647 | region into paragraphs, treating every change in the amount of | ||
| 648 | indentation as the start of a new paragraph, and fills each of these | ||
| 649 | paragraphs. Thus, all the lines in one ``paragraph'' have the same | ||
| 650 | amount of indentation. That indentation serves as the fill prefix for | ||
| 651 | that paragraph. | ||
| 652 | |||
| 653 | @findex fill-nonuniform-paragraphs | ||
| 654 | @kbd{M-x fill-nonuniform-paragraphs} is a similar command that divides | ||
| 655 | the region into paragraphs in a different way. It considers only | ||
| 656 | paragraph-separating lines (as defined by @code{paragraph-separate}) as | ||
| 657 | starting a new paragraph. Since this means that the lines of one | ||
| 658 | paragraph may have different amounts of indentation, the fill prefix | ||
| 659 | used is the smallest amount of indentation of any of the lines of the | ||
| 660 | paragraph. This gives good results with styles that indent a paragraph's | ||
| 661 | first line more or less that the rest of the paragraph. | ||
| 662 | |||
| 663 | @vindex fill-prefix | ||
| 664 | The fill prefix is stored in the variable @code{fill-prefix}. Its value | ||
| 665 | is a string, or @code{nil} when there is no fill prefix. This is a | ||
| 666 | per-buffer variable; altering the variable affects only the current buffer, | ||
| 667 | but there is a default value which you can change as well. @xref{Locals}. | ||
| 668 | |||
| 669 | The @code{indentation} text property provides another way to control | ||
| 670 | the amount of indentation paragraphs receive. @xref{Format Indentation}. | ||
| 671 | |||
| 672 | @node Adaptive Fill | ||
| 673 | @subsection Adaptive Filling | ||
| 674 | |||
| 675 | @cindex adaptive filling | ||
| 676 | The fill commands can deduce the proper fill prefix for a paragraph | ||
| 677 | automatically in certain cases: either whitespace or certain punctuation | ||
| 678 | characters at the beginning of a line are propagated to all lines of the | ||
| 679 | paragraph. | ||
| 680 | |||
| 681 | If the paragraph has two or more lines, the fill prefix is taken from | ||
| 682 | the paragraph's second line, but only if it appears on the first line as | ||
| 683 | well. | ||
| 684 | |||
| 685 | If a paragraph has just one line, fill commands @emph{may} take a | ||
| 686 | prefix from that line. The decision is complicated because there are | ||
| 687 | three reasonable things to do in such a case: | ||
| 688 | |||
| 689 | @itemize @bullet | ||
| 690 | @item | ||
| 691 | Use the first line's prefix on all the lines of the paragraph. | ||
| 692 | |||
| 693 | @item | ||
| 694 | Indent subsequent lines with whitespace, so that they line up under the | ||
| 695 | text that follows the prefix on the first line, but don't actually copy | ||
| 696 | the prefix from the first line. | ||
| 697 | |||
| 698 | @item | ||
| 699 | Don't do anything special with the second and following lines. | ||
| 700 | @end itemize | ||
| 701 | |||
| 702 | All three of these styles of formatting are commonly used. So the | ||
| 703 | fill commands try to determine what you would like, based on the prefix | ||
| 704 | that appears and on the major mode. Here is how. | ||
| 705 | |||
| 706 | @vindex adaptive-fill-first-line-regexp | ||
| 707 | If the prefix found on the first line matches | ||
| 708 | @code{adaptive-fill-first-line-regexp}, or if it appears to be a | ||
| 709 | comment-starting sequence (this depends on the major mode), then the | ||
| 710 | prefix found is used for filling the paragraph, provided it would not | ||
| 711 | act as a paragraph starter on subsequent lines. | ||
| 712 | |||
| 713 | Otherwise, the prefix found is converted to an equivalent number of | ||
| 714 | spaces, and those spaces are used as the fill prefix for the rest of the | ||
| 715 | lines, provided they would not act as a paragraph starter on subsequent | ||
| 716 | lines. | ||
| 717 | |||
| 718 | In Text mode, and other modes where only blank lines and page | ||
| 719 | delimiters separate paragraphs, the prefix chosen by adaptive filling | ||
| 720 | never acts as a paragraph starter, so it can always be used for filling. | ||
| 721 | |||
| 722 | @vindex adaptive-fill-mode | ||
| 723 | @vindex adaptive-fill-regexp | ||
| 724 | The variable @code{adaptive-fill-regexp} determines what kinds of line | ||
| 725 | beginnings can serve as a fill prefix: any characters at the start of | ||
| 726 | the line that match this regular expression are used. If you set the | ||
| 727 | variable @code{adaptive-fill-mode} to @code{nil}, the fill prefix is | ||
| 728 | never chosen automatically. | ||
| 729 | |||
| 730 | @vindex adaptive-fill-function | ||
| 731 | You can specify more complex ways of choosing a fill prefix | ||
| 732 | automatically by setting the variable @code{adaptive-fill-function} to a | ||
| 733 | function. This function is called with point after the left margin of a | ||
| 734 | line, and it should return the appropriate fill prefix based on that | ||
| 735 | line. If it returns @code{nil}, @code{adaptive-fill-regexp} gets | ||
| 736 | a chance to find a prefix. | ||
| 737 | |||
| 738 | @node Refill | ||
| 739 | @subsection Refill Mode | ||
| 740 | @cindex refilling text, word processor style | ||
| 741 | @cindex modes, Refill | ||
| 742 | @cindex Refill minor mode | ||
| 743 | |||
| 744 | Refill minor mode provides support for keeping paragraphs filled as | ||
| 745 | you type or modify them in other ways. It provides an effect similar | ||
| 746 | to typical word processor behavior. This works by running a | ||
| 747 | paragraph-filling command at suitable times. | ||
| 748 | |||
| 749 | To toggle the use of Refill mode in the current buffer, type | ||
| 750 | @kbd{M-x refill-mode}. When you are typing text, only characters | ||
| 751 | which normally trigger auto filling, like the space character, will | ||
| 752 | trigger refilling. This is to avoid making it too slow. Apart from | ||
| 753 | self-inserting characters, other commands which modify the text cause | ||
| 754 | refilling. | ||
| 755 | |||
| 756 | The current implementation is preliminary and not robust. You can | ||
| 757 | get better ``line wrapping'' behavior using Longlines mode. | ||
| 758 | @xref{Longlines}. However, Longlines mode has an important | ||
| 759 | side-effect: the newlines that it inserts for you are not saved to | ||
| 760 | disk, so the files that you make with Longlines mode will appear to be | ||
| 761 | completely unfilled if you edit them without Longlines mode. | ||
| 762 | |||
| 763 | @node Longlines | ||
| 764 | @subsection Long Lines Mode | ||
| 765 | @cindex refilling text, word processor style | ||
| 766 | @cindex modes, Long Lines | ||
| 767 | @cindex word wrap | ||
| 768 | @cindex Long Lines minor mode | ||
| 769 | |||
| 770 | Long Lines mode is a minor mode for @dfn{word wrapping}; it lets you | ||
| 771 | edit ``unfilled'' text files, which Emacs would normally display as a | ||
| 772 | bunch of extremely long lines. Many text editors, such as those built | ||
| 773 | into many web browsers, normally do word wrapping. | ||
| 774 | |||
| 775 | @findex longlines-mode | ||
| 776 | To enable Long Lines mode, type @kbd{M-x longlines-mode}. If the | ||
| 777 | text is full of long lines, this will ``wrap'' them | ||
| 778 | immediately---i.e., break up to fit in the window. As you edit the | ||
| 779 | text, Long Lines mode automatically re-wraps lines by inserting or | ||
| 780 | deleting @dfn{soft newlines} as necessary (@pxref{Hard and Soft | ||
| 781 | Newlines}.) These soft newlines won't show up when you save the | ||
| 782 | buffer into a file, or when you copy the text into the kill ring, | ||
| 783 | clipboard, or a register. | ||
| 784 | |||
| 785 | @findex longlines-auto-wrap | ||
| 786 | Word wrapping is @emph{not} the same as ordinary filling | ||
| 787 | (@pxref{Fill Commands}). It does not contract multiple spaces into a | ||
| 788 | single space, recognize fill prefixes (@pxref{Fill Prefix}), or | ||
| 789 | perform adaptive filling (@pxref{Adaptive Fill}). The reason for this | ||
| 790 | is that a wrapped line is still, conceptually, a single line. Each | ||
| 791 | soft newline is equivalent to exactly one space in that long line, and | ||
| 792 | vice versa. However, you can still call filling functions such as | ||
| 793 | @kbd{M-q}, and these will work as expected, inserting soft newlines | ||
| 794 | that won't show up on disk or when the text is copied. You can even | ||
| 795 | rely entirely on the normal fill commands by turning off automatic | ||
| 796 | line wrapping, with @kbd{C-u M-x longlines-auto-wrap}. To turn | ||
| 797 | automatic line wrapping back on, type @kbd{M-x longlines-auto-wrap}. | ||
| 798 | |||
| 799 | @findex longlines-show-hard-newlines | ||
| 800 | Type @kbd{RET} to insert a hard newline, one which automatic | ||
| 801 | refilling will not remove. If you want to see where all the hard | ||
| 802 | newlines are, type @kbd{M-x longlines-show-hard-newlines}. This will | ||
| 803 | mark each hard newline with a special symbol. The same command with a | ||
| 804 | prefix argument turns this display off. | ||
| 805 | |||
| 806 | Long Lines mode does not change normal text files that are already | ||
| 807 | filled, since the existing newlines are considered hard newlines. | ||
| 808 | Before Long Lines can do anything, you need to transform each | ||
| 809 | paragraph into a long line. One way is to set @code{fill-column} to a | ||
| 810 | large number (e.g., @kbd{C-u 9999 C-x f}), re-fill all the paragraphs, | ||
| 811 | and then set @code{fill-column} back to its original value. | ||
| 812 | |||
| 813 | @node Case | ||
| 814 | @section Case Conversion Commands | ||
| 815 | @cindex case conversion | ||
| 816 | |||
| 817 | Emacs has commands for converting either a single word or any arbitrary | ||
| 818 | range of text to upper case or to lower case. | ||
| 819 | |||
| 820 | @table @kbd | ||
| 821 | @item M-l | ||
| 822 | Convert following word to lower case (@code{downcase-word}). | ||
| 823 | @item M-u | ||
| 824 | Convert following word to upper case (@code{upcase-word}). | ||
| 825 | @item M-c | ||
| 826 | Capitalize the following word (@code{capitalize-word}). | ||
| 827 | @item C-x C-l | ||
| 828 | Convert region to lower case (@code{downcase-region}). | ||
| 829 | @item C-x C-u | ||
| 830 | Convert region to upper case (@code{upcase-region}). | ||
| 831 | @end table | ||
| 832 | |||
| 833 | @kindex M-l | ||
| 834 | @kindex M-u | ||
| 835 | @kindex M-c | ||
| 836 | @cindex words, case conversion | ||
| 837 | @cindex converting text to upper or lower case | ||
| 838 | @cindex capitalizing words | ||
| 839 | @findex downcase-word | ||
| 840 | @findex upcase-word | ||
| 841 | @findex capitalize-word | ||
| 842 | The word conversion commands are the most useful. @kbd{M-l} | ||
| 843 | (@code{downcase-word}) converts the word after point to lower case, moving | ||
| 844 | past it. Thus, repeating @kbd{M-l} converts successive words. | ||
| 845 | @kbd{M-u} (@code{upcase-word}) converts to all capitals instead, while | ||
| 846 | @kbd{M-c} (@code{capitalize-word}) puts the first letter of the word | ||
| 847 | into upper case and the rest into lower case. All these commands convert | ||
| 848 | several words at once if given an argument. They are especially convenient | ||
| 849 | for converting a large amount of text from all upper case to mixed case, | ||
| 850 | because you can move through the text using @kbd{M-l}, @kbd{M-u} or | ||
| 851 | @kbd{M-c} on each word as appropriate, occasionally using @kbd{M-f} instead | ||
| 852 | to skip a word. | ||
| 853 | |||
| 854 | When given a negative argument, the word case conversion commands apply | ||
| 855 | to the appropriate number of words before point, but do not move point. | ||
| 856 | This is convenient when you have just typed a word in the wrong case: you | ||
| 857 | can give the case conversion command and continue typing. | ||
| 858 | |||
| 859 | If a word case conversion command is given in the middle of a word, | ||
| 860 | it applies only to the part of the word which follows point. (This is | ||
| 861 | comparable to what @kbd{M-d} (@code{kill-word}) does.) With a | ||
| 862 | negative argument, case conversion applies only to the part of the | ||
| 863 | word before point. | ||
| 864 | |||
| 865 | @kindex C-x C-l | ||
| 866 | @kindex C-x C-u | ||
| 867 | @findex downcase-region | ||
| 868 | @findex upcase-region | ||
| 869 | The other case conversion commands are @kbd{C-x C-u} | ||
| 870 | (@code{upcase-region}) and @kbd{C-x C-l} (@code{downcase-region}), which | ||
| 871 | convert everything between point and mark to the specified case. Point and | ||
| 872 | mark do not move. | ||
| 873 | |||
| 874 | The region case conversion commands @code{upcase-region} and | ||
| 875 | @code{downcase-region} are normally disabled. This means that they ask | ||
| 876 | for confirmation if you try to use them. When you confirm, you may | ||
| 877 | enable the command, which means it will not ask for confirmation again. | ||
| 878 | @xref{Disabling}. | ||
| 879 | |||
| 880 | @node Text Mode | ||
| 881 | @section Text Mode | ||
| 882 | @cindex Text mode | ||
| 883 | @cindex mode, Text | ||
| 884 | @findex text-mode | ||
| 885 | |||
| 886 | When you edit files of text in a human language, it's more convenient | ||
| 887 | to use Text mode rather than Fundamental mode. To enter Text mode, type | ||
| 888 | @kbd{M-x text-mode}. | ||
| 889 | |||
| 890 | In Text mode, only blank lines and page delimiters separate | ||
| 891 | paragraphs. As a result, paragraphs can be indented, and adaptive | ||
| 892 | filling determines what indentation to use when filling a paragraph. | ||
| 893 | @xref{Adaptive Fill}. | ||
| 894 | |||
| 895 | @kindex TAB @r{(Text mode)} | ||
| 896 | Text mode defines @key{TAB} to run @code{indent-relative} | ||
| 897 | (@pxref{Indentation}), so that you can conveniently indent a line like | ||
| 898 | the previous line. | ||
| 899 | |||
| 900 | Text mode turns off the features concerned with comments except when | ||
| 901 | you explicitly invoke them. It changes the syntax table so that | ||
| 902 | single-quotes are considered part of words. However, if a word starts | ||
| 903 | with single-quotes, these are treated as a prefix for purposes such as | ||
| 904 | capitalization. That is, @kbd{M-c} will convert @samp{'hello'} into | ||
| 905 | @samp{'Hello'}, as expected. | ||
| 906 | |||
| 907 | @cindex Paragraph-Indent Text mode | ||
| 908 | @cindex mode, Paragraph-Indent Text | ||
| 909 | @findex paragraph-indent-text-mode | ||
| 910 | @findex paragraph-indent-minor-mode | ||
| 911 | If you indent the first lines of paragraphs, then you should use | ||
| 912 | Paragraph-Indent Text mode rather than Text mode. In this mode, you | ||
| 913 | do not need to have blank lines between paragraphs, because the | ||
| 914 | first-line indentation is sufficient to start a paragraph; however | ||
| 915 | paragraphs in which every line is indented are not supported. Use | ||
| 916 | @kbd{M-x paragraph-indent-text-mode} to enter this mode. Use @kbd{M-x | ||
| 917 | paragraph-indent-minor-mode} to enable an equivalent minor mode in | ||
| 918 | situations where you can't change the major mode---in mail | ||
| 919 | composition, for instance. | ||
| 920 | |||
| 921 | @kindex M-TAB @r{(Text mode)} | ||
| 922 | Text mode, and all the modes based on it, define @kbd{M-@key{TAB}} | ||
| 923 | as the command @code{ispell-complete-word}, which performs completion | ||
| 924 | of the partial word in the buffer before point, using the spelling | ||
| 925 | dictionary as the space of possible words. @xref{Spelling}. If your | ||
| 926 | window manager defines @kbd{M-@key{TAB}} to switch windows, you can | ||
| 927 | type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}. | ||
| 928 | |||
| 929 | @vindex text-mode-hook | ||
| 930 | Entering Text mode runs the hook @code{text-mode-hook}. Other major | ||
| 931 | modes related to Text mode also run this hook, followed by hooks of | ||
| 932 | their own; this includes Paragraph-Indent Text mode, Nroff mode, @TeX{} | ||
| 933 | mode, Outline mode, and Mail mode. Hook functions on | ||
| 934 | @code{text-mode-hook} can look at the value of @code{major-mode} to see | ||
| 935 | which of these modes is actually being entered. @xref{Hooks}. | ||
| 936 | |||
| 937 | @ifnottex | ||
| 938 | Emacs provides two other modes for editing text that is to be passed | ||
| 939 | through a text formatter to produce fancy formatted printed output. | ||
| 940 | @xref{Nroff Mode}, for editing input to the formatter nroff. | ||
| 941 | @xref{TeX Mode,,@TeX{} Mode}, for editing input to the formatter TeX. | ||
| 942 | |||
| 943 | Another mode is used for editing outlines. It allows you to view the | ||
| 944 | text at various levels of detail. You can view either the outline | ||
| 945 | headings alone or both headings and text; you can also hide some of the | ||
| 946 | headings at lower levels from view to make the high level structure more | ||
| 947 | visible. @xref{Outline Mode}. | ||
| 948 | @end ifnottex | ||
| 949 | |||
| 950 | @node Outline Mode | ||
| 951 | @section Outline Mode | ||
| 952 | @cindex Outline mode | ||
| 953 | @cindex mode, Outline | ||
| 954 | @cindex invisible lines | ||
| 955 | |||
| 956 | @findex outline-mode | ||
| 957 | @findex outline-minor-mode | ||
| 958 | @vindex outline-minor-mode-prefix | ||
| 959 | Outline mode is a major mode much like Text mode but intended for | ||
| 960 | editing outlines. It allows you to make parts of the text temporarily | ||
| 961 | invisible so that you can see the outline structure. Type @kbd{M-x | ||
| 962 | outline-mode} to switch to Outline mode as the major mode of the current | ||
| 963 | buffer. | ||
| 964 | |||
| 965 | When Outline mode makes a line invisible, the line does not appear | ||
| 966 | on the screen. The screen appears exactly as if the invisible line | ||
| 967 | were deleted, except that an ellipsis (three periods in a row) appears | ||
| 968 | at the end of the previous visible line. (Multiple consecutive | ||
| 969 | invisible lines produce just one ellipsis.) | ||
| 970 | |||
| 971 | Editing commands that operate on lines, such as @kbd{C-n} and | ||
| 972 | @kbd{C-p}, treat the text of the invisible line as part of the previous | ||
| 973 | visible line. Killing the ellipsis at the end of a visible line | ||
| 974 | really kills all the following invisible lines. | ||
| 975 | |||
| 976 | Outline minor mode provides the same commands as the major mode, | ||
| 977 | Outline mode, but you can use it in conjunction with other major modes. | ||
| 978 | Type @kbd{M-x outline-minor-mode} to enable the Outline minor mode in | ||
| 979 | the current buffer. You can also specify this in the text of a file, | ||
| 980 | with a file local variable of the form @samp{mode: outline-minor} | ||
| 981 | (@pxref{File Variables}). | ||
| 982 | |||
| 983 | @kindex C-c @@ @r{(Outline minor mode)} | ||
| 984 | The major mode, Outline mode, provides special key bindings on the | ||
| 985 | @kbd{C-c} prefix. Outline minor mode provides similar bindings with | ||
| 986 | @kbd{C-c @@} as the prefix; this is to reduce the conflicts with the | ||
| 987 | major mode's special commands. (The variable | ||
| 988 | @code{outline-minor-mode-prefix} controls the prefix used.) | ||
| 989 | |||
| 990 | @vindex outline-mode-hook | ||
| 991 | Entering Outline mode runs the hook @code{text-mode-hook} followed by | ||
| 992 | the hook @code{outline-mode-hook} (@pxref{Hooks}). | ||
| 993 | |||
| 994 | @menu | ||
| 995 | * Format: Outline Format. What the text of an outline looks like. | ||
| 996 | * Motion: Outline Motion. Special commands for moving through | ||
| 997 | outlines. | ||
| 998 | * Visibility: Outline Visibility. Commands to control what is visible. | ||
| 999 | * Views: Outline Views. Outlines and multiple views. | ||
| 1000 | * Foldout:: Folding means zooming in on outlines. | ||
| 1001 | @end menu | ||
| 1002 | |||
| 1003 | @node Outline Format | ||
| 1004 | @subsection Format of Outlines | ||
| 1005 | |||
| 1006 | @cindex heading lines (Outline mode) | ||
| 1007 | @cindex body lines (Outline mode) | ||
| 1008 | Outline mode assumes that the lines in the buffer are of two types: | ||
| 1009 | @dfn{heading lines} and @dfn{body lines}. A heading line represents a | ||
| 1010 | topic in the outline. Heading lines start with one or more stars; the | ||
| 1011 | number of stars determines the depth of the heading in the outline | ||
| 1012 | structure. Thus, a heading line with one star is a major topic; all the | ||
| 1013 | heading lines with two stars between it and the next one-star heading | ||
| 1014 | are its subtopics; and so on. Any line that is not a heading line is a | ||
| 1015 | body line. Body lines belong with the preceding heading line. Here is | ||
| 1016 | an example: | ||
| 1017 | |||
| 1018 | @example | ||
| 1019 | * Food | ||
| 1020 | This is the body, | ||
| 1021 | which says something about the topic of food. | ||
| 1022 | |||
| 1023 | ** Delicious Food | ||
| 1024 | This is the body of the second-level header. | ||
| 1025 | |||
| 1026 | ** Distasteful Food | ||
| 1027 | This could have | ||
| 1028 | a body too, with | ||
| 1029 | several lines. | ||
| 1030 | |||
| 1031 | *** Dormitory Food | ||
| 1032 | |||
| 1033 | * Shelter | ||
| 1034 | Another first-level topic with its header line. | ||
| 1035 | @end example | ||
| 1036 | |||
| 1037 | A heading line together with all following body lines is called | ||
| 1038 | collectively an @dfn{entry}. A heading line together with all following | ||
| 1039 | deeper heading lines and their body lines is called a @dfn{subtree}. | ||
| 1040 | |||
| 1041 | @vindex outline-regexp | ||
| 1042 | You can customize the criterion for distinguishing heading lines by | ||
| 1043 | setting the variable @code{outline-regexp}. (The recommended ways to | ||
| 1044 | do this are in a major mode function or with a file local variable.) | ||
| 1045 | Any line whose beginning has a match for this regexp is considered a | ||
| 1046 | heading line. Matches that start within a line (not at the left | ||
| 1047 | margin) do not count. | ||
| 1048 | |||
| 1049 | The length of the matching text determines the level of the heading; | ||
| 1050 | longer matches make a more deeply nested level. Thus, for example, if | ||
| 1051 | a text formatter has commands @samp{@@chapter}, @samp{@@section} and | ||
| 1052 | @samp{@@subsection} to divide the document into chapters and sections, | ||
| 1053 | you could make those lines count as heading lines by setting | ||
| 1054 | @code{outline-regexp} to @samp{"@@chap\\|@@\\(sub\\)*section"}. Note | ||
| 1055 | the trick: the two words @samp{chapter} and @samp{section} are equally | ||
| 1056 | long, but by defining the regexp to match only @samp{chap} we ensure | ||
| 1057 | that the length of the text matched on a chapter heading is shorter, | ||
| 1058 | so that Outline mode will know that sections are contained in | ||
| 1059 | chapters. This works as long as no other command starts with | ||
| 1060 | @samp{@@chap}. | ||
| 1061 | |||
| 1062 | @vindex outline-level | ||
| 1063 | You can explicitly specify a rule for calculating the level of a | ||
| 1064 | heading line by setting the variable @code{outline-level}. The value | ||
| 1065 | of @code{outline-level} should be a function that takes no arguments | ||
| 1066 | and returns the level of the current heading. The recommended ways to | ||
| 1067 | set this variable are in a major mode command or with a file local | ||
| 1068 | variable. | ||
| 1069 | |||
| 1070 | @node Outline Motion | ||
| 1071 | @subsection Outline Motion Commands | ||
| 1072 | |||
| 1073 | Outline mode provides special motion commands that move backward and | ||
| 1074 | forward to heading lines. | ||
| 1075 | |||
| 1076 | @table @kbd | ||
| 1077 | @item C-c C-n | ||
| 1078 | Move point to the next visible heading line | ||
| 1079 | (@code{outline-next-visible-heading}). | ||
| 1080 | @item C-c C-p | ||
| 1081 | Move point to the previous visible heading line | ||
| 1082 | (@code{outline-previous-visible-heading}). | ||
| 1083 | @item C-c C-f | ||
| 1084 | Move point to the next visible heading line at the same level | ||
| 1085 | as the one point is on (@code{outline-forward-same-level}). | ||
| 1086 | @item C-c C-b | ||
| 1087 | Move point to the previous visible heading line at the same level | ||
| 1088 | (@code{outline-backward-same-level}). | ||
| 1089 | @item C-c C-u | ||
| 1090 | Move point up to a lower-level (more inclusive) visible heading line | ||
| 1091 | (@code{outline-up-heading}). | ||
| 1092 | @end table | ||
| 1093 | |||
| 1094 | @findex outline-next-visible-heading | ||
| 1095 | @findex outline-previous-visible-heading | ||
| 1096 | @kindex C-c C-n @r{(Outline mode)} | ||
| 1097 | @kindex C-c C-p @r{(Outline mode)} | ||
| 1098 | @kbd{C-c C-n} (@code{outline-next-visible-heading}) moves down to the next | ||
| 1099 | heading line. @kbd{C-c C-p} (@code{outline-previous-visible-heading}) moves | ||
| 1100 | similarly backward. Both accept numeric arguments as repeat counts. The | ||
| 1101 | names emphasize that invisible headings are skipped, but this is not really | ||
| 1102 | a special feature. All editing commands that look for lines ignore the | ||
| 1103 | invisible lines automatically. | ||
| 1104 | |||
| 1105 | @findex outline-up-heading | ||
| 1106 | @findex outline-forward-same-level | ||
| 1107 | @findex outline-backward-same-level | ||
| 1108 | @kindex C-c C-f @r{(Outline mode)} | ||
| 1109 | @kindex C-c C-b @r{(Outline mode)} | ||
| 1110 | @kindex C-c C-u @r{(Outline mode)} | ||
| 1111 | More powerful motion commands understand the level structure of headings. | ||
| 1112 | @kbd{C-c C-f} (@code{outline-forward-same-level}) and | ||
| 1113 | @kbd{C-c C-b} (@code{outline-backward-same-level}) move from one | ||
| 1114 | heading line to another visible heading at the same depth in | ||
| 1115 | the outline. @kbd{C-c C-u} (@code{outline-up-heading}) moves | ||
| 1116 | backward to another heading that is less deeply nested. | ||
| 1117 | |||
| 1118 | @node Outline Visibility | ||
| 1119 | @subsection Outline Visibility Commands | ||
| 1120 | |||
| 1121 | The other special commands of outline mode are used to make lines visible | ||
| 1122 | or invisible. Their names all start with @code{hide} or @code{show}. | ||
| 1123 | Most of them fall into pairs of opposites. They are not undoable; instead, | ||
| 1124 | you can undo right past them. Making lines visible or invisible is simply | ||
| 1125 | not recorded by the undo mechanism. | ||
| 1126 | |||
| 1127 | Many of these commands act on the ``current'' heading line. If | ||
| 1128 | point is on a heading line, that is the current heading line; if point | ||
| 1129 | is on a body line, the current heading line is the nearest preceding | ||
| 1130 | header line. | ||
| 1131 | |||
| 1132 | @table @kbd | ||
| 1133 | @item C-c C-c | ||
| 1134 | Make the current heading line's body invisible (@code{hide-entry}). | ||
| 1135 | @item C-c C-e | ||
| 1136 | Make the current heading line's body visible (@code{show-entry}). | ||
| 1137 | @item C-c C-d | ||
| 1138 | Make everything under the current heading invisible, not including the | ||
| 1139 | heading itself (@code{hide-subtree}). | ||
| 1140 | @item C-c C-s | ||
| 1141 | Make everything under the current heading visible, including body, | ||
| 1142 | subheadings, and their bodies (@code{show-subtree}). | ||
| 1143 | @item C-c C-l | ||
| 1144 | Make the body of the current heading line, and of all its subheadings, | ||
| 1145 | invisible (@code{hide-leaves}). | ||
| 1146 | @item C-c C-k | ||
| 1147 | Make all subheadings of the current heading line, at all levels, | ||
| 1148 | visible (@code{show-branches}). | ||
| 1149 | @item C-c C-i | ||
| 1150 | Make immediate subheadings (one level down) of the current heading | ||
| 1151 | line visible (@code{show-children}). | ||
| 1152 | @item C-c C-t | ||
| 1153 | Make all body lines in the buffer invisible (@code{hide-body}). | ||
| 1154 | @item C-c C-a | ||
| 1155 | Make all lines in the buffer visible (@code{show-all}). | ||
| 1156 | @item C-c C-q | ||
| 1157 | Hide everything except the top @var{n} levels of heading lines | ||
| 1158 | (@code{hide-sublevels}). | ||
| 1159 | @item C-c C-o | ||
| 1160 | Hide everything except for the heading or body that point is in, plus | ||
| 1161 | the headings leading up from there to the top level of the outline | ||
| 1162 | (@code{hide-other}). | ||
| 1163 | @end table | ||
| 1164 | |||
| 1165 | @findex hide-entry | ||
| 1166 | @findex show-entry | ||
| 1167 | @kindex C-c C-c @r{(Outline mode)} | ||
| 1168 | @kindex C-c C-e @r{(Outline mode)} | ||
| 1169 | Two commands that are exact opposites are @kbd{C-c C-c} | ||
| 1170 | (@code{hide-entry}) and @kbd{C-c C-e} (@code{show-entry}). They apply | ||
| 1171 | to the body lines directly following the current heading line. | ||
| 1172 | Subheadings and their bodies are not affected. | ||
| 1173 | |||
| 1174 | @findex hide-subtree | ||
| 1175 | @findex show-subtree | ||
| 1176 | @kindex C-c C-s @r{(Outline mode)} | ||
| 1177 | @kindex C-c C-d @r{(Outline mode)} | ||
| 1178 | @cindex subtree (Outline mode) | ||
| 1179 | Two more powerful opposites are @kbd{C-c C-d} (@code{hide-subtree}) | ||
| 1180 | and @kbd{C-c C-s} (@code{show-subtree}). Both apply to the current | ||
| 1181 | heading line's @dfn{subtree}: its body, all its subheadings, both | ||
| 1182 | direct and indirect, and all of their bodies. In other words, the | ||
| 1183 | subtree contains everything following the current heading line, up to | ||
| 1184 | and not including the next heading of the same or higher rank. | ||
| 1185 | |||
| 1186 | @findex hide-leaves | ||
| 1187 | @findex show-branches | ||
| 1188 | @kindex C-c C-l @r{(Outline mode)} | ||
| 1189 | @kindex C-c C-k @r{(Outline mode)} | ||
| 1190 | Intermediate between a visible subtree and an invisible one is having | ||
| 1191 | all the subheadings visible but none of the body. There are two | ||
| 1192 | commands for doing this, depending on whether you want to hide the | ||
| 1193 | bodies or make the subheadings visible. They are @kbd{C-c C-l} | ||
| 1194 | (@code{hide-leaves}) and @kbd{C-c C-k} (@code{show-branches}). | ||
| 1195 | |||
| 1196 | @kindex C-c C-i @r{(Outline mode)} | ||
| 1197 | @findex show-children | ||
| 1198 | A little weaker than @code{show-branches} is @kbd{C-c C-i} | ||
| 1199 | (@code{show-children}). It makes just the direct subheadings | ||
| 1200 | visible---those one level down. Deeper subheadings remain invisible, if | ||
| 1201 | they were invisible. | ||
| 1202 | |||
| 1203 | @findex hide-body | ||
| 1204 | @findex show-all | ||
| 1205 | @kindex C-c C-t @r{(Outline mode)} | ||
| 1206 | @kindex C-c C-a @r{(Outline mode)} | ||
| 1207 | Two commands have a blanket effect on the whole file. @kbd{C-c C-t} | ||
| 1208 | (@code{hide-body}) makes all body lines invisible, so that you see just | ||
| 1209 | the outline structure (as a special exception, it will not hide lines | ||
| 1210 | at the top of the file, preceding the first header line, even though | ||
| 1211 | these are technically body lines). @kbd{C-c C-a} (@code{show-all}) | ||
| 1212 | makes all lines visible. These commands can be thought of as a pair | ||
| 1213 | of opposites even though @kbd{C-c C-a} applies to more than just body | ||
| 1214 | lines. | ||
| 1215 | |||
| 1216 | @findex hide-sublevels | ||
| 1217 | @kindex C-c C-q @r{(Outline mode)} | ||
| 1218 | The command @kbd{C-c C-q} (@code{hide-sublevels}) hides all but the | ||
| 1219 | top level headings. With a numeric argument @var{n}, it hides everything | ||
| 1220 | except the top @var{n} levels of heading lines. | ||
| 1221 | |||
| 1222 | @findex hide-other | ||
| 1223 | @kindex C-c C-o @r{(Outline mode)} | ||
| 1224 | The command @kbd{C-c C-o} (@code{hide-other}) hides everything except | ||
| 1225 | the heading and body text that point is in, plus its parents (the headers | ||
| 1226 | leading up from there to top level in the outline) and the top level | ||
| 1227 | headings. | ||
| 1228 | |||
| 1229 | @findex reveal-mode | ||
| 1230 | When incremental search finds text that is hidden by Outline mode, | ||
| 1231 | it makes that part of the buffer visible. If you exit the search | ||
| 1232 | at that position, the text remains visible. You can also | ||
| 1233 | automatically make text visible as you navigate in it by using | ||
| 1234 | @kbd{M-x reveal-mode}. | ||
| 1235 | |||
| 1236 | @node Outline Views | ||
| 1237 | @subsection Viewing One Outline in Multiple Views | ||
| 1238 | |||
| 1239 | @cindex multiple views of outline | ||
| 1240 | @cindex views of an outline | ||
| 1241 | @cindex outline with multiple views | ||
| 1242 | @cindex indirect buffers and outlines | ||
| 1243 | You can display two views of a single outline at the same time, in | ||
| 1244 | different windows. To do this, you must create an indirect buffer using | ||
| 1245 | @kbd{M-x make-indirect-buffer}. The first argument of this command is | ||
| 1246 | the existing outline buffer name, and its second argument is the name to | ||
| 1247 | use for the new indirect buffer. @xref{Indirect Buffers}. | ||
| 1248 | |||
| 1249 | Once the indirect buffer exists, you can display it in a window in the | ||
| 1250 | normal fashion, with @kbd{C-x 4 b} or other Emacs commands. The Outline | ||
| 1251 | mode commands to show and hide parts of the text operate on each buffer | ||
| 1252 | independently; as a result, each buffer can have its own view. If you | ||
| 1253 | want more than two views on the same outline, create additional indirect | ||
| 1254 | buffers. | ||
| 1255 | |||
| 1256 | @node Foldout | ||
| 1257 | @subsection Folding Editing | ||
| 1258 | |||
| 1259 | @cindex folding editing | ||
| 1260 | The Foldout package extends Outline mode and Outline minor mode with | ||
| 1261 | ``folding'' commands. The idea of folding is that you zoom in on a | ||
| 1262 | nested portion of the outline, while hiding its relatives at higher | ||
| 1263 | levels. | ||
| 1264 | |||
| 1265 | Consider an Outline mode buffer with all the text and subheadings under | ||
| 1266 | level-1 headings hidden. To look at what is hidden under one of these | ||
| 1267 | headings, you could use @kbd{C-c C-e} (@kbd{M-x show-entry}) to expose | ||
| 1268 | the body, or @kbd{C-c C-i} to expose the child (level-2) headings. | ||
| 1269 | |||
| 1270 | @kindex C-c C-z | ||
| 1271 | @findex foldout-zoom-subtree | ||
| 1272 | With Foldout, you use @kbd{C-c C-z} (@kbd{M-x foldout-zoom-subtree}). | ||
| 1273 | This exposes the body and child subheadings, and narrows the buffer so | ||
| 1274 | that only the @w{level-1} heading, the body and the level-2 headings are | ||
| 1275 | visible. Now to look under one of the level-2 headings, position the | ||
| 1276 | cursor on it and use @kbd{C-c C-z} again. This exposes the level-2 body | ||
| 1277 | and its level-3 child subheadings and narrows the buffer again. Zooming | ||
| 1278 | in on successive subheadings can be done as much as you like. A string | ||
| 1279 | in the mode line shows how deep you've gone. | ||
| 1280 | |||
| 1281 | When zooming in on a heading, to see only the child subheadings specify | ||
| 1282 | a numeric argument: @kbd{C-u C-c C-z}. The number of levels of children | ||
| 1283 | can be specified too (compare @kbd{M-x show-children}), e.g.@: @kbd{M-2 | ||
| 1284 | C-c C-z} exposes two levels of child subheadings. Alternatively, the | ||
| 1285 | body can be specified with a negative argument: @kbd{M-- C-c C-z}. The | ||
| 1286 | whole subtree can be expanded, similarly to @kbd{C-c C-s} (@kbd{M-x | ||
| 1287 | show-subtree}), by specifying a zero argument: @kbd{M-0 C-c C-z}. | ||
| 1288 | |||
| 1289 | While you're zoomed in, you can still use Outline mode's exposure and | ||
| 1290 | hiding functions without disturbing Foldout. Also, since the buffer is | ||
| 1291 | narrowed, ``global'' editing actions will only affect text under the | ||
| 1292 | zoomed-in heading. This is useful for restricting changes to a | ||
| 1293 | particular chapter or section of your document. | ||
| 1294 | |||
| 1295 | @kindex C-c C-x | ||
| 1296 | @findex foldout-exit-fold | ||
| 1297 | To unzoom (exit) a fold, use @kbd{C-c C-x} (@kbd{M-x foldout-exit-fold}). | ||
| 1298 | This hides all the text and subheadings under the top-level heading and | ||
| 1299 | returns you to the previous view of the buffer. Specifying a numeric | ||
| 1300 | argument exits that many levels of folds. Specifying a zero argument | ||
| 1301 | exits all folds. | ||
| 1302 | |||
| 1303 | To cancel the narrowing of a fold without hiding the text and | ||
| 1304 | subheadings, specify a negative argument. For example, @kbd{M--2 C-c | ||
| 1305 | C-x} exits two folds and leaves the text and subheadings exposed. | ||
| 1306 | |||
| 1307 | Foldout mode also provides mouse commands for entering and exiting | ||
| 1308 | folds, and for showing and hiding text: | ||
| 1309 | |||
| 1310 | @table @asis | ||
| 1311 | @item @kbd{C-M-Mouse-1} zooms in on the heading clicked on | ||
| 1312 | @itemize @asis | ||
| 1313 | @item | ||
| 1314 | single click: expose body. | ||
| 1315 | @item | ||
| 1316 | double click: expose subheadings. | ||
| 1317 | @item | ||
| 1318 | triple click: expose body and subheadings. | ||
| 1319 | @item | ||
| 1320 | quad click: expose entire subtree. | ||
| 1321 | @end itemize | ||
| 1322 | @item @kbd{C-M-Mouse-2} exposes text under the heading clicked on | ||
| 1323 | @itemize @asis | ||
| 1324 | @item | ||
| 1325 | single click: expose body. | ||
| 1326 | @item | ||
| 1327 | double click: expose subheadings. | ||
| 1328 | @item | ||
| 1329 | triple click: expose body and subheadings. | ||
| 1330 | @item | ||
| 1331 | quad click: expose entire subtree. | ||
| 1332 | @end itemize | ||
| 1333 | @item @kbd{C-M-Mouse-3} hides text under the heading clicked on or exits fold | ||
| 1334 | @itemize @asis | ||
| 1335 | @item | ||
| 1336 | single click: hide subtree. | ||
| 1337 | @item | ||
| 1338 | double click: exit fold and hide text. | ||
| 1339 | @item | ||
| 1340 | triple click: exit fold without hiding text. | ||
| 1341 | @item | ||
| 1342 | quad click: exit all folds and hide text. | ||
| 1343 | @end itemize | ||
| 1344 | @end table | ||
| 1345 | |||
| 1346 | @vindex foldout-mouse-modifiers | ||
| 1347 | You can specify different modifier keys (instead of | ||
| 1348 | @kbd{Control-Meta-}) by setting @code{foldout-mouse-modifiers}; but if | ||
| 1349 | you have already loaded the @file{foldout.el} library, you must reload | ||
| 1350 | it in order for this to take effect. | ||
| 1351 | |||
| 1352 | To use the Foldout package, you can type @kbd{M-x load-library | ||
| 1353 | @key{RET} foldout @key{RET}}; or you can arrange for to do that | ||
| 1354 | automatically by putting this in your @file{.emacs} file: | ||
| 1355 | |||
| 1356 | @example | ||
| 1357 | (eval-after-load "outline" '(require 'foldout)) | ||
| 1358 | @end example | ||
| 1359 | |||
| 1360 | @node TeX Mode | ||
| 1361 | @section @TeX{} Mode | ||
| 1362 | @cindex @TeX{} mode | ||
| 1363 | @cindex La@TeX{} mode | ||
| 1364 | @cindex Sli@TeX{} mode | ||
| 1365 | @cindex Doc@TeX{} mode | ||
| 1366 | @cindex mode, @TeX{} | ||
| 1367 | @cindex mode, La@TeX{} | ||
| 1368 | @cindex mode, Sli@TeX{} | ||
| 1369 | @cindex mode, Doc@TeX{} | ||
| 1370 | @findex tex-mode | ||
| 1371 | @findex plain-tex-mode | ||
| 1372 | @findex latex-mode | ||
| 1373 | @findex slitex-mode | ||
| 1374 | @findex doctex-mode | ||
| 1375 | |||
| 1376 | @TeX{} is a powerful text formatter written by Donald Knuth; it is | ||
| 1377 | also free software, like GNU Emacs. La@TeX{} is a simplified input | ||
| 1378 | format for @TeX{}, implemented by @TeX{} macros; it comes with @TeX{}. | ||
| 1379 | Sli@TeX{} is a special form of La@TeX{}.@footnote{Sli@TeX{} is | ||
| 1380 | obsoleted by the @samp{slides} document class and other alternative | ||
| 1381 | packages in recent La@TeX{} versions.} Doc@TeX{} (@file{.dtx}) is a | ||
| 1382 | special file format in which the La@TeX{} sources are written, | ||
| 1383 | combining sources with documentation. | ||
| 1384 | |||
| 1385 | Emacs has a special @TeX{} mode for editing @TeX{} input files. | ||
| 1386 | It provides facilities for checking the balance of delimiters and for | ||
| 1387 | invoking @TeX{} on all or part of the file. | ||
| 1388 | |||
| 1389 | @vindex tex-default-mode | ||
| 1390 | @TeX{} mode has four variants: Plain @TeX{} mode, La@TeX{} mode, | ||
| 1391 | Sli@TeX{} mode, and Doc@TeX{} mode (these distinct major modes differ | ||
| 1392 | only slightly). They are designed for editing the four different | ||
| 1393 | formats. The command @kbd{M-x tex-mode} looks at the contents of the | ||
| 1394 | buffer to determine whether the contents appear to be either La@TeX{} | ||
| 1395 | input, Sli@TeX{}, or Doc@TeX{} input; if so, it selects the | ||
| 1396 | appropriate mode. If the file contents do not appear to be La@TeX{}, | ||
| 1397 | Sli@TeX{} or Doc@TeX{}, it selects Plain @TeX{} mode. If the contents | ||
| 1398 | are insufficient to determine this, the variable | ||
| 1399 | @code{tex-default-mode} controls which mode is used. | ||
| 1400 | |||
| 1401 | When @kbd{M-x tex-mode} does not guess right, you can use the commands | ||
| 1402 | @kbd{M-x plain-tex-mode}, @kbd{M-x latex-mode}, @kbd{M-x slitex-mode}, | ||
| 1403 | and @kbd{doctex-mode} to select explicitly the particular variants of | ||
| 1404 | @TeX{} mode. | ||
| 1405 | |||
| 1406 | @menu | ||
| 1407 | * Editing: TeX Editing. Special commands for editing in TeX mode. | ||
| 1408 | * LaTeX: LaTeX Editing. Additional commands for LaTeX input files. | ||
| 1409 | * Printing: TeX Print. Commands for printing part of a file with TeX. | ||
| 1410 | * Misc: TeX Misc. Customization of TeX mode, and related features. | ||
| 1411 | @end menu | ||
| 1412 | |||
| 1413 | @node TeX Editing | ||
| 1414 | @subsection @TeX{} Editing Commands | ||
| 1415 | |||
| 1416 | Here are the special commands provided in @TeX{} mode for editing the | ||
| 1417 | text of the file. | ||
| 1418 | |||
| 1419 | @table @kbd | ||
| 1420 | @item " | ||
| 1421 | Insert, according to context, either @samp{``} or @samp{"} or | ||
| 1422 | @samp{''} (@code{tex-insert-quote}). | ||
| 1423 | @item C-j | ||
| 1424 | Insert a paragraph break (two newlines) and check the previous | ||
| 1425 | paragraph for unbalanced braces or dollar signs | ||
| 1426 | (@code{tex-terminate-paragraph}). | ||
| 1427 | @item M-x tex-validate-region | ||
| 1428 | Check each paragraph in the region for unbalanced braces or dollar signs. | ||
| 1429 | @item C-c @{ | ||
| 1430 | Insert @samp{@{@}} and position point between them (@code{tex-insert-braces}). | ||
| 1431 | @item C-c @} | ||
| 1432 | Move forward past the next unmatched close brace (@code{up-list}). | ||
| 1433 | @end table | ||
| 1434 | |||
| 1435 | @findex tex-insert-quote | ||
| 1436 | @kindex " @r{(@TeX{} mode)} | ||
| 1437 | In @TeX{}, the character @samp{"} is not normally used; we use | ||
| 1438 | @samp{``} to start a quotation and @samp{''} to end one. To make | ||
| 1439 | editing easier under this formatting convention, @TeX{} mode overrides | ||
| 1440 | the normal meaning of the key @kbd{"} with a command that inserts a pair | ||
| 1441 | of single-quotes or backquotes (@code{tex-insert-quote}). To be | ||
| 1442 | precise, this command inserts @samp{``} after whitespace or an open | ||
| 1443 | brace, @samp{"} after a backslash, and @samp{''} after any other | ||
| 1444 | character. | ||
| 1445 | |||
| 1446 | If you need the character @samp{"} itself in unusual contexts, use | ||
| 1447 | @kbd{C-q} to insert it. Also, @kbd{"} with a numeric argument always | ||
| 1448 | inserts that number of @samp{"} characters. You can turn off the | ||
| 1449 | feature of @kbd{"} expansion by eliminating that binding in the local | ||
| 1450 | map (@pxref{Key Bindings}). | ||
| 1451 | |||
| 1452 | In @TeX{} mode, @samp{$} has a special syntax code which attempts to | ||
| 1453 | understand the way @TeX{} math mode delimiters match. When you insert a | ||
| 1454 | @samp{$} that is meant to exit math mode, the position of the matching | ||
| 1455 | @samp{$} that entered math mode is displayed for a second. This is the | ||
| 1456 | same feature that displays the open brace that matches a close brace that | ||
| 1457 | is inserted. However, there is no way to tell whether a @samp{$} enters | ||
| 1458 | math mode or leaves it; so when you insert a @samp{$} that enters math | ||
| 1459 | mode, the previous @samp{$} position is shown as if it were a match, even | ||
| 1460 | though they are actually unrelated. | ||
| 1461 | |||
| 1462 | @findex tex-insert-braces | ||
| 1463 | @kindex C-c @{ @r{(@TeX{} mode)} | ||
| 1464 | @findex up-list | ||
| 1465 | @kindex C-c @} @r{(@TeX{} mode)} | ||
| 1466 | @TeX{} uses braces as delimiters that must match. Some users prefer | ||
| 1467 | to keep braces balanced at all times, rather than inserting them | ||
| 1468 | singly. Use @kbd{C-c @{} (@code{tex-insert-braces}) to insert a pair of | ||
| 1469 | braces. It leaves point between the two braces so you can insert the | ||
| 1470 | text that belongs inside. Afterward, use the command @kbd{C-c @}} | ||
| 1471 | (@code{up-list}) to move forward past the close brace. | ||
| 1472 | |||
| 1473 | @findex tex-validate-region | ||
| 1474 | @findex tex-terminate-paragraph | ||
| 1475 | @kindex C-j @r{(@TeX{} mode)} | ||
| 1476 | There are two commands for checking the matching of braces. @kbd{C-j} | ||
| 1477 | (@code{tex-terminate-paragraph}) checks the paragraph before point, and | ||
| 1478 | inserts two newlines to start a new paragraph. It outputs a message in | ||
| 1479 | the echo area if any mismatch is found. @kbd{M-x tex-validate-region} | ||
| 1480 | checks a region, paragraph by paragraph. The errors are listed in the | ||
| 1481 | @samp{*Occur*} buffer, and you can use @kbd{C-c C-c} or @kbd{Mouse-2} in | ||
| 1482 | that buffer to go to a particular mismatch. | ||
| 1483 | |||
| 1484 | Note that Emacs commands count square brackets and parentheses in | ||
| 1485 | @TeX{} mode, not just braces. This is not strictly correct for the | ||
| 1486 | purpose of checking @TeX{} syntax. However, parentheses and square | ||
| 1487 | brackets are likely to be used in text as matching delimiters and it is | ||
| 1488 | useful for the various motion commands and automatic match display to | ||
| 1489 | work with them. | ||
| 1490 | |||
| 1491 | @node LaTeX Editing | ||
| 1492 | @subsection La@TeX{} Editing Commands | ||
| 1493 | |||
| 1494 | La@TeX{} mode, and its variant, Sli@TeX{} mode, provide a few extra | ||
| 1495 | features not applicable to plain @TeX{}. | ||
| 1496 | |||
| 1497 | @table @kbd | ||
| 1498 | @item C-c C-o | ||
| 1499 | Insert @samp{\begin} and @samp{\end} for La@TeX{} block and position | ||
| 1500 | point on a line between them (@code{tex-latex-block}). | ||
| 1501 | @item C-c C-e | ||
| 1502 | Close the innermost La@TeX{} block not yet closed | ||
| 1503 | (@code{tex-close-latex-block}). | ||
| 1504 | @end table | ||
| 1505 | |||
| 1506 | @findex tex-latex-block | ||
| 1507 | @kindex C-c C-o @r{(La@TeX{} mode)} | ||
| 1508 | @vindex latex-block-names | ||
| 1509 | In La@TeX{} input, @samp{\begin} and @samp{\end} commands are used to | ||
| 1510 | group blocks of text. To insert a @samp{\begin} and a matching | ||
| 1511 | @samp{\end} (on a new line following the @samp{\begin}), use @kbd{C-c | ||
| 1512 | C-o} (@code{tex-latex-block}). A blank line is inserted between the | ||
| 1513 | two, and point is left there. You can use completion when you enter the | ||
| 1514 | block type; to specify additional block type names beyond the standard | ||
| 1515 | list, set the variable @code{latex-block-names}. For example, here's | ||
| 1516 | how to add @samp{theorem}, @samp{corollary}, and @samp{proof}: | ||
| 1517 | |||
| 1518 | @example | ||
| 1519 | (setq latex-block-names '("theorem" "corollary" "proof")) | ||
| 1520 | @end example | ||
| 1521 | |||
| 1522 | @findex tex-close-latex-block | ||
| 1523 | @kindex C-c C-e @r{(La@TeX{} mode)} | ||
| 1524 | In La@TeX{} input, @samp{\begin} and @samp{\end} commands must | ||
| 1525 | balance. You can use @kbd{C-c C-e} (@code{tex-close-latex-block}) to | ||
| 1526 | insert automatically a matching @samp{\end} to match the last unmatched | ||
| 1527 | @samp{\begin}. It indents the @samp{\end} to match the corresponding | ||
| 1528 | @samp{\begin}. It inserts a newline after @samp{\end} if point is at | ||
| 1529 | the beginning of a line. | ||
| 1530 | |||
| 1531 | @node TeX Print | ||
| 1532 | @subsection @TeX{} Printing Commands | ||
| 1533 | |||
| 1534 | You can invoke @TeX{} as an inferior of Emacs on either the entire | ||
| 1535 | contents of the buffer or just a region at a time. Running @TeX{} in | ||
| 1536 | this way on just one chapter is a good way to see what your changes | ||
| 1537 | look like without taking the time to format the entire file. | ||
| 1538 | |||
| 1539 | @table @kbd | ||
| 1540 | @item C-c C-r | ||
| 1541 | Invoke @TeX{} on the current region, together with the buffer's header | ||
| 1542 | (@code{tex-region}). | ||
| 1543 | @item C-c C-b | ||
| 1544 | Invoke @TeX{} on the entire current buffer (@code{tex-buffer}). | ||
| 1545 | @item C-c @key{TAB} | ||
| 1546 | Invoke Bib@TeX{} on the current file (@code{tex-bibtex-file}). | ||
| 1547 | @item C-c C-f | ||
| 1548 | Invoke @TeX{} on the current file (@code{tex-file}). | ||
| 1549 | @item C-c C-l | ||
| 1550 | Recenter the window showing output from the inferior @TeX{} so that | ||
| 1551 | the last line can be seen (@code{tex-recenter-output-buffer}). | ||
| 1552 | @item C-c C-k | ||
| 1553 | Kill the @TeX{} subprocess (@code{tex-kill-job}). | ||
| 1554 | @item C-c C-p | ||
| 1555 | Print the output from the last @kbd{C-c C-r}, @kbd{C-c C-b}, or @kbd{C-c | ||
| 1556 | C-f} command (@code{tex-print}). | ||
| 1557 | @item C-c C-v | ||
| 1558 | Preview the output from the last @kbd{C-c C-r}, @kbd{C-c C-b}, or @kbd{C-c | ||
| 1559 | C-f} command (@code{tex-view}). | ||
| 1560 | @item C-c C-q | ||
| 1561 | Show the printer queue (@code{tex-show-print-queue}). | ||
| 1562 | @item C-c C-c | ||
| 1563 | Invoke some other compilation command on the entire current buffer | ||
| 1564 | (@code{tex-compile}). | ||
| 1565 | @end table | ||
| 1566 | |||
| 1567 | @findex tex-buffer | ||
| 1568 | @kindex C-c C-b @r{(@TeX{} mode)} | ||
| 1569 | @findex tex-print | ||
| 1570 | @kindex C-c C-p @r{(@TeX{} mode)} | ||
| 1571 | @findex tex-view | ||
| 1572 | @kindex C-c C-v @r{(@TeX{} mode)} | ||
| 1573 | @findex tex-show-print-queue | ||
| 1574 | @kindex C-c C-q @r{(@TeX{} mode)} | ||
| 1575 | You can pass the current buffer through an inferior @TeX{} by means of | ||
| 1576 | @kbd{C-c C-b} (@code{tex-buffer}). The formatted output appears in a | ||
| 1577 | temporary file; to print it, type @kbd{C-c C-p} (@code{tex-print}). | ||
| 1578 | Afterward, you can use @kbd{C-c C-q} (@code{tex-show-print-queue}) to | ||
| 1579 | view the progress of your output towards being printed. If your terminal | ||
| 1580 | has the ability to display @TeX{} output files, you can preview the | ||
| 1581 | output on the terminal with @kbd{C-c C-v} (@code{tex-view}). | ||
| 1582 | |||
| 1583 | @cindex @env{TEXINPUTS} environment variable | ||
| 1584 | @vindex tex-directory | ||
| 1585 | You can specify the directory to use for running @TeX{} by setting the | ||
| 1586 | variable @code{tex-directory}. @code{"."} is the default value. If | ||
| 1587 | your environment variable @env{TEXINPUTS} contains relative directory | ||
| 1588 | names, or if your files contains @samp{\input} commands with relative | ||
| 1589 | file names, then @code{tex-directory} @emph{must} be @code{"."} or you | ||
| 1590 | will get the wrong results. Otherwise, it is safe to specify some other | ||
| 1591 | directory, such as @code{"/tmp"}. | ||
| 1592 | |||
| 1593 | @vindex tex-run-command | ||
| 1594 | @vindex latex-run-command | ||
| 1595 | @vindex slitex-run-command | ||
| 1596 | @vindex tex-dvi-print-command | ||
| 1597 | @vindex tex-dvi-view-command | ||
| 1598 | @vindex tex-show-queue-command | ||
| 1599 | If you want to specify which shell commands are used in the inferior @TeX{}, | ||
| 1600 | you can do so by setting the values of the variables @code{tex-run-command}, | ||
| 1601 | @code{latex-run-command}, @code{slitex-run-command}, | ||
| 1602 | @code{tex-dvi-print-command}, @code{tex-dvi-view-command}, and | ||
| 1603 | @code{tex-show-queue-command}. The default values may | ||
| 1604 | (or may not) be appropriate for your system. | ||
| 1605 | |||
| 1606 | Normally, the file name given to these commands comes at the end of | ||
| 1607 | the command string; for example, @samp{latex @var{filename}}. In some | ||
| 1608 | cases, however, the file name needs to be embedded in the command; an | ||
| 1609 | example is when you need to provide the file name as an argument to one | ||
| 1610 | command whose output is piped to another. You can specify where to put | ||
| 1611 | the file name with @samp{*} in the command string. For example, | ||
| 1612 | |||
| 1613 | @example | ||
| 1614 | (setq tex-dvi-print-command "dvips -f * | lpr") | ||
| 1615 | @end example | ||
| 1616 | |||
| 1617 | @findex tex-kill-job | ||
| 1618 | @kindex C-c C-k @r{(@TeX{} mode)} | ||
| 1619 | @findex tex-recenter-output-buffer | ||
| 1620 | @kindex C-c C-l @r{(@TeX{} mode)} | ||
| 1621 | The terminal output from @TeX{}, including any error messages, appears | ||
| 1622 | in a buffer called @samp{*tex-shell*}. If @TeX{} gets an error, you can | ||
| 1623 | switch to this buffer and feed it input (this works as in Shell mode; | ||
| 1624 | @pxref{Interactive Shell}). Without switching to this buffer you can | ||
| 1625 | scroll it so that its last line is visible by typing @kbd{C-c | ||
| 1626 | C-l}. | ||
| 1627 | |||
| 1628 | Type @kbd{C-c C-k} (@code{tex-kill-job}) to kill the @TeX{} process if | ||
| 1629 | you see that its output is no longer useful. Using @kbd{C-c C-b} or | ||
| 1630 | @kbd{C-c C-r} also kills any @TeX{} process still running. | ||
| 1631 | |||
| 1632 | @findex tex-region | ||
| 1633 | @kindex C-c C-r @r{(@TeX{} mode)} | ||
| 1634 | You can also pass an arbitrary region through an inferior @TeX{} by typing | ||
| 1635 | @kbd{C-c C-r} (@code{tex-region}). This is tricky, however, because most files | ||
| 1636 | of @TeX{} input contain commands at the beginning to set parameters and | ||
| 1637 | define macros, without which no later part of the file will format | ||
| 1638 | correctly. To solve this problem, @kbd{C-c C-r} allows you to designate a | ||
| 1639 | part of the file as containing essential commands; it is included before | ||
| 1640 | the specified region as part of the input to @TeX{}. The designated part | ||
| 1641 | of the file is called the @dfn{header}. | ||
| 1642 | |||
| 1643 | @cindex header (@TeX{} mode) | ||
| 1644 | To indicate the bounds of the header in Plain @TeX{} mode, you insert two | ||
| 1645 | special strings in the file. Insert @samp{%**start of header} before the | ||
| 1646 | header, and @samp{%**end of header} after it. Each string must appear | ||
| 1647 | entirely on one line, but there may be other text on the line before or | ||
| 1648 | after. The lines containing the two strings are included in the header. | ||
| 1649 | If @samp{%**start of header} does not appear within the first 100 lines of | ||
| 1650 | the buffer, @kbd{C-c C-r} assumes that there is no header. | ||
| 1651 | |||
| 1652 | In La@TeX{} mode, the header begins with @samp{\documentclass} or | ||
| 1653 | @samp{\documentstyle} and ends with @samp{\begin@{document@}}. These | ||
| 1654 | are commands that La@TeX{} requires you to use in any case, so nothing | ||
| 1655 | special needs to be done to identify the header. | ||
| 1656 | |||
| 1657 | @findex tex-file | ||
| 1658 | @kindex C-c C-f @r{(@TeX{} mode)} | ||
| 1659 | The commands (@code{tex-buffer}) and (@code{tex-region}) do all of their | ||
| 1660 | work in a temporary directory, and do not have available any of the auxiliary | ||
| 1661 | files needed by @TeX{} for cross-references; these commands are generally | ||
| 1662 | not suitable for running the final copy in which all of the cross-references | ||
| 1663 | need to be correct. | ||
| 1664 | |||
| 1665 | When you want the auxiliary files for cross references, use @kbd{C-c | ||
| 1666 | C-f} (@code{tex-file}) which runs @TeX{} on the current buffer's file, | ||
| 1667 | in that file's directory. Before running @TeX{}, it offers to save any | ||
| 1668 | modified buffers. Generally, you need to use (@code{tex-file}) twice to | ||
| 1669 | get the cross-references right. | ||
| 1670 | |||
| 1671 | @vindex tex-start-options | ||
| 1672 | The value of the variable @code{tex-start-options} specifies | ||
| 1673 | options for the @TeX{} run. | ||
| 1674 | |||
| 1675 | @vindex tex-start-commands | ||
| 1676 | The value of the variable @code{tex-start-commands} specifies @TeX{} | ||
| 1677 | commands for starting @TeX{}. The default value causes @TeX{} to run | ||
| 1678 | in nonstop mode. To run @TeX{} interactively, set the variable to | ||
| 1679 | @code{""}. | ||
| 1680 | |||
| 1681 | @vindex tex-main-file | ||
| 1682 | Large @TeX{} documents are often split into several files---one main | ||
| 1683 | file, plus subfiles. Running @TeX{} on a subfile typically does not | ||
| 1684 | work; you have to run it on the main file. In order to make | ||
| 1685 | @code{tex-file} useful when you are editing a subfile, you can set the | ||
| 1686 | variable @code{tex-main-file} to the name of the main file. Then | ||
| 1687 | @code{tex-file} runs @TeX{} on that file. | ||
| 1688 | |||
| 1689 | The most convenient way to use @code{tex-main-file} is to specify it | ||
| 1690 | in a local variable list in each of the subfiles. @xref{File | ||
| 1691 | Variables}. | ||
| 1692 | |||
| 1693 | @findex tex-bibtex-file | ||
| 1694 | @kindex C-c TAB @r{(@TeX{} mode)} | ||
| 1695 | @vindex tex-bibtex-command | ||
| 1696 | For La@TeX{} files, you can use Bib@TeX{} to process the auxiliary | ||
| 1697 | file for the current buffer's file. Bib@TeX{} looks up bibliographic | ||
| 1698 | citations in a data base and prepares the cited references for the | ||
| 1699 | bibliography section. The command @kbd{C-c @key{TAB}} | ||
| 1700 | (@code{tex-bibtex-file}) runs the shell command | ||
| 1701 | (@code{tex-bibtex-command}) to produce a @samp{.bbl} file for the | ||
| 1702 | current buffer's file. Generally, you need to do @kbd{C-c C-f} | ||
| 1703 | (@code{tex-file}) once to generate the @samp{.aux} file, then do | ||
| 1704 | @kbd{C-c @key{TAB}} (@code{tex-bibtex-file}), and then repeat @kbd{C-c C-f} | ||
| 1705 | (@code{tex-file}) twice more to get the cross-references correct. | ||
| 1706 | |||
| 1707 | @findex tex-compile | ||
| 1708 | @kindex C-c C-c @r{(@TeX{} mode)} | ||
| 1709 | To invoke some other compilation program on the current @TeX{} | ||
| 1710 | buffer, type @kbd{C-c C-c} (@code{tex-compile}). This command knows | ||
| 1711 | how to pass arguments to many common programs, including | ||
| 1712 | @file{pdflatex}, @file{yap}, @file{xdvi}, and @file{dvips}. You can | ||
| 1713 | select your desired compilation program using the standard completion | ||
| 1714 | keys (@pxref{Completion}). | ||
| 1715 | |||
| 1716 | @node TeX Misc | ||
| 1717 | @subsection @TeX{} Mode Miscellany | ||
| 1718 | |||
| 1719 | @vindex tex-shell-hook | ||
| 1720 | @vindex tex-mode-hook | ||
| 1721 | @vindex latex-mode-hook | ||
| 1722 | @vindex slitex-mode-hook | ||
| 1723 | @vindex plain-tex-mode-hook | ||
| 1724 | Entering any variant of @TeX{} mode runs the hooks | ||
| 1725 | @code{text-mode-hook} and @code{tex-mode-hook}. Then it runs either | ||
| 1726 | @code{plain-tex-mode-hook}, @code{latex-mode-hook}, or | ||
| 1727 | @code{slitex-mode-hook}, whichever is appropriate. Starting the | ||
| 1728 | @TeX{} shell runs the hook @code{tex-shell-hook}. @xref{Hooks}. | ||
| 1729 | |||
| 1730 | @findex iso-iso2tex | ||
| 1731 | @findex iso-tex2iso | ||
| 1732 | @findex iso-iso2gtex | ||
| 1733 | @findex iso-gtex2iso | ||
| 1734 | @cindex Latin-1 @TeX{} encoding | ||
| 1735 | @cindex @TeX{} encoding | ||
| 1736 | The commands @kbd{M-x iso-iso2tex}, @kbd{M-x iso-tex2iso}, @kbd{M-x | ||
| 1737 | iso-iso2gtex} and @kbd{M-x iso-gtex2iso} can be used to convert | ||
| 1738 | between Latin-1 encoded files and @TeX{}-encoded equivalents. | ||
| 1739 | @ignore | ||
| 1740 | @c Too cryptic to be useful, too cryptic for me to make it better -- rms. | ||
| 1741 | They | ||
| 1742 | are included by default in the @code{format-alist} variable, so they | ||
| 1743 | can be used with @kbd{M-x format-find-file}, for instance. | ||
| 1744 | @end ignore | ||
| 1745 | |||
| 1746 | @ignore @c Not worth documenting if it is only for Czech -- rms. | ||
| 1747 | @findex tildify-buffer | ||
| 1748 | @findex tildify-region | ||
| 1749 | @cindex ties, @TeX{}, inserting | ||
| 1750 | @cindex hard spaces, @TeX{}, inserting | ||
| 1751 | The commands @kbd{M-x tildify-buffer} and @kbd{M-x tildify-region} | ||
| 1752 | insert @samp{~} (@dfn{tie}) characters where they are conventionally | ||
| 1753 | required. This is set up for Czech---customize the group | ||
| 1754 | @samp{tildify} for other languages or for other sorts of markup. | ||
| 1755 | @end ignore | ||
| 1756 | |||
| 1757 | @cindex Ref@TeX{} package | ||
| 1758 | @cindex references, La@TeX{} | ||
| 1759 | @cindex La@TeX{} references | ||
| 1760 | For managing all kinds of references for La@TeX{}, you can use | ||
| 1761 | Ref@TeX{}. @inforef{Top,, reftex}. | ||
| 1762 | |||
| 1763 | @node HTML Mode | ||
| 1764 | @section SGML, XML, and HTML Modes | ||
| 1765 | |||
| 1766 | The major modes for SGML and HTML include indentation support and | ||
| 1767 | commands to operate on tags. This section describes the special | ||
| 1768 | commands of these modes. (HTML mode is a slightly customized variant | ||
| 1769 | of SGML mode.) | ||
| 1770 | |||
| 1771 | @table @kbd | ||
| 1772 | @item C-c C-n | ||
| 1773 | @kindex C-c C-n @r{(SGML mode)} | ||
| 1774 | @findex sgml-name-char | ||
| 1775 | Interactively specify a special character and insert the SGML | ||
| 1776 | @samp{&}-command for that character. | ||
| 1777 | |||
| 1778 | @item C-c C-t | ||
| 1779 | @kindex C-c C-t @r{(SGML mode)} | ||
| 1780 | @findex sgml-tag | ||
| 1781 | Interactively specify a tag and its attributes (@code{sgml-tag}). | ||
| 1782 | This command asks you for a tag name and for the attribute values, | ||
| 1783 | then inserts both the opening tag and the closing tag, leaving point | ||
| 1784 | between them. | ||
| 1785 | |||
| 1786 | With a prefix argument @var{n}, the command puts the tag around the | ||
| 1787 | @var{n} words already present in the buffer after point. With | ||
| 1788 | @minus{}1 as argument, it puts the tag around the region. (In | ||
| 1789 | Transient Mark mode, it does this whenever a region is active.) | ||
| 1790 | |||
| 1791 | @item C-c C-a | ||
| 1792 | @kindex C-c C-a @r{(SGML mode)} | ||
| 1793 | @findex sgml-attributes | ||
| 1794 | Interactively insert attribute values for the current tag | ||
| 1795 | (@code{sgml-attributes}). | ||
| 1796 | |||
| 1797 | @item C-c C-f | ||
| 1798 | @kindex C-c C-f @r{(SGML mode)} | ||
| 1799 | @findex sgml-skip-tag-forward | ||
| 1800 | Skip across a balanced tag group (which extends from an opening tag | ||
| 1801 | through its corresponding closing tag) (@code{sgml-skip-tag-forward}). | ||
| 1802 | A numeric argument acts as a repeat count. | ||
| 1803 | |||
| 1804 | @item C-c C-b | ||
| 1805 | @kindex C-c C-b @r{(SGML mode)} | ||
| 1806 | @findex sgml-skip-tag-backward | ||
| 1807 | Skip backward across a balanced tag group (which extends from an | ||
| 1808 | opening tag through its corresponding closing tag) | ||
| 1809 | (@code{sgml-skip-tag-forward}). A numeric argument acts as a repeat | ||
| 1810 | count. | ||
| 1811 | |||
| 1812 | @item C-c C-d | ||
| 1813 | @kindex C-c C-d @r{(SGML mode)} | ||
| 1814 | @findex sgml-delete-tag | ||
| 1815 | Delete the tag at or after point, and delete the matching tag too | ||
| 1816 | (@code{sgml-delete-tag}). If the tag at or after point is an opening | ||
| 1817 | tag, delete the closing tag too; if it is a closing tag, delete the | ||
| 1818 | opening tag too. | ||
| 1819 | |||
| 1820 | @item C-c ? @var{tag} @key{RET} | ||
| 1821 | @kindex C-c ? @r{(SGML mode)} | ||
| 1822 | @findex sgml-tag-help | ||
| 1823 | Display a description of the meaning of tag @var{tag} | ||
| 1824 | (@code{sgml-tag-help}). If the argument @var{tag} is empty, describe | ||
| 1825 | the tag at point. | ||
| 1826 | |||
| 1827 | @item C-c / | ||
| 1828 | @kindex C-c / @r{(SGML mode)} | ||
| 1829 | @findex sgml-close-tag | ||
| 1830 | Insert a close tag for the innermost unterminated tag | ||
| 1831 | (@code{sgml-close-tag}). If called from within a tag or a comment, | ||
| 1832 | close this element instead of inserting a close tag. | ||
| 1833 | |||
| 1834 | @item C-c 8 | ||
| 1835 | @kindex C-c 8 @r{(SGML mode)} | ||
| 1836 | @findex sgml-name-8bit-mode | ||
| 1837 | Toggle a minor mode in which Latin-1 characters insert the | ||
| 1838 | corresponding SGML commands that stand for them, instead of the | ||
| 1839 | characters themselves (@code{sgml-name-8bit-mode}). | ||
| 1840 | |||
| 1841 | @item C-c C-v | ||
| 1842 | @kindex C-c C-v @r{(SGML mode)} | ||
| 1843 | @findex sgml-validate | ||
| 1844 | Run a shell command (which you must specify) to validate the current | ||
| 1845 | buffer as SGML (@code{sgml-validate}). | ||
| 1846 | |||
| 1847 | @item C-c TAB | ||
| 1848 | @kindex C-c TAB @r{(SGML mode)} | ||
| 1849 | @findex sgml-tags-invisible | ||
| 1850 | Toggle the visibility of existing tags in the buffer. This can be | ||
| 1851 | used as a cheap preview. | ||
| 1852 | @end table | ||
| 1853 | |||
| 1854 | @vindex sgml-xml-mode | ||
| 1855 | SGML mode and HTML mode support XML also. In XML, every opening tag | ||
| 1856 | must have an explicit closing tag. When @code{sgml-xml-mode} is | ||
| 1857 | non-@code{nil}, SGML mode and HTML mode always insert explicit | ||
| 1858 | closing tags. When you visit a file, these modes determine from the | ||
| 1859 | file contents whether it is XML or not, and set @code{sgml-xml-mode} | ||
| 1860 | accordingly, so that they do the right thing for the file in either | ||
| 1861 | case. | ||
| 1862 | |||
| 1863 | @node Nroff Mode | ||
| 1864 | @section Nroff Mode | ||
| 1865 | |||
| 1866 | @cindex nroff | ||
| 1867 | @findex nroff-mode | ||
| 1868 | Nroff mode is a mode like Text mode but modified to handle nroff commands | ||
| 1869 | present in the text. Invoke @kbd{M-x nroff-mode} to enter this mode. It | ||
| 1870 | differs from Text mode in only a few ways. All nroff command lines are | ||
| 1871 | considered paragraph separators, so that filling will never garble the | ||
| 1872 | nroff commands. Pages are separated by @samp{.bp} commands. Comments | ||
| 1873 | start with backslash-doublequote. Also, three special commands are | ||
| 1874 | provided that are not in Text mode: | ||
| 1875 | |||
| 1876 | @findex forward-text-line | ||
| 1877 | @findex backward-text-line | ||
| 1878 | @findex count-text-lines | ||
| 1879 | @kindex M-n @r{(Nroff mode)} | ||
| 1880 | @kindex M-p @r{(Nroff mode)} | ||
| 1881 | @kindex M-? @r{(Nroff mode)} | ||
| 1882 | @table @kbd | ||
| 1883 | @item M-n | ||
| 1884 | Move to the beginning of the next line that isn't an nroff command | ||
| 1885 | (@code{forward-text-line}). An argument is a repeat count. | ||
| 1886 | @item M-p | ||
| 1887 | Like @kbd{M-n} but move up (@code{backward-text-line}). | ||
| 1888 | @item M-? | ||
| 1889 | Displays in the echo area the number of text lines (lines that are not | ||
| 1890 | nroff commands) in the region (@code{count-text-lines}). | ||
| 1891 | @end table | ||
| 1892 | |||
| 1893 | @findex electric-nroff-mode | ||
| 1894 | The other feature of Nroff mode is that you can turn on Electric Nroff | ||
| 1895 | mode. This is a minor mode that you can turn on or off with @kbd{M-x | ||
| 1896 | electric-nroff-mode} (@pxref{Minor Modes}). When the mode is on, each | ||
| 1897 | time you use @key{RET} to end a line that contains an nroff command that | ||
| 1898 | opens a kind of grouping, the matching nroff command to close that | ||
| 1899 | grouping is automatically inserted on the following line. For example, | ||
| 1900 | if you are at the beginning of a line and type @kbd{.@: ( b @key{RET}}, | ||
| 1901 | this inserts the matching command @samp{.)b} on a new line following | ||
| 1902 | point. | ||
| 1903 | |||
| 1904 | If you use Outline minor mode with Nroff mode (@pxref{Outline Mode}), | ||
| 1905 | heading lines are lines of the form @samp{.H} followed by a number (the | ||
| 1906 | header level). | ||
| 1907 | |||
| 1908 | @vindex nroff-mode-hook | ||
| 1909 | Entering Nroff mode runs the hook @code{text-mode-hook}, followed by | ||
| 1910 | the hook @code{nroff-mode-hook} (@pxref{Hooks}). | ||
| 1911 | |||
| 1912 | @node Formatted Text | ||
| 1913 | @section Editing Formatted Text | ||
| 1914 | |||
| 1915 | @cindex Enriched mode | ||
| 1916 | @cindex mode, Enriched | ||
| 1917 | @cindex formatted text | ||
| 1918 | @cindex WYSIWYG | ||
| 1919 | @cindex word processing | ||
| 1920 | @dfn{Enriched mode} is a minor mode for editing files that contain | ||
| 1921 | formatted text in WYSIWYG fashion, as in a word processor. Currently, | ||
| 1922 | formatted text in Enriched mode can specify fonts, colors, underlining, | ||
| 1923 | margins, and types of filling and justification. In the future, we plan | ||
| 1924 | to implement other formatting features as well. | ||
| 1925 | |||
| 1926 | Enriched mode is a minor mode (@pxref{Minor Modes}). It is | ||
| 1927 | typically used in conjunction with Text mode (@pxref{Text Mode}), but | ||
| 1928 | you can also use it with other major modes such as Outline mode and | ||
| 1929 | Paragraph-Indent Text mode. | ||
| 1930 | |||
| 1931 | @cindex text/enriched MIME format | ||
| 1932 | Potentially, Emacs can store formatted text files in various file | ||
| 1933 | formats. Currently, only one format is implemented: @dfn{text/enriched} | ||
| 1934 | format, which is defined by the MIME protocol. @xref{Format | ||
| 1935 | Conversion,, Format Conversion, elisp, the Emacs Lisp Reference Manual}, | ||
| 1936 | for details of how Emacs recognizes and converts file formats. | ||
| 1937 | |||
| 1938 | The Emacs distribution contains a formatted text file that can serve as | ||
| 1939 | an example. Its name is @file{etc/enriched.doc}. It contains samples | ||
| 1940 | illustrating all the features described in this section. It also | ||
| 1941 | contains a list of ideas for future enhancements. | ||
| 1942 | |||
| 1943 | @menu | ||
| 1944 | * Requesting Formatted Text:: Entering and exiting Enriched mode. | ||
| 1945 | * Hard and Soft Newlines:: There are two different kinds of newlines. | ||
| 1946 | * Editing Format Info:: How to edit text properties. | ||
| 1947 | * Faces: Format Faces. Bold, italic, underline, etc. | ||
| 1948 | * Color: Format Colors. Changing the color of text. | ||
| 1949 | * Indent: Format Indentation. Changing the left and right margins. | ||
| 1950 | * Justification: Format Justification. | ||
| 1951 | Centering, setting text flush with the | ||
| 1952 | left or right margin, etc. | ||
| 1953 | * Other: Format Properties. The "special" text properties submenu. | ||
| 1954 | * Forcing Enriched Mode:: How to force use of Enriched mode. | ||
| 1955 | @end menu | ||
| 1956 | |||
| 1957 | @node Requesting Formatted Text | ||
| 1958 | @subsection Requesting to Edit Formatted Text | ||
| 1959 | |||
| 1960 | Whenever you visit a file that Emacs saved in the text/enriched | ||
| 1961 | format, Emacs automatically converts the formatting information in the | ||
| 1962 | file into Emacs's own internal format (known as @dfn{text | ||
| 1963 | properties}), and turns on Enriched mode. | ||
| 1964 | |||
| 1965 | @findex enriched-mode | ||
| 1966 | To create a new file of formatted text, first visit the nonexistent | ||
| 1967 | file, then type @kbd{M-x enriched-mode} before you start inserting text. | ||
| 1968 | This command turns on Enriched mode. Do this before you begin inserting | ||
| 1969 | text, to ensure that the text you insert is handled properly. | ||
| 1970 | |||
| 1971 | More generally, the command @code{enriched-mode} turns Enriched mode | ||
| 1972 | on if it was off, and off if it was on. With a prefix argument, this | ||
| 1973 | command turns Enriched mode on if the argument is positive, and turns | ||
| 1974 | the mode off otherwise. | ||
| 1975 | |||
| 1976 | When you save a buffer while Enriched mode is enabled in it, Emacs | ||
| 1977 | automatically converts the text to text/enriched format while writing it | ||
| 1978 | into the file. When you visit the file again, Emacs will automatically | ||
| 1979 | recognize the format, reconvert the text, and turn on Enriched mode | ||
| 1980 | again. | ||
| 1981 | |||
| 1982 | @vindex enriched-translations | ||
| 1983 | You can add annotations for saving additional text properties, which | ||
| 1984 | Emacs normally does not save, by adding to @code{enriched-translations}. | ||
| 1985 | Note that the text/enriched standard requires any non-standard | ||
| 1986 | annotations to have names starting with @samp{x-}, as in | ||
| 1987 | @samp{x-read-only}. This ensures that they will not conflict with | ||
| 1988 | standard annotations that may be added later. | ||
| 1989 | |||
| 1990 | @xref{Text Properties,,, elisp, the Emacs Lisp Reference Manual}, | ||
| 1991 | for more information about text properties. | ||
| 1992 | |||
| 1993 | @node Hard and Soft Newlines | ||
| 1994 | @subsection Hard and Soft Newlines | ||
| 1995 | @cindex hard newline | ||
| 1996 | @cindex soft newline | ||
| 1997 | @cindex newlines, hard and soft | ||
| 1998 | |||
| 1999 | @cindex use-hard-newlines | ||
| 2000 | In formatted text, Emacs distinguishes between two different kinds of | ||
| 2001 | newlines, @dfn{hard} newlines and @dfn{soft} newlines. (You can enable | ||
| 2002 | or disable this feature separately in any buffer with the command | ||
| 2003 | @code{use-hard-newlines}.) | ||
| 2004 | |||
| 2005 | Hard newlines are used to separate paragraphs, or items in a list, or | ||
| 2006 | anywhere that there should always be a line break regardless of the | ||
| 2007 | margins. The @key{RET} command (@code{newline}) and @kbd{C-o} | ||
| 2008 | (@code{open-line}) insert hard newlines. | ||
| 2009 | |||
| 2010 | Soft newlines are used to make text fit between the margins. All the | ||
| 2011 | fill commands, including Auto Fill, insert soft newlines---and they | ||
| 2012 | delete only soft newlines. | ||
| 2013 | |||
| 2014 | Although hard and soft newlines look the same, it is important to bear | ||
| 2015 | the difference in mind. Do not use @key{RET} to break lines in the | ||
| 2016 | middle of filled paragraphs, or else you will get hard newlines that are | ||
| 2017 | barriers to further filling. Instead, let Auto Fill mode break lines, | ||
| 2018 | so that if the text or the margins change, Emacs can refill the lines | ||
| 2019 | properly. @xref{Auto Fill}. | ||
| 2020 | |||
| 2021 | On the other hand, in tables and lists, where the lines should always | ||
| 2022 | remain as you type them, you can use @key{RET} to end lines. For these | ||
| 2023 | lines, you may also want to set the justification style to | ||
| 2024 | @code{unfilled}. @xref{Format Justification}. | ||
| 2025 | |||
| 2026 | @node Editing Format Info | ||
| 2027 | @subsection Editing Format Information | ||
| 2028 | |||
| 2029 | There are two ways to alter the formatting information for a formatted | ||
| 2030 | text file: with keyboard commands, and with the mouse. | ||
| 2031 | |||
| 2032 | The easiest way to add properties to your document is with the Text | ||
| 2033 | Properties menu. You can get to this menu in two ways: from the Edit | ||
| 2034 | menu in the menu bar (use @kbd{@key{F10} e t} if you have no mouse), | ||
| 2035 | or with @kbd{C-Mouse-2} (hold the @key{CTRL} key and press the middle | ||
| 2036 | mouse button). There are also keyboard commands described in the | ||
| 2037 | following section. | ||
| 2038 | |||
| 2039 | Most of the items in the Text Properties menu lead to other submenus. | ||
| 2040 | These are described in the sections that follow. Some items run | ||
| 2041 | commands directly: | ||
| 2042 | |||
| 2043 | @table @code | ||
| 2044 | @findex facemenu-remove-face-props | ||
| 2045 | @item Remove Face Properties | ||
| 2046 | Delete from the region all face and color text properties | ||
| 2047 | (@code{facemenu-remove-face-props}). | ||
| 2048 | |||
| 2049 | @findex facemenu-remove-all | ||
| 2050 | @item Remove Text Properties | ||
| 2051 | Delete @emph{all} text properties from the region | ||
| 2052 | (@code{facemenu-remove-all}). | ||
| 2053 | |||
| 2054 | @findex describe-text-properties | ||
| 2055 | @cindex text properties of characters | ||
| 2056 | @cindex overlays at character position | ||
| 2057 | @cindex widgets at buffer position | ||
| 2058 | @cindex buttons at buffer position | ||
| 2059 | @item Describe Properties | ||
| 2060 | List all the text properties, widgets, buttons, and overlays of the | ||
| 2061 | character following point (@code{describe-text-properties}). | ||
| 2062 | |||
| 2063 | @item Display Faces | ||
| 2064 | Display a list of all the defined faces (@code{list-faces-display}). | ||
| 2065 | |||
| 2066 | @item Display Colors | ||
| 2067 | Display a list of all the defined colors (@code{list-colors-display}). | ||
| 2068 | @end table | ||
| 2069 | |||
| 2070 | @node Format Faces | ||
| 2071 | @subsection Faces in Formatted Text | ||
| 2072 | |||
| 2073 | The Faces submenu lists various Emacs faces including @code{bold}, | ||
| 2074 | @code{italic}, and @code{underline} (@pxref{Faces}). These menu items | ||
| 2075 | operate on the region if it is active and nonempty. Otherwise, they | ||
| 2076 | specify to use that face for an immediately following self-inserting | ||
| 2077 | character. Instead of the menu, you can use these keyboard commands: | ||
| 2078 | |||
| 2079 | @table @kbd | ||
| 2080 | @kindex M-o d @r{(Enriched mode)} | ||
| 2081 | @findex facemenu-set-default | ||
| 2082 | @item M-o d | ||
| 2083 | Remove all @code{face} properties from the region (which includes | ||
| 2084 | specified colors), or force the following inserted character to have no | ||
| 2085 | @code{face} property (@code{facemenu-set-default}). | ||
| 2086 | @kindex M-o b @r{(Enriched mode)} | ||
| 2087 | @findex facemenu-set-bold | ||
| 2088 | @item M-o b | ||
| 2089 | Add the face @code{bold} to the region or to the following inserted | ||
| 2090 | character (@code{facemenu-set-bold}). | ||
| 2091 | @kindex M-o i @r{(Enriched mode)} | ||
| 2092 | @findex facemenu-set-italic | ||
| 2093 | @item M-o i | ||
| 2094 | Add the face @code{italic} to the region or to the following inserted | ||
| 2095 | character (@code{facemenu-set-italic}). | ||
| 2096 | @kindex M-o l @r{(Enriched mode)} | ||
| 2097 | @findex facemenu-set-bold-italic | ||
| 2098 | @item M-o l | ||
| 2099 | Add the face @code{bold-italic} to the region or to the following | ||
| 2100 | inserted character (@code{facemenu-set-bold-italic}). | ||
| 2101 | @kindex M-o u @r{(Enriched mode)} | ||
| 2102 | @findex facemenu-set-underline | ||
| 2103 | @item M-o u | ||
| 2104 | Add the face @code{underline} to the region or to the following inserted | ||
| 2105 | character (@code{facemenu-set-underline}). | ||
| 2106 | @kindex M-o o @r{(Enriched mode)} | ||
| 2107 | @findex facemenu-set-face | ||
| 2108 | @item M-o o @var{face} @key{RET} | ||
| 2109 | Add the face @var{face} to the region or to the following inserted | ||
| 2110 | character (@code{facemenu-set-face}). | ||
| 2111 | @end table | ||
| 2112 | |||
| 2113 | With a prefix argument, all these commands apply to an immediately | ||
| 2114 | following self-inserting character, disregarding the region. | ||
| 2115 | |||
| 2116 | A self-inserting character normally inherits the @code{face} | ||
| 2117 | property (and most other text properties) from the preceding character | ||
| 2118 | in the buffer. If you use the above commands to specify face for the | ||
| 2119 | next self-inserting character, or the next section's commands to | ||
| 2120 | specify a foreground or background color for it, then it does not | ||
| 2121 | inherit the @code{face} property from the preceding character; instead | ||
| 2122 | it uses whatever you specified. It will still inherit other text | ||
| 2123 | properties, though. | ||
| 2124 | |||
| 2125 | Strictly speaking, these commands apply only to the first following | ||
| 2126 | self-inserting character that you type. But if you insert additional | ||
| 2127 | characters after it, they will inherit from the first one. So it | ||
| 2128 | appears that these commands apply to all of them. | ||
| 2129 | |||
| 2130 | Enriched mode defines two additional faces: @code{excerpt} and | ||
| 2131 | @code{fixed}. These correspond to codes used in the text/enriched file | ||
| 2132 | format. | ||
| 2133 | |||
| 2134 | The @code{excerpt} face is intended for quotations. This face is the | ||
| 2135 | same as @code{italic} unless you customize it (@pxref{Face Customization}). | ||
| 2136 | |||
| 2137 | The @code{fixed} face means, ``Use a fixed-width font for this part | ||
| 2138 | of the text.'' Applying the @code{fixed} face to a part of the text | ||
| 2139 | will cause that part of the text to appear in a fixed-width font, even | ||
| 2140 | if the default font is variable-width. This applies to Emacs and to | ||
| 2141 | other systems that display text/enriched format. So if you | ||
| 2142 | specifically want a certain part of the text to use a fixed-width | ||
| 2143 | font, you should specify the @code{fixed} face for that part. | ||
| 2144 | |||
| 2145 | By default, the @code{fixed} face looks the same as @code{bold}. | ||
| 2146 | This is an attempt to distinguish it from @code{default}. You may | ||
| 2147 | wish to customize @code{fixed} to some other fixed-width medium font. | ||
| 2148 | @xref{Face Customization}. | ||
| 2149 | |||
| 2150 | If your terminal cannot display different faces, you will not be | ||
| 2151 | able to see them, but you can still edit documents containing faces, | ||
| 2152 | and even add faces and colors to documents. The faces you specify | ||
| 2153 | will be visible when the file is viewed on a terminal that can display | ||
| 2154 | them. | ||
| 2155 | |||
| 2156 | @node Format Colors | ||
| 2157 | @subsection Colors in Formatted Text | ||
| 2158 | |||
| 2159 | You can specify foreground and background colors for portions of the | ||
| 2160 | text. There is a menu for specifying the foreground color and a menu | ||
| 2161 | for specifying the background color. Each color menu lists all the | ||
| 2162 | colors that you have used in Enriched mode in the current Emacs session. | ||
| 2163 | |||
| 2164 | If you specify a color with a prefix argument---or, in Transient | ||
| 2165 | Mark mode, if the region is not active---then it applies to any | ||
| 2166 | immediately following self-inserting input. Otherwise, the command | ||
| 2167 | applies to the region. | ||
| 2168 | |||
| 2169 | Each color menu contains one additional item: @samp{Other}. You can use | ||
| 2170 | this item to specify a color that is not listed in the menu; it reads | ||
| 2171 | the color name with the minibuffer. To display a list of available colors | ||
| 2172 | and their names, use the @samp{Display Colors} menu item in the Text | ||
| 2173 | Properties menu (@pxref{Editing Format Info}). | ||
| 2174 | |||
| 2175 | Any color that you specify in this way, or that is mentioned in a | ||
| 2176 | formatted text file that you read in, is added to the corresponding | ||
| 2177 | color menu for the duration of the Emacs session. | ||
| 2178 | |||
| 2179 | @findex facemenu-set-foreground | ||
| 2180 | @findex facemenu-set-background | ||
| 2181 | There are no predefined key bindings for specifying colors, but you can do so | ||
| 2182 | with the extended commands @kbd{M-x facemenu-set-foreground} and | ||
| 2183 | @kbd{M-x facemenu-set-background}. Both of these commands read the name | ||
| 2184 | of the color with the minibuffer. | ||
| 2185 | |||
| 2186 | @node Format Indentation | ||
| 2187 | @subsection Indentation in Formatted Text | ||
| 2188 | |||
| 2189 | When editing formatted text, you can specify different amounts of | ||
| 2190 | indentation for the right or left margin of an entire paragraph or a | ||
| 2191 | part of a paragraph. The margins you specify automatically affect the | ||
| 2192 | Emacs fill commands (@pxref{Filling}) and line-breaking commands. | ||
| 2193 | |||
| 2194 | The Indentation submenu provides a convenient interface for specifying | ||
| 2195 | these properties. The submenu contains four items: | ||
| 2196 | |||
| 2197 | @table @code | ||
| 2198 | @kindex C-x TAB @r{(Enriched mode)} | ||
| 2199 | @findex increase-left-margin | ||
| 2200 | @item Indent More | ||
| 2201 | Indent the region by 4 columns (@code{increase-left-margin}). In | ||
| 2202 | Enriched mode, this command is also available on @kbd{C-x @key{TAB}}; if | ||
| 2203 | you supply a numeric argument, that says how many columns to add to the | ||
| 2204 | margin (a negative argument reduces the number of columns). | ||
| 2205 | |||
| 2206 | @item Indent Less | ||
| 2207 | Remove 4 columns of indentation from the region. | ||
| 2208 | |||
| 2209 | @item Indent Right More | ||
| 2210 | Make the text narrower by indenting 4 columns at the right margin. | ||
| 2211 | |||
| 2212 | @item Indent Right Less | ||
| 2213 | Remove 4 columns of indentation from the right margin. | ||
| 2214 | @end table | ||
| 2215 | |||
| 2216 | You can use these commands repeatedly to increase or decrease the | ||
| 2217 | indentation. | ||
| 2218 | |||
| 2219 | The most common way to use them is to change the indentation of an | ||
| 2220 | entire paragraph. For other uses, the effects of refilling can be | ||
| 2221 | hard to predict, except in some special cases like the one described | ||
| 2222 | next. | ||
| 2223 | |||
| 2224 | The most common other use is to format paragraphs with @dfn{hanging | ||
| 2225 | indents}, which means that the first line is indented less than | ||
| 2226 | subsequent lines. To set up a hanging indent, increase the | ||
| 2227 | indentation of the region starting after the first word of the | ||
| 2228 | paragraph and running until the end of the paragraph. | ||
| 2229 | |||
| 2230 | Indenting the first line of a paragraph is easier. Set the margin for | ||
| 2231 | the whole paragraph where you want it to be for the body of the | ||
| 2232 | paragraph, then indent the first line by inserting extra spaces or tabs. | ||
| 2233 | |||
| 2234 | @vindex standard-indent | ||
| 2235 | The variable @code{standard-indent} specifies how many columns these | ||
| 2236 | commands should add to or subtract from the indentation. The default | ||
| 2237 | value is 4. The overall default right margin for Enriched mode is | ||
| 2238 | controlled by the variable @code{fill-column}, as usual. | ||
| 2239 | |||
| 2240 | @kindex C-c [ @r{(Enriched mode)} | ||
| 2241 | @kindex C-c ] @r{(Enriched mode)} | ||
| 2242 | @findex set-left-margin | ||
| 2243 | @findex set-right-margin | ||
| 2244 | There are also two commands for setting the left or right margin of | ||
| 2245 | the region absolutely: @code{set-left-margin} and | ||
| 2246 | @code{set-right-margin}. Enriched mode binds these commands to | ||
| 2247 | @kbd{C-c [} and @kbd{C-c ]}, respectively. You can specify the | ||
| 2248 | margin width either with a numeric argument or in the minibuffer. | ||
| 2249 | |||
| 2250 | Sometimes, as a result of editing, the filling of a paragraph becomes | ||
| 2251 | messed up---parts of the paragraph may extend past the left or right | ||
| 2252 | margins. When this happens, use @kbd{M-q} (@code{fill-paragraph}) to | ||
| 2253 | refill the paragraph. | ||
| 2254 | |||
| 2255 | The fill prefix, if any, works in addition to the specified paragraph | ||
| 2256 | indentation: @kbd{C-x .} does not include the specified indentation's | ||
| 2257 | whitespace in the new value for the fill prefix, and the fill commands | ||
| 2258 | look for the fill prefix after the indentation on each line. @xref{Fill | ||
| 2259 | Prefix}. | ||
| 2260 | |||
| 2261 | @node Format Justification | ||
| 2262 | @subsection Justification in Formatted Text | ||
| 2263 | |||
| 2264 | When editing formatted text, you can specify various styles of | ||
| 2265 | justification for a paragraph. The style you specify automatically | ||
| 2266 | affects the Emacs fill commands. | ||
| 2267 | |||
| 2268 | The Justification submenu provides a convenient interface for specifying | ||
| 2269 | the style. The submenu contains five items: | ||
| 2270 | |||
| 2271 | @table @code | ||
| 2272 | @item Left | ||
| 2273 | This is the most common style of justification (at least for English). | ||
| 2274 | Lines are aligned at the left margin but left uneven at the right. | ||
| 2275 | |||
| 2276 | @item Right | ||
| 2277 | This aligns each line with the right margin. Spaces and tabs are added | ||
| 2278 | on the left, if necessary, to make lines line up on the right. | ||
| 2279 | |||
| 2280 | @item Full | ||
| 2281 | This justifies the text, aligning both edges of each line. Justified | ||
| 2282 | text looks very nice in a printed book, where the spaces can all be | ||
| 2283 | adjusted equally, but it does not look as nice with a fixed-width font | ||
| 2284 | on the screen. Perhaps a future version of Emacs will be able to adjust | ||
| 2285 | the width of spaces in a line to achieve elegant justification. | ||
| 2286 | |||
| 2287 | @item Center | ||
| 2288 | This centers every line between the current margins. | ||
| 2289 | |||
| 2290 | @item Unfilled | ||
| 2291 | This turns off filling entirely. Each line will remain as you wrote it; | ||
| 2292 | the fill and auto-fill functions will have no effect on text which has | ||
| 2293 | this setting. You can, however, still indent the left margin. In | ||
| 2294 | unfilled regions, all newlines are treated as hard newlines (@pxref{Hard | ||
| 2295 | and Soft Newlines}) . | ||
| 2296 | @end table | ||
| 2297 | |||
| 2298 | In Enriched mode, you can also specify justification from the keyboard | ||
| 2299 | using the @kbd{M-j} prefix character: | ||
| 2300 | |||
| 2301 | @table @kbd | ||
| 2302 | @kindex M-j l @r{(Enriched mode)} | ||
| 2303 | @findex set-justification-left | ||
| 2304 | @item M-j l | ||
| 2305 | Make the region left-filled (@code{set-justification-left}). | ||
| 2306 | @kindex M-j r @r{(Enriched mode)} | ||
| 2307 | @findex set-justification-right | ||
| 2308 | @item M-j r | ||
| 2309 | Make the region right-filled (@code{set-justification-right}). | ||
| 2310 | @kindex M-j b @r{(Enriched mode)} | ||
| 2311 | @findex set-justification-full | ||
| 2312 | @item M-j b | ||
| 2313 | Make the region fully justified (@code{set-justification-full}). | ||
| 2314 | @kindex M-j c @r{(Enriched mode)} | ||
| 2315 | @kindex M-S @r{(Enriched mode)} | ||
| 2316 | @findex set-justification-center | ||
| 2317 | @item M-j c | ||
| 2318 | @itemx M-S | ||
| 2319 | Make the region centered (@code{set-justification-center}). | ||
| 2320 | @kindex M-j u @r{(Enriched mode)} | ||
| 2321 | @findex set-justification-none | ||
| 2322 | @item M-j u | ||
| 2323 | Make the region unfilled (@code{set-justification-none}). | ||
| 2324 | @end table | ||
| 2325 | |||
| 2326 | Justification styles apply to entire paragraphs. All the | ||
| 2327 | justification-changing commands operate on the paragraph containing | ||
| 2328 | point, or, if the region is active, on all paragraphs which overlap the | ||
| 2329 | region. | ||
| 2330 | |||
| 2331 | @vindex default-justification | ||
| 2332 | The default justification style is specified by the variable | ||
| 2333 | @code{default-justification}. Its value should be one of the symbols | ||
| 2334 | @code{left}, @code{right}, @code{full}, @code{center}, or @code{none}. | ||
| 2335 | This is a per-buffer variable. Setting the variable directly affects | ||
| 2336 | only the current buffer. However, customizing it in a Custom buffer | ||
| 2337 | sets (as always) the default value for buffers that do not override it. | ||
| 2338 | @xref{Locals}, and @ref{Easy Customization}. | ||
| 2339 | |||
| 2340 | @node Format Properties | ||
| 2341 | @subsection Setting Other Text Properties | ||
| 2342 | |||
| 2343 | The Special Properties menu lets you add or remove three other useful text | ||
| 2344 | properties: @code{read-only}, @code{invisible} and @code{intangible}. | ||
| 2345 | The @code{intangible} property disallows moving point within the text, | ||
| 2346 | the @code{invisible} text property hides text from display, and the | ||
| 2347 | @code{read-only} property disallows alteration of the text. | ||
| 2348 | |||
| 2349 | Each of these special properties has a menu item to add it to the | ||
| 2350 | region. The last menu item, @samp{Remove Special}, removes all of these | ||
| 2351 | special properties from the text in the region. | ||
| 2352 | |||
| 2353 | Currently, the @code{invisible} and @code{intangible} properties are | ||
| 2354 | @emph{not} saved in the text/enriched format. The @code{read-only} | ||
| 2355 | property is saved, but it is not a standard part of the text/enriched | ||
| 2356 | format, so other editors may not respect it. | ||
| 2357 | |||
| 2358 | @node Forcing Enriched Mode | ||
| 2359 | @subsection Forcing Enriched Mode | ||
| 2360 | |||
| 2361 | Normally, Emacs knows when you are editing formatted text because it | ||
| 2362 | recognizes the special annotations used in the file that you visited. | ||
| 2363 | However, sometimes you must take special actions to convert file | ||
| 2364 | contents or turn on Enriched mode: | ||
| 2365 | |||
| 2366 | @itemize @bullet | ||
| 2367 | @item | ||
| 2368 | When you visit a file that was created with some other editor, Emacs may | ||
| 2369 | not recognize the file as being in the text/enriched format. In this | ||
| 2370 | case, when you visit the file you will see the formatting commands | ||
| 2371 | rather than the formatted text. Type @kbd{M-x format-decode-buffer} to | ||
| 2372 | translate it. This also automatically turns on Enriched mode. | ||
| 2373 | |||
| 2374 | @item | ||
| 2375 | When you @emph{insert} a file into a buffer, rather than visiting it, | ||
| 2376 | Emacs does the necessary conversions on the text which you insert, but | ||
| 2377 | it does not enable Enriched mode. If you wish to do that, type @kbd{M-x | ||
| 2378 | enriched-mode}. | ||
| 2379 | @end itemize | ||
| 2380 | |||
| 2381 | The command @code{format-decode-buffer} translates text in various | ||
| 2382 | formats into Emacs's internal format. It asks you to specify the format | ||
| 2383 | to translate from; however, normally you can type just @key{RET}, which | ||
| 2384 | tells Emacs to guess the format. | ||
| 2385 | |||
| 2386 | @findex format-find-file | ||
| 2387 | If you wish to look at a text/enriched file in its raw form, as a | ||
| 2388 | sequence of characters rather than as formatted text, use the @kbd{M-x | ||
| 2389 | find-file-literally} command. This visits a file, like | ||
| 2390 | @code{find-file}, but does not do format conversion. It also inhibits | ||
| 2391 | character code conversion (@pxref{Coding Systems}) and automatic | ||
| 2392 | uncompression (@pxref{Compressed Files}). To disable format conversion | ||
| 2393 | but allow character code conversion and/or automatic uncompression if | ||
| 2394 | appropriate, use @code{format-find-file} with suitable arguments. | ||
| 2395 | |||
| 2396 | @node Text Based Tables | ||
| 2397 | @section Editing Text-based Tables | ||
| 2398 | @cindex table mode | ||
| 2399 | @cindex text-based tables | ||
| 2400 | |||
| 2401 | Table mode provides an easy and intuitive way to create and edit WYSIWYG | ||
| 2402 | text-based tables. Here is an example of such a table: | ||
| 2403 | |||
| 2404 | @smallexample | ||
| 2405 | @group | ||
| 2406 | +-----------------+--------------------------------+-----------------+ | ||
| 2407 | | Command | Description | Key Binding | | ||
| 2408 | +-----------------+--------------------------------+-----------------+ | ||
| 2409 | | forward-char |Move point right N characters | C-f | | ||
| 2410 | | |(left if N is negative). | | | ||
| 2411 | | | | | | ||
| 2412 | | |On reaching end of buffer, stop | | | ||
| 2413 | | |and signal error. | | | ||
| 2414 | +-----------------+--------------------------------+-----------------+ | ||
| 2415 | | backward-char |Move point left N characters | C-b | | ||
| 2416 | | |(right if N is negative). | | | ||
| 2417 | | | | | | ||
| 2418 | | |On attempt to pass beginning or | | | ||
| 2419 | | |end of buffer, stop and signal | | | ||
| 2420 | | |error. | | | ||
| 2421 | +-----------------+--------------------------------+-----------------+ | ||
| 2422 | @end group | ||
| 2423 | @end smallexample | ||
| 2424 | |||
| 2425 | Table mode allows the contents of the table such as this one to be | ||
| 2426 | easily manipulated by inserting or deleting characters inside a cell. | ||
| 2427 | A cell is effectively a localized rectangular edit region and edits to | ||
| 2428 | a cell do not affect the contents of the surrounding cells. If the | ||
| 2429 | contents do not fit into a cell, then the cell is automatically | ||
| 2430 | expanded in the vertical and/or horizontal directions and the rest of | ||
| 2431 | the table is restructured and reformatted in accordance with the | ||
| 2432 | growth of the cell. | ||
| 2433 | |||
| 2434 | @menu | ||
| 2435 | * Table Definition:: What is a text based table. | ||
| 2436 | * Table Creation:: How to create a table. | ||
| 2437 | * Table Recognition:: How to activate and deactivate tables. | ||
| 2438 | * Cell Commands:: Cell-oriented commands in a table. | ||
| 2439 | * Cell Justification:: Justifying cell contents. | ||
| 2440 | * Row Commands:: Manipulating rows of table cell. | ||
| 2441 | * Column Commands:: Manipulating columns of table cell. | ||
| 2442 | * Fixed Width Mode:: Fixing cell width. | ||
| 2443 | * Table Conversion:: Converting between plain text and tables. | ||
| 2444 | * Measuring Tables:: Analyzing table dimension. | ||
| 2445 | * Table Misc:: Table miscellany. | ||
| 2446 | @end menu | ||
| 2447 | |||
| 2448 | @node Table Definition | ||
| 2449 | @subsection What is a Text-based Table? | ||
| 2450 | |||
| 2451 | Keep the following examples of valid tables in mind as a reference | ||
| 2452 | while you read this section: | ||
| 2453 | |||
| 2454 | @example | ||
| 2455 | +--+----+---+ +-+ +--+-----+ | ||
| 2456 | | | | | | | | | | | ||
| 2457 | +--+----+---+ +-+ | +--+--+ | ||
| 2458 | | | | | | | | | | ||
| 2459 | +--+----+---+ +--+--+ | | ||
| 2460 | | | | | ||
| 2461 | +-----+--+ | ||
| 2462 | @end example | ||
| 2463 | |||
| 2464 | A table consists of a rectangular frame whose inside is divided into | ||
| 2465 | cells. Each cell must be at least one character wide and one | ||
| 2466 | character high, not counting its border lines. A cell can be | ||
| 2467 | subdivided into multiple rectangular cells, but cells cannot overlap. | ||
| 2468 | |||
| 2469 | The table frame and cell border lines are made of three special | ||
| 2470 | characters. These variables specify those characters: | ||
| 2471 | |||
| 2472 | @table @code | ||
| 2473 | @vindex table-cell-vertical-char | ||
| 2474 | @item table-cell-vertical-char | ||
| 2475 | Holds the character used for vertical lines. The default value is | ||
| 2476 | @samp{|}. | ||
| 2477 | |||
| 2478 | @vindex table-cell-horizontal-char | ||
| 2479 | @item table-cell-horizontal-char | ||
| 2480 | Holds the character used for horizontal lines. The default value is | ||
| 2481 | @samp{-}. | ||
| 2482 | |||
| 2483 | @vindex table-cell-intersection-char | ||
| 2484 | @item table-cell-intersection-char | ||
| 2485 | Holds the character used at where horizontal line and vertical line | ||
| 2486 | meet. The default value is @samp{+}. | ||
| 2487 | @end table | ||
| 2488 | |||
| 2489 | @noindent | ||
| 2490 | Based on this definition, the following five tables are examples of invalid | ||
| 2491 | tables: | ||
| 2492 | |||
| 2493 | @example | ||
| 2494 | +-----+ +-----+ +--+ +-++--+ ++ | ||
| 2495 | | | | | | | | || | ++ | ||
| 2496 | | +-+ | | | | | | || | | ||
| 2497 | | | | | +--+ | +--+--+ +-++--+ | ||
| 2498 | | +-+ | | | | | | | +-++--+ | ||
| 2499 | | | | | | | | | | || | | ||
| 2500 | +-----+ +--+--+ +--+--+ +-++--+ | ||
| 2501 | a b c d e | ||
| 2502 | @end example | ||
| 2503 | |||
| 2504 | From left to right: | ||
| 2505 | |||
| 2506 | @enumerate a | ||
| 2507 | @item | ||
| 2508 | Overlapped cells or non-rectangular cells are not allowed. | ||
| 2509 | @item | ||
| 2510 | Same as a. | ||
| 2511 | @item | ||
| 2512 | The border must be rectangular. | ||
| 2513 | @item | ||
| 2514 | Cells must have a minimum width/height of one character. | ||
| 2515 | @item | ||
| 2516 | Same as d. | ||
| 2517 | @end enumerate | ||
| 2518 | |||
| 2519 | @node Table Creation | ||
| 2520 | @subsection How to Create a Table? | ||
| 2521 | @cindex create a text-based table | ||
| 2522 | @cindex table creation | ||
| 2523 | |||
| 2524 | @findex table-insert | ||
| 2525 | The command to create a table is @code{table-insert}. When called | ||
| 2526 | interactively, it asks for the number of columns, number of rows, cell | ||
| 2527 | width and cell height. The number of columns is the number of cells | ||
| 2528 | horizontally side by side. The number of rows is the number of cells | ||
| 2529 | vertically within the table's height. The cell width is a number of | ||
| 2530 | characters that each cell holds, left to right. The cell height is a | ||
| 2531 | number of lines each cell holds. The cell width and the cell height | ||
| 2532 | can be either an integer (when the value is constant across the table) | ||
| 2533 | or a series of integer, separated by spaces or commas, where each | ||
| 2534 | number corresponds to the next cell within a row from left to right, | ||
| 2535 | or the next cell within a column from top to bottom. | ||
| 2536 | |||
| 2537 | @node Table Recognition | ||
| 2538 | @subsection Table Recognition | ||
| 2539 | @cindex table recognition | ||
| 2540 | |||
| 2541 | @findex table-recognize | ||
| 2542 | @findex table-unrecognize | ||
| 2543 | Table mode maintains special text properties in the buffer to allow | ||
| 2544 | editing in a convenient fashion. When a buffer with tables is saved | ||
| 2545 | to its file, these text properties are lost, so when you visit this | ||
| 2546 | file again later, Emacs does not see a table, but just formatted text. | ||
| 2547 | To resurrect the table text properties, issue the @kbd{M-x | ||
| 2548 | table-recognize} command. It scans the current buffer, recognizes | ||
| 2549 | valid table cells, and attaches appropriate text properties to allow | ||
| 2550 | for table editing. The converse command, @code{table-unrecognize}, is | ||
| 2551 | used to remove the special text properties and convert the buffer back | ||
| 2552 | to plain text. | ||
| 2553 | |||
| 2554 | Special commands exist to enable or disable tables within a region, | ||
| 2555 | enable or disable individual tables, and enable/disable individual | ||
| 2556 | cells. These commands are: | ||
| 2557 | |||
| 2558 | @table @kbd | ||
| 2559 | @findex table-recognize-region | ||
| 2560 | @item M-x table-recognize-region | ||
| 2561 | Recognize tables within the current region and activate them. | ||
| 2562 | @findex table-unrecognize-region | ||
| 2563 | @item M-x table-unrecognize-region | ||
| 2564 | Deactivate tables within the current region. | ||
| 2565 | @findex table-recognize-table | ||
| 2566 | @item M-x table-recognize-table | ||
| 2567 | Recognize the table under point and activate it. | ||
| 2568 | @findex table-unrecognize-table | ||
| 2569 | @item M-x table-unrecognize-table | ||
| 2570 | Deactivate the table under point. | ||
| 2571 | @findex table-recognize-cell | ||
| 2572 | @item M-x table-recognize-cell | ||
| 2573 | Recognize the cell under point and activate it. | ||
| 2574 | @findex table-unrecognize-cell | ||
| 2575 | @item M-x table-unrecognize-cell | ||
| 2576 | Deactivate the cell under point. | ||
| 2577 | @end table | ||
| 2578 | |||
| 2579 | For another way of converting text into tables, see @ref{Table | ||
| 2580 | Conversion}. | ||
| 2581 | |||
| 2582 | @node Cell Commands | ||
| 2583 | @subsection Commands for Table Cells | ||
| 2584 | |||
| 2585 | @findex table-forward-cell | ||
| 2586 | @findex table-backward-cell | ||
| 2587 | The commands @code{table-forward-cell} and | ||
| 2588 | @code{table-backward-cell} move point from the current cell to an | ||
| 2589 | adjacent cell forward and backward respectively. The order of the | ||
| 2590 | cells is cyclic: when point is in the last cell of a table, typing | ||
| 2591 | @kbd{M-x table-forward-cell} moves to the first cell in the table. | ||
| 2592 | Likewise @kbd{M-x table-backward-cell} from the first cell in a table | ||
| 2593 | moves to the last cell. | ||
| 2594 | |||
| 2595 | @findex table-span-cell | ||
| 2596 | The command @code{table-span-cell} merges the current cell with the | ||
| 2597 | adjacent cell in a specified direction---right, left, above or below. | ||
| 2598 | You specify the direction with the minibuffer. It does not allow | ||
| 2599 | merges which don't result in a legitimate cell layout. | ||
| 2600 | |||
| 2601 | @findex table-split-cell | ||
| 2602 | @cindex text-based tables, split a cell | ||
| 2603 | @cindex split table cell | ||
| 2604 | The command @code{table-split-cell} splits the current cell | ||
| 2605 | vertically or horizontally. This command is a wrapper to the | ||
| 2606 | direction specific commands @code{table-split-cell-vertically} and | ||
| 2607 | @code{table-split-cell-horizontally}. You specify the direction with | ||
| 2608 | a minibuffer argument. | ||
| 2609 | |||
| 2610 | @findex table-split-cell-vertically | ||
| 2611 | The command @code{table-split-cell-vertically} splits the current | ||
| 2612 | cell vertically and creates a pair of cells above and below where | ||
| 2613 | point is located. The content in the original cell is split as well. | ||
| 2614 | |||
| 2615 | @findex table-split-cell-horizontally | ||
| 2616 | The command @code{table-split-cell-horizontally} splits the current | ||
| 2617 | cell horizontally and creates a pair of cells right and left of where | ||
| 2618 | point is located. If the cell being split is not empty, this asks you | ||
| 2619 | how to handle the cell contents. The three options are: @code{split}, | ||
| 2620 | @code{left}, or @code{right}. @code{split} splits the contents at | ||
| 2621 | point literally, while the @code{left} and @code{right} options move | ||
| 2622 | the entire contents into the left or right cell respectively. | ||
| 2623 | |||
| 2624 | @cindex enlarge a table cell | ||
| 2625 | @cindex shrink a table cell | ||
| 2626 | The next four commands enlarge or shrink a cell. They use numeric | ||
| 2627 | arguments (@pxref{Arguments}) to specify how many columns or rows to | ||
| 2628 | enlarge or shrink a particular table. | ||
| 2629 | |||
| 2630 | @table @kbd | ||
| 2631 | @findex table-heighten-cell | ||
| 2632 | @item M-x table-heighten-cell | ||
| 2633 | Enlarge the current cell vertically. | ||
| 2634 | @findex table-shorten-cell | ||
| 2635 | @item M-x table-shorten-cell | ||
| 2636 | Shrink the current cell vertically. | ||
| 2637 | @findex table-widen-cell | ||
| 2638 | @item M-x table-widen-cell | ||
| 2639 | Enlarge the current cell horizontally. | ||
| 2640 | @findex table-narrow-cell | ||
| 2641 | @item M-x table-narrow-cell | ||
| 2642 | Shrink the current cell horizontally. | ||
| 2643 | @end table | ||
| 2644 | |||
| 2645 | @node Cell Justification | ||
| 2646 | @subsection Cell Justification | ||
| 2647 | @cindex cell text justification | ||
| 2648 | |||
| 2649 | You can specify text justification for each cell. The justification | ||
| 2650 | is remembered independently for each cell and the subsequent editing | ||
| 2651 | of cell contents is subject to the specified justification. | ||
| 2652 | |||
| 2653 | @findex table-justify | ||
| 2654 | The command @code{table-justify} ask you to specify what to justify: | ||
| 2655 | a cell, a column, or a row. If you select cell justification, this | ||
| 2656 | command sets the justification only for the current cell. Selecting | ||
| 2657 | column or row justification sets the justification for all the cells | ||
| 2658 | within a column or row respectively. The command then ask you which | ||
| 2659 | kind of justification to apply: @code{left}, @code{center}, | ||
| 2660 | @code{right}, @code{top}, @code{middle}, @code{bottom}, or | ||
| 2661 | @code{none}. Horizontal justification and vertical justification are | ||
| 2662 | specified independently. The options @code{left}, @code{center}, and | ||
| 2663 | @code{right} specify horizontal justification while the options | ||
| 2664 | @code{top}, @code{middle}, @code{bottom}, and @code{none} specify | ||
| 2665 | vertical justification. The vertical justification @code{none} | ||
| 2666 | effectively removes vertical justification. Horizontal justification | ||
| 2667 | must be one of @code{left}, @code{center}, or @code{right}. | ||
| 2668 | |||
| 2669 | @vindex table-detect-cell-alignment | ||
| 2670 | Justification information is stored in the buffer as a part of text | ||
| 2671 | property. Therefore, this information is ephemeral and does not | ||
| 2672 | survive through the loss of the buffer (closing the buffer and | ||
| 2673 | revisiting the buffer erase any previous text properties). To | ||
| 2674 | countermand for this, the command @code{table-recognize} and other | ||
| 2675 | recognition commands (@pxref{Table Recognition}) are equipped with a | ||
| 2676 | convenience feature (turned on by default). During table recognition, | ||
| 2677 | the contents of a cell are examined to determine which justification | ||
| 2678 | was originally applied to the cell and then applies this justification | ||
| 2679 | to the cell. This is a speculative algorithm and is therefore not | ||
| 2680 | perfect, however, the justification is deduced correctly most of the | ||
| 2681 | time. To disable this feature, customize the variable | ||
| 2682 | @code{table-detect-cell-alignment} and set it to @code{nil}. | ||
| 2683 | |||
| 2684 | @node Row Commands | ||
| 2685 | @subsection Commands for Table Rows | ||
| 2686 | @cindex table row commands | ||
| 2687 | |||
| 2688 | @cindex insert row in table | ||
| 2689 | @findex table-insert-row | ||
| 2690 | The command @code{table-insert-row} inserts a row of cells before | ||
| 2691 | the current row in a table. The current row where point is located is | ||
| 2692 | pushed down after the newly inserted row. A numeric prefix argument | ||
| 2693 | specifies the number of rows to insert. Note that in order to insert | ||
| 2694 | rows @emph{after} the last row at the bottom of a table, you must | ||
| 2695 | place point below the table---that is, outside the table---prior to | ||
| 2696 | invoking this command. | ||
| 2697 | |||
| 2698 | @cindex delete row in table | ||
| 2699 | @findex table-delete-row | ||
| 2700 | The command @code{table-delete-row} deletes a row of cells at point. | ||
| 2701 | A numeric prefix argument specifies the number of rows to delete. | ||
| 2702 | |||
| 2703 | @node Column Commands | ||
| 2704 | @subsection Commands for Table Columns | ||
| 2705 | @cindex table column commands | ||
| 2706 | |||
| 2707 | @cindex insert column in table | ||
| 2708 | @findex table-insert-column | ||
| 2709 | The command @code{table-insert-column} inserts a column of cells to | ||
| 2710 | the left of the current row in a table. This pushes the current | ||
| 2711 | column to the right. To insert a column to the right side of the | ||
| 2712 | rightmost column, place point to the right of the rightmost column, | ||
| 2713 | which is outside of the table, prior to invoking this command. A | ||
| 2714 | numeric prefix argument specifies the number of columns to insert. | ||
| 2715 | |||
| 2716 | @cindex delete column in table | ||
| 2717 | A command @code{table-delete-column} deletes a column of cells at | ||
| 2718 | point. A numeric prefix argument specifies the number of columns to | ||
| 2719 | delete. | ||
| 2720 | |||
| 2721 | @node Fixed Width Mode | ||
| 2722 | @subsection Fix Width of Cells | ||
| 2723 | @cindex fix width of table cells | ||
| 2724 | |||
| 2725 | @findex table-fixed-width-mode | ||
| 2726 | The command @code{table-fixed-width-mode} toggles fixed width mode | ||
| 2727 | on and off. When fixed width mode is turned on, editing inside a | ||
| 2728 | cell never changes the cell width; when it is off, the cell width | ||
| 2729 | expands automatically in order to prevent a word from being folded | ||
| 2730 | into multiple lines. By default, fixed width mode is disabled. | ||
| 2731 | |||
| 2732 | @node Table Conversion | ||
| 2733 | @subsection Conversion Between Plain Text and Tables | ||
| 2734 | @cindex text to table | ||
| 2735 | @cindex table to text | ||
| 2736 | |||
| 2737 | @findex table-capture | ||
| 2738 | The command @code{table-capture} captures plain text in a region and | ||
| 2739 | turns it into a table. Unlike @code{table-recognize} (@pxref{Table | ||
| 2740 | Recognition}), the original text does not have a table appearance but | ||
| 2741 | may hold a logical table structure. For example, some elements | ||
| 2742 | separated by known patterns form a two dimensional structure which can | ||
| 2743 | be turned into a table. | ||
| 2744 | |||
| 2745 | Here's an example of data that @code{table-capture} can operate on. | ||
| 2746 | The numbers are horizontally separated by a comma and vertically | ||
| 2747 | separated by a newline character. | ||
| 2748 | |||
| 2749 | @example | ||
| 2750 | 1, 2, 3, 4 | ||
| 2751 | 5, 6, 7, 8 | ||
| 2752 | , 9, 10 | ||
| 2753 | @end example | ||
| 2754 | |||
| 2755 | @noindent | ||
| 2756 | Invoking @kbd{M-x table-capture} on that text produces this table: | ||
| 2757 | |||
| 2758 | @example | ||
| 2759 | +-----+-----+-----+-----+ | ||
| 2760 | |1 |2 |3 |4 | | ||
| 2761 | +-----+-----+-----+-----+ | ||
| 2762 | |5 |6 |7 |8 | | ||
| 2763 | +-----+-----+-----+-----+ | ||
| 2764 | | |9 |10 | | | ||
| 2765 | +-----+-----+-----+-----+ | ||
| 2766 | @end example | ||
| 2767 | |||
| 2768 | @noindent | ||
| 2769 | The conversion uses @samp{,} for the column delimiter and newline for | ||
| 2770 | a row delimiter, cells are left justified, and minimum cell width is | ||
| 2771 | 5. | ||
| 2772 | |||
| 2773 | @findex table-release | ||
| 2774 | The command @code{table-release} does the opposite of | ||
| 2775 | @code{table-capture}. It releases a table by removing the table frame | ||
| 2776 | and cell borders. This leaves the table contents as plain text. One | ||
| 2777 | of the useful applications of @code{table-capture} and | ||
| 2778 | @code{table-release} is to edit a text in layout. Look at the | ||
| 2779 | following three paragraphs (the latter two are indented with header | ||
| 2780 | lines): | ||
| 2781 | |||
| 2782 | @example | ||
| 2783 | @samp{table-capture} is a powerful command, but mastering its | ||
| 2784 | power requires some practice. Here are some things it can do: | ||
| 2785 | |||
| 2786 | Parse Cell Items By using column delimiter regular | ||
| 2787 | expression and raw delimiter regular | ||
| 2788 | expression, it parses the specified text | ||
| 2789 | area and extracts cell items from | ||
| 2790 | non-table text and then forms a table out | ||
| 2791 | of them. | ||
| 2792 | |||
| 2793 | Capture Text Area When no delimiters are specified it | ||
| 2794 | creates a single cell table. The text in | ||
| 2795 | the specified region is placed in that | ||
| 2796 | cell. | ||
| 2797 | @end example | ||
| 2798 | |||
| 2799 | @noindent | ||
| 2800 | Applying @code{table-capture} to a region containing the above three | ||
| 2801 | paragraphs, with empty strings for column delimiter regexp and row | ||
| 2802 | delimiter regexp, creates a table with a single cell like the | ||
| 2803 | following one. | ||
| 2804 | |||
| 2805 | @c The first line's right-hand frame in the following two examples | ||
| 2806 | @c sticks out to accommodate for the removal of @samp in the | ||
| 2807 | @c produced output!! | ||
| 2808 | @smallexample | ||
| 2809 | @group | ||
| 2810 | +-----------------------------------------------------------------+ | ||
| 2811 | |@samp{table-capture} is a powerful command, but mastering its | | ||
| 2812 | |power requires some practice. Here are some things it can do: | | ||
| 2813 | | | | ||
| 2814 | |Parse Cell Items By using column delimiter regular | | ||
| 2815 | | expression and raw delimiter regular | | ||
| 2816 | | expression, it parses the specified text | | ||
| 2817 | | area and extracts cell items from | | ||
| 2818 | | non-table text and then forms a table out | | ||
| 2819 | | of them. | | ||
| 2820 | | | | ||
| 2821 | |Capture Text Area When no delimiters are specified it | | ||
| 2822 | | creates a single cell table. The text in | | ||
| 2823 | | the specified region is placed in that | | ||
| 2824 | | cell. | | ||
| 2825 | +-----------------------------------------------------------------+ | ||
| 2826 | @end group | ||
| 2827 | @end smallexample | ||
| 2828 | |||
| 2829 | @noindent | ||
| 2830 | By splitting the cell appropriately we now have a table consisting of | ||
| 2831 | paragraphs occupying its own cell. Each cell can now be edited | ||
| 2832 | independently without affecting the layout of other cells. | ||
| 2833 | |||
| 2834 | @smallexample | ||
| 2835 | +-----------------------------------------------------------------+ | ||
| 2836 | |@samp{table-capture} is a powerful command, but mastering its | | ||
| 2837 | |power requires some practice. Here are some things it can do: | | ||
| 2838 | +---------------------+-------------------------------------------+ | ||
| 2839 | |Parse Cell Items |By using column delimiter regular | | ||
| 2840 | | |expression and raw delimiter regular | | ||
| 2841 | | |expression, it parses the specified text | | ||
| 2842 | | |area and extracts cell items from | | ||
| 2843 | | |non-table text and then forms a table out | | ||
| 2844 | | |of them. | | ||
| 2845 | +---------------------+-------------------------------------------+ | ||
| 2846 | |Capture Text Area |When no delimiters are specified it | | ||
| 2847 | | |creates a single cell table. The text in | | ||
| 2848 | | |the specified region is placed in that | | ||
| 2849 | | |cell. | | ||
| 2850 | +---------------------+-------------------------------------------+ | ||
| 2851 | @end smallexample | ||
| 2852 | |||
| 2853 | @noindent | ||
| 2854 | By applying @code{table-release}, which does the opposite process, the | ||
| 2855 | contents become once again plain text. @code{table-release} works as | ||
| 2856 | a companion command to @code{table-capture}. | ||
| 2857 | |||
| 2858 | @node Measuring Tables | ||
| 2859 | @subsection Analyzing Table Dimensions | ||
| 2860 | @cindex table dimensions | ||
| 2861 | |||
| 2862 | @findex table-query-dimension | ||
| 2863 | The command @code{table-query-dimension} analyzes a table structure | ||
| 2864 | and reports information regarding its dimensions. In case of the | ||
| 2865 | above example table, the @code{table-query-dimension} command displays | ||
| 2866 | in echo area: | ||
| 2867 | |||
| 2868 | @smallexample | ||
| 2869 | Cell: (21w, 6h), Table: (67w, 16h), Dim: (2c, 3r), Total Cells: 5 | ||
| 2870 | @end smallexample | ||
| 2871 | |||
| 2872 | @noindent | ||
| 2873 | This indicates that the current cell is 21 character wide and 6 lines | ||
| 2874 | high, the entire table is 67 characters wide and 16 lines high. The | ||
| 2875 | table has 2 columns and 3 rows. It has a total of 5 cells, since the | ||
| 2876 | first row has a spanned cell. | ||
| 2877 | |||
| 2878 | @node Table Misc | ||
| 2879 | @subsection Table Miscellany | ||
| 2880 | |||
| 2881 | @cindex insert string into table cells | ||
| 2882 | @findex table-insert-sequence | ||
| 2883 | The command @code{table-insert-sequence} inserts a string into each | ||
| 2884 | cell. Each string is a part of a sequence i.e.@: a series of | ||
| 2885 | increasing integer numbers. | ||
| 2886 | |||
| 2887 | @cindex table in language format | ||
| 2888 | @cindex table for HTML and LaTeX | ||
| 2889 | @findex table-generate-source | ||
| 2890 | The command @code{table-generate-source} generates a table formatted | ||
| 2891 | for a specific markup language. It asks for a language (which must be | ||
| 2892 | one of @code{html}, @code{latex}, or @code{cals}), a destination | ||
| 2893 | buffer where to put the result, and the table caption (a string), and | ||
| 2894 | then inserts the generated table in the proper syntax into the | ||
| 2895 | destination buffer. The default destination buffer is | ||
| 2896 | @code{table.@var{lang}}, where @var{lang} is the language you | ||
| 2897 | specified. | ||
| 2898 | |||
| 2899 | @ignore | ||
| 2900 | arch-tag: 8db54ed8-2036-49ca-b0df-23811d03dc70 | ||
| 2901 | @end ignore | ||
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi new file mode 100644 index 00000000000..ea494445a4e --- /dev/null +++ b/doc/emacs/trouble.texi | |||
| @@ -0,0 +1,1066 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, | ||
| 3 | @c 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @iftex | ||
| 6 | @chapter Dealing with Common Problems | ||
| 7 | |||
| 8 | If you type an Emacs command you did not intend, the results are often | ||
| 9 | mysterious. This chapter tells what you can do to cancel your mistake or | ||
| 10 | recover from a mysterious situation. Emacs bugs and system crashes are | ||
| 11 | also considered. | ||
| 12 | @end iftex | ||
| 13 | |||
| 14 | @ifnottex | ||
| 15 | @raisesections | ||
| 16 | @end ifnottex | ||
| 17 | |||
| 18 | @node Quitting, Lossage, Customization, Top | ||
| 19 | @section Quitting and Aborting | ||
| 20 | @cindex quitting | ||
| 21 | |||
| 22 | @table @kbd | ||
| 23 | @item C-g | ||
| 24 | @itemx C-@key{BREAK} @r{(MS-DOS only)} | ||
| 25 | Quit: cancel running or partially typed command. | ||
| 26 | @item C-] | ||
| 27 | Abort innermost recursive editing level and cancel the command which | ||
| 28 | invoked it (@code{abort-recursive-edit}). | ||
| 29 | @item @key{ESC} @key{ESC} @key{ESC} | ||
| 30 | Either quit or abort, whichever makes sense (@code{keyboard-escape-quit}). | ||
| 31 | @item M-x top-level | ||
| 32 | Abort all recursive editing levels that are currently executing. | ||
| 33 | @item C-x u | ||
| 34 | Cancel a previously made change in the buffer contents (@code{undo}). | ||
| 35 | @end table | ||
| 36 | |||
| 37 | There are two ways of canceling a command before it has finished: | ||
| 38 | @dfn{quitting} with @kbd{C-g}, and @dfn{aborting} with @kbd{C-]} or | ||
| 39 | @kbd{M-x top-level}. Quitting cancels a partially typed command, or | ||
| 40 | one which is still running. Aborting exits a recursive editing level | ||
| 41 | and cancels the command that invoked the recursive edit. | ||
| 42 | (@xref{Recursive Edit}.) | ||
| 43 | |||
| 44 | @cindex quitting | ||
| 45 | @kindex C-g | ||
| 46 | Quitting with @kbd{C-g} is the way to get rid of a partially typed | ||
| 47 | command, or a numeric argument that you don't want. It also stops a | ||
| 48 | running command in the middle in a relatively safe way, so you can use | ||
| 49 | it if you accidentally give a command which takes a long time. In | ||
| 50 | particular, it is safe to quit out of a kill command; either your text | ||
| 51 | will @emph{all} still be in the buffer, or it will @emph{all} be in | ||
| 52 | the kill ring, or maybe both. Quitting an incremental search does | ||
| 53 | special things, documented under searching; it may take two successive | ||
| 54 | @kbd{C-g} characters to get out of a search (@pxref{Incremental | ||
| 55 | Search}). | ||
| 56 | |||
| 57 | On MS-DOS, the character @kbd{C-@key{BREAK}} serves as a quit character | ||
| 58 | like @kbd{C-g}. The reason is that it is not feasible, on MS-DOS, to | ||
| 59 | recognize @kbd{C-g} while a command is running, between interactions | ||
| 60 | with the user. By contrast, it @emph{is} feasible to recognize | ||
| 61 | @kbd{C-@key{BREAK}} at all times. | ||
| 62 | @iftex | ||
| 63 | @xref{MS-DOS Keyboard,,,emacs-xtra, Specialized Emacs Features}. | ||
| 64 | @end iftex | ||
| 65 | @ifnottex | ||
| 66 | @xref{MS-DOS Keyboard}. | ||
| 67 | @end ifnottex | ||
| 68 | |||
| 69 | |||
| 70 | @findex keyboard-quit | ||
| 71 | @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t} | ||
| 72 | the instant @kbd{C-g} is typed; Emacs Lisp checks this variable | ||
| 73 | frequently, and quits if it is non-@code{nil}. @kbd{C-g} is only | ||
| 74 | actually executed as a command if you type it while Emacs is waiting for | ||
| 75 | input. In that case, the command it runs is @code{keyboard-quit}. | ||
| 76 | |||
| 77 | On a text terminal, if you quit with @kbd{C-g} a second time before | ||
| 78 | the first @kbd{C-g} is recognized, you activate the ``emergency | ||
| 79 | escape'' feature and return to the shell. @xref{Emergency Escape}. | ||
| 80 | |||
| 81 | @cindex NFS and quitting | ||
| 82 | There are some situations where you cannot quit. When Emacs is | ||
| 83 | waiting for the operating system to do something, quitting is | ||
| 84 | impossible unless special pains are taken for the particular system | ||
| 85 | call within Emacs where the waiting occurs. We have done this for the | ||
| 86 | system calls that users are likely to want to quit from, but it's | ||
| 87 | possible you will a case not handled. In one very common | ||
| 88 | case---waiting for file input or output using NFS---Emacs itself knows | ||
| 89 | how to quit, but many NFS implementations simply do not allow user | ||
| 90 | programs to stop waiting for NFS when the NFS server is hung. | ||
| 91 | |||
| 92 | @cindex aborting recursive edit | ||
| 93 | @findex abort-recursive-edit | ||
| 94 | @kindex C-] | ||
| 95 | Aborting with @kbd{C-]} (@code{abort-recursive-edit}) is used to get | ||
| 96 | out of a recursive editing level and cancel the command which invoked | ||
| 97 | it. Quitting with @kbd{C-g} does not do this, and could not do this, | ||
| 98 | because it is used to cancel a partially typed command @emph{within} the | ||
| 99 | recursive editing level. Both operations are useful. For example, if | ||
| 100 | you are in a recursive edit and type @kbd{C-u 8} to enter a numeric | ||
| 101 | argument, you can cancel that argument with @kbd{C-g} and remain in the | ||
| 102 | recursive edit. | ||
| 103 | |||
| 104 | @findex keyboard-escape-quit | ||
| 105 | @kindex ESC ESC ESC | ||
| 106 | The sequence @kbd{@key{ESC} @key{ESC} @key{ESC}} | ||
| 107 | (@code{keyboard-escape-quit}) can either quit or abort. (We defined | ||
| 108 | it this way because @key{ESC} means ``get out'' in many PC programs.) | ||
| 109 | It can cancel a prefix argument, clear a selected region, or get out | ||
| 110 | of a Query Replace, like @kbd{C-g}. It can get out of the minibuffer | ||
| 111 | or a recursive edit, like @kbd{C-]}. It can also get out of splitting | ||
| 112 | the frame into multiple windows, as with @kbd{C-x 1}. One thing it | ||
| 113 | cannot do, however, is stop a command that is running. That's because | ||
| 114 | it executes as an ordinary command, and Emacs doesn't notice it until | ||
| 115 | it is ready for the next command. | ||
| 116 | |||
| 117 | @findex top-level | ||
| 118 | The command @kbd{M-x top-level} is equivalent to ``enough'' @kbd{C-]} | ||
| 119 | commands to get you out of all the levels of recursive edits that you | ||
| 120 | are in. @kbd{C-]} gets you out one level at a time, but @kbd{M-x | ||
| 121 | top-level} goes out all levels at once. Both @kbd{C-]} and @kbd{M-x | ||
| 122 | top-level} are like all other commands, and unlike @kbd{C-g}, in that | ||
| 123 | they take effect only when Emacs is ready for a command. @kbd{C-]} is | ||
| 124 | an ordinary key and has its meaning only because of its binding in the | ||
| 125 | keymap. @xref{Recursive Edit}. | ||
| 126 | |||
| 127 | @kbd{C-x u} (@code{undo}) is not strictly speaking a way of canceling | ||
| 128 | a command, but you can think of it as canceling a command that already | ||
| 129 | finished executing. @xref{Undo}, for more information | ||
| 130 | about the undo facility. | ||
| 131 | |||
| 132 | @node Lossage, Bugs, Quitting, Top | ||
| 133 | @section Dealing with Emacs Trouble | ||
| 134 | |||
| 135 | This section describes various conditions in which Emacs fails to work | ||
| 136 | normally, and how to recognize them and correct them. For a list of | ||
| 137 | additional problems you might encounter, see @ref{Bugs and problems, , | ||
| 138 | Bugs and problems, efaq, GNU Emacs FAQ}, and the file @file{etc/PROBLEMS} | ||
| 139 | in the Emacs distribution. Type @kbd{C-h C-f} to read the FAQ; type | ||
| 140 | @kbd{C-h C-e} to read the @file{PROBLEMS} file. | ||
| 141 | |||
| 142 | @menu | ||
| 143 | * DEL Does Not Delete:: What to do if @key{DEL} doesn't delete. | ||
| 144 | * Stuck Recursive:: `[...]' in mode line around the parentheses. | ||
| 145 | * Screen Garbled:: Garbage on the screen. | ||
| 146 | * Text Garbled:: Garbage in the text. | ||
| 147 | * Memory Full:: How to cope when you run out of memory. | ||
| 148 | * After a Crash:: Recovering editing in an Emacs session that crashed. | ||
| 149 | * Emergency Escape:: Emergency escape--- | ||
| 150 | What to do if Emacs stops responding. | ||
| 151 | * Total Frustration:: When you are at your wits' end. | ||
| 152 | @end menu | ||
| 153 | |||
| 154 | @node DEL Does Not Delete | ||
| 155 | @subsection If @key{DEL} Fails to Delete | ||
| 156 | @cindex @key{DEL} vs @key{BACKSPACE} | ||
| 157 | @cindex @key{BACKSPACE} vs @key{DEL} | ||
| 158 | @cindex usual erasure key | ||
| 159 | |||
| 160 | Every keyboard has a large key, a little ways above the @key{RET} or | ||
| 161 | @key{ENTER} key, which you normally use outside Emacs to erase the | ||
| 162 | last character that you typed. We call this key @dfn{the usual | ||
| 163 | erasure key}. In Emacs, it is supposed to be equivalent to @key{DEL}, | ||
| 164 | and when Emacs is properly configured for your terminal, it translates | ||
| 165 | that key into the character @key{DEL}. | ||
| 166 | |||
| 167 | When Emacs starts up on a graphical display, it determines | ||
| 168 | automatically which key should be @key{DEL}. In some unusual cases | ||
| 169 | Emacs gets the wrong information from the system. If the usual | ||
| 170 | erasure key deletes forwards instead of backwards, that is probably | ||
| 171 | what happened---Emacs ought to be treating the @key{DELETE} key as | ||
| 172 | @key{DEL}, but it isn't. | ||
| 173 | |||
| 174 | On a graphical display, if the usual erasure key is labeled | ||
| 175 | @key{BACKSPACE} and there is a @key{DELETE} key elsewhere, but the | ||
| 176 | @key{DELETE} key deletes backward instead of forward, that too | ||
| 177 | suggests Emacs got the wrong information---but in the opposite sense. | ||
| 178 | It ought to be treating the @key{BACKSPACE} key as @key{DEL}, and | ||
| 179 | treating @key{DELETE} differently, but it isn't. | ||
| 180 | |||
| 181 | On a text-only terminal, if you find the usual erasure key prompts | ||
| 182 | for a Help command, like @kbd{Control-h}, instead of deleting a | ||
| 183 | character, it means that key is actually sending the @key{BS} | ||
| 184 | character. Emacs ought to be treating @key{BS} as @key{DEL}, but it | ||
| 185 | isn't. | ||
| 186 | |||
| 187 | In all of those cases, the immediate remedy is the same: use the | ||
| 188 | command @kbd{M-x normal-erase-is-backspace-mode}. This toggles | ||
| 189 | between the two modes that Emacs supports for handling @key{DEL}, so | ||
| 190 | if Emacs starts in the wrong mode, this should switch to the right | ||
| 191 | mode. On a text-only terminal, if you want to ask for help when | ||
| 192 | @key{BS} is treated as @key{DEL}, use @key{F1}; @kbd{C-?} may also | ||
| 193 | work, if it sends character code 127. | ||
| 194 | |||
| 195 | @findex normal-erase-is-backspace-mode | ||
| 196 | To fix the problem automatically for every Emacs session, you can | ||
| 197 | put one of the following lines into your @file{.emacs} file | ||
| 198 | (@pxref{Init File}). For the first case above, where @key{DELETE} | ||
| 199 | deletes forwards instead of backwards, use this line to make | ||
| 200 | @key{DELETE} act as @key{DEL} (resulting in behavior compatible | ||
| 201 | with Emacs 20 and previous versions): | ||
| 202 | |||
| 203 | @lisp | ||
| 204 | (normal-erase-is-backspace-mode 0) | ||
| 205 | @end lisp | ||
| 206 | |||
| 207 | @noindent | ||
| 208 | For the other two cases, where @key{BACKSPACE} ought to act as | ||
| 209 | @key{DEL}, use this line: | ||
| 210 | |||
| 211 | @lisp | ||
| 212 | (normal-erase-is-backspace-mode 1) | ||
| 213 | @end lisp | ||
| 214 | |||
| 215 | @vindex normal-erase-is-backspace | ||
| 216 | Another way to fix the problem for every Emacs session is to | ||
| 217 | customize the variable @code{normal-erase-is-backspace}: the value | ||
| 218 | @code{t} specifies the mode where @key{BS} or @key{BACKSPACE} is | ||
| 219 | @key{DEL}, and @code{nil} specifies the other mode. @xref{Easy | ||
| 220 | Customization}. | ||
| 221 | |||
| 222 | On a graphical display, it can also happen that the usual erasure key | ||
| 223 | is labeled @key{BACKSPACE}, there is a @key{DELETE} key elsewhere, and | ||
| 224 | both keys delete forward. This probably means that someone has | ||
| 225 | redefined your @key{BACKSPACE} key as a @key{DELETE} key. With X, | ||
| 226 | this is typically done with a command to the @code{xmodmap} program | ||
| 227 | when you start the server or log in. The most likely motive for this | ||
| 228 | customization was to support old versions of Emacs, so we recommend | ||
| 229 | you simply remove it now. | ||
| 230 | |||
| 231 | @node Stuck Recursive | ||
| 232 | @subsection Recursive Editing Levels | ||
| 233 | |||
| 234 | Recursive editing levels are important and useful features of Emacs, but | ||
| 235 | they can seem like malfunctions if you do not understand them. | ||
| 236 | |||
| 237 | If the mode line has square brackets @samp{[@dots{}]} around the parentheses | ||
| 238 | that contain the names of the major and minor modes, you have entered a | ||
| 239 | recursive editing level. If you did not do this on purpose, or if you | ||
| 240 | don't understand what that means, you should just get out of the recursive | ||
| 241 | editing level. To do so, type @kbd{M-x top-level}. This is called getting | ||
| 242 | back to top level. @xref{Recursive Edit}. | ||
| 243 | |||
| 244 | @node Screen Garbled | ||
| 245 | @subsection Garbage on the Screen | ||
| 246 | |||
| 247 | If the text on a text terminal looks wrong, the first thing to do is | ||
| 248 | see whether it is wrong in the buffer. Type @kbd{C-l} to redisplay | ||
| 249 | the entire screen. If the screen appears correct after this, the | ||
| 250 | problem was entirely in the previous screen update. (Otherwise, see | ||
| 251 | the following section.) | ||
| 252 | |||
| 253 | Display updating problems often result from an incorrect terminfo | ||
| 254 | entry for the terminal you are using. The file @file{etc/TERMS} in | ||
| 255 | the Emacs distribution gives the fixes for known problems of this | ||
| 256 | sort. @file{INSTALL} contains general advice for these problems in | ||
| 257 | one of its sections. To investigate the possibility that you have | ||
| 258 | this sort of problem, try Emacs on another terminal made by a | ||
| 259 | different manufacturer. If problems happen frequently on one kind of | ||
| 260 | terminal but not another kind, it is likely to be a bad terminfo entry, | ||
| 261 | though it could also be due to a bug in Emacs that appears for | ||
| 262 | terminals that have or that lack specific features. | ||
| 263 | |||
| 264 | @node Text Garbled | ||
| 265 | @subsection Garbage in the Text | ||
| 266 | |||
| 267 | If @kbd{C-l} shows that the text is wrong, first type @kbd{C-h l} to | ||
| 268 | see what commands you typed to produce the observed results. Then try | ||
| 269 | undoing the changes step by step using @kbd{C-x u}, until it gets back | ||
| 270 | to a state you consider correct. | ||
| 271 | |||
| 272 | If a large portion of text appears to be missing at the beginning or | ||
| 273 | end of the buffer, check for the word @samp{Narrow} in the mode line. | ||
| 274 | If it appears, the text you don't see is probably still present, but | ||
| 275 | temporarily off-limits. To make it accessible again, type @kbd{C-x n | ||
| 276 | w}. @xref{Narrowing}. | ||
| 277 | |||
| 278 | @node Memory Full | ||
| 279 | @subsection Running out of Memory | ||
| 280 | @cindex memory full | ||
| 281 | @cindex out of memory | ||
| 282 | |||
| 283 | If you get the error message @samp{Virtual memory exceeded}, save | ||
| 284 | your modified buffers with @kbd{C-x s}. This method of saving them | ||
| 285 | has the smallest need for additional memory. Emacs keeps a reserve of | ||
| 286 | memory which it makes available when this error happens; that should | ||
| 287 | be enough to enable @kbd{C-x s} to complete its work. When the | ||
| 288 | reserve has been used, @samp{!MEM FULL!} appears at the beginning of | ||
| 289 | the mode line, indicating there is no more reserve. | ||
| 290 | |||
| 291 | Once you have saved your modified buffers, you can exit this Emacs | ||
| 292 | session and start another, or you can use @kbd{M-x kill-some-buffers} | ||
| 293 | to free space in the current Emacs job. If this frees up sufficient | ||
| 294 | space, Emacs will refill its memory reserve, and @samp{!MEM FULL!} | ||
| 295 | will disappear from the mode line. That means you can safely go on | ||
| 296 | editing in the same Emacs session. | ||
| 297 | |||
| 298 | Do not use @kbd{M-x buffer-menu} to save or kill buffers when you run | ||
| 299 | out of memory, because the buffer menu needs a fair amount of memory | ||
| 300 | itself, and the reserve supply may not be enough. | ||
| 301 | |||
| 302 | @node After a Crash | ||
| 303 | @subsection Recovery After a Crash | ||
| 304 | |||
| 305 | If Emacs or the computer crashes, you can recover the files you were | ||
| 306 | editing at the time of the crash from their auto-save files. To do | ||
| 307 | this, start Emacs again and type the command @kbd{M-x recover-session}. | ||
| 308 | |||
| 309 | This command initially displays a buffer which lists interrupted | ||
| 310 | session files, each with its date. You must choose which session to | ||
| 311 | recover from. Typically the one you want is the most recent one. Move | ||
| 312 | point to the one you choose, and type @kbd{C-c C-c}. | ||
| 313 | |||
| 314 | Then @code{recover-session} considers each of the files that you | ||
| 315 | were editing during that session; for each such file, it asks whether | ||
| 316 | to recover that file. If you answer @kbd{y} for a file, it shows the | ||
| 317 | dates of that file and its auto-save file, then asks once again | ||
| 318 | whether to recover that file. For the second question, you must | ||
| 319 | confirm with @kbd{yes}. If you do, Emacs visits the file but gets the | ||
| 320 | text from the auto-save file. | ||
| 321 | |||
| 322 | When @code{recover-session} is done, the files you've chosen to | ||
| 323 | recover are present in Emacs buffers. You should then save them. Only | ||
| 324 | this---saving them---updates the files themselves. | ||
| 325 | |||
| 326 | As a last resort, if you had buffers with content which were not | ||
| 327 | associated with any files, or if the autosave was not recent enough to | ||
| 328 | have recorded important changes, you can use the | ||
| 329 | @file{etc/emacs-buffer.gdb} script with GDB (the GNU Debugger) to | ||
| 330 | retrieve them from a core dump--provided that a core dump was saved, | ||
| 331 | and that the Emacs executable was not stripped of its debugging | ||
| 332 | symbols. | ||
| 333 | |||
| 334 | As soon as you get the core dump, rename it to another name such as | ||
| 335 | @file{core.emacs}, so that another crash won't overwrite it. | ||
| 336 | |||
| 337 | To use this script, run @code{gdb} with the file name of your Emacs | ||
| 338 | executable and the file name of the core dump, e.g. @samp{gdb | ||
| 339 | /usr/bin/emacs core.emacs}. At the @code{(gdb)} prompt, load the | ||
| 340 | recovery script: @samp{source /usr/src/emacs/etc/emacs-buffer.gdb}. | ||
| 341 | Then type the command @code{ybuffer-list} to see which buffers are | ||
| 342 | available. For each buffer, it lists a buffer number. To save a | ||
| 343 | buffer, use @code{ysave-buffer}; you specify the buffer number, and | ||
| 344 | the file name to write that buffer into. You should use a file name | ||
| 345 | which does not already exist; if the file does exist, the script does | ||
| 346 | not make a backup of its old contents. | ||
| 347 | |||
| 348 | @node Emergency Escape | ||
| 349 | @subsection Emergency Escape | ||
| 350 | |||
| 351 | On text-only terminals, the @dfn{emergency escape} feature suspends | ||
| 352 | Emacs immediately if you type @kbd{C-g} a second time before Emacs can | ||
| 353 | actually respond to the first one by quitting. This is so you can | ||
| 354 | always get out of GNU Emacs no matter how badly it might be hung. | ||
| 355 | When things are working properly, Emacs recognizes and handles the | ||
| 356 | first @kbd{C-g} so fast that the second one won't trigger emergency | ||
| 357 | escape. However, if some problem prevents Emacs from handling the | ||
| 358 | first @kbd{C-g} properly, then the second one will get you back to the | ||
| 359 | shell. | ||
| 360 | |||
| 361 | When you resume Emacs after a suspension caused by emergency escape, | ||
| 362 | it asks two questions before going back to what it had been doing: | ||
| 363 | |||
| 364 | @example | ||
| 365 | Auto-save? (y or n) | ||
| 366 | Abort (and dump core)? (y or n) | ||
| 367 | @end example | ||
| 368 | |||
| 369 | @noindent | ||
| 370 | Answer each one with @kbd{y} or @kbd{n} followed by @key{RET}. | ||
| 371 | |||
| 372 | Saying @kbd{y} to @samp{Auto-save?} causes immediate auto-saving of | ||
| 373 | all modified buffers in which auto-saving is enabled. Saying @kbd{n} | ||
| 374 | skips this. | ||
| 375 | |||
| 376 | Saying @kbd{y} to @samp{Abort (and dump core)?} causes Emacs to | ||
| 377 | crash, dumping core. This is to enable a wizard to figure out why | ||
| 378 | Emacs was failing to quit in the first place. Execution does not | ||
| 379 | continue after a core dump. | ||
| 380 | |||
| 381 | If you answer this question @kbd{n}, Emacs execution resumes. With | ||
| 382 | luck, Emacs will ultimately do the requested quit. If not, each | ||
| 383 | subsequent @kbd{C-g} invokes emergency escape again. | ||
| 384 | |||
| 385 | If Emacs is not really hung, just slow, you may invoke the double | ||
| 386 | @kbd{C-g} feature without really meaning to. Then just resume and | ||
| 387 | answer @kbd{n} to both questions, and you will get back to the former | ||
| 388 | state. The quit you requested will happen by and by. | ||
| 389 | |||
| 390 | Emergency escape is active only for text terminals. On graphical | ||
| 391 | displays, you can use the mouse to kill Emacs or switch to another | ||
| 392 | program. | ||
| 393 | |||
| 394 | On MS-DOS, you must type @kbd{C-@key{BREAK}} (twice) to cause | ||
| 395 | emergency escape---but there are cases where it won't work, when | ||
| 396 | system call hangs or when Emacs is stuck in a tight loop in C code. | ||
| 397 | |||
| 398 | @node Total Frustration | ||
| 399 | @subsection Help for Total Frustration | ||
| 400 | @cindex Eliza | ||
| 401 | @cindex doctor | ||
| 402 | |||
| 403 | If using Emacs (or something else) becomes terribly frustrating and none | ||
| 404 | of the techniques described above solve the problem, Emacs can still help | ||
| 405 | you. | ||
| 406 | |||
| 407 | First, if the Emacs you are using is not responding to commands, type | ||
| 408 | @kbd{C-g C-g} to get out of it and then start a new one. | ||
| 409 | |||
| 410 | @findex doctor | ||
| 411 | Second, type @kbd{M-x doctor @key{RET}}. | ||
| 412 | |||
| 413 | The Emacs psychotherapist will help you feel better. Each time you | ||
| 414 | say something to the psychotherapist, you must end it by typing | ||
| 415 | @key{RET} @key{RET}. This indicates you are finished typing. | ||
| 416 | |||
| 417 | @node Bugs, Contributing, Lossage, Top | ||
| 418 | @section Reporting Bugs | ||
| 419 | |||
| 420 | @cindex bugs | ||
| 421 | Sometimes you will encounter a bug in Emacs. Although we cannot | ||
| 422 | promise we can or will fix the bug, and we might not even agree that it | ||
| 423 | is a bug, we want to hear about problems you encounter. Often we agree | ||
| 424 | they are bugs and want to fix them. | ||
| 425 | |||
| 426 | To make it possible for us to fix a bug, you must report it. In order | ||
| 427 | to do so effectively, you must know when and how to do it. | ||
| 428 | |||
| 429 | Before reporting a bug, it is a good idea to see if it is already | ||
| 430 | known. You can find the list of known problems in the file | ||
| 431 | @file{etc/PROBLEMS} in the Emacs distribution; type @kbd{C-h C-e} to read | ||
| 432 | it. Some additional user-level problems can be found in @ref{Bugs and | ||
| 433 | problems, , Bugs and problems, efaq, GNU Emacs FAQ}. Looking up your | ||
| 434 | problem in these two documents might provide you with a solution or a | ||
| 435 | work-around, or give you additional information about related issues. | ||
| 436 | |||
| 437 | @menu | ||
| 438 | * Criteria: Bug Criteria. Have you really found a bug? | ||
| 439 | * Understanding Bug Reporting:: How to report a bug effectively. | ||
| 440 | * Checklist:: Steps to follow for a good bug report. | ||
| 441 | * Sending Patches:: How to send a patch for GNU Emacs. | ||
| 442 | @end menu | ||
| 443 | |||
| 444 | @node Bug Criteria | ||
| 445 | @subsection When Is There a Bug | ||
| 446 | |||
| 447 | If Emacs accesses an invalid memory location (``segmentation | ||
| 448 | fault''), or exits with an operating system error message that | ||
| 449 | indicates a problem in the program (as opposed to something like | ||
| 450 | ``disk full''), then it is certainly a bug. | ||
| 451 | |||
| 452 | If Emacs updates the display in a way that does not correspond to what is | ||
| 453 | in the buffer, then it is certainly a bug. If a command seems to do the | ||
| 454 | wrong thing but the problem corrects itself if you type @kbd{C-l}, it is a | ||
| 455 | case of incorrect display updating. | ||
| 456 | |||
| 457 | Taking forever to complete a command can be a bug, but you must make | ||
| 458 | certain that it was really Emacs's fault. Some commands simply take a | ||
| 459 | long time. Type @kbd{C-g} (@kbd{C-@key{BREAK}} on MS-DOS) and then @kbd{C-h l} | ||
| 460 | to see whether the input Emacs received was what you intended to type; | ||
| 461 | if the input was such that you @emph{know} it should have been processed | ||
| 462 | quickly, report a bug. If you don't know whether the command should | ||
| 463 | take a long time, find out by looking in the manual or by asking for | ||
| 464 | assistance. | ||
| 465 | |||
| 466 | If a command you are familiar with causes an Emacs error message in a | ||
| 467 | case where its usual definition ought to be reasonable, it is probably a | ||
| 468 | bug. | ||
| 469 | |||
| 470 | If a command does the wrong thing, that is a bug. But be sure you know | ||
| 471 | for certain what it ought to have done. If you aren't familiar with the | ||
| 472 | command, or don't know for certain how the command is supposed to work, | ||
| 473 | then it might actually be working right. Rather than jumping to | ||
| 474 | conclusions, show the problem to someone who knows for certain. | ||
| 475 | |||
| 476 | Finally, a command's intended definition may not be the best | ||
| 477 | possible definition for editing with. This is a very important sort | ||
| 478 | of problem, but it is also a matter of judgment. Also, it is easy to | ||
| 479 | come to such a conclusion out of ignorance of some of the existing | ||
| 480 | features. It is probably best not to complain about such a problem | ||
| 481 | until you have checked the documentation in the usual ways, feel | ||
| 482 | confident that you understand it, and know for certain that what you | ||
| 483 | want is not available. Ask other Emacs users, too. If you are not | ||
| 484 | sure what the command is supposed to do after a careful reading of the | ||
| 485 | manual, check the index and glossary for any terms that may be | ||
| 486 | unclear. | ||
| 487 | |||
| 488 | If after careful rereading of the manual you still do not understand | ||
| 489 | what the command should do, that indicates a bug in the manual, which | ||
| 490 | you should report. The manual's job is to make everything clear to | ||
| 491 | people who are not Emacs experts---including you. It is just as | ||
| 492 | important to report documentation bugs as program bugs. | ||
| 493 | |||
| 494 | If the on-line documentation string of a function or variable disagrees | ||
| 495 | with the manual, one of them must be wrong; that is a bug. | ||
| 496 | |||
| 497 | @node Understanding Bug Reporting | ||
| 498 | @subsection Understanding Bug Reporting | ||
| 499 | |||
| 500 | @findex emacs-version | ||
| 501 | When you decide that there is a bug, it is important to report it and to | ||
| 502 | report it in a way which is useful. What is most useful is an exact | ||
| 503 | description of what commands you type, starting with the shell command to | ||
| 504 | run Emacs, until the problem happens. | ||
| 505 | |||
| 506 | The most important principle in reporting a bug is to report | ||
| 507 | @emph{facts}. Hypotheses and verbal descriptions are no substitute for | ||
| 508 | the detailed raw data. Reporting the facts is straightforward, but many | ||
| 509 | people strain to posit explanations and report them instead of the | ||
| 510 | facts. If the explanations are based on guesses about how Emacs is | ||
| 511 | implemented, they will be useless; meanwhile, lacking the facts, we will | ||
| 512 | have no real information about the bug. | ||
| 513 | |||
| 514 | For example, suppose that you type @kbd{C-x C-f /glorp/baz.ugh | ||
| 515 | @key{RET}}, visiting a file which (you know) happens to be rather | ||
| 516 | large, and Emacs displays @samp{I feel pretty today}. The best way to | ||
| 517 | report the bug is with a sentence like the preceding one, because it | ||
| 518 | gives all the facts. | ||
| 519 | |||
| 520 | A bad way would be to assume that the problem is due to the size of | ||
| 521 | the file and say, ``I visited a large file, and Emacs displayed @samp{I | ||
| 522 | feel pretty today}.'' This is what we mean by ``guessing | ||
| 523 | explanations.'' The problem is just as likely to be due to the fact | ||
| 524 | that there is a @samp{z} in the file name. If this is so, then when we | ||
| 525 | got your report, we would try out the problem with some ``large file,'' | ||
| 526 | probably with no @samp{z} in its name, and not see any problem. There | ||
| 527 | is no way in the world that we could guess that we should try visiting a | ||
| 528 | file with a @samp{z} in its name. | ||
| 529 | |||
| 530 | Alternatively, the problem might be due to the fact that the file starts | ||
| 531 | with exactly 25 spaces. For this reason, you should make sure that you | ||
| 532 | inform us of the exact contents of any file that is needed to reproduce the | ||
| 533 | bug. What if the problem only occurs when you have typed the @kbd{C-x C-a} | ||
| 534 | command previously? This is why we ask you to give the exact sequence of | ||
| 535 | characters you typed since starting the Emacs session. | ||
| 536 | |||
| 537 | You should not even say ``visit a file'' instead of @kbd{C-x C-f} unless | ||
| 538 | you @emph{know} that it makes no difference which visiting command is used. | ||
| 539 | Similarly, rather than saying ``if I have three characters on the line,'' | ||
| 540 | say ``after I type @kbd{@key{RET} A B C @key{RET} C-p},'' if that is | ||
| 541 | the way you entered the text. | ||
| 542 | |||
| 543 | So please don't guess any explanations when you report a bug. If you | ||
| 544 | want to actually @emph{debug} the problem, and report explanations that | ||
| 545 | are more than guesses, that is useful---but please include the facts as | ||
| 546 | well. | ||
| 547 | |||
| 548 | @node Checklist | ||
| 549 | @subsection Checklist for Bug Reports | ||
| 550 | |||
| 551 | @cindex reporting bugs | ||
| 552 | The best way to send a bug report is to mail it electronically to the | ||
| 553 | Emacs maintainers at @email{bug-gnu-emacs@@gnu.org}, or to | ||
| 554 | @email{emacs-pretest-bug@@gnu.org} if you are pretesting an Emacs beta | ||
| 555 | release. (If you want to suggest a change as an improvement, use the | ||
| 556 | same address.) | ||
| 557 | |||
| 558 | If you'd like to read the bug reports, you can find them on the | ||
| 559 | newsgroup @samp{gnu.emacs.bug}; keep in mind, however, that as a | ||
| 560 | spectator you should not criticize anything about what you see there. | ||
| 561 | The purpose of bug reports is to give information to the Emacs | ||
| 562 | maintainers. Spectators are welcome only as long as they do not | ||
| 563 | interfere with this. In particular, some bug reports contain fairly | ||
| 564 | large amounts of data; spectators should not complain about this. | ||
| 565 | |||
| 566 | Please do not post bug reports using netnews; mail is more reliable | ||
| 567 | than netnews about reporting your correct address, which we may need | ||
| 568 | in order to ask you for more information. If your data is more than | ||
| 569 | 500,000 bytes, please don't include it directly in the bug report; | ||
| 570 | instead, offer to send it on request, or make it available by ftp and | ||
| 571 | say where. | ||
| 572 | |||
| 573 | @findex report-emacs-bug | ||
| 574 | A convenient way to send a bug report for Emacs is to use the command | ||
| 575 | @kbd{M-x report-emacs-bug}. This sets up a mail buffer (@pxref{Sending | ||
| 576 | Mail}) and automatically inserts @emph{some} of the essential | ||
| 577 | information. However, it cannot supply all the necessary information; | ||
| 578 | you should still read and follow the guidelines below, so you can enter | ||
| 579 | the other crucial information by hand before you send the message. | ||
| 580 | |||
| 581 | To enable maintainers to investigate a bug, your report | ||
| 582 | should include all these things: | ||
| 583 | |||
| 584 | @itemize @bullet | ||
| 585 | @item | ||
| 586 | The version number of Emacs. Without this, we won't know whether there | ||
| 587 | is any point in looking for the bug in the current version of GNU | ||
| 588 | Emacs. | ||
| 589 | |||
| 590 | You can get the version number by typing @kbd{M-x emacs-version | ||
| 591 | @key{RET}}. If that command does not work, you probably have something | ||
| 592 | other than GNU Emacs, so you will have to report the bug somewhere | ||
| 593 | else. | ||
| 594 | |||
| 595 | @item | ||
| 596 | The type of machine you are using, and the operating system name and | ||
| 597 | version number. @kbd{M-x emacs-version @key{RET}} provides this | ||
| 598 | information too. Copy its output from the @samp{*Messages*} buffer, so | ||
| 599 | that you get it all and get it accurately. | ||
| 600 | |||
| 601 | @item | ||
| 602 | The operands given to the @code{configure} command when Emacs was | ||
| 603 | installed. | ||
| 604 | |||
| 605 | @item | ||
| 606 | A complete list of any modifications you have made to the Emacs source. | ||
| 607 | (We may not have time to investigate the bug unless it happens in an | ||
| 608 | unmodified Emacs. But if you've made modifications and you don't tell | ||
| 609 | us, you are sending us on a wild goose chase.) | ||
| 610 | |||
| 611 | Be precise about these changes. A description in English is not | ||
| 612 | enough---send a context diff for them. | ||
| 613 | |||
| 614 | Adding files of your own, or porting to another machine, is a | ||
| 615 | modification of the source. | ||
| 616 | |||
| 617 | @item | ||
| 618 | Details of any other deviations from the standard procedure for installing | ||
| 619 | GNU Emacs. | ||
| 620 | |||
| 621 | @item | ||
| 622 | The complete text of any files needed to reproduce the bug. | ||
| 623 | |||
| 624 | If you can tell us a way to cause the problem without visiting any files, | ||
| 625 | please do so. This makes it much easier to debug. If you do need files, | ||
| 626 | make sure you arrange for us to see their exact contents. For example, it | ||
| 627 | can matter whether there are spaces at the ends of lines, or a | ||
| 628 | newline after the last line in the buffer (nothing ought to care whether | ||
| 629 | the last line is terminated, but try telling the bugs that). | ||
| 630 | |||
| 631 | @item | ||
| 632 | The precise commands we need to type to reproduce the bug. | ||
| 633 | |||
| 634 | @findex open-dribble-file | ||
| 635 | @cindex dribble file | ||
| 636 | @cindex logging keystrokes | ||
| 637 | The easy way to record the input to Emacs precisely is to write a | ||
| 638 | dribble file. To start the file, execute the Lisp expression | ||
| 639 | |||
| 640 | @example | ||
| 641 | (open-dribble-file "~/dribble") | ||
| 642 | @end example | ||
| 643 | |||
| 644 | @noindent | ||
| 645 | using @kbd{M-:} or from the @samp{*scratch*} buffer just after | ||
| 646 | starting Emacs. From then on, Emacs copies all your input to the | ||
| 647 | specified dribble file until the Emacs process is killed. | ||
| 648 | |||
| 649 | @item | ||
| 650 | @findex open-termscript | ||
| 651 | @cindex termscript file | ||
| 652 | @cindex @env{TERM} environment variable | ||
| 653 | For possible display bugs, the terminal type (the value of environment | ||
| 654 | variable @env{TERM}), the complete termcap entry for the terminal from | ||
| 655 | @file{/etc/termcap} (since that file is not identical on all machines), | ||
| 656 | and the output that Emacs actually sent to the terminal. | ||
| 657 | |||
| 658 | The way to collect the terminal output is to execute the Lisp expression | ||
| 659 | |||
| 660 | @example | ||
| 661 | (open-termscript "~/termscript") | ||
| 662 | @end example | ||
| 663 | |||
| 664 | @noindent | ||
| 665 | using @kbd{M-:} or from the @samp{*scratch*} buffer just after | ||
| 666 | starting Emacs. From then on, Emacs copies all terminal output to the | ||
| 667 | specified termscript file as well, until the Emacs process is killed. | ||
| 668 | If the problem happens when Emacs starts up, put this expression into | ||
| 669 | your @file{.emacs} file so that the termscript file will be open when | ||
| 670 | Emacs displays the screen for the first time. | ||
| 671 | |||
| 672 | Be warned: it is often difficult, and sometimes impossible, to fix a | ||
| 673 | terminal-dependent bug without access to a terminal of the type that | ||
| 674 | stimulates the bug. | ||
| 675 | |||
| 676 | @item | ||
| 677 | If non-@acronym{ASCII} text or internationalization is relevant, the locale that | ||
| 678 | was current when you started Emacs. On GNU/Linux and Unix systems, or | ||
| 679 | if you use a Posix-style shell such as Bash, you can use this shell | ||
| 680 | command to view the relevant values: | ||
| 681 | |||
| 682 | @smallexample | ||
| 683 | echo LC_ALL=$LC_ALL LC_COLLATE=$LC_COLLATE LC_CTYPE=$LC_CTYPE \ | ||
| 684 | LC_MESSAGES=$LC_MESSAGES LC_TIME=$LC_TIME LANG=$LANG | ||
| 685 | @end smallexample | ||
| 686 | |||
| 687 | Alternatively, use the @command{locale} command, if your system has it, | ||
| 688 | to display your locale settings. | ||
| 689 | |||
| 690 | You can use the @kbd{M-!} command to execute these commands from | ||
| 691 | Emacs, and then copy the output from the @samp{*Messages*} buffer into | ||
| 692 | the bug report. Alternatively, @kbd{M-x getenv @key{RET} LC_ALL | ||
| 693 | @key{RET}} will display the value of @code{LC_ALL} in the echo area, and | ||
| 694 | you can copy its output from the @samp{*Messages*} buffer. | ||
| 695 | |||
| 696 | @item | ||
| 697 | A description of what behavior you observe that you believe is | ||
| 698 | incorrect. For example, ``The Emacs process gets a fatal signal,'' or, | ||
| 699 | ``The resulting text is as follows, which I think is wrong.'' | ||
| 700 | |||
| 701 | Of course, if the bug is that Emacs gets a fatal signal, then one can't | ||
| 702 | miss it. But if the bug is incorrect text, the maintainer might fail to | ||
| 703 | notice what is wrong. Why leave it to chance? | ||
| 704 | |||
| 705 | Even if the problem you experience is a fatal signal, you should still | ||
| 706 | say so explicitly. Suppose something strange is going on, such as, your | ||
| 707 | copy of the source is out of sync, or you have encountered a bug in the | ||
| 708 | C library on your system. (This has happened!) Your copy might crash | ||
| 709 | and the copy here might not. If you @emph{said} to expect a crash, then | ||
| 710 | when Emacs here fails to crash, we would know that the bug was not | ||
| 711 | happening. If you don't say to expect a crash, then we would not know | ||
| 712 | whether the bug was happening---we would not be able to draw any | ||
| 713 | conclusion from our observations. | ||
| 714 | |||
| 715 | @item | ||
| 716 | If the bug is that the Emacs Manual or the Emacs Lisp Reference Manual | ||
| 717 | fails to describe the actual behavior of Emacs, or that the text is | ||
| 718 | confusing, copy in the text from the online manual which you think is | ||
| 719 | at fault. If the section is small, just the section name is enough. | ||
| 720 | |||
| 721 | @item | ||
| 722 | If the manifestation of the bug is an Emacs error message, it is | ||
| 723 | important to report the precise text of the error message, and a | ||
| 724 | backtrace showing how the Lisp program in Emacs arrived at the error. | ||
| 725 | |||
| 726 | To get the error message text accurately, copy it from the | ||
| 727 | @samp{*Messages*} buffer into the bug report. Copy all of it, not just | ||
| 728 | part. | ||
| 729 | |||
| 730 | @findex toggle-debug-on-error | ||
| 731 | @pindex Edebug | ||
| 732 | To make a backtrace for the error, use @kbd{M-x toggle-debug-on-error} | ||
| 733 | before the error happens (that is to say, you must give that command | ||
| 734 | and then make the bug happen). This causes the error to start the Lisp | ||
| 735 | debugger, which shows you a backtrace. Copy the text of the | ||
| 736 | debugger's backtrace into the bug report. @xref{Debugger,, The Lisp | ||
| 737 | Debugger, elisp, the Emacs Lisp Reference Manual}, for information on | ||
| 738 | debugging Emacs Lisp programs with the Edebug package. | ||
| 739 | |||
| 740 | This use of the debugger is possible only if you know how to make the | ||
| 741 | bug happen again. If you can't make it happen again, at least copy | ||
| 742 | the whole error message. | ||
| 743 | |||
| 744 | @item | ||
| 745 | Check whether any programs you have loaded into the Lisp world, | ||
| 746 | including your @file{.emacs} file, set any variables that may affect the | ||
| 747 | functioning of Emacs. Also, see whether the problem happens in a | ||
| 748 | freshly started Emacs without loading your @file{.emacs} file (start | ||
| 749 | Emacs with the @code{-q} switch to prevent loading the init file). If | ||
| 750 | the problem does @emph{not} occur then, you must report the precise | ||
| 751 | contents of any programs that you must load into the Lisp world in order | ||
| 752 | to cause the problem to occur. | ||
| 753 | |||
| 754 | @item | ||
| 755 | If the problem does depend on an init file or other Lisp programs that | ||
| 756 | are not part of the standard Emacs system, then you should make sure it | ||
| 757 | is not a bug in those programs by complaining to their maintainers | ||
| 758 | first. After they verify that they are using Emacs in a way that is | ||
| 759 | supposed to work, they should report the bug. | ||
| 760 | |||
| 761 | @item | ||
| 762 | If you wish to mention something in the GNU Emacs source, show the line | ||
| 763 | of code with a few lines of context. Don't just give a line number. | ||
| 764 | |||
| 765 | The line numbers in the development sources don't match those in your | ||
| 766 | sources. It would take extra work for the maintainers to determine what | ||
| 767 | code is in your version at a given line number, and we could not be | ||
| 768 | certain. | ||
| 769 | |||
| 770 | @item | ||
| 771 | Additional information from a C debugger such as GDB might enable | ||
| 772 | someone to find a problem on a machine which he does not have available. | ||
| 773 | If you don't know how to use GDB, please read the GDB manual---it is not | ||
| 774 | very long, and using GDB is easy. You can find the GDB distribution, | ||
| 775 | including the GDB manual in online form, in most of the same places you | ||
| 776 | can find the Emacs distribution. To run Emacs under GDB, you should | ||
| 777 | switch to the @file{src} subdirectory in which Emacs was compiled, then | ||
| 778 | do @samp{gdb emacs}. It is important for the directory @file{src} to be | ||
| 779 | current so that GDB will read the @file{.gdbinit} file in this | ||
| 780 | directory. | ||
| 781 | |||
| 782 | However, you need to think when you collect the additional information | ||
| 783 | if you want it to show what causes the bug. | ||
| 784 | |||
| 785 | @cindex backtrace for bug reports | ||
| 786 | For example, many people send just a backtrace, but that is not very | ||
| 787 | useful by itself. A simple backtrace with arguments often conveys | ||
| 788 | little about what is happening inside GNU Emacs, because most of the | ||
| 789 | arguments listed in the backtrace are pointers to Lisp objects. The | ||
| 790 | numeric values of these pointers have no significance whatever; all that | ||
| 791 | matters is the contents of the objects they point to (and most of the | ||
| 792 | contents are themselves pointers). | ||
| 793 | |||
| 794 | @findex debug_print | ||
| 795 | To provide useful information, you need to show the values of Lisp | ||
| 796 | objects in Lisp notation. Do this for each variable which is a Lisp | ||
| 797 | object, in several stack frames near the bottom of the stack. Look at | ||
| 798 | the source to see which variables are Lisp objects, because the debugger | ||
| 799 | thinks of them as integers. | ||
| 800 | |||
| 801 | To show a variable's value in Lisp syntax, first print its value, then | ||
| 802 | use the user-defined GDB command @code{pr} to print the Lisp object in | ||
| 803 | Lisp syntax. (If you must use another debugger, call the function | ||
| 804 | @code{debug_print} with the object as an argument.) The @code{pr} | ||
| 805 | command is defined by the file @file{.gdbinit}, and it works only if you | ||
| 806 | are debugging a running process (not with a core dump). | ||
| 807 | |||
| 808 | To make Lisp errors stop Emacs and return to GDB, put a breakpoint at | ||
| 809 | @code{Fsignal}. | ||
| 810 | |||
| 811 | For a short listing of Lisp functions running, type the GDB | ||
| 812 | command @code{xbacktrace}. | ||
| 813 | |||
| 814 | The file @file{.gdbinit} defines several other commands that are useful | ||
| 815 | for examining the data types and contents of Lisp objects. Their names | ||
| 816 | begin with @samp{x}. These commands work at a lower level than | ||
| 817 | @code{pr}, and are less convenient, but they may work even when | ||
| 818 | @code{pr} does not, such as when debugging a core dump or when Emacs has | ||
| 819 | had a fatal signal. | ||
| 820 | |||
| 821 | @cindex debugging Emacs, tricks and techniques | ||
| 822 | More detailed advice and other useful techniques for debugging Emacs | ||
| 823 | are available in the file @file{etc/DEBUG} in the Emacs distribution. | ||
| 824 | That file also includes instructions for investigating problems | ||
| 825 | whereby Emacs stops responding (many people assume that Emacs is | ||
| 826 | ``hung,'' whereas in fact it might be in an infinite loop). | ||
| 827 | |||
| 828 | To find the file @file{etc/DEBUG} in your Emacs installation, use the | ||
| 829 | directory name stored in the variable @code{data-directory}. | ||
| 830 | @end itemize | ||
| 831 | |||
| 832 | Here are some things that are not necessary in a bug report: | ||
| 833 | |||
| 834 | @itemize @bullet | ||
| 835 | @item | ||
| 836 | A description of the envelope of the bug---this is not necessary for a | ||
| 837 | reproducible bug. | ||
| 838 | |||
| 839 | Often people who encounter a bug spend a lot of time investigating | ||
| 840 | which changes to the input file will make the bug go away and which | ||
| 841 | changes will not affect it. | ||
| 842 | |||
| 843 | This is often time-consuming and not very useful, because the way we | ||
| 844 | will find the bug is by running a single example under the debugger | ||
| 845 | with breakpoints, not by pure deduction from a series of examples. | ||
| 846 | You might as well save time by not searching for additional examples. | ||
| 847 | It is better to send the bug report right away, go back to editing, | ||
| 848 | and find another bug to report. | ||
| 849 | |||
| 850 | Of course, if you can find a simpler example to report @emph{instead} of | ||
| 851 | the original one, that is a convenience. Errors in the output will be | ||
| 852 | easier to spot, running under the debugger will take less time, etc. | ||
| 853 | |||
| 854 | However, simplification is not vital; if you can't do this or don't have | ||
| 855 | time to try, please report the bug with your original test case. | ||
| 856 | |||
| 857 | @item | ||
| 858 | A core dump file. | ||
| 859 | |||
| 860 | Debugging the core dump might be useful, but it can only be done on | ||
| 861 | your machine, with your Emacs executable. Therefore, sending the core | ||
| 862 | dump file to the Emacs maintainers won't be useful. Above all, don't | ||
| 863 | include the core file in an email bug report! Such a large message | ||
| 864 | can be extremely inconvenient. | ||
| 865 | |||
| 866 | @item | ||
| 867 | A system-call trace of Emacs execution. | ||
| 868 | |||
| 869 | System-call traces are very useful for certain special kinds of | ||
| 870 | debugging, but in most cases they give little useful information. It is | ||
| 871 | therefore strange that many people seem to think that @emph{the} way to | ||
| 872 | report information about a crash is to send a system-call trace. Perhaps | ||
| 873 | this is a habit formed from experience debugging programs that don't | ||
| 874 | have source code or debugging symbols. | ||
| 875 | |||
| 876 | In most programs, a backtrace is normally far, far more informative than | ||
| 877 | a system-call trace. Even in Emacs, a simple backtrace is generally | ||
| 878 | more informative, though to give full information you should supplement | ||
| 879 | the backtrace by displaying variable values and printing them as Lisp | ||
| 880 | objects with @code{pr} (see above). | ||
| 881 | |||
| 882 | @item | ||
| 883 | A patch for the bug. | ||
| 884 | |||
| 885 | A patch for the bug is useful if it is a good one. But don't omit the | ||
| 886 | other information that a bug report needs, such as the test case, on the | ||
| 887 | assumption that a patch is sufficient. We might see problems with your | ||
| 888 | patch and decide to fix the problem another way, or we might not | ||
| 889 | understand it at all. And if we can't understand what bug you are | ||
| 890 | trying to fix, or why your patch should be an improvement, we mustn't | ||
| 891 | install it. | ||
| 892 | |||
| 893 | @ifnottex | ||
| 894 | @xref{Sending Patches}, for guidelines on how to make it easy for us to | ||
| 895 | understand and install your patches. | ||
| 896 | @end ifnottex | ||
| 897 | |||
| 898 | @item | ||
| 899 | A guess about what the bug is or what it depends on. | ||
| 900 | |||
| 901 | Such guesses are usually wrong. Even experts can't guess right about | ||
| 902 | such things without first using the debugger to find the facts. | ||
| 903 | @end itemize | ||
| 904 | |||
| 905 | @node Sending Patches | ||
| 906 | @subsection Sending Patches for GNU Emacs | ||
| 907 | |||
| 908 | @cindex sending patches for GNU Emacs | ||
| 909 | @cindex patches, sending | ||
| 910 | If you would like to write bug fixes or improvements for GNU Emacs, | ||
| 911 | that is very helpful. When you send your changes, please follow these | ||
| 912 | guidelines to make it easy for the maintainers to use them. If you | ||
| 913 | don't follow these guidelines, your information might still be useful, | ||
| 914 | but using it will take extra work. Maintaining GNU Emacs is a lot of | ||
| 915 | work in the best of circumstances, and we can't keep up unless you do | ||
| 916 | your best to help. | ||
| 917 | |||
| 918 | @itemize @bullet | ||
| 919 | @item | ||
| 920 | Send an explanation with your changes of what problem they fix or what | ||
| 921 | improvement they bring about. For a bug fix, just include a copy of the | ||
| 922 | bug report, and explain why the change fixes the bug. | ||
| 923 | |||
| 924 | (Referring to a bug report is not as good as including it, because then | ||
| 925 | we will have to look it up, and we have probably already deleted it if | ||
| 926 | we've already fixed the bug.) | ||
| 927 | |||
| 928 | @item | ||
| 929 | Always include a proper bug report for the problem you think you have | ||
| 930 | fixed. We need to convince ourselves that the change is right before | ||
| 931 | installing it. Even if it is correct, we might have trouble | ||
| 932 | understanding it if we don't have a way to reproduce the problem. | ||
| 933 | |||
| 934 | @item | ||
| 935 | Include all the comments that are appropriate to help people reading the | ||
| 936 | source in the future understand why this change was needed. | ||
| 937 | |||
| 938 | @item | ||
| 939 | Don't mix together changes made for different reasons. | ||
| 940 | Send them @emph{individually}. | ||
| 941 | |||
| 942 | If you make two changes for separate reasons, then we might not want to | ||
| 943 | install them both. We might want to install just one. If you send them | ||
| 944 | all jumbled together in a single set of diffs, we have to do extra work | ||
| 945 | to disentangle them---to figure out which parts of the change serve | ||
| 946 | which purpose. If we don't have time for this, we might have to ignore | ||
| 947 | your changes entirely. | ||
| 948 | |||
| 949 | If you send each change as soon as you have written it, with its own | ||
| 950 | explanation, then two changes never get tangled up, and we can consider | ||
| 951 | each one properly without any extra work to disentangle them. | ||
| 952 | |||
| 953 | @item | ||
| 954 | Send each change as soon as that change is finished. Sometimes people | ||
| 955 | think they are helping us by accumulating many changes to send them all | ||
| 956 | together. As explained above, this is absolutely the worst thing you | ||
| 957 | could do. | ||
| 958 | |||
| 959 | Since you should send each change separately, you might as well send it | ||
| 960 | right away. That gives us the option of installing it immediately if it | ||
| 961 | is important. | ||
| 962 | |||
| 963 | @item | ||
| 964 | Use @samp{diff -c} to make your diffs. Diffs without context are hard | ||
| 965 | to install reliably. More than that, they are hard to study; we must | ||
| 966 | always study a patch to decide whether we want to install it. Unidiff | ||
| 967 | format is better than contextless diffs, but not as easy to read as | ||
| 968 | @samp{-c} format. | ||
| 969 | |||
| 970 | If you have GNU diff, use @samp{diff -c -F'^[_a-zA-Z0-9$]+ *('} when | ||
| 971 | making diffs of C code. This shows the name of the function that each | ||
| 972 | change occurs in. | ||
| 973 | |||
| 974 | @item | ||
| 975 | Avoid any ambiguity as to which is the old version and which is the new. | ||
| 976 | Please make the old version the first argument to diff, and the new | ||
| 977 | version the second argument. And please give one version or the other a | ||
| 978 | name that indicates whether it is the old version or your new changed | ||
| 979 | one. | ||
| 980 | |||
| 981 | @item | ||
| 982 | Write the change log entries for your changes. This is both to save us | ||
| 983 | the extra work of writing them, and to help explain your changes so we | ||
| 984 | can understand them. | ||
| 985 | |||
| 986 | The purpose of the change log is to show people where to find what was | ||
| 987 | changed. So you need to be specific about what functions you changed; | ||
| 988 | in large functions, it's often helpful to indicate where within the | ||
| 989 | function the change was. | ||
| 990 | |||
| 991 | On the other hand, once you have shown people where to find the change, | ||
| 992 | you need not explain its purpose in the change log. Thus, if you add a | ||
| 993 | new function, all you need to say about it is that it is new. If you | ||
| 994 | feel that the purpose needs explaining, it probably does---but put the | ||
| 995 | explanation in comments in the code. It will be more useful there. | ||
| 996 | |||
| 997 | Please read the @file{ChangeLog} files in the @file{src} and | ||
| 998 | @file{lisp} directories to see what sorts of information to put in, | ||
| 999 | and to learn the style that we use. @xref{Change Log}. | ||
| 1000 | |||
| 1001 | @item | ||
| 1002 | When you write the fix, keep in mind that we can't install a change that | ||
| 1003 | would break other systems. Please think about what effect your change | ||
| 1004 | will have if compiled on another type of system. | ||
| 1005 | |||
| 1006 | Sometimes people send fixes that @emph{might} be an improvement in | ||
| 1007 | general---but it is hard to be sure of this. It's hard to install | ||
| 1008 | such changes because we have to study them very carefully. Of course, | ||
| 1009 | a good explanation of the reasoning by which you concluded the change | ||
| 1010 | was correct can help convince us. | ||
| 1011 | |||
| 1012 | The safest changes are changes to the configuration files for a | ||
| 1013 | particular machine. These are safe because they can't create new bugs | ||
| 1014 | on other machines. | ||
| 1015 | |||
| 1016 | Please help us keep up with the workload by designing the patch in a | ||
| 1017 | form that is clearly safe to install. | ||
| 1018 | @end itemize | ||
| 1019 | |||
| 1020 | @node Contributing, Service, Bugs, Top | ||
| 1021 | @section Contributing to Emacs Development | ||
| 1022 | |||
| 1023 | If you would like to help pretest Emacs releases to assure they work | ||
| 1024 | well, or if you would like to work on improving Emacs, please contact | ||
| 1025 | the maintainers at @email{emacs-devel@@gnu.org}. A pretester | ||
| 1026 | should be prepared to investigate bugs as well as report them. If you'd | ||
| 1027 | like to work on improving Emacs, please ask for suggested projects or | ||
| 1028 | suggest your own ideas. | ||
| 1029 | |||
| 1030 | If you have already written an improvement, please tell us about it. If | ||
| 1031 | you have not yet started work, it is useful to contact | ||
| 1032 | @email{emacs-devel@@gnu.org} before you start; it might be | ||
| 1033 | possible to suggest ways to make your extension fit in better with the | ||
| 1034 | rest of Emacs. | ||
| 1035 | |||
| 1036 | The development version of Emacs can be downloaded from the CVS | ||
| 1037 | repository where it is actively maintained by a group of developers. | ||
| 1038 | See the Emacs project page | ||
| 1039 | @url{http://savannah.gnu.org/projects/emacs/} for details. | ||
| 1040 | |||
| 1041 | @node Service, Copying, Contributing, Top | ||
| 1042 | @section How To Get Help with GNU Emacs | ||
| 1043 | |||
| 1044 | If you need help installing, using or changing GNU Emacs, there are two | ||
| 1045 | ways to find it: | ||
| 1046 | |||
| 1047 | @itemize @bullet | ||
| 1048 | @item | ||
| 1049 | Send a message to the mailing list | ||
| 1050 | @email{help-gnu-emacs@@gnu.org}, or post your request on | ||
| 1051 | newsgroup @code{gnu.emacs.help}. (This mailing list and newsgroup | ||
| 1052 | interconnect, so it does not matter which one you use.) | ||
| 1053 | |||
| 1054 | @item | ||
| 1055 | Look in the service directory for someone who might help you for a fee. | ||
| 1056 | The service directory is found in the file named @file{etc/SERVICE} in the | ||
| 1057 | Emacs distribution. | ||
| 1058 | @end itemize | ||
| 1059 | |||
| 1060 | @ifnottex | ||
| 1061 | @lowersections | ||
| 1062 | @end ifnottex | ||
| 1063 | |||
| 1064 | @ignore | ||
| 1065 | arch-tag: c9cba76d-b2cb-4e0c-ae3f-19d5ef35817c | ||
| 1066 | @end ignore | ||
diff --git a/doc/emacs/vc-xtra.texi b/doc/emacs/vc-xtra.texi new file mode 100644 index 00000000000..6ec69d60896 --- /dev/null +++ b/doc/emacs/vc-xtra.texi | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | @c | ||
| 5 | @c This file is included in emacs-xtra.texi when producing the printed | ||
| 6 | @c version. | ||
| 7 | @iftex | ||
| 8 | @node Advanced VC Usage | ||
| 9 | @section Advanced VC Usage | ||
| 10 | |||
| 11 | Commonly used features of Emacs' version control (VC) support are | ||
| 12 | described in the main Emacs manual (@pxref{Version Control,,,emacs, | ||
| 13 | the Emacs Manual}). This chapter describes more advanced VC usage. | ||
| 14 | |||
| 15 | @menu | ||
| 16 | * VC Dired Mode:: Listing files managed by version control. | ||
| 17 | * VC Dired Commands:: Commands to use in a VC Dired buffer. | ||
| 18 | * Remote Repositories:: Efficient access to remote CVS servers. | ||
| 19 | * Snapshots:: Sets of file versions treated as a unit. | ||
| 20 | * Miscellaneous VC:: Various other commands and features of VC. | ||
| 21 | * Customizing VC:: Variables that change VC's behavior. | ||
| 22 | @end menu | ||
| 23 | @end iftex | ||
| 24 | |||
| 25 | @iftex | ||
| 26 | @include vc1-xtra.texi | ||
| 27 | @include vc2-xtra.texi | ||
| 28 | @end iftex | ||
| 29 | |||
| 30 | @ignore | ||
| 31 | arch-tag: 11a18d0e-1baf-49da-8e38-f61195ae4dc3 | ||
| 32 | @end ignore | ||
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi new file mode 100644 index 00000000000..6d5df78848c --- /dev/null +++ b/doc/emacs/vc1-xtra.texi | |||
| @@ -0,0 +1,151 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | @c | ||
| 5 | @c This file is included either in vc-xtra.texi (when producing the | ||
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | ||
| 7 | @node VC Dired Mode | ||
| 8 | @subsection Dired under VC | ||
| 9 | |||
| 10 | @cindex PCL-CVS | ||
| 11 | @pindex cvs | ||
| 12 | @cindex CVS Dired Mode | ||
| 13 | The VC Dired Mode described here works with all the version control | ||
| 14 | systems that VC supports. Another more powerful facility, designed | ||
| 15 | specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS, | ||
| 16 | pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}. | ||
| 17 | |||
| 18 | @kindex C-x v d | ||
| 19 | @findex vc-directory | ||
| 20 | When you are working on a large program, it is often useful to find | ||
| 21 | out which files have changed within an entire directory tree, or to view | ||
| 22 | the status of all files under version control at once, and to perform | ||
| 23 | version control operations on collections of files. You can use the | ||
| 24 | command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing | ||
| 25 | that includes only files relevant for version control. | ||
| 26 | |||
| 27 | @vindex vc-dired-terse-display | ||
| 28 | @kbd{C-x v d} creates a buffer which uses VC Dired Mode. This looks | ||
| 29 | much like an ordinary Dired buffer | ||
| 30 | @iftex | ||
| 31 | (@pxref{Dired,,,emacs, the Emacs Manual}); | ||
| 32 | @end iftex | ||
| 33 | @ifnottex | ||
| 34 | (@pxref{Dired}); | ||
| 35 | @end ifnottex | ||
| 36 | however, normally it shows only the noteworthy files (those locked or | ||
| 37 | not up-to-date). This is called @dfn{terse display}. If you set the | ||
| 38 | variable @code{vc-dired-terse-display} to @code{nil}, then VC Dired | ||
| 39 | shows all relevant files---those managed under version control, plus | ||
| 40 | all subdirectories (@dfn{full display}). The command @kbd{v t} in a | ||
| 41 | VC Dired buffer toggles between terse display and full display | ||
| 42 | (@pxref{VC Dired Commands}). | ||
| 43 | |||
| 44 | @vindex vc-dired-recurse | ||
| 45 | By default, VC Dired produces a recursive listing of noteworthy or | ||
| 46 | relevant files at or below the given directory. You can change this by | ||
| 47 | setting the variable @code{vc-dired-recurse} to @code{nil}; then VC | ||
| 48 | Dired shows only the files in the given directory. | ||
| 49 | |||
| 50 | The line for an individual file shows the version control state in the | ||
| 51 | place of the hard link count, owner, group, and size of the file. If | ||
| 52 | the file is unmodified, in sync with the master file, the version | ||
| 53 | control state shown is blank. Otherwise it consists of text in | ||
| 54 | parentheses. Under RCS and SCCS, the name of the user locking the file | ||
| 55 | is shown; under CVS, an abbreviated version of the @samp{cvs status} | ||
| 56 | output is used. Here is an example using RCS: | ||
| 57 | |||
| 58 | @smallexample | ||
| 59 | @group | ||
| 60 | /home/jim/project: | ||
| 61 | |||
| 62 | -rw-r--r-- (jim) Apr 2 23:39 file1 | ||
| 63 | -r--r--r-- Apr 5 20:21 file2 | ||
| 64 | @end group | ||
| 65 | @end smallexample | ||
| 66 | |||
| 67 | @noindent | ||
| 68 | The files @samp{file1} and @samp{file2} are under version control, | ||
| 69 | @samp{file1} is locked by user jim, and @samp{file2} is unlocked. | ||
| 70 | |||
| 71 | Here is an example using CVS: | ||
| 72 | |||
| 73 | @smallexample | ||
| 74 | @group | ||
| 75 | /home/joe/develop: | ||
| 76 | |||
| 77 | -rw-r--r-- (modified) Aug 2 1997 file1.c | ||
| 78 | -rw-r--r-- Apr 4 20:09 file2.c | ||
| 79 | -rw-r--r-- (merge) Sep 13 1996 file3.c | ||
| 80 | @end group | ||
| 81 | @end smallexample | ||
| 82 | |||
| 83 | Here @samp{file1.c} is modified with respect to the repository, and | ||
| 84 | @samp{file2.c} is not. @samp{file3.c} is modified, but other changes | ||
| 85 | have also been checked in to the repository---you need to merge them | ||
| 86 | with the work file before you can check it in. | ||
| 87 | |||
| 88 | @vindex vc-stay-local | ||
| 89 | @vindex vc-cvs-stay-local | ||
| 90 | In the above, if the repository were on a remote machine, VC would | ||
| 91 | only contact it when the variable @code{vc-stay-local} (or | ||
| 92 | @code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is | ||
| 93 | because access to the repository may be slow, or you may be working | ||
| 94 | offline and not have access to the repository at all. As a | ||
| 95 | consequence, VC would not be able to tell you that @samp{file3.c} is | ||
| 96 | in the ``merge'' state; you would learn that only when you try to | ||
| 97 | check-in your modified copy of the file, or use a command such as | ||
| 98 | @kbd{C-x v m}. | ||
| 99 | |||
| 100 | In practice, this is not a problem because CVS handles this case | ||
| 101 | consistently whenever it arises. In VC, you'll simply get prompted to | ||
| 102 | merge the remote changes into your work file first. The benefits of | ||
| 103 | less network communication usually outweigh the disadvantage of not | ||
| 104 | seeing remote changes immediately. | ||
| 105 | |||
| 106 | @vindex vc-directory-exclusion-list | ||
| 107 | When VC Dired displays subdirectories (in the ``full'' display mode), | ||
| 108 | it omits some that should never contain any files under version control. | ||
| 109 | By default, this includes Version Control subdirectories such as | ||
| 110 | @samp{RCS} and @samp{CVS}; you can customize this by setting the | ||
| 111 | variable @code{vc-directory-exclusion-list}. | ||
| 112 | |||
| 113 | You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in | ||
| 114 | ordinary Dired, that allows you to specify additional switches for the | ||
| 115 | @samp{ls} command. | ||
| 116 | |||
| 117 | @node VC Dired Commands | ||
| 118 | @subsection VC Dired Commands | ||
| 119 | |||
| 120 | All the usual Dired commands work normally in VC Dired mode, except | ||
| 121 | for @kbd{v}, which is redefined as the version control prefix. You can | ||
| 122 | invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by | ||
| 123 | typing @kbd{v =}, or @kbd{v l}, and so on. Most of these commands apply | ||
| 124 | to the file name on the current line. | ||
| 125 | |||
| 126 | The command @kbd{v v} (@code{vc-next-action}) operates on all the | ||
| 127 | marked files, so that you can lock or check in several files at once. | ||
| 128 | If it operates on more than one file, it handles each file according to | ||
| 129 | its current state; thus, it might lock one file, but check in another | ||
| 130 | file. This could be confusing; it is up to you to avoid confusing | ||
| 131 | behavior by marking a set of files that are in a similar state. If no | ||
| 132 | files are marked, @kbd{v v} operates on the file in the current line. | ||
| 133 | |||
| 134 | If any files call for check-in, @kbd{v v} reads a single log entry, | ||
| 135 | then uses it for all the files being checked in. This is convenient for | ||
| 136 | registering or checking in several files at once, as part of the same | ||
| 137 | change. | ||
| 138 | |||
| 139 | @findex vc-dired-toggle-terse-mode | ||
| 140 | @findex vc-dired-mark-locked | ||
| 141 | You can toggle between terse display (only locked files, or files not | ||
| 142 | up-to-date) and full display at any time by typing @kbd{v t} | ||
| 143 | (@code{vc-dired-toggle-terse-mode}). There is also a special command | ||
| 144 | @kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently | ||
| 145 | locked (or, with CVS, all files not up-to-date). Thus, typing @kbd{* l | ||
| 146 | t k} is another way to delete from the buffer all files except those | ||
| 147 | currently locked. | ||
| 148 | |||
| 149 | @ignore | ||
| 150 | arch-tag: 8e8c2a01-ad41-4e61-a89a-60131ad67263 | ||
| 151 | @end ignore | ||
diff --git a/doc/emacs/vc2-xtra.texi b/doc/emacs/vc2-xtra.texi new file mode 100644 index 00000000000..83f28088726 --- /dev/null +++ b/doc/emacs/vc2-xtra.texi | |||
| @@ -0,0 +1,789 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 3 | @c See file emacs.texi for copying conditions. | ||
| 4 | @c | ||
| 5 | @c This file is included either in vc-xtra.texi (when producing the | ||
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | ||
| 7 | @node Remote Repositories | ||
| 8 | @subsection Remote Repositories | ||
| 9 | @cindex remote repositories (CVS) | ||
| 10 | |||
| 11 | A common way of using CVS is to set up a central CVS repository on | ||
| 12 | some Internet host, then have each developer check out a personal | ||
| 13 | working copy of the files on his local machine. Committing changes to | ||
| 14 | the repository, and picking up changes from other users into one's own | ||
| 15 | working area, then works by direct interactions with the CVS server. | ||
| 16 | |||
| 17 | One difficulty is that access to the CVS server is often slow, and | ||
| 18 | that developers might need to work off-line as well. VC is designed | ||
| 19 | to reduce the amount of network interaction necessary. | ||
| 20 | |||
| 21 | @menu | ||
| 22 | * Version Backups:: Keeping local copies of repository versions. | ||
| 23 | * Local Version Control:: Using another version system for local editing. | ||
| 24 | @end menu | ||
| 25 | |||
| 26 | @node Version Backups | ||
| 27 | @subsubsection Version Backups | ||
| 28 | @cindex version backups | ||
| 29 | |||
| 30 | @cindex automatic version backups | ||
| 31 | When VC sees that the CVS repository for a file is on a remote | ||
| 32 | machine, it automatically makes local backups of unmodified versions | ||
| 33 | of the file---@dfn{automatic version backups}. This means that you | ||
| 34 | can compare the file to the repository version (@kbd{C-x v =}), or | ||
| 35 | revert to that version (@kbd{C-x v u}), without any network | ||
| 36 | interactions. | ||
| 37 | |||
| 38 | The local copy of the unmodified file is called a @dfn{version | ||
| 39 | backup} to indicate that it corresponds exactly to a version that is | ||
| 40 | stored in the repository. Note that version backups are not the same | ||
| 41 | as ordinary Emacs backup files | ||
| 42 | @iftex | ||
| 43 | (@pxref{Backup,,,emacs, the Emacs Manual}). | ||
| 44 | @end iftex | ||
| 45 | @ifnottex | ||
| 46 | (@pxref{Backup}). | ||
| 47 | @end ifnottex | ||
| 48 | But they follow a similar naming convention. | ||
| 49 | |||
| 50 | For a file that comes from a remote CVS repository, VC makes a | ||
| 51 | version backup whenever you save the first changes to the file, and | ||
| 52 | removes it after you have committed your modified version to the | ||
| 53 | repository. You can disable the making of automatic version backups by | ||
| 54 | setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}). | ||
| 55 | |||
| 56 | @cindex manual version backups | ||
| 57 | The name of the automatic version backup for version @var{version} | ||
| 58 | of file @var{file} is @code{@var{file}.~@var{version}.~}. This is | ||
| 59 | almost the same as the name used by @kbd{C-x v ~} | ||
| 60 | @iftex | ||
| 61 | (@pxref{Old Versions,,,emacs, the Emacs Manual}), | ||
| 62 | @end iftex | ||
| 63 | @ifnottex | ||
| 64 | (@pxref{Old Versions}), | ||
| 65 | @end ifnottex | ||
| 66 | the only difference being the additional dot (@samp{.}) after the | ||
| 67 | version number. This similarity is intentional, because both kinds of | ||
| 68 | files store the same kind of information. The file made by @kbd{C-x v | ||
| 69 | ~} acts as a @dfn{manual version backup}. | ||
| 70 | |||
| 71 | All the VC commands that operate on old versions of a file can use | ||
| 72 | both kinds of version backups. For instance, @kbd{C-x v ~} uses | ||
| 73 | either an automatic or a manual version backup, if possible, to get | ||
| 74 | the contents of the version you request. Likewise, @kbd{C-x v =} and | ||
| 75 | @kbd{C-x v u} use either an automatic or a manual version backup, if | ||
| 76 | one of them exists, to get the contents of a version to compare or | ||
| 77 | revert to. If you changed a file outside of Emacs, so that no | ||
| 78 | automatic version backup was created for the previous text, you can | ||
| 79 | create a manual backup of that version using @kbd{C-x v ~}, and thus | ||
| 80 | obtain the benefit of the local copy for Emacs commands. | ||
| 81 | |||
| 82 | The only difference in Emacs's handling of manual and automatic | ||
| 83 | version backups, once they exist, is that Emacs deletes automatic | ||
| 84 | version backups when you commit to the repository. By contrast, | ||
| 85 | manual version backups remain until you delete them. | ||
| 86 | |||
| 87 | @node Local Version Control | ||
| 88 | @subsubsection Local Version Control | ||
| 89 | @cindex local version control | ||
| 90 | @cindex local back end (version control) | ||
| 91 | |||
| 92 | When you make many changes to a file that comes from a remote | ||
| 93 | repository, it can be convenient to have version control on your local | ||
| 94 | machine as well. You can then record intermediate versions, revert to | ||
| 95 | a previous state, etc., before you actually commit your changes to the | ||
| 96 | remote server. | ||
| 97 | |||
| 98 | VC lets you do this by putting a file under a second, local version | ||
| 99 | control system, so that the file is effectively registered in two | ||
| 100 | systems at the same time. For the description here, we will assume | ||
| 101 | that the remote system is CVS, and you use RCS locally, although the | ||
| 102 | mechanism works with any combination of version control systems | ||
| 103 | (@dfn{back ends}). | ||
| 104 | |||
| 105 | To make it work with other back ends, you must make sure that the | ||
| 106 | ``more local'' back end comes before the ``more remote'' back end in | ||
| 107 | the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By | ||
| 108 | default, this variable is set up so that you can use remote CVS and | ||
| 109 | local RCS as described here. | ||
| 110 | |||
| 111 | To start using local RCS for a file that comes from a remote CVS | ||
| 112 | server, you must @emph{register the file in RCS}, by typing @kbd{C-u | ||
| 113 | C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a | ||
| 114 | prefix argument, and specify RCS as the back end.) | ||
| 115 | |||
| 116 | You can do this at any time; it does not matter whether you have | ||
| 117 | already modified the file with respect to the version in the CVS | ||
| 118 | repository. If possible, VC tries to make the RCS master start with | ||
| 119 | the unmodified repository version, then checks in any local changes | ||
| 120 | as a new version. This works if you have not made any changes yet, or | ||
| 121 | if the unmodified repository version exists locally as a version | ||
| 122 | backup (@pxref{Version Backups}). If the unmodified version is not | ||
| 123 | available locally, the RCS master starts with the modified version; | ||
| 124 | the only drawback to this is that you cannot compare your changes | ||
| 125 | locally to what is stored in the repository. | ||
| 126 | |||
| 127 | The version number of the RCS master is derived from the current CVS | ||
| 128 | version, starting a branch from it. For example, if the current CVS | ||
| 129 | version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in | ||
| 130 | the RCS master will be identical to version 1.23 under CVS; your first | ||
| 131 | changes are checked in as 1.23.1.1. (If the unmodified file is not | ||
| 132 | available locally, VC will check in the modified file twice, both as | ||
| 133 | 1.23 and 1.23.1.1, to make the revision numbers consistent.) | ||
| 134 | |||
| 135 | If you do not use locking under CVS (the default), locking is also | ||
| 136 | disabled for RCS, so that editing under RCS works exactly as under | ||
| 137 | CVS. | ||
| 138 | |||
| 139 | When you are done with local editing, you can commit the final version | ||
| 140 | back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}. | ||
| 141 | This initializes the log entry buffer | ||
| 142 | @iftex | ||
| 143 | (@pxref{Log Buffer,,,emacs, the Emacs Manual}) | ||
| 144 | @end iftex | ||
| 145 | @ifnottex | ||
| 146 | (@pxref{Log Buffer}) | ||
| 147 | @end ifnottex | ||
| 148 | to contain all the log entries you have recorded in the RCS master; | ||
| 149 | you can edit them as you wish, and then commit in CVS by typing | ||
| 150 | @kbd{C-c C-c}. If the commit is successful, VC removes the RCS | ||
| 151 | master, so that the file is once again registered under CVS only. | ||
| 152 | (The RCS master is not actually deleted, just renamed by appending | ||
| 153 | @samp{~} to the name, so that you can refer to it later if you wish.) | ||
| 154 | |||
| 155 | While using local RCS, you can pick up recent changes from the CVS | ||
| 156 | repository into your local file, or commit some of your changes back | ||
| 157 | to CVS, without terminating local RCS version control. To do this, | ||
| 158 | switch to the CVS back end temporarily, with the @kbd{C-x v b} command: | ||
| 159 | |||
| 160 | @table @kbd | ||
| 161 | @item C-x v b | ||
| 162 | Switch to another back end that the current file is registered | ||
| 163 | under (@code{vc-switch-backend}). | ||
| 164 | |||
| 165 | @item C-u C-x v b @var{backend} @key{RET} | ||
| 166 | Switch to @var{backend} for the current file. | ||
| 167 | @end table | ||
| 168 | |||
| 169 | @kindex C-x v b | ||
| 170 | @findex vc-switch-backend | ||
| 171 | @kbd{C-x v b} does not change the buffer contents, or any files; it | ||
| 172 | only changes VC's perspective on how to handle the file. Any | ||
| 173 | subsequent VC commands for that file will operate on the back end that | ||
| 174 | is currently selected. | ||
| 175 | |||
| 176 | If the current file is registered in more than one back end, typing | ||
| 177 | @kbd{C-x v b} ``cycles'' through all of these back ends. With a | ||
| 178 | prefix argument, it asks for the back end to use in the minibuffer. | ||
| 179 | |||
| 180 | Thus, if you are using local RCS, and you want to pick up some recent | ||
| 181 | changes in the file from remote CVS, first visit the file, then type | ||
| 182 | @kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m | ||
| 183 | @key{RET}} to merge the news | ||
| 184 | @iftex | ||
| 185 | (@pxref{Merging,,,emacs, the Emacs Manual}). | ||
| 186 | @end iftex | ||
| 187 | @ifnottex | ||
| 188 | (@pxref{Merging}). | ||
| 189 | @end ifnottex | ||
| 190 | You can then switch back to RCS by typing @kbd{C-x v b} again, and | ||
| 191 | continue to edit locally. | ||
| 192 | |||
| 193 | But if you do this, the revision numbers in the RCS master no longer | ||
| 194 | correspond to those of CVS. Technically, this is not a problem, but | ||
| 195 | it can become difficult to keep track of what is in the CVS repository | ||
| 196 | and what is not. So we suggest that you return from time to time to | ||
| 197 | CVS-only operation, by committing your local changes back to the | ||
| 198 | repository using @kbd{C-u C-x v v cvs @key{RET}}. | ||
| 199 | |||
| 200 | @node Snapshots | ||
| 201 | @subsection Snapshots | ||
| 202 | @cindex snapshots and version control | ||
| 203 | |||
| 204 | A @dfn{snapshot} is a named set of file versions (one for each | ||
| 205 | registered file) that you can treat as a unit. One important kind of | ||
| 206 | snapshot is a @dfn{release}, a (theoretically) stable version of the | ||
| 207 | system that is ready for distribution to users. | ||
| 208 | |||
| 209 | @menu | ||
| 210 | * Making Snapshots:: The snapshot facilities. | ||
| 211 | * Snapshot Caveats:: Things to be careful of when using snapshots. | ||
| 212 | @end menu | ||
| 213 | |||
| 214 | @node Making Snapshots | ||
| 215 | @subsubsection Making and Using Snapshots | ||
| 216 | |||
| 217 | There are two basic commands for snapshots; one makes a | ||
| 218 | snapshot with a given name, the other retrieves a named snapshot. | ||
| 219 | |||
| 220 | @table @code | ||
| 221 | @kindex C-x v s | ||
| 222 | @findex vc-create-snapshot | ||
| 223 | @item C-x v s @var{name} @key{RET} | ||
| 224 | Define the last saved versions of every registered file in or under the | ||
| 225 | current directory as a snapshot named @var{name} | ||
| 226 | (@code{vc-create-snapshot}). | ||
| 227 | |||
| 228 | @kindex C-x v r | ||
| 229 | @findex vc-retrieve-snapshot | ||
| 230 | @item C-x v r @var{name} @key{RET} | ||
| 231 | For all registered files at or below the current directory level, select | ||
| 232 | whatever versions correspond to the snapshot @var{name} | ||
| 233 | (@code{vc-retrieve-snapshot}). | ||
| 234 | |||
| 235 | This command reports an error if any files are locked at or below the | ||
| 236 | current directory, without changing anything; this is to avoid | ||
| 237 | overwriting work in progress. | ||
| 238 | @end table | ||
| 239 | |||
| 240 | A snapshot uses a very small amount of resources---just enough to record | ||
| 241 | the list of file names and which version belongs to the snapshot. Thus, | ||
| 242 | you need not hesitate to create snapshots whenever they are useful. | ||
| 243 | |||
| 244 | You can give a snapshot name as an argument to @kbd{C-x v =} or | ||
| 245 | @kbd{C-x v ~} | ||
| 246 | @iftex | ||
| 247 | (@pxref{Old Versions,,,emacs, the Emacs Manual}). | ||
| 248 | @end iftex | ||
| 249 | @ifnottex | ||
| 250 | (@pxref{Old Versions}). | ||
| 251 | @end ifnottex | ||
| 252 | Thus, you can use it to compare a snapshot against the current files, | ||
| 253 | or two snapshots against each other, or a snapshot against a named | ||
| 254 | version. | ||
| 255 | |||
| 256 | @node Snapshot Caveats | ||
| 257 | @subsubsection Snapshot Caveats | ||
| 258 | |||
| 259 | @cindex named configurations (RCS) | ||
| 260 | VC's snapshot facilities are modeled on RCS's named-configuration | ||
| 261 | support. They use RCS's native facilities for this, so | ||
| 262 | snapshots made using RCS through VC are visible even when you bypass VC. | ||
| 263 | |||
| 264 | With CVS, Meta-CVS, and Subversion, VC also uses the native | ||
| 265 | mechanism provided by that back end to make snapshots and retrieve them | ||
| 266 | (@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion). | ||
| 267 | |||
| 268 | @c worded verbosely to avoid overfull hbox. | ||
| 269 | For SCCS, VC implements snapshots itself. The files it uses contain | ||
| 270 | name/file/version-number triples. These snapshots are visible only | ||
| 271 | through VC. | ||
| 272 | |||
| 273 | There is no support for VC snapshots using GNU Arch yet. | ||
| 274 | |||
| 275 | A snapshot is a set of checked-in versions. So make sure that all the | ||
| 276 | files are checked in and not locked when you make a snapshot. | ||
| 277 | |||
| 278 | File renaming and deletion can create some difficulties with snapshots. | ||
| 279 | This is not a VC-specific problem, but a general design issue in version | ||
| 280 | control systems that no one has solved very well yet. | ||
| 281 | |||
| 282 | If you rename a registered file, you need to rename its master along | ||
| 283 | with it (the command @code{vc-rename-file} does this automatically). If | ||
| 284 | you are using SCCS, you must also update the records of the snapshot, to | ||
| 285 | mention the file by its new name (@code{vc-rename-file} does this, | ||
| 286 | too). An old snapshot that refers to a master file that no longer | ||
| 287 | exists under the recorded name is invalid; VC can no longer retrieve | ||
| 288 | it. It would be beyond the scope of this manual to explain enough about | ||
| 289 | RCS and SCCS to explain how to update the snapshots by hand. | ||
| 290 | |||
| 291 | Using @code{vc-rename-file} makes the snapshot remain valid for | ||
| 292 | retrieval, but it does not solve all problems. For example, some of the | ||
| 293 | files in your program probably refer to others by name. At the very | ||
| 294 | least, the makefile probably mentions the file that you renamed. If you | ||
| 295 | retrieve an old snapshot, the renamed file is retrieved under its new | ||
| 296 | name, which is not the name that the makefile expects. So the program | ||
| 297 | won't really work as retrieved. | ||
| 298 | |||
| 299 | @node Miscellaneous VC | ||
| 300 | @subsection Miscellaneous Commands and Features of VC | ||
| 301 | |||
| 302 | This section explains the less-frequently-used features of VC. | ||
| 303 | |||
| 304 | @menu | ||
| 305 | * Change Logs and VC:: Generating a change log file from log entries. | ||
| 306 | * Renaming and VC:: A command to rename both the source and master | ||
| 307 | file correctly. | ||
| 308 | * Version Headers:: Inserting version control headers into working files. | ||
| 309 | @end menu | ||
| 310 | |||
| 311 | @node Change Logs and VC | ||
| 312 | @subsubsection Change Logs and VC | ||
| 313 | |||
| 314 | If you use RCS or CVS for a program and also maintain a change log | ||
| 315 | file for it | ||
| 316 | @iftex | ||
| 317 | (@pxref{Change Log,,,emacs, the Emacs Manual}), | ||
| 318 | @end iftex | ||
| 319 | @ifnottex | ||
| 320 | (@pxref{Change Log}), | ||
| 321 | @end ifnottex | ||
| 322 | you can generate change log entries automatically from the version | ||
| 323 | control log entries: | ||
| 324 | |||
| 325 | @table @kbd | ||
| 326 | @item C-x v a | ||
| 327 | @kindex C-x v a | ||
| 328 | @findex vc-update-change-log | ||
| 329 | Visit the current directory's change log file and, for registered files | ||
| 330 | in that directory, create new entries for versions checked in since the | ||
| 331 | most recent entry in the change log file. | ||
| 332 | (@code{vc-update-change-log}). | ||
| 333 | |||
| 334 | This command works with RCS or CVS only, not with any of the other | ||
| 335 | back ends. | ||
| 336 | |||
| 337 | @item C-u C-x v a | ||
| 338 | As above, but only find entries for the current buffer's file. | ||
| 339 | |||
| 340 | @item M-1 C-x v a | ||
| 341 | As above, but find entries for all the currently visited files that are | ||
| 342 | maintained with version control. This works only with RCS, and it puts | ||
| 343 | all entries in the log for the default directory, which may not be | ||
| 344 | appropriate. | ||
| 345 | @end table | ||
| 346 | |||
| 347 | For example, suppose the first line of @file{ChangeLog} is dated | ||
| 348 | 1999-04-10, and that the only check-in since then was by Nathaniel | ||
| 349 | Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log | ||
| 350 | messages that start with `#'.}. Then @kbd{C-x v a} visits | ||
| 351 | @file{ChangeLog} and inserts text like this: | ||
| 352 | |||
| 353 | @iftex | ||
| 354 | @medbreak | ||
| 355 | @end iftex | ||
| 356 | @smallexample | ||
| 357 | @group | ||
| 358 | 1999-05-22 Nathaniel Bowditch <nat@@apn.org> | ||
| 359 | |||
| 360 | * rcs2log: Ignore log messages that start with `#'. | ||
| 361 | @end group | ||
| 362 | @end smallexample | ||
| 363 | @iftex | ||
| 364 | @medbreak | ||
| 365 | @end iftex | ||
| 366 | |||
| 367 | @noindent | ||
| 368 | You can then edit the new change log entry further as you wish. | ||
| 369 | |||
| 370 | Some of the new change log entries may duplicate what's already in | ||
| 371 | ChangeLog. You will have to remove these duplicates by hand. | ||
| 372 | |||
| 373 | Normally, the log entry for file @file{foo} is displayed as @samp{* | ||
| 374 | foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted | ||
| 375 | if the text of the log entry starts with @w{@samp{(@var{functionname}): | ||
| 376 | }}. For example, if the log entry for @file{vc.el} is | ||
| 377 | @samp{(vc-do-command): Check call-process status.}, then the text in | ||
| 378 | @file{ChangeLog} looks like this: | ||
| 379 | |||
| 380 | @iftex | ||
| 381 | @medbreak | ||
| 382 | @end iftex | ||
| 383 | @smallexample | ||
| 384 | @group | ||
| 385 | 1999-05-06 Nathaniel Bowditch <nat@@apn.org> | ||
| 386 | |||
| 387 | * vc.el (vc-do-command): Check call-process status. | ||
| 388 | @end group | ||
| 389 | @end smallexample | ||
| 390 | @iftex | ||
| 391 | @medbreak | ||
| 392 | @end iftex | ||
| 393 | |||
| 394 | When @kbd{C-x v a} adds several change log entries at once, it groups | ||
| 395 | related log entries together if they all are checked in by the same | ||
| 396 | author at nearly the same time. If the log entries for several such | ||
| 397 | files all have the same text, it coalesces them into a single entry. | ||
| 398 | For example, suppose the most recent check-ins have the following log | ||
| 399 | entries: | ||
| 400 | |||
| 401 | @flushleft | ||
| 402 | @bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.} | ||
| 403 | @bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.} | ||
| 404 | @bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.} | ||
| 405 | @end flushleft | ||
| 406 | |||
| 407 | @noindent | ||
| 408 | They appear like this in @file{ChangeLog}: | ||
| 409 | |||
| 410 | @iftex | ||
| 411 | @medbreak | ||
| 412 | @end iftex | ||
| 413 | @smallexample | ||
| 414 | @group | ||
| 415 | 1999-04-01 Nathaniel Bowditch <nat@@apn.org> | ||
| 416 | |||
| 417 | * vc.texinfo: Fix expansion typos. | ||
| 418 | |||
| 419 | * vc.el, vc-hooks.el: Don't call expand-file-name. | ||
| 420 | @end group | ||
| 421 | @end smallexample | ||
| 422 | @iftex | ||
| 423 | @medbreak | ||
| 424 | @end iftex | ||
| 425 | |||
| 426 | Normally, @kbd{C-x v a} separates log entries by a blank line, but you | ||
| 427 | can mark several related log entries to be clumped together (without an | ||
| 428 | intervening blank line) by starting the text of each related log entry | ||
| 429 | with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label | ||
| 430 | itself is not copied to @file{ChangeLog}. For example, suppose the log | ||
| 431 | entries are: | ||
| 432 | |||
| 433 | @flushleft | ||
| 434 | @bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.} | ||
| 435 | @bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.} | ||
| 436 | @bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.} | ||
| 437 | @end flushleft | ||
| 438 | |||
| 439 | @noindent | ||
| 440 | Then the text in @file{ChangeLog} looks like this: | ||
| 441 | |||
| 442 | @iftex | ||
| 443 | @medbreak | ||
| 444 | @end iftex | ||
| 445 | @smallexample | ||
| 446 | @group | ||
| 447 | 1999-04-01 Nathaniel Bowditch <nat@@apn.org> | ||
| 448 | |||
| 449 | * vc.texinfo: Fix expansion typos. | ||
| 450 | * vc.el, vc-hooks.el: Don't call expand-file-name. | ||
| 451 | @end group | ||
| 452 | @end smallexample | ||
| 453 | @iftex | ||
| 454 | @medbreak | ||
| 455 | @end iftex | ||
| 456 | |||
| 457 | A log entry whose text begins with @samp{#} is not copied to | ||
| 458 | @file{ChangeLog}. For example, if you merely fix some misspellings in | ||
| 459 | comments, you can log the change with an entry beginning with @samp{#} | ||
| 460 | to avoid putting such trivia into @file{ChangeLog}. | ||
| 461 | |||
| 462 | @node Renaming and VC | ||
| 463 | @subsubsection Renaming VC Work Files and Master Files | ||
| 464 | |||
| 465 | @findex vc-rename-file | ||
| 466 | When you rename a registered file, you must also rename its master | ||
| 467 | file correspondingly to get proper results. Use @code{vc-rename-file} | ||
| 468 | to rename the source file as you specify, and rename its master file | ||
| 469 | accordingly. It also updates any snapshots (@pxref{Snapshots}) that | ||
| 470 | mention the file, so that they use the new name; despite this, the | ||
| 471 | snapshot thus modified may not completely work (@pxref{Snapshot | ||
| 472 | Caveats}). | ||
| 473 | |||
| 474 | Some back ends do not provide an explicit rename operation to their | ||
| 475 | repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v} | ||
| 476 | on the original and renamed buffers and provide the necessary edit | ||
| 477 | log. | ||
| 478 | |||
| 479 | You cannot use @code{vc-rename-file} on a file that is locked by | ||
| 480 | someone else. | ||
| 481 | |||
| 482 | @node Version Headers | ||
| 483 | @subsubsection Inserting Version Control Headers | ||
| 484 | |||
| 485 | Sometimes it is convenient to put version identification strings | ||
| 486 | directly into working files. Certain special strings called | ||
| 487 | @dfn{version headers} are replaced in each successive version by the | ||
| 488 | number of that version, the name of the user who created it, and other | ||
| 489 | relevant information. All of the back ends that VC supports have such | ||
| 490 | a mechanism, except GNU Arch. | ||
| 491 | |||
| 492 | VC does not normally use the information contained in these headers. | ||
| 493 | The exception is RCS---with RCS, version headers are sometimes more | ||
| 494 | reliable than the master file to determine which version of the file | ||
| 495 | you are editing. Note that in a multi-branch environment, version | ||
| 496 | headers are necessary to make VC behave correctly | ||
| 497 | @iftex | ||
| 498 | (@pxref{Multi-User Branching,,,emacs, the Emacs Manual}). | ||
| 499 | @end iftex | ||
| 500 | @ifnottex | ||
| 501 | (@pxref{Multi-User Branching}). | ||
| 502 | @end ifnottex | ||
| 503 | |||
| 504 | Searching for RCS version headers is controlled by the variable | ||
| 505 | @code{vc-consult-headers}. If it is non-@code{nil} (the default), | ||
| 506 | Emacs searches for headers to determine the version number you are | ||
| 507 | editing. Setting it to @code{nil} disables this feature. | ||
| 508 | |||
| 509 | Note that although CVS uses the same kind of version headers as RCS | ||
| 510 | does, VC never searches for these headers if you are using CVS, | ||
| 511 | regardless of the above setting. | ||
| 512 | |||
| 513 | @kindex C-x v h | ||
| 514 | @findex vc-insert-headers | ||
| 515 | You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to | ||
| 516 | insert a suitable header string. | ||
| 517 | |||
| 518 | @table @kbd | ||
| 519 | @item C-x v h | ||
| 520 | Insert headers in a file for use with your version-control system. | ||
| 521 | @end table | ||
| 522 | |||
| 523 | @vindex vc-@var{backend}-header | ||
| 524 | The default header string is @samp{@w{$}Id$} for RCS and | ||
| 525 | @samp{@w{%}W%} for SCCS. You can specify other headers to insert by | ||
| 526 | setting the variables @code{vc-@var{backend}-header} where | ||
| 527 | @var{backend} is @code{rcs} or @code{sccs}. | ||
| 528 | |||
| 529 | Instead of a single string, you can specify a list of strings; then | ||
| 530 | each string in the list is inserted as a separate header on a line of | ||
| 531 | its own. | ||
| 532 | |||
| 533 | It may be necessary to use apparently-superfluous backslashes when | ||
| 534 | writing the strings that you put in this variable. For instance, you | ||
| 535 | might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra | ||
| 536 | backslash prevents the string constant from being interpreted as a | ||
| 537 | header, if the Emacs Lisp file containing it is maintained with | ||
| 538 | version control. | ||
| 539 | |||
| 540 | @vindex vc-comment-alist | ||
| 541 | Each header is inserted surrounded by tabs, inside comment delimiters, | ||
| 542 | on a new line at point. Normally the ordinary comment | ||
| 543 | start and comment end strings of the current mode are used, but for | ||
| 544 | certain modes, there are special comment delimiters for this purpose; | ||
| 545 | the variable @code{vc-comment-alist} specifies them. Each element of | ||
| 546 | this list has the form @code{(@var{mode} @var{starter} @var{ender})}. | ||
| 547 | |||
| 548 | @vindex vc-static-header-alist | ||
| 549 | The variable @code{vc-static-header-alist} specifies further strings | ||
| 550 | to add based on the name of the buffer. Its value should be a list of | ||
| 551 | elements of the form @code{(@var{regexp} . @var{format})}. Whenever | ||
| 552 | @var{regexp} matches the buffer name, @var{format} is inserted as part | ||
| 553 | of the header. A header line is inserted for each element that matches | ||
| 554 | the buffer name, and for each string specified by | ||
| 555 | @code{vc-@var{backend}-header}. The header line is made by processing the | ||
| 556 | string from @code{vc-@var{backend}-header} with the format taken from the | ||
| 557 | element. The default value for @code{vc-static-header-alist} is as follows: | ||
| 558 | |||
| 559 | @example | ||
| 560 | @group | ||
| 561 | (("\\.c$" . | ||
| 562 | "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\ | ||
| 563 | #endif /* lint */\n")) | ||
| 564 | @end group | ||
| 565 | @end example | ||
| 566 | |||
| 567 | @noindent | ||
| 568 | It specifies insertion of text of this form: | ||
| 569 | |||
| 570 | @example | ||
| 571 | @group | ||
| 572 | |||
| 573 | #ifndef lint | ||
| 574 | static char vcid[] = "@var{string}"; | ||
| 575 | #endif /* lint */ | ||
| 576 | @end group | ||
| 577 | @end example | ||
| 578 | |||
| 579 | @noindent | ||
| 580 | Note that the text above starts with a blank line. | ||
| 581 | |||
| 582 | If you use more than one version header in a file, put them close | ||
| 583 | together in the file. The mechanism in @code{revert-buffer} that | ||
| 584 | preserves markers may not handle markers positioned between two version | ||
| 585 | headers. | ||
| 586 | |||
| 587 | @node Customizing VC | ||
| 588 | @subsection Customizing VC | ||
| 589 | |||
| 590 | @vindex vc-handled-backends | ||
| 591 | The variable @code{vc-handled-backends} determines which version | ||
| 592 | control systems VC should handle. The default value is @code{(RCS CVS | ||
| 593 | SVN SCCS BZR GIT HG Arch MCVS)}, so it contains all the version systems | ||
| 594 | that are currently supported. If you want VC to ignore one or more of | ||
| 595 | these systems, exclude its name from the list. To disable VC entirely, | ||
| 596 | set this variable to @code{nil}. | ||
| 597 | |||
| 598 | The order of systems in the list is significant: when you visit a file | ||
| 599 | registered in more than one system (@pxref{Local Version Control}), VC | ||
| 600 | uses the system that comes first in @code{vc-handled-backends} by | ||
| 601 | default. The order is also significant when you register a file for | ||
| 602 | the first time, see | ||
| 603 | @iftex | ||
| 604 | @ref{Registering,,,emacs, the Emacs Manual}, | ||
| 605 | @end iftex | ||
| 606 | @ifnottex | ||
| 607 | @ref{Registering}, | ||
| 608 | @end ifnottex | ||
| 609 | for details. | ||
| 610 | |||
| 611 | @menu | ||
| 612 | * General VC Options:: Options that apply to multiple back ends. | ||
| 613 | * RCS and SCCS:: Options for RCS and SCCS. | ||
| 614 | * CVS Options:: Options for CVS. | ||
| 615 | @end menu | ||
| 616 | |||
| 617 | @node General VC Options | ||
| 618 | @subsubsection General Options | ||
| 619 | |||
| 620 | @vindex vc-make-backup-files | ||
| 621 | Emacs normally does not save backup files for source files that are | ||
| 622 | maintained with version control. If you want to make backup files even | ||
| 623 | for files that use version control, set the variable | ||
| 624 | @code{vc-make-backup-files} to a non-@code{nil} value. | ||
| 625 | |||
| 626 | @vindex vc-keep-workfiles | ||
| 627 | Normally the work file exists all the time, whether it is locked or | ||
| 628 | not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking | ||
| 629 | in a new version with @kbd{C-x v v} deletes the work file; but any | ||
| 630 | attempt to visit the file with Emacs creates it again. (With CVS, work | ||
| 631 | files are always kept.) | ||
| 632 | |||
| 633 | @vindex vc-follow-symlinks | ||
| 634 | Editing a version-controlled file through a symbolic link can be | ||
| 635 | dangerous. It bypasses the version control system---you can edit the | ||
| 636 | file without locking it, and fail to check your changes in. Also, | ||
| 637 | your changes might overwrite those of another user. To protect against | ||
| 638 | this, VC checks each symbolic link that you visit, to see if it points | ||
| 639 | to a file under version control. | ||
| 640 | |||
| 641 | The variable @code{vc-follow-symlinks} controls what to do when a | ||
| 642 | symbolic link points to a version-controlled file. If it is @code{nil}, | ||
| 643 | VC only displays a warning message. If it is @code{t}, VC automatically | ||
| 644 | follows the link, and visits the real file instead, telling you about | ||
| 645 | this in the echo area. If the value is @code{ask} (the default), VC | ||
| 646 | asks you each time whether to follow the link. | ||
| 647 | |||
| 648 | @vindex vc-suppress-confirm | ||
| 649 | If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v} | ||
| 650 | and @kbd{C-x v i} can save the current buffer without asking, and | ||
| 651 | @kbd{C-x v u} also operates without asking for confirmation. (This | ||
| 652 | variable does not affect @kbd{C-x v c}; that operation is so drastic | ||
| 653 | that it should always ask for confirmation.) | ||
| 654 | |||
| 655 | @vindex vc-command-messages | ||
| 656 | VC mode does much of its work by running the shell commands for RCS, | ||
| 657 | CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC | ||
| 658 | displays messages to indicate which shell commands it runs, and | ||
| 659 | additional messages when the commands finish. | ||
| 660 | |||
| 661 | @vindex vc-path | ||
| 662 | You can specify additional directories to search for version control | ||
| 663 | programs by setting the variable @code{vc-path}. These directories | ||
| 664 | are searched before the usual search path. It is rarely necessary to | ||
| 665 | set this variable, because VC normally finds the proper files | ||
| 666 | automatically. | ||
| 667 | |||
| 668 | @node RCS and SCCS | ||
| 669 | @subsubsection Options for RCS and SCCS | ||
| 670 | |||
| 671 | @cindex non-strict locking (RCS) | ||
| 672 | @cindex locking, non-strict (RCS) | ||
| 673 | By default, RCS uses locking to coordinate the activities of several | ||
| 674 | users, but there is a mode called @dfn{non-strict locking} in which | ||
| 675 | you can check-in changes without locking the file first. Use | ||
| 676 | @samp{rcs -U} to switch to non-strict locking for a particular file, | ||
| 677 | see the @code{rcs} manual page for details. | ||
| 678 | |||
| 679 | When deducing the version control state of an RCS file, VC first | ||
| 680 | looks for an RCS version header string in the file (@pxref{Version | ||
| 681 | Headers}). If there is no header string, VC normally looks at the | ||
| 682 | file permissions of the work file; this is fast. But there might be | ||
| 683 | situations when the file permissions cannot be trusted. In this case | ||
| 684 | the master file has to be consulted, which is rather expensive. Also | ||
| 685 | the master file can only tell you @emph{if} there's any lock on the | ||
| 686 | file, but not whether your work file really contains that locked | ||
| 687 | version. | ||
| 688 | |||
| 689 | @vindex vc-consult-headers | ||
| 690 | You can tell VC not to use version headers to determine the file | ||
| 691 | status by setting @code{vc-consult-headers} to @code{nil}. VC then | ||
| 692 | always uses the file permissions (if it is supposed to trust them), or | ||
| 693 | else checks the master file. | ||
| 694 | |||
| 695 | @vindex vc-mistrust-permissions | ||
| 696 | You can specify the criterion for whether to trust the file | ||
| 697 | permissions by setting the variable @code{vc-mistrust-permissions}. | ||
| 698 | Its value can be @code{t} (always mistrust the file permissions and | ||
| 699 | check the master file), @code{nil} (always trust the file | ||
| 700 | permissions), or a function of one argument which makes the decision. | ||
| 701 | The argument is the directory name of the @file{RCS} subdirectory. A | ||
| 702 | non-@code{nil} value from the function says to mistrust the file | ||
| 703 | permissions. If you find that the file permissions of work files are | ||
| 704 | changed erroneously, set @code{vc-mistrust-permissions} to @code{t}. | ||
| 705 | Then VC always checks the master file to determine the file's status. | ||
| 706 | |||
| 707 | VC determines the version control state of files under SCCS much as | ||
| 708 | with RCS. It does not consider SCCS version headers, though. Thus, | ||
| 709 | the variable @code{vc-mistrust-permissions} affects SCCS use, but | ||
| 710 | @code{vc-consult-headers} does not. | ||
| 711 | |||
| 712 | @node CVS Options | ||
| 713 | @subsubsection Options specific for CVS | ||
| 714 | |||
| 715 | @cindex locking (CVS) | ||
| 716 | By default, CVS does not use locking to coordinate the activities of | ||
| 717 | several users; anyone can change a work file at any time. However, | ||
| 718 | there are ways to restrict this, resulting in behavior that resembles | ||
| 719 | locking. | ||
| 720 | |||
| 721 | @cindex CVSREAD environment variable (CVS) | ||
| 722 | For one thing, you can set the @env{CVSREAD} environment variable | ||
| 723 | (the value you use makes no difference). If this variable is defined, | ||
| 724 | CVS makes your work files read-only by default. In Emacs, you must | ||
| 725 | type @kbd{C-x v v} to make the file writable, so that editing works | ||
| 726 | in fact similar as if locking was used. Note however, that no actual | ||
| 727 | locking is performed, so several users can make their files writable | ||
| 728 | at the same time. When setting @env{CVSREAD} for the first time, make | ||
| 729 | sure to check out all your modules anew, so that the file protections | ||
| 730 | are set correctly. | ||
| 731 | |||
| 732 | @cindex cvs watch feature | ||
| 733 | @cindex watching files (CVS) | ||
| 734 | Another way to achieve something similar to locking is to use the | ||
| 735 | @dfn{watch} feature of CVS. If a file is being watched, CVS makes it | ||
| 736 | read-only by default, and you must also use @kbd{C-x v v} in Emacs to | ||
| 737 | make it writable. VC calls @code{cvs edit} to make the file writable, | ||
| 738 | and CVS takes care to notify other developers of the fact that you | ||
| 739 | intend to change the file. See the CVS documentation for details on | ||
| 740 | using the watch feature. | ||
| 741 | |||
| 742 | @vindex vc-stay-local | ||
| 743 | @vindex vc-cvs-stay-local | ||
| 744 | @cindex remote repositories (CVS) | ||
| 745 | When a file's repository is on a remote machine, VC tries to keep | ||
| 746 | network interactions to a minimum. This is controlled by the variable | ||
| 747 | @code{vc-cvs-stay-local}. There is another variable, | ||
| 748 | @code{vc-stay-local}, which enables the feature also for other back | ||
| 749 | ends that support it, including CVS. In the following, we will talk | ||
| 750 | only about @code{vc-cvs-stay-local}, but everything applies to | ||
| 751 | @code{vc-stay-local} as well. | ||
| 752 | |||
| 753 | If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses | ||
| 754 | only the entry in the local CVS subdirectory to determine the file's | ||
| 755 | state (and possibly information returned by previous CVS commands). | ||
| 756 | One consequence of this is that when you have modified a file, and | ||
| 757 | somebody else has already checked in other changes to the file, you | ||
| 758 | are not notified of it until you actually try to commit. (But you can | ||
| 759 | try to pick up any recent changes from the repository first, using | ||
| 760 | @kbd{C-x v m @key{RET}}, | ||
| 761 | @iftex | ||
| 762 | @pxref{Merging,,,emacs, the Emacs Manual}). | ||
| 763 | @end iftex | ||
| 764 | @ifnottex | ||
| 765 | @pxref{Merging}). | ||
| 766 | @end ifnottex | ||
| 767 | |||
| 768 | When @code{vc-cvs-stay-local} is @code{t}, VC also makes local | ||
| 769 | version backups, so that simple diff and revert operations are | ||
| 770 | completely local (@pxref{Version Backups}). | ||
| 771 | |||
| 772 | On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil}, | ||
| 773 | then VC queries the remote repository @emph{before} it decides what to | ||
| 774 | do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local | ||
| 775 | repositories. It also does not make any version backups. | ||
| 776 | |||
| 777 | You can also set @code{vc-cvs-stay-local} to a regular expression | ||
| 778 | that is matched against the repository host name; VC then stays local | ||
| 779 | only for repositories from hosts that match the pattern. | ||
| 780 | |||
| 781 | @vindex vc-cvs-global-switches | ||
| 782 | You can specify additional command line options to pass to all CVS | ||
| 783 | operations in the variable @code{vc-cvs-global-switches}. These | ||
| 784 | switches are inserted immediately after the @code{cvs} command, before | ||
| 785 | the name of the operation to invoke. | ||
| 786 | |||
| 787 | @ignore | ||
| 788 | arch-tag: 140b8629-4339-4b5e-9e50-72453e51615e | ||
| 789 | @end ignore | ||
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi new file mode 100644 index 00000000000..fa9cadc1351 --- /dev/null +++ b/doc/emacs/windows.texi | |||
| @@ -0,0 +1,387 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | ||
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Windows, Frames, Buffers, Top | ||
| 6 | @chapter Multiple Windows | ||
| 7 | @cindex windows in Emacs | ||
| 8 | @cindex multiple windows in Emacs | ||
| 9 | |||
| 10 | Emacs can split a frame into two or many windows. Multiple windows | ||
| 11 | can display parts of different buffers, or different parts of one | ||
| 12 | buffer. Multiple frames always imply multiple windows, because each | ||
| 13 | frame has its own set of windows. Each window belongs to one and only | ||
| 14 | one frame. | ||
| 15 | |||
| 16 | @menu | ||
| 17 | * Basic Window:: Introduction to Emacs windows. | ||
| 18 | * Split Window:: New windows are made by splitting existing windows. | ||
| 19 | * Other Window:: Moving to another window or doing something to it. | ||
| 20 | * Pop Up Window:: Finding a file or buffer in another window. | ||
| 21 | * Force Same Window:: Forcing certain buffers to appear in the selected | ||
| 22 | window rather than in another window. | ||
| 23 | * Change Window:: Deleting windows and changing their sizes. | ||
| 24 | * Window Convenience:: Convenience functions for window handling. | ||
| 25 | @end menu | ||
| 26 | |||
| 27 | @node Basic Window | ||
| 28 | @section Concepts of Emacs Windows | ||
| 29 | |||
| 30 | Each Emacs window displays one Emacs buffer at any time. A single | ||
| 31 | buffer may appear in more than one window; if it does, any changes in | ||
| 32 | its text are displayed in all the windows where it appears. But these | ||
| 33 | windows can show different parts of the buffer, because each window | ||
| 34 | has its own value of point. | ||
| 35 | |||
| 36 | @cindex selected window | ||
| 37 | At any time, one Emacs window is the @dfn{selected window}; the | ||
| 38 | buffer this window is displaying is the current buffer. The terminal's | ||
| 39 | cursor shows the location of point in this window. Each other window | ||
| 40 | has a location of point as well. On text-only terminals, there is no | ||
| 41 | way to show where those locations are, since the terminal has only one | ||
| 42 | cursor. On a graphical display, the location of point in a | ||
| 43 | non-selected window is indicated by a hollow box; the cursor in the | ||
| 44 | selected window is blinking or solid. | ||
| 45 | |||
| 46 | Commands to move point affect the value of point for the selected Emacs | ||
| 47 | window only. They do not change the value of point in other Emacs | ||
| 48 | windows, even those showing the same buffer. The same is true for commands | ||
| 49 | such as @kbd{C-x b} to switch buffers in the selected window; | ||
| 50 | they do not affect other windows at all. However, there are other commands | ||
| 51 | such as @kbd{C-x 4 b} that select a different window and switch buffers in | ||
| 52 | it. Also, all commands that display information in a window, including | ||
| 53 | (for example) @kbd{C-h f} (@code{describe-function}) and @kbd{C-x C-b} | ||
| 54 | (@code{list-buffers}), work by switching buffers in a nonselected window | ||
| 55 | without affecting the selected window. | ||
| 56 | |||
| 57 | When multiple windows show the same buffer, they can have different | ||
| 58 | regions, because they can have different values of point. However, | ||
| 59 | they all have the same value for the mark, because each buffer has | ||
| 60 | only one mark position. | ||
| 61 | |||
| 62 | Each window has its own mode line, which displays the buffer name, | ||
| 63 | modification status and major and minor modes of the buffer that is | ||
| 64 | displayed in the window. The selected window's mode line appears in a | ||
| 65 | different color. @xref{Mode Line}, for full details on the mode line. | ||
| 66 | |||
| 67 | @node Split Window | ||
| 68 | @section Splitting Windows | ||
| 69 | |||
| 70 | @table @kbd | ||
| 71 | @item C-x 2 | ||
| 72 | Split the selected window into two windows, one above the other | ||
| 73 | (@code{split-window-vertically}). | ||
| 74 | @item C-x 3 | ||
| 75 | Split the selected window into two windows positioned side by side | ||
| 76 | (@code{split-window-horizontally}). | ||
| 77 | @item C-Mouse-2 | ||
| 78 | In the mode line or scroll bar of a window, split that window. | ||
| 79 | @end table | ||
| 80 | |||
| 81 | @kindex C-x 2 | ||
| 82 | @findex split-window-vertically | ||
| 83 | The command @kbd{C-x 2} (@code{split-window-vertically}) breaks the | ||
| 84 | selected window into two windows, one above the other. Both windows start | ||
| 85 | out displaying the same buffer, with the same value of point. By default | ||
| 86 | the two windows each get half the height of the window that was split; a | ||
| 87 | numeric argument specifies how many lines to give to the top window. | ||
| 88 | |||
| 89 | @kindex C-x 3 | ||
| 90 | @findex split-window-horizontally | ||
| 91 | @kbd{C-x 3} (@code{split-window-horizontally}) breaks the selected | ||
| 92 | window into two side-by-side windows. A numeric argument specifies how | ||
| 93 | many columns to give the one on the left. If you are not using | ||
| 94 | scrollbars, a vertical line separates the two windows. | ||
| 95 | You can customize its color with the face @code{vertical-border}. | ||
| 96 | Windows that are not the full width of the screen have mode lines, but | ||
| 97 | they are truncated. On terminals where Emacs does not support | ||
| 98 | highlighting, truncated mode lines sometimes do not appear in inverse | ||
| 99 | video. | ||
| 100 | |||
| 101 | @kindex C-Mouse-2 @r{(scroll bar)} | ||
| 102 | You can split a window horizontally or vertically by clicking | ||
| 103 | @kbd{C-Mouse-2} in the mode line or the scroll bar. The line of | ||
| 104 | splitting goes through the place where you click: if you click on the | ||
| 105 | mode line, the new scroll bar goes above the spot; if you click in the | ||
| 106 | scroll bar, the mode line of the split window is side by side with | ||
| 107 | your click. | ||
| 108 | |||
| 109 | @vindex truncate-partial-width-windows | ||
| 110 | When a window is less than the full width, text lines too long to | ||
| 111 | fit are frequent. Continuing all those lines might be confusing, so | ||
| 112 | if the variable @code{truncate-partial-width-windows} is | ||
| 113 | non-@code{nil}, that forces truncation in all windows less than the | ||
| 114 | full width of the screen, independent of the buffer being displayed | ||
| 115 | and its value for @code{truncate-lines}. @xref{Line Truncation}. | ||
| 116 | |||
| 117 | Horizontal scrolling is often used in side-by-side windows. | ||
| 118 | @xref{Horizontal Scrolling}. | ||
| 119 | |||
| 120 | @vindex split-window-keep-point | ||
| 121 | If @code{split-window-keep-point} is non-@code{nil}, the default, | ||
| 122 | both of the windows resulting from @kbd{C-x 2} inherit the value of | ||
| 123 | point from the window that was split. This means that scrolling is | ||
| 124 | inevitable. If this variable is @code{nil}, then @kbd{C-x 2} tries to | ||
| 125 | avoid scrolling the text currently visible on the screen, by putting | ||
| 126 | point in each window at a position already visible in the window. It | ||
| 127 | also selects whichever window contains the screen line that the cursor | ||
| 128 | was previously on. Some users prefer that mode on slow terminals. | ||
| 129 | |||
| 130 | @node Other Window | ||
| 131 | @section Using Other Windows | ||
| 132 | |||
| 133 | @table @kbd | ||
| 134 | @item C-x o | ||
| 135 | Select another window (@code{other-window}). That is @kbd{o}, not zero. | ||
| 136 | @item C-M-v | ||
| 137 | Scroll the next window (@code{scroll-other-window}). | ||
| 138 | @item M-x compare-windows | ||
| 139 | Find next place where the text in the selected window does not match | ||
| 140 | the text in the next window. | ||
| 141 | @item Mouse-1 | ||
| 142 | @kbd{Mouse-1}, in a window's mode line, selects that window | ||
| 143 | but does not move point in it (@code{mouse-select-window}). | ||
| 144 | @end table | ||
| 145 | |||
| 146 | @kindex C-x o | ||
| 147 | @findex other-window | ||
| 148 | To select a different window, click with @kbd{Mouse-1} on its mode | ||
| 149 | line. With the keyboard, you can switch windows by typing @kbd{C-x o} | ||
| 150 | (@code{other-window}). That is an @kbd{o}, for ``other,'' not a zero. | ||
| 151 | When there are more than two windows, this command moves through all the | ||
| 152 | windows in a cyclic order, generally top to bottom and left to right. | ||
| 153 | After the rightmost and bottommost window, it goes back to the one at | ||
| 154 | the upper left corner. A numeric argument means to move several steps | ||
| 155 | in the cyclic order of windows. A negative argument moves around the | ||
| 156 | cycle in the opposite order. When the minibuffer is active, the | ||
| 157 | minibuffer is the last window in the cycle; you can switch from the | ||
| 158 | minibuffer window to one of the other windows, and later switch back and | ||
| 159 | finish supplying the minibuffer argument that is requested. | ||
| 160 | @xref{Minibuffer Edit}. | ||
| 161 | |||
| 162 | @kindex C-M-v | ||
| 163 | @findex scroll-other-window | ||
| 164 | The usual scrolling commands (@pxref{Display}) apply to the selected | ||
| 165 | window only, but there is one command to scroll the next window. | ||
| 166 | @kbd{C-M-v} (@code{scroll-other-window}) scrolls the window that | ||
| 167 | @kbd{C-x o} would select. It takes arguments, positive and negative, | ||
| 168 | like @kbd{C-v}. (In the minibuffer, @kbd{C-M-v} scrolls the window | ||
| 169 | that contains the minibuffer help display, if any, rather than the | ||
| 170 | next window in the standard cyclic order.) | ||
| 171 | |||
| 172 | The command @kbd{M-x compare-windows} lets you compare two files or | ||
| 173 | buffers visible in two windows, by moving through them to the next | ||
| 174 | mismatch. @xref{Comparing Files}, for details. | ||
| 175 | |||
| 176 | @vindex mouse-autoselect-window | ||
| 177 | If you set @code{mouse-autoselect-window} to a non-@code{nil} value, | ||
| 178 | moving the mouse into a different window selects that window. This | ||
| 179 | feature is off by default. | ||
| 180 | |||
| 181 | @node Pop Up Window | ||
| 182 | @section Displaying in Another Window | ||
| 183 | |||
| 184 | @cindex selecting buffers in other windows | ||
| 185 | @kindex C-x 4 | ||
| 186 | @kbd{C-x 4} is a prefix key for commands that select another window | ||
| 187 | (splitting the window if there is only one) and select a buffer in that | ||
| 188 | window. Different @kbd{C-x 4} commands have different ways of finding the | ||
| 189 | buffer to select. | ||
| 190 | |||
| 191 | @table @kbd | ||
| 192 | @item C-x 4 b @var{bufname} @key{RET} | ||
| 193 | Select buffer @var{bufname} in another window. This runs | ||
| 194 | @code{switch-to-buffer-other-window}. | ||
| 195 | @item C-x 4 C-o @var{bufname} @key{RET} | ||
| 196 | Display buffer @var{bufname} in another window, but | ||
| 197 | don't select that buffer or that window. This runs | ||
| 198 | @code{display-buffer}. | ||
| 199 | @item C-x 4 f @var{filename} @key{RET} | ||
| 200 | Visit file @var{filename} and select its buffer in another window. This | ||
| 201 | runs @code{find-file-other-window}. @xref{Visiting}. | ||
| 202 | @item C-x 4 d @var{directory} @key{RET} | ||
| 203 | Select a Dired buffer for directory @var{directory} in another window. | ||
| 204 | This runs @code{dired-other-window}. @xref{Dired}. | ||
| 205 | @item C-x 4 m | ||
| 206 | Start composing a mail message in another window. This runs | ||
| 207 | @code{mail-other-window}; its same-window analogue is @kbd{C-x m} | ||
| 208 | (@pxref{Sending Mail}). | ||
| 209 | @item C-x 4 . | ||
| 210 | Find a tag in the current tags table, in another window. This runs | ||
| 211 | @code{find-tag-other-window}, the multiple-window variant of @kbd{M-.} | ||
| 212 | (@pxref{Tags}). | ||
| 213 | @item C-x 4 r @var{filename} @key{RET} | ||
| 214 | Visit file @var{filename} read-only, and select its buffer in another | ||
| 215 | window. This runs @code{find-file-read-only-other-window}. | ||
| 216 | @xref{Visiting}. | ||
| 217 | @end table | ||
| 218 | |||
| 219 | @node Force Same Window | ||
| 220 | @section Forcing Display in the Same Window | ||
| 221 | |||
| 222 | Certain Emacs commands switch to a specific buffer with special | ||
| 223 | contents. For example, @kbd{M-x shell} switches to a buffer named | ||
| 224 | @samp{*shell*}. By convention, all these commands are written to pop up | ||
| 225 | the buffer in a separate window. But you can specify that certain of | ||
| 226 | these buffers should appear in the selected window. | ||
| 227 | |||
| 228 | @vindex same-window-buffer-names | ||
| 229 | If you add a buffer name to the list @code{same-window-buffer-names}, | ||
| 230 | the effect is that such commands display that particular buffer by | ||
| 231 | switching to it in the selected window. For example, if you add the | ||
| 232 | element @code{"*grep*"} to the list, the @code{grep} command will | ||
| 233 | display its output buffer in the selected window. | ||
| 234 | |||
| 235 | The default value of @code{same-window-buffer-names} is not | ||
| 236 | @code{nil}: it specifies buffer names @samp{*info*}, @samp{*mail*} and | ||
| 237 | @samp{*shell*} (as well as others used by more obscure Emacs packages). | ||
| 238 | This is why @kbd{M-x shell} normally switches to the @samp{*shell*} | ||
| 239 | buffer in the selected window. If you delete this element from the | ||
| 240 | value of @code{same-window-buffer-names}, the behavior of @kbd{M-x | ||
| 241 | shell} will change---it will pop up the buffer in another window | ||
| 242 | instead. | ||
| 243 | |||
| 244 | @vindex same-window-regexps | ||
| 245 | You can specify these buffers more generally with the variable | ||
| 246 | @code{same-window-regexps}. Set it to a list of regular expressions; | ||
| 247 | then any buffer whose name matches one of those regular expressions is | ||
| 248 | displayed by switching to it in the selected window. (Once again, this | ||
| 249 | applies only to buffers that normally get displayed for you in a | ||
| 250 | separate window.) The default value of this variable specifies Telnet | ||
| 251 | and rlogin buffers. | ||
| 252 | |||
| 253 | An analogous feature lets you specify buffers which should be | ||
| 254 | displayed in their own individual frames. @xref{Special Buffer Frames}. | ||
| 255 | |||
| 256 | @node Change Window | ||
| 257 | @section Deleting and Rearranging Windows | ||
| 258 | |||
| 259 | @table @kbd | ||
| 260 | @item C-x 0 | ||
| 261 | Delete the selected window (@code{delete-window}). The last character | ||
| 262 | in this key sequence is a zero. | ||
| 263 | @item C-x 1 | ||
| 264 | Delete all windows in the selected frame except the selected window | ||
| 265 | (@code{delete-other-windows}). | ||
| 266 | @item C-x 4 0 | ||
| 267 | Delete the selected window and kill the buffer that was showing in it | ||
| 268 | (@code{kill-buffer-and-window}). The last character in this key | ||
| 269 | sequence is a zero. | ||
| 270 | @item C-x ^ | ||
| 271 | Make selected window taller (@code{enlarge-window}). | ||
| 272 | @item C-x @} | ||
| 273 | Make selected window wider (@code{enlarge-window-horizontally}). | ||
| 274 | @item C-x @{ | ||
| 275 | Make selected window narrower (@code{shrink-window-horizontally}). | ||
| 276 | @item C-x - | ||
| 277 | Shrink this window if its buffer doesn't need so many lines | ||
| 278 | (@code{shrink-window-if-larger-than-buffer}). | ||
| 279 | @item C-x + | ||
| 280 | Make all windows the same height (@code{balance-windows}). | ||
| 281 | @end table | ||
| 282 | |||
| 283 | @kindex C-x 0 | ||
| 284 | @findex delete-window | ||
| 285 | To delete a window, type @kbd{C-x 0} (@code{delete-window}). (That is | ||
| 286 | a zero.) The space occupied by the deleted window is given to an | ||
| 287 | adjacent window (but not the minibuffer window, even if that is active | ||
| 288 | at the time). Once a window is deleted, its attributes are forgotten; | ||
| 289 | only restoring a window configuration can bring it back. Deleting the | ||
| 290 | window has no effect on the buffer it used to display; the buffer | ||
| 291 | continues to exist, and you can select it in any window with @kbd{C-x | ||
| 292 | b}. | ||
| 293 | |||
| 294 | @findex kill-buffer-and-window | ||
| 295 | @kindex C-x 4 0 | ||
| 296 | @kbd{C-x 4 0} (@code{kill-buffer-and-window}) is a stronger command | ||
| 297 | than @kbd{C-x 0}; it kills the current buffer and then deletes the | ||
| 298 | selected window. | ||
| 299 | |||
| 300 | @kindex C-x 1 | ||
| 301 | @findex delete-other-windows | ||
| 302 | @kbd{C-x 1} (@code{delete-other-windows}) is more powerful in a | ||
| 303 | different way; it deletes all the windows except the selected one (and | ||
| 304 | the minibuffer); the selected window expands to use the whole frame | ||
| 305 | except for the echo area. | ||
| 306 | |||
| 307 | @kindex C-x ^ | ||
| 308 | @findex enlarge-window | ||
| 309 | @kindex C-x @} | ||
| 310 | @findex enlarge-window-horizontally | ||
| 311 | @vindex window-min-height | ||
| 312 | @vindex window-min-width | ||
| 313 | To readjust the division of space among vertically adjacent windows, | ||
| 314 | use @kbd{C-x ^} (@code{enlarge-window}). It makes the currently | ||
| 315 | selected window one line bigger, or as many lines as is specified | ||
| 316 | with a numeric argument. With a negative argument, it makes the | ||
| 317 | selected window smaller. @kbd{C-x @}} | ||
| 318 | (@code{enlarge-window-horizontally}) makes the selected window wider by | ||
| 319 | the specified number of columns. @kbd{C-x @{} | ||
| 320 | (@code{shrink-window-horizontally}) makes the selected window narrower | ||
| 321 | by the specified number of columns. | ||
| 322 | |||
| 323 | When you make a window bigger, the space comes from its peers. If | ||
| 324 | this makes any window too small, it is deleted and its space is given | ||
| 325 | to an adjacent window. The minimum size is specified by the variables | ||
| 326 | @code{window-min-height} and @code{window-min-width}. | ||
| 327 | |||
| 328 | @kindex C-x - | ||
| 329 | @findex shrink-window-if-larger-than-buffer | ||
| 330 | The command @kbd{C-x -} (@code{shrink-window-if-larger-than-buffer}) | ||
| 331 | reduces the height of the selected window, if it is taller than | ||
| 332 | necessary to show the whole text of the buffer it is displaying. It | ||
| 333 | gives the extra lines to other windows in the frame. | ||
| 334 | |||
| 335 | @kindex C-x + | ||
| 336 | @findex balance-windows | ||
| 337 | You can also use @kbd{C-x +} (@code{balance-windows}) to even out the | ||
| 338 | heights of all the windows in the selected frame. | ||
| 339 | |||
| 340 | Mouse clicks on the mode line provide another way to change window | ||
| 341 | heights and to delete windows. @xref{Mode Line Mouse}. | ||
| 342 | |||
| 343 | @node Window Convenience | ||
| 344 | @section Window Handling Convenience Features and Customization | ||
| 345 | |||
| 346 | @findex winner-mode | ||
| 347 | @cindex Winner mode | ||
| 348 | @cindex mode, Winner | ||
| 349 | @cindex undoing window configuration changes | ||
| 350 | @cindex window configuration changes, undoing | ||
| 351 | @kbd{M-x winner-mode} is a global minor mode that records the | ||
| 352 | changes in the window configuration (i.e. how the frames are | ||
| 353 | partitioned into windows), so that you can ``undo'' them. To undo, | ||
| 354 | use @kbd{C-c left} (@code{winner-undo}). If you change your mind | ||
| 355 | while undoing, you can redo the changes you had undone using @kbd{C-c | ||
| 356 | right} (@code{M-x winner-redo}). Another way to enable Winner mode is | ||
| 357 | by customizing the variable @code{winner-mode}. | ||
| 358 | |||
| 359 | @cindex Windmove package | ||
| 360 | @cindex directional window selection | ||
| 361 | @findex windmove-right | ||
| 362 | @findex windmove-default-keybindings | ||
| 363 | The Windmove commands move directionally between neighboring windows in | ||
| 364 | a frame. @kbd{M-x windmove-right} selects the window immediately to the | ||
| 365 | right of the currently selected one, and similarly for the ``left,'' ``up,'' | ||
| 366 | and ``down'' counterparts. @kbd{M-x windmove-default-keybindings} binds | ||
| 367 | these commands to @kbd{S-right} etc. (Not all terminals support shifted | ||
| 368 | arrow keys, however.) | ||
| 369 | |||
| 370 | Follow minor mode (@kbd{M-x follow-mode}) synchronizes several | ||
| 371 | windows on the same buffer so that they always display adjacent | ||
| 372 | sections of that buffer. @xref{Follow Mode}. | ||
| 373 | |||
| 374 | @vindex scroll-all-mode | ||
| 375 | @cindex scrolling windows together | ||
| 376 | @cindex Scroll-all mode | ||
| 377 | @cindex mode, Scroll-all | ||
| 378 | @kbd{M-x scroll-all-mode} provides commands to scroll all visible | ||
| 379 | windows together. You can also turn it on by customizing the variable | ||
| 380 | @code{scroll-all-mode}. The commands provided are @kbd{M-x | ||
| 381 | scroll-all-scroll-down-all}, @kbd{M-x scroll-all-page-down-all} and | ||
| 382 | their corresponding ``up'' equivalents. To make this mode useful, | ||
| 383 | you should bind these commands to appropriate keys. | ||
| 384 | |||
| 385 | @ignore | ||
| 386 | arch-tag: 8bea7453-d4b1-49b1-9bf4-cfe4383e1113 | ||
| 387 | @end ignore | ||
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi new file mode 100644 index 00000000000..c402ec89f88 --- /dev/null +++ b/doc/emacs/xresources.texi | |||
| @@ -0,0 +1,1216 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1987, 1993, 1994, 1995, 1997, 2001, 2002, 2003, | ||
| 3 | @c 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node X Resources, Antinews, Emacs Invocation, Top | ||
| 6 | @appendix X Options and Resources | ||
| 7 | |||
| 8 | You can customize some X-related aspects of Emacs behavior using X | ||
| 9 | resources, as is usual for programs that use X. On MS-Windows, you | ||
| 10 | can customize some of the same aspects using the system registry. | ||
| 11 | @xref{MS-Windows Registry}. Likewise, Emacs on MacOS Carbon emulates X | ||
| 12 | resources using the Preferences system. @xref{Mac Environment Variables}. | ||
| 13 | |||
| 14 | When Emacs is built using an ``X toolkit'', such as Lucid or | ||
| 15 | LessTif, you need to use X resources to customize the appearance of | ||
| 16 | the widgets, including the menu-bar, scroll-bar, and dialog boxes. | ||
| 17 | This is because the libraries that implement these don't provide for | ||
| 18 | customization through Emacs. GTK+ widgets use a separate system of | ||
| 19 | @ifnottex | ||
| 20 | ``GTK resources'', which we will also describe. | ||
| 21 | @end ifnottex | ||
| 22 | @iftex | ||
| 23 | ``GTK resources.'' In this chapter we describe the most commonly used | ||
| 24 | resource specifications. For full documentation, see the online | ||
| 25 | manual. | ||
| 26 | |||
| 27 | @c Add xref for LessTif/Motif menu resources. | ||
| 28 | @end iftex | ||
| 29 | |||
| 30 | |||
| 31 | @menu | ||
| 32 | * Resources:: Using X resources with Emacs (in general). | ||
| 33 | * Table of Resources:: Table of specific X resources that affect Emacs. | ||
| 34 | * Face Resources:: X resources for customizing faces. | ||
| 35 | * Lucid Resources:: X resources for Lucid menus. | ||
| 36 | * LessTif Resources:: X resources for LessTif and Motif menus. | ||
| 37 | * GTK resources:: Resources for GTK widgets. | ||
| 38 | @end menu | ||
| 39 | |||
| 40 | @node Resources | ||
| 41 | @appendixsec X Resources | ||
| 42 | @cindex resources | ||
| 43 | @cindex X resources | ||
| 44 | @cindex @file{~/.Xdefaults} file | ||
| 45 | @cindex @file{~/.Xresources} file | ||
| 46 | |||
| 47 | Programs running under the X Window System organize their user | ||
| 48 | options under a hierarchy of classes and resources. You can specify | ||
| 49 | default values for these options in your X resources file, usually | ||
| 50 | named @file{~/.Xdefaults} or @file{~/.Xresources}. | ||
| 51 | If changes in @file{~/.Xdefaults} do not | ||
| 52 | take effect, it is because your X server stores its own list of | ||
| 53 | resources; to update them, use the shell command @command{xrdb}---for | ||
| 54 | instance, @samp{xrdb ~/.Xdefaults}. | ||
| 55 | |||
| 56 | Each line in the file specifies a value for one option or for a | ||
| 57 | collection of related options, for one program or for several programs | ||
| 58 | (optionally even for all programs). | ||
| 59 | |||
| 60 | @cindex Registry (MS-Windows) | ||
| 61 | MS-Windows systems do not support @file{~/.Xdefaults} files, so | ||
| 62 | instead Emacs compiled for Windows looks for X resources in the | ||
| 63 | Windows Registry, first under the key | ||
| 64 | @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} and then under the key | ||
| 65 | @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs}. The menu and scroll | ||
| 66 | bars are native widgets on MS-Windows, so they are only customizable | ||
| 67 | via the system-wide settings in the Display Control Panel. You can | ||
| 68 | also set resources using the @samp{-xrm} command line option (see | ||
| 69 | below.) | ||
| 70 | |||
| 71 | @iftex | ||
| 72 | Applications such as Emacs look for resources with specific names | ||
| 73 | and their particular meanings. Case distinctions are significant in | ||
| 74 | these names. Each resource specification in @file{~/.Xdefaults} | ||
| 75 | states the name of the program and the name of the resource. For | ||
| 76 | Emacs, the program name is @samp{Emacs}. It looks like this: | ||
| 77 | |||
| 78 | @example | ||
| 79 | Emacs.borderWidth: 2 | ||
| 80 | @end example | ||
| 81 | @end iftex | ||
| 82 | @ifnottex | ||
| 83 | Programs define named resources with particular meanings. They also | ||
| 84 | define how to group resources into named classes. For instance, in | ||
| 85 | Emacs, the @samp{internalBorder} resource controls the width of the | ||
| 86 | internal border, and the @samp{borderWidth} resource controls the width | ||
| 87 | of the external border. Both of these resources are part of the | ||
| 88 | @samp{BorderWidth} class. Case distinctions are significant in these | ||
| 89 | names. | ||
| 90 | |||
| 91 | Every resource definition is associated with a specific program | ||
| 92 | name---the name of the executable file that you ran. For Emacs, that | ||
| 93 | is normally @samp{emacs}. To specify a definition for all instances | ||
| 94 | of Emacs, regardless of their names, use @samp{Emacs}. | ||
| 95 | |||
| 96 | In @file{~/.Xdefaults}, you can specify a value for a single resource | ||
| 97 | on one line, like this: | ||
| 98 | |||
| 99 | @example | ||
| 100 | emacs.borderWidth: 2 | ||
| 101 | @end example | ||
| 102 | |||
| 103 | @noindent | ||
| 104 | Or you can use a class name to specify the same value for all resources | ||
| 105 | in that class. Here's an example: | ||
| 106 | |||
| 107 | @example | ||
| 108 | emacs.BorderWidth: 2 | ||
| 109 | @end example | ||
| 110 | |||
| 111 | If you specify a value for a class, it becomes the default for all | ||
| 112 | resources in that class. You can specify values for individual | ||
| 113 | resources as well; these override the class value, for those particular | ||
| 114 | resources. Thus, this example specifies 2 as the default width for all | ||
| 115 | borders, but overrides this value with 4 for the external border: | ||
| 116 | |||
| 117 | @example | ||
| 118 | emacs.BorderWidth: 2 | ||
| 119 | emacs.borderWidth: 4 | ||
| 120 | @end example | ||
| 121 | @end ifnottex | ||
| 122 | |||
| 123 | The order in which the lines appear in the file does not matter. | ||
| 124 | Also, command-line options always override the X resources file. | ||
| 125 | |||
| 126 | @ifnottex | ||
| 127 | Here is a list of X command-line options and their corresponding | ||
| 128 | resource names. | ||
| 129 | |||
| 130 | @table @samp | ||
| 131 | @item -name @var{name} | ||
| 132 | @opindex --name | ||
| 133 | @itemx --name=@var{name} | ||
| 134 | @cindex resource name, command-line argument | ||
| 135 | Use @var{name} as the resource name (and the title) for the initial | ||
| 136 | Emacs frame. This option does not affect subsequent frames, but Lisp | ||
| 137 | programs can specify frame names when they create frames. | ||
| 138 | |||
| 139 | If you don't specify this option, the default is to use the Emacs | ||
| 140 | executable's name as the resource name. | ||
| 141 | |||
| 142 | @item -xrm @var{resource-values} | ||
| 143 | @opindex --xrm | ||
| 144 | @itemx --xrm=@var{resource-values} | ||
| 145 | @cindex resource values, command-line argument | ||
| 146 | Specify X resource values for this Emacs job (see below). | ||
| 147 | @end table | ||
| 148 | |||
| 149 | For consistency, @samp{-name} also specifies the name to use for | ||
| 150 | other resource values that do not belong to any particular frame. | ||
| 151 | |||
| 152 | The resources that name Emacs invocations also belong to a class; its | ||
| 153 | name is @samp{Emacs}. If you write @samp{Emacs} instead of | ||
| 154 | @samp{emacs}, the resource applies to all frames in all Emacs jobs, | ||
| 155 | regardless of frame titles and regardless of the name of the executable | ||
| 156 | file. Here is an example: | ||
| 157 | |||
| 158 | @example | ||
| 159 | Emacs.BorderWidth: 2 | ||
| 160 | Emacs.borderWidth: 4 | ||
| 161 | @end example | ||
| 162 | |||
| 163 | You can specify a string of additional resource values for Emacs to | ||
| 164 | use with the command line option @samp{-xrm @var{resources}}. The text | ||
| 165 | @var{resources} should have the same format that you would use inside a file | ||
| 166 | of X resources. To include multiple resource specifications in | ||
| 167 | @var{resources}, put a newline between them, just as you would in a file. | ||
| 168 | You can also use @samp{#include "@var{filename}"} to include a file full | ||
| 169 | of resource specifications. Resource values specified with @samp{-xrm} | ||
| 170 | take precedence over all other resource specifications. | ||
| 171 | |||
| 172 | One way to experiment with the effect of different resource settings | ||
| 173 | is to use the @code{editres} program. Select @samp{Get Tree} from the | ||
| 174 | @end ifnottex | ||
| 175 | @iftex | ||
| 176 | You can experiment with the effect of different resource settings | ||
| 177 | with the @code{editres} program. Select @samp{Get Tree} from the | ||
| 178 | @end iftex | ||
| 179 | @samp{Commands} menu, then click on an Emacs frame. This will display | ||
| 180 | a tree showing the structure of X toolkit widgets used in an Emacs | ||
| 181 | frame. Select one of them, such as @samp{menubar}, then select | ||
| 182 | @samp{Show Resource Box} from the @samp{Commands} menu. This displays | ||
| 183 | a list of all the meaningful X resources for that widget, and allows | ||
| 184 | you to edit them. Changes take effect when you click on the | ||
| 185 | @samp{Apply} button. (See the @code{editres} man page for more | ||
| 186 | details.) | ||
| 187 | |||
| 188 | @node Table of Resources | ||
| 189 | @appendixsec Table of X Resources for Emacs | ||
| 190 | |||
| 191 | This table lists the resource names that designate options for | ||
| 192 | Emacs, not counting those for the appearance of the menu bar, each | ||
| 193 | with the class that it belongs to: | ||
| 194 | |||
| 195 | @table @asis | ||
| 196 | @item @code{background} (class @code{Background}) | ||
| 197 | Background color name. | ||
| 198 | |||
| 199 | @ifnottex | ||
| 200 | @item @code{bitmapIcon} (class @code{BitmapIcon}) | ||
| 201 | Use a bitmap icon (a picture of a gnu) if @samp{on}, let the window | ||
| 202 | manager choose an icon if @samp{off}. | ||
| 203 | @end ifnottex | ||
| 204 | |||
| 205 | @item @code{borderColor} (class @code{BorderColor}) | ||
| 206 | Color name for the external border. | ||
| 207 | |||
| 208 | @ifnottex | ||
| 209 | @item @code{borderWidth} (class @code{BorderWidth}) | ||
| 210 | Width in pixels of the external border. | ||
| 211 | @end ifnottex | ||
| 212 | |||
| 213 | @item @code{cursorColor} (class @code{Foreground}) | ||
| 214 | Color name for text cursor (point). | ||
| 215 | |||
| 216 | @ifnottex | ||
| 217 | @item @code{cursorBlink} (class @code{CursorBlink}) | ||
| 218 | Specifies whether to make the cursor blink. The default is @samp{on}. Use | ||
| 219 | @samp{off} or @samp{false} to turn cursor blinking off. | ||
| 220 | @end ifnottex | ||
| 221 | |||
| 222 | @item @code{font} (class @code{Font}) | ||
| 223 | Font name (or fontset name, @pxref{Fontsets}) for @code{default} font. | ||
| 224 | |||
| 225 | @item @code{foreground} (class @code{Foreground}) | ||
| 226 | Color name for text. | ||
| 227 | |||
| 228 | @item @code{geometry} (class @code{Geometry}) | ||
| 229 | Window size and position. Be careful not to specify this resource as | ||
| 230 | @samp{emacs*geometry}, because that may affect individual menus as well | ||
| 231 | as the Emacs frame itself. | ||
| 232 | |||
| 233 | If this resource specifies a position, that position applies only to the | ||
| 234 | initial Emacs frame (or, in the case of a resource for a specific frame | ||
| 235 | name, only that frame). However, the size, if specified here, applies to | ||
| 236 | all frames. | ||
| 237 | |||
| 238 | @ifnottex | ||
| 239 | @item @code{fullscreen} (class @code{Fullscreen}) | ||
| 240 | The desired fullscreen size. The value can be one of @code{fullboth}, | ||
| 241 | @code{fullwidth} or @code{fullheight}, which correspond to | ||
| 242 | the command-line options @samp{-fs}, @samp{-fw}, and @samp{-fh} | ||
| 243 | (@pxref{Window Size X}). | ||
| 244 | |||
| 245 | Note that this applies to the initial frame only. | ||
| 246 | @end ifnottex | ||
| 247 | |||
| 248 | @item @code{iconName} (class @code{Title}) | ||
| 249 | Name to display in the icon. | ||
| 250 | |||
| 251 | @item @code{internalBorder} (class @code{BorderWidth}) | ||
| 252 | Width in pixels of the internal border. | ||
| 253 | |||
| 254 | @item @code{lineSpacing} (class @code{LineSpacing}) | ||
| 255 | @cindex line spacing | ||
| 256 | @cindex leading | ||
| 257 | Additional space (@dfn{leading}) between lines, in pixels. | ||
| 258 | |||
| 259 | @item @code{menuBar} (class @code{MenuBar}) | ||
| 260 | @cindex menu bar | ||
| 261 | Give frames menu bars if @samp{on}; don't have menu bars if @samp{off}. | ||
| 262 | @ifnottex | ||
| 263 | @xref{Lucid Resources}, and @ref{LessTif Resources}, | ||
| 264 | @end ifnottex | ||
| 265 | @iftex | ||
| 266 | @xref{Lucid Resources}, | ||
| 267 | @end iftex | ||
| 268 | for how to control the appearance of the menu bar if you have one. | ||
| 269 | |||
| 270 | @ifnottex | ||
| 271 | @item @code{minibuffer} (class @code{Minibuffer}) | ||
| 272 | If @samp{none}, don't make a minibuffer in this frame. | ||
| 273 | It will use a separate minibuffer frame instead. | ||
| 274 | |||
| 275 | @item @code{paneFont} (class @code{Font}) | ||
| 276 | @cindex font for menus | ||
| 277 | Font name for menu pane titles, in non-toolkit versions of Emacs. | ||
| 278 | @end ifnottex | ||
| 279 | |||
| 280 | @item @code{pointerColor} (class @code{Foreground}) | ||
| 281 | Color of the mouse cursor. | ||
| 282 | |||
| 283 | @ifnottex | ||
| 284 | @item @code{privateColormap} (class @code{PrivateColormap}) | ||
| 285 | If @samp{on}, use a private color map, in the case where the ``default | ||
| 286 | visual'' of class PseudoColor and Emacs is using it. | ||
| 287 | |||
| 288 | @item @code{reverseVideo} (class @code{ReverseVideo}) | ||
| 289 | Switch foreground and background default colors if @samp{on}, use colors as | ||
| 290 | specified if @samp{off}. | ||
| 291 | @end ifnottex | ||
| 292 | |||
| 293 | @item @code{screenGamma} (class @code{ScreenGamma}) | ||
| 294 | @cindex gamma correction | ||
| 295 | Gamma correction for colors, equivalent to the frame parameter | ||
| 296 | @code{screen-gamma}. | ||
| 297 | |||
| 298 | @item @code{scrollBarWidth} (class @code{ScrollBarWidth}) | ||
| 299 | @cindex scrollbar width | ||
| 300 | The scroll bar width in pixels, equivalent to the frame parameter | ||
| 301 | @code{scroll-bar-width}. | ||
| 302 | |||
| 303 | @ifnottex | ||
| 304 | @item @code{selectionFont} (class @code{SelectionFont}) | ||
| 305 | Font name for pop-up menu items, in non-toolkit versions of Emacs. (For | ||
| 306 | toolkit versions, see @ref{Lucid Resources}, also see @ref{LessTif | ||
| 307 | Resources}.) | ||
| 308 | |||
| 309 | @item @code{selectionTimeout} (class @code{SelectionTimeout}) | ||
| 310 | Number of milliseconds to wait for a selection reply. | ||
| 311 | If the selection owner doesn't reply in this time, we give up. | ||
| 312 | A value of 0 means wait as long as necessary. | ||
| 313 | |||
| 314 | @item @code{synchronous} (class @code{Synchronous}) | ||
| 315 | @cindex debugging X problems | ||
| 316 | @cindex synchronous X mode | ||
| 317 | Run Emacs in synchronous mode if @samp{on}. Synchronous mode is | ||
| 318 | useful for debugging X problems. | ||
| 319 | @end ifnottex | ||
| 320 | |||
| 321 | @item @code{title} (class @code{Title}) | ||
| 322 | Name to display in the title bar of the initial Emacs frame. | ||
| 323 | |||
| 324 | @item @code{toolBar} (class @code{ToolBar}) | ||
| 325 | @cindex tool bar | ||
| 326 | Number of lines to reserve for the tool bar. A zero value suppresses | ||
| 327 | the tool bar. If the value is non-zero and | ||
| 328 | @code{auto-resize-tool-bars} is non-@code{nil}, the tool bar's size | ||
| 329 | will be changed automatically so that all tool bar items are visible. | ||
| 330 | If the value of @code{auto-resize-tool-bars} is @code{grow-only}, | ||
| 331 | the tool bar expands automatically, but does not contract automatically. | ||
| 332 | To contract the tool bar, you must redraw the frame by entering @kbd{C-l}. | ||
| 333 | |||
| 334 | @item @code{useXIM} (class @code{UseXIM}) | ||
| 335 | @cindex XIM | ||
| 336 | @cindex X input methods | ||
| 337 | @cindex input methods, X | ||
| 338 | Turn off use of X input methods (XIM) if @samp{false} or @samp{off}. | ||
| 339 | This is only relevant if your Emacs is actually built with XIM | ||
| 340 | support. It is potentially useful to turn off XIM for efficiency, | ||
| 341 | especially slow X client/server links. | ||
| 342 | |||
| 343 | @item @code{verticalScrollBars} (class @code{ScrollBars}) | ||
| 344 | Give frames scroll bars if @samp{on}; don't have scroll bars if | ||
| 345 | @samp{off}. | ||
| 346 | |||
| 347 | @ifnottex | ||
| 348 | @item @code{visualClass} (class @code{VisualClass}) | ||
| 349 | Specify the ``visual'' that X should use. This tells X how to handle | ||
| 350 | colors. | ||
| 351 | |||
| 352 | The value should start with one of @samp{TrueColor}, | ||
| 353 | @samp{PseudoColor}, @samp{DirectColor}, @samp{StaticColor}, | ||
| 354 | @samp{GrayScale}, and @samp{StaticGray}, followed by | ||
| 355 | @samp{-@var{depth}}, where @var{depth} is the number of color planes. | ||
| 356 | Most terminals only allow a few ``visuals,'' and the @samp{dpyinfo} | ||
| 357 | program outputs information saying which ones. | ||
| 358 | @end ifnottex | ||
| 359 | @end table | ||
| 360 | |||
| 361 | @node Face Resources | ||
| 362 | @appendixsec X Resources for Faces | ||
| 363 | |||
| 364 | You can use resources to customize the appearance of particular | ||
| 365 | faces (@pxref{Faces}): | ||
| 366 | |||
| 367 | @table @code | ||
| 368 | @item @var{face}.attributeForeground | ||
| 369 | Foreground color for face @var{face}. | ||
| 370 | @item @var{face}.attributeBackground | ||
| 371 | Background color for face @var{face}. | ||
| 372 | @item @var{face}.attributeUnderline | ||
| 373 | Underline flag for face @var{face}. Use @samp{on} or @samp{true} for | ||
| 374 | yes. | ||
| 375 | @item @var{face}.attributeStrikeThrough | ||
| 376 | @itemx @var{face}.attributeOverline | ||
| 377 | @itemx @var{face}.attributeBox | ||
| 378 | @itemx @var{face}.attributeInverse | ||
| 379 | Likewise, for other boolean font attributes. | ||
| 380 | @item @var{face}.attributeStipple | ||
| 381 | The name of a pixmap data file to use for the stipple pattern, or | ||
| 382 | @code{false} to not use stipple for the face @var{face}. | ||
| 383 | @item @var{face}.attributeBackgroundPixmap | ||
| 384 | The background pixmap for the face @var{face}. Should be a name of a | ||
| 385 | pixmap file or @code{false}. | ||
| 386 | @item @var{face}.attributeFont | ||
| 387 | Font name (full XFD name or valid X abbreviation) for face @var{face}. | ||
| 388 | Instead of this, you can specify the font through separate attributes. | ||
| 389 | @end table | ||
| 390 | |||
| 391 | Instead of using @code{attributeFont} to specify a font name, you can | ||
| 392 | select a font through these separate attributes: | ||
| 393 | |||
| 394 | @table @code | ||
| 395 | @item @var{face}.attributeFamily | ||
| 396 | Font family for face @var{face}. | ||
| 397 | @item @var{face}.attributeHeight | ||
| 398 | Height of the font to use for face @var{face}: either an integer | ||
| 399 | specifying the height in units of 1/10@dmn{pt}, or a floating point | ||
| 400 | number that specifies a scale factor to scale the underlying face's | ||
| 401 | default font, or a function to be called with the default height which | ||
| 402 | will return a new height. | ||
| 403 | @item @var{face}.attributeWidth | ||
| 404 | @itemx @var{face}.attributeWeight | ||
| 405 | @itemx @var{face}.attributeSlant | ||
| 406 | Each of these resources corresponds to a like-named font attribute, | ||
| 407 | and you write the resource value the same as the symbol you would use | ||
| 408 | for the font attribute value. | ||
| 409 | @item @var{face}.attributeBold | ||
| 410 | Bold flag for face @var{face}---instead of @code{attributeWeight}. Use @samp{on} or @samp{true} for | ||
| 411 | yes. | ||
| 412 | @item @var{face}.attributeItalic | ||
| 413 | Italic flag for face @var{face}---instead of @code{attributeSlant}. | ||
| 414 | @end table | ||
| 415 | |||
| 416 | @node Lucid Resources | ||
| 417 | @appendixsec Lucid Menu X Resources | ||
| 418 | @cindex Menu X Resources (Lucid widgets) | ||
| 419 | @cindex Lucid Widget X Resources | ||
| 420 | |||
| 421 | @ifnottex | ||
| 422 | If the Emacs installed at your site was built to use the X toolkit | ||
| 423 | with the Lucid menu widgets, then the menu bar is a separate widget and | ||
| 424 | has its own resources. The resource names contain @samp{pane.menubar} | ||
| 425 | (following, as always, the name of the Emacs invocation, or @samp{Emacs}, | ||
| 426 | which stands for all Emacs invocations). Specify them like this: | ||
| 427 | |||
| 428 | @example | ||
| 429 | Emacs.pane.menubar.@var{resource}: @var{value} | ||
| 430 | @end example | ||
| 431 | |||
| 432 | @noindent | ||
| 433 | For example, to specify the font @samp{8x16} for the menu-bar items, | ||
| 434 | write this: | ||
| 435 | @end ifnottex | ||
| 436 | @iftex | ||
| 437 | If the Emacs installed at your site was built to use the X toolkit | ||
| 438 | with the Lucid menu widgets, then the menu bar is a separate widget | ||
| 439 | and has its own resources. The resource specifications start with | ||
| 440 | @samp{Emacs.pane.menubar}---for instance, to specify the font | ||
| 441 | @samp{8x16} for the menu-bar items, write this: | ||
| 442 | @end iftex | ||
| 443 | |||
| 444 | @example | ||
| 445 | Emacs.pane.menubar.font: 8x16 | ||
| 446 | @end example | ||
| 447 | |||
| 448 | @noindent | ||
| 449 | Resources for @emph{non-menubar} toolkit pop-up menus have | ||
| 450 | @samp{menu*} instead of @samp{pane.menubar}. For example, to specify | ||
| 451 | the font @samp{8x16} for the pop-up menu items, write this: | ||
| 452 | |||
| 453 | @example | ||
| 454 | Emacs.menu*.font: 8x16 | ||
| 455 | @end example | ||
| 456 | |||
| 457 | @noindent | ||
| 458 | For dialog boxes, use @samp{dialog*}: | ||
| 459 | |||
| 460 | @example | ||
| 461 | Emacs.dialog*.font: 8x16 | ||
| 462 | @end example | ||
| 463 | |||
| 464 | @noindent | ||
| 465 | The Lucid menus can display multilingual text in your locale. For | ||
| 466 | more information about fontsets see the man page for | ||
| 467 | @code{XCreateFontSet}. To enable multilingual menu text you specify a | ||
| 468 | @code{fontSet} resource instead of the font resource. If both | ||
| 469 | @code{font} and @code{fontSet} resources are specified, the | ||
| 470 | @code{fontSet} resource is used. | ||
| 471 | |||
| 472 | Thus, to specify @samp{-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*} | ||
| 473 | for both the popup and menu bar menus, write this: | ||
| 474 | |||
| 475 | @example | ||
| 476 | Emacs*menu*fontSet: -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,* | ||
| 477 | @end example | ||
| 478 | |||
| 479 | @noindent | ||
| 480 | The @samp{*menu*} as a wildcard matches @samp{pane.menubar} and | ||
| 481 | @samp{menu@dots{}}. | ||
| 482 | |||
| 483 | Experience shows that on some systems you may need to add | ||
| 484 | @samp{shell.}@: before the @samp{pane.menubar} or @samp{menu*}. On | ||
| 485 | some other systems, you must not add @samp{shell.}. The generic wildcard | ||
| 486 | approach should work on both kinds of systems. | ||
| 487 | |||
| 488 | Here is a list of the specific resources for menu bars and pop-up menus: | ||
| 489 | |||
| 490 | @table @code | ||
| 491 | @item font | ||
| 492 | Font for menu item text. | ||
| 493 | @item fontSet | ||
| 494 | Fontset for menu item text. | ||
| 495 | @item foreground | ||
| 496 | Color of the foreground. | ||
| 497 | @item background | ||
| 498 | Color of the background. | ||
| 499 | @item buttonForeground | ||
| 500 | In the menu bar, the color of the foreground for a selected item. | ||
| 501 | @ifnottex | ||
| 502 | @item horizontalSpacing | ||
| 503 | Horizontal spacing in pixels between items. Default is 3. | ||
| 504 | @item verticalSpacing | ||
| 505 | Vertical spacing in pixels between items. Default is 2. | ||
| 506 | @item arrowSpacing | ||
| 507 | Horizontal spacing between the arrow (which indicates a submenu) and | ||
| 508 | the associated text. Default is 10. | ||
| 509 | @item shadowThickness | ||
| 510 | Thickness of shadow line around the widget. Default is 1. | ||
| 511 | |||
| 512 | Also determines the thickness of shadow lines around other objects, | ||
| 513 | for instance 3D buttons and arrows. If you have the impression that | ||
| 514 | the arrows in the menus do not stand out clearly enough or that the | ||
| 515 | difference between ``in'' and ``out'' buttons is difficult to see, set | ||
| 516 | this to 2. If you have no problems with visibility, the default | ||
| 517 | probably looks better. The background color may also have some effect | ||
| 518 | on the contrast. | ||
| 519 | @end ifnottex | ||
| 520 | @item margin | ||
| 521 | The margin of the menu bar, in characters. Default is 1. | ||
| 522 | @end table | ||
| 523 | |||
| 524 | @ifnottex | ||
| 525 | @node LessTif Resources | ||
| 526 | @appendixsec LessTif Menu X Resources | ||
| 527 | @cindex Menu X Resources (LessTif widgets) | ||
| 528 | @cindex LessTif Widget X Resources | ||
| 529 | |||
| 530 | If the Emacs installed at your site was built to use the X toolkit | ||
| 531 | with the LessTif or Motif widgets, then the menu bar, the dialog | ||
| 532 | boxes, the pop-up menus, and the file-selection box are separate | ||
| 533 | widgets and have their own resources. | ||
| 534 | |||
| 535 | The resource names for the menu bar contain @samp{pane.menubar} | ||
| 536 | (following, as always, the name of the Emacs invocation, or | ||
| 537 | @samp{Emacs}, which stands for all Emacs invocations). Specify them | ||
| 538 | like this: | ||
| 539 | |||
| 540 | @smallexample | ||
| 541 | Emacs.pane.menubar.@var{subwidget}.@var{resource}: @var{value} | ||
| 542 | @end smallexample | ||
| 543 | |||
| 544 | Each individual string in the menu bar is a subwidget; the subwidget's | ||
| 545 | name is the same as the menu item string. For example, the word | ||
| 546 | @samp{File} in the menu bar is part of a subwidget named | ||
| 547 | @samp{emacs.pane.menubar.File}. Most likely, you want to specify the | ||
| 548 | same resources for the whole menu bar. To do this, use @samp{*} instead | ||
| 549 | of a specific subwidget name. For example, to specify the font | ||
| 550 | @samp{8x16} for the menu-bar items, write this: | ||
| 551 | |||
| 552 | @smallexample | ||
| 553 | Emacs.pane.menubar.*.fontList: 8x16 | ||
| 554 | @end smallexample | ||
| 555 | |||
| 556 | @noindent | ||
| 557 | This also specifies the resource value for submenus. | ||
| 558 | |||
| 559 | Each item in a submenu in the menu bar also has its own name for X | ||
| 560 | resources; for example, the @samp{File} submenu has an item named | ||
| 561 | @samp{Save (current buffer)}. A resource specification for a submenu | ||
| 562 | item looks like this: | ||
| 563 | |||
| 564 | @smallexample | ||
| 565 | Emacs.pane.menubar.popup_*.@var{menu}.@var{item}.@var{resource}: @var{value} | ||
| 566 | @end smallexample | ||
| 567 | |||
| 568 | @noindent | ||
| 569 | For example, here's how to specify the font for the @samp{Save (current | ||
| 570 | buffer)} item: | ||
| 571 | |||
| 572 | @smallexample | ||
| 573 | Emacs.pane.menubar.popup_*.File.Save (current buffer).fontList: 8x16 | ||
| 574 | @end smallexample | ||
| 575 | |||
| 576 | @noindent | ||
| 577 | For an item in a second-level submenu, such as @samp{Complete Word} | ||
| 578 | under @samp{Spell Checking} under @samp{Tools}, the resource fits this | ||
| 579 | template: | ||
| 580 | |||
| 581 | @smallexample | ||
| 582 | Emacs.pane.menubar.popup_*.popup_*.@var{menu}.@var{resource}: @var{value} | ||
| 583 | @end smallexample | ||
| 584 | |||
| 585 | @noindent | ||
| 586 | For example, | ||
| 587 | |||
| 588 | @smallexample | ||
| 589 | Emacs.pane.menubar.popup_*.popup_*.Spell Checking.Complete Word: @var{value} | ||
| 590 | @end smallexample | ||
| 591 | |||
| 592 | @noindent | ||
| 593 | (This should be one long line.) | ||
| 594 | |||
| 595 | It's impossible to specify a resource for all the menu-bar items | ||
| 596 | without also specifying it for the submenus as well. So if you want the | ||
| 597 | submenu items to look different from the menu bar itself, you must ask | ||
| 598 | for that in two steps. First, specify the resource for all of them; | ||
| 599 | then, override the value for submenus alone. Here is an example: | ||
| 600 | |||
| 601 | @smallexample | ||
| 602 | Emacs.pane.menubar.*.fontList: 8x16 | ||
| 603 | Emacs.pane.menubar.popup_*.fontList: 8x16 | ||
| 604 | @end smallexample | ||
| 605 | |||
| 606 | @noindent | ||
| 607 | For LessTif pop-up menus, use @samp{menu*} instead of | ||
| 608 | @samp{pane.menubar}. For example, to specify the font @samp{8x16} for | ||
| 609 | the pop-up menu items, write this: | ||
| 610 | |||
| 611 | @smallexample | ||
| 612 | Emacs.menu*.fontList: 8x16 | ||
| 613 | @end smallexample | ||
| 614 | |||
| 615 | @noindent | ||
| 616 | For LessTif dialog boxes, use @samp{dialog} instead of @samp{menu}: | ||
| 617 | |||
| 618 | @example | ||
| 619 | Emacs.dialog*.fontList: 8x16 | ||
| 620 | Emacs.dialog*.foreground: hotpink | ||
| 621 | @end example | ||
| 622 | |||
| 623 | To specify resources for the LessTif file-selection box, use | ||
| 624 | @samp{fsb*}, like this: | ||
| 625 | |||
| 626 | @example | ||
| 627 | Emacs.fsb*.fontList: 8x16 | ||
| 628 | @end example | ||
| 629 | |||
| 630 | @iftex | ||
| 631 | @medbreak | ||
| 632 | @end iftex | ||
| 633 | Here is a list of the specific resources for LessTif menu bars and | ||
| 634 | pop-up menus: | ||
| 635 | |||
| 636 | @table @code | ||
| 637 | @item armColor | ||
| 638 | The color to show in an armed button. | ||
| 639 | @item fontList | ||
| 640 | The font to use. | ||
| 641 | @item marginBottom | ||
| 642 | @itemx marginHeight | ||
| 643 | @itemx marginLeft | ||
| 644 | @itemx marginRight | ||
| 645 | @itemx marginTop | ||
| 646 | @itemx marginWidth | ||
| 647 | Amount of space to leave around the item, within the border. | ||
| 648 | @item borderWidth | ||
| 649 | The width of the border around the menu item, on all sides. | ||
| 650 | @item shadowThickness | ||
| 651 | The width of the border shadow. | ||
| 652 | @item bottomShadowColor | ||
| 653 | The color for the border shadow, on the bottom and the right. | ||
| 654 | @item topShadowColor | ||
| 655 | The color for the border shadow, on the top and the left. | ||
| 656 | @end table | ||
| 657 | @end ifnottex | ||
| 658 | |||
| 659 | |||
| 660 | @node GTK resources | ||
| 661 | @appendixsec GTK resources | ||
| 662 | @iftex | ||
| 663 | The most common way to customize the GTK widgets Emacs uses (menus, dialogs | ||
| 664 | tool bars and scroll bars) is by choosing an appropriate theme, for example | ||
| 665 | with the GNOME theme selector. You can also do Emacs specific customization | ||
| 666 | by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc}. Some GTK | ||
| 667 | themes ignore customizations in @file{~/.emacs.d/gtkrc} so not everything | ||
| 668 | works with all themes. To customize Emacs font, background, faces, etc., use | ||
| 669 | the normal X resources (@pxref{Resources}). We will present some examples of | ||
| 670 | customizations here, but for a more detailed description, see the online manual | ||
| 671 | |||
| 672 | The first example is just one line. It changes the font on all GTK widgets | ||
| 673 | to courier with size 12: | ||
| 674 | |||
| 675 | @smallexample | ||
| 676 | gtk-font-name = "courier 12" | ||
| 677 | @end smallexample | ||
| 678 | |||
| 679 | The thing to note is that the font name is not an X font name, like | ||
| 680 | -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*, but a Pango font name. A Pango | ||
| 681 | font name is basically of the format "family style size", where the style | ||
| 682 | is optional as in the case above. A name with a style could be for example: | ||
| 683 | |||
| 684 | @smallexample | ||
| 685 | gtk-font-name = "helvetica bold 10" | ||
| 686 | @end smallexample | ||
| 687 | |||
| 688 | To customize widgets you first define a style and then apply the style to | ||
| 689 | the widgets. Here is an example that sets the font for menus, but not | ||
| 690 | for other widgets: | ||
| 691 | |||
| 692 | @smallexample | ||
| 693 | # @r{Define the style @samp{menufont}.} | ||
| 694 | style "menufont" | ||
| 695 | @{ | ||
| 696 | font_name = "helvetica bold 14" # This is a Pango font name | ||
| 697 | @} | ||
| 698 | |||
| 699 | # @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.} | ||
| 700 | widget "*emacs-menuitem*" style "menufont" | ||
| 701 | @end smallexample | ||
| 702 | |||
| 703 | The widget name in this example contains wildcards, so the style will be | ||
| 704 | applied to all widgets that match "*emacs-menuitem*". The widgets are | ||
| 705 | named by the way they are contained, from the outer widget to the inner widget. | ||
| 706 | So to apply the style "my_style" (not shown) with the full, absolute name, for | ||
| 707 | the menubar and the scroll bar in Emacs we use: | ||
| 708 | |||
| 709 | @smallexample | ||
| 710 | widget "Emacs.pane.menubar" style "my_style" | ||
| 711 | widget "Emacs.pane.emacs.verticalScrollBar" style "my_style" | ||
| 712 | @end smallexample | ||
| 713 | |||
| 714 | But to avoid having to type it all, wildcards are often used. @samp{*} | ||
| 715 | matches zero or more characters and @samp{?} matches one character. So "*" | ||
| 716 | matches all widgets. | ||
| 717 | |||
| 718 | Each widget has a class (for example GtkMenuItem) and a name (emacs-menuitem). | ||
| 719 | You can assign styles by name or by class. In this example we have used the | ||
| 720 | class: | ||
| 721 | |||
| 722 | @smallexample | ||
| 723 | style "menufont" | ||
| 724 | @{ | ||
| 725 | font_name = "helvetica bold 14" | ||
| 726 | @} | ||
| 727 | |||
| 728 | widget_class "*GtkMenuBar" style "menufont" | ||
| 729 | @end smallexample | ||
| 730 | |||
| 731 | @noindent | ||
| 732 | The names and classes for the GTK widgets Emacs uses are: | ||
| 733 | |||
| 734 | @multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some} | ||
| 735 | @item @code{emacs-filedialog} | ||
| 736 | @tab @code{GtkFileSelection} | ||
| 737 | @item @code{emacs-dialog} | ||
| 738 | @tab @code{GtkDialog} | ||
| 739 | @item @code{Emacs} | ||
| 740 | @tab @code{GtkWindow} | ||
| 741 | @item @code{pane} | ||
| 742 | @tab @code{GtkVHbox} | ||
| 743 | @item @code{emacs} | ||
| 744 | @tab @code{GtkFixed} | ||
| 745 | @item @code{verticalScrollBar} | ||
| 746 | @tab @code{GtkVScrollbar} | ||
| 747 | @item @code{emacs-toolbar} | ||
| 748 | @tab @code{GtkToolbar} | ||
| 749 | @item @code{menubar} | ||
| 750 | @tab @code{GtkMenuBar} | ||
| 751 | @item @code{emacs-menuitem} | ||
| 752 | @tab anything in menus | ||
| 753 | @end multitable | ||
| 754 | |||
| 755 | GTK absolute names are quite strange when it comes to menus | ||
| 756 | and dialogs. The names do not start with @samp{Emacs}, as they are | ||
| 757 | free-standing windows and not contained (in the GTK sense) by the | ||
| 758 | Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: | ||
| 759 | |||
| 760 | @smallexample | ||
| 761 | widget "*emacs-dialog*" style "my_dialog_style" | ||
| 762 | widget "*emacs-filedialog* style "my_file_style" | ||
| 763 | widget "*emacs-menuitem* style "my_menu_style" | ||
| 764 | @end smallexample | ||
| 765 | |||
| 766 | If you specify a customization in @file{~/.emacs.d/gtkrc}, then it | ||
| 767 | automatically applies only to Emacs, since other programs don't read | ||
| 768 | that file. For example, the drop down menu in the file dialog can not | ||
| 769 | be customized by any absolute widget name, only by an absolute class | ||
| 770 | name. This is because the widgets in the drop down menu do not | ||
| 771 | have names and the menu is not contained in the Emacs GtkWindow. To | ||
| 772 | have all menus in Emacs look the same, use this in | ||
| 773 | @file{~/.emacs.d/gtkrc}: | ||
| 774 | |||
| 775 | @smallexample | ||
| 776 | widget_class "*Menu*" style "my_menu_style" | ||
| 777 | @end smallexample | ||
| 778 | |||
| 779 | Here is a more elaborate example, showing how to change the parts of | ||
| 780 | the scroll bar: | ||
| 781 | |||
| 782 | @smallexample | ||
| 783 | style "scroll" | ||
| 784 | @{ | ||
| 785 | fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.} | ||
| 786 | bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.} | ||
| 787 | bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.} | ||
| 788 | bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.} | ||
| 789 | @} | ||
| 790 | |||
| 791 | widget "*verticalScrollBar*" style "scroll" | ||
| 792 | @end smallexample | ||
| 793 | @end iftex | ||
| 794 | |||
| 795 | @ifnottex | ||
| 796 | @cindex GTK resources and customization | ||
| 797 | @cindex resource files for GTK | ||
| 798 | @cindex @file{~/.gtkrc-2.0} file | ||
| 799 | @cindex @file{~/.emacs.d/gtkrc} file | ||
| 800 | |||
| 801 | If Emacs was built to use the GTK widget set, then the menu bar, tool bar, | ||
| 802 | scroll bar and the dialogs are customized with the standard GTK | ||
| 803 | customization file, @file{~/.gtkrc-2.0}, or with the Emacs specific | ||
| 804 | file @file{~/.emacs.d/gtkrc}. We recommend that you use | ||
| 805 | @file{~/.emacs.d/gtkrc} for customizations, since @file{~/.gtkrc-2.0} | ||
| 806 | seems to be ignored when running GConf with GNOME. These files apply | ||
| 807 | only to GTK widget features. To customize Emacs font, background, | ||
| 808 | faces, etc., use the normal X resources (@pxref{Resources}). | ||
| 809 | |||
| 810 | Some GTK themes override these mechanisms, which means that using | ||
| 811 | these mechanisms will not work to customize them. | ||
| 812 | |||
| 813 | In these files you first define a style and say what it means; then | ||
| 814 | you specify to apply the style to various widget types (@pxref{GTK | ||
| 815 | widget names}). Here is an example of how to change the font for | ||
| 816 | Emacs menus: | ||
| 817 | |||
| 818 | @smallexample | ||
| 819 | # @r{Define the style @samp{menufont}.} | ||
| 820 | style "menufont" | ||
| 821 | @{ | ||
| 822 | font_name = "helvetica bold 14" # This is a Pango font name | ||
| 823 | @} | ||
| 824 | |||
| 825 | # @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.} | ||
| 826 | widget "*emacs-menuitem*" style "menufont" | ||
| 827 | @end smallexample | ||
| 828 | |||
| 829 | Here is a more elaborate example, showing how to change the parts of | ||
| 830 | the scroll bar: | ||
| 831 | |||
| 832 | @smallexample | ||
| 833 | style "scroll" | ||
| 834 | @{ | ||
| 835 | fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.} | ||
| 836 | bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.} | ||
| 837 | bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.} | ||
| 838 | bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.} | ||
| 839 | @} | ||
| 840 | |||
| 841 | widget "*verticalScrollBar*" style "scroll" | ||
| 842 | @end smallexample | ||
| 843 | |||
| 844 | There are also parameters that affect GTK as a whole. For example, | ||
| 845 | the property @code{gtk-font-name} sets the default font for GTK. You | ||
| 846 | must use Pango font names (@pxref{GTK styles}). A GTK resources file | ||
| 847 | that just sets a default font looks like this: | ||
| 848 | |||
| 849 | @smallexample | ||
| 850 | gtk-font-name = "courier 12" | ||
| 851 | @end smallexample | ||
| 852 | |||
| 853 | The GTK resources file is fully described in the GTK API document. | ||
| 854 | This can be found in | ||
| 855 | @file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html}, | ||
| 856 | where @file{prefix} is the directory in which the GTK libraries were | ||
| 857 | installed (usually @file{/usr} or @file{/usr/local}). You can also | ||
| 858 | find the document online, at | ||
| 859 | @uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}. | ||
| 860 | |||
| 861 | @menu | ||
| 862 | * GTK widget names:: How widgets in GTK are named in general. | ||
| 863 | * GTK Names in Emacs:: GTK widget names in Emacs. | ||
| 864 | * GTK styles:: What can be customized in a GTK widget. | ||
| 865 | @end menu | ||
| 866 | |||
| 867 | @node GTK widget names | ||
| 868 | @appendixsubsec GTK widget names | ||
| 869 | @cindex GTK widget names | ||
| 870 | |||
| 871 | A GTK widget is specified by its @dfn{widget class} and | ||
| 872 | @dfn{widget name}. The widget class is the type of the widget: for | ||
| 873 | example, @code{GtkMenuBar}. The widget name is the name given to a | ||
| 874 | specific widget. A widget always has a class, but need not have a | ||
| 875 | name. | ||
| 876 | |||
| 877 | @dfn{Absolute names} are sequences of widget names or widget | ||
| 878 | classes, corresponding to hierarchies of widgets embedded within | ||
| 879 | other widgets. For example, if a @code{GtkWindow} named @code{top} | ||
| 880 | contains a @code{GtkVBox} named @code{box}, which in turn contains | ||
| 881 | a @code{GtkMenuBar} called @code{menubar}, the absolute class name | ||
| 882 | of the menu-bar widget is @code{GtkWindow.GtkVBox.GtkMenuBar}, and | ||
| 883 | its absolute widget name is @code{top.box.menubar}. | ||
| 884 | |||
| 885 | When assigning a style to a widget, you can use the absolute class | ||
| 886 | name or the absolute widget name. | ||
| 887 | |||
| 888 | There are two commands to specify changes for widgets: | ||
| 889 | |||
| 890 | @table @asis | ||
| 891 | @item @code{widget_class} | ||
| 892 | specifies a style for widgets based on the absolute class name. | ||
| 893 | |||
| 894 | @item @code{widget} | ||
| 895 | specifies a style for widgets based on the absolute class name, | ||
| 896 | or just the class. | ||
| 897 | @end table | ||
| 898 | |||
| 899 | @noindent | ||
| 900 | You must specify the class and the style in double-quotes, and put | ||
| 901 | these commands at the top level in the GTK customization file, like | ||
| 902 | this: | ||
| 903 | |||
| 904 | @smallexample | ||
| 905 | style "menufont" | ||
| 906 | @{ | ||
| 907 | font_name = "helvetica bold 14" | ||
| 908 | @} | ||
| 909 | |||
| 910 | widget "top.box.menubar" style "menufont" | ||
| 911 | widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "menufont" | ||
| 912 | @end smallexample | ||
| 913 | |||
| 914 | Matching of absolute names uses shell wildcard syntax: @samp{*} | ||
| 915 | matches zero or more characters and @samp{?} matches one character. | ||
| 916 | This example assigns @code{base_style} to all widgets: | ||
| 917 | |||
| 918 | @smallexample | ||
| 919 | widget "*" style "base_style" | ||
| 920 | @end smallexample | ||
| 921 | |||
| 922 | Given the absolute class name @code{GtkWindow.GtkVBox.GtkMenuBar} | ||
| 923 | and the corresponding absolute widget name @code{top.box.menubar}, all | ||
| 924 | these examples specify @code{my_style} for the menu bar: | ||
| 925 | |||
| 926 | @smallexample | ||
| 927 | widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" | ||
| 928 | widget_class "GtkWindow.*.GtkMenuBar" style "my_style" | ||
| 929 | widget_class "*GtkMenuBar" style "my_style" | ||
| 930 | widget "top.box.menubar" style "my_style" | ||
| 931 | widget "*box*menubar" style "my_style" | ||
| 932 | widget "*menubar" style "my_style" | ||
| 933 | widget "*menu*" style "my_style" | ||
| 934 | @end smallexample | ||
| 935 | |||
| 936 | @node GTK Names in Emacs | ||
| 937 | @appendixsubsec GTK Widget Names in Emacs | ||
| 938 | @cindex GTK widget names | ||
| 939 | @cindex GTK widget classes | ||
| 940 | |||
| 941 | In Emacs, the top level widget for a frame is a @code{GtkWindow} | ||
| 942 | that contains a @code{GtkVBox}. The @code{GtkVBox} contains the | ||
| 943 | @code{GtkMenuBar} and a @code{GtkFixed} widget. The vertical scroll | ||
| 944 | bars, @code{GtkVScrollbar}, are contained in the @code{GtkFixed} | ||
| 945 | widget. The text you write in Emacs is drawn in the @code{GtkFixed} | ||
| 946 | widget. | ||
| 947 | |||
| 948 | Dialogs in Emacs are @code{GtkDialog} widgets. The file dialog is a | ||
| 949 | @code{GtkFileSelection} widget. | ||
| 950 | |||
| 951 | @noindent | ||
| 952 | To set a style for the menu bar using the absolute class name, use: | ||
| 953 | |||
| 954 | @smallexample | ||
| 955 | widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" | ||
| 956 | @end smallexample | ||
| 957 | |||
| 958 | @noindent | ||
| 959 | For the scroll bar, the absolute class name is: | ||
| 960 | |||
| 961 | @smallexample | ||
| 962 | widget_class | ||
| 963 | "GtkWindow.GtkVBox.GtkFixed.GtkVScrollbar" | ||
| 964 | style "my_style" | ||
| 965 | @end smallexample | ||
| 966 | |||
| 967 | @noindent | ||
| 968 | The names for the emacs widgets, and their classes, are: | ||
| 969 | |||
| 970 | @multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some} | ||
| 971 | @item @code{emacs-filedialog} | ||
| 972 | @tab @code{GtkFileSelection} | ||
| 973 | @item @code{emacs-dialog} | ||
| 974 | @tab @code{GtkDialog} | ||
| 975 | @item @code{Emacs} | ||
| 976 | @tab @code{GtkWindow} | ||
| 977 | @item @code{pane} | ||
| 978 | @tab @code{GtkVHbox} | ||
| 979 | @item @code{emacs} | ||
| 980 | @tab @code{GtkFixed} | ||
| 981 | @item @code{verticalScrollBar} | ||
| 982 | @tab @code{GtkVScrollbar} | ||
| 983 | @item @code{emacs-toolbar} | ||
| 984 | @tab @code{GtkToolbar} | ||
| 985 | @item @code{menubar} | ||
| 986 | @tab @code{GtkMenuBar} | ||
| 987 | @item @code{emacs-menuitem} | ||
| 988 | @tab anything in menus | ||
| 989 | @end multitable | ||
| 990 | |||
| 991 | @noindent | ||
| 992 | Thus, for Emacs you can write the two examples above as: | ||
| 993 | |||
| 994 | @smallexample | ||
| 995 | widget "Emacs.pane.menubar" style "my_style" | ||
| 996 | widget "Emacs.pane.emacs.verticalScrollBar" style "my_style" | ||
| 997 | @end smallexample | ||
| 998 | |||
| 999 | GTK absolute names are quite strange when it comes to menus | ||
| 1000 | and dialogs. The names do not start with @samp{Emacs}, as they are | ||
| 1001 | free-standing windows and not contained (in the GTK sense) by the | ||
| 1002 | Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: | ||
| 1003 | |||
| 1004 | @smallexample | ||
| 1005 | widget "*emacs-dialog*" style "my_dialog_style" | ||
| 1006 | widget "*emacs-filedialog* style "my_file_style" | ||
| 1007 | widget "*emacs-menuitem* style "my_menu_style" | ||
| 1008 | @end smallexample | ||
| 1009 | |||
| 1010 | If you specify a customization in @file{~/.emacs.d/gtkrc}, then it | ||
| 1011 | automatically applies only to Emacs, since other programs don't read | ||
| 1012 | that file. For example, the drop down menu in the file dialog can not | ||
| 1013 | be customized by any absolute widget name, only by an absolute class | ||
| 1014 | name. This is because the widgets in the drop down menu do not | ||
| 1015 | have names and the menu is not contained in the Emacs GtkWindow. To | ||
| 1016 | have all menus in Emacs look the same, use this in | ||
| 1017 | @file{~/.emacs.d/gtkrc}: | ||
| 1018 | |||
| 1019 | @smallexample | ||
| 1020 | widget_class "*Menu*" style "my_menu_style" | ||
| 1021 | @end smallexample | ||
| 1022 | |||
| 1023 | @node GTK styles | ||
| 1024 | @appendixsubsec GTK styles | ||
| 1025 | @cindex GTK styles | ||
| 1026 | |||
| 1027 | In a GTK style you specify the appearance widgets shall have. You | ||
| 1028 | can specify foreground and background color, background pixmap and | ||
| 1029 | font. The edit widget (where you edit the text) in Emacs is a GTK | ||
| 1030 | widget, but trying to specify a style for the edit widget will have no | ||
| 1031 | effect. This is so that Emacs compiled for GTK is compatible with | ||
| 1032 | Emacs compiled for other X toolkits. The settings for foreground, | ||
| 1033 | background and font for the edit widget is taken from the X resources; | ||
| 1034 | @pxref{Resources}. Here is an example of two style declarations, | ||
| 1035 | @samp{default} and @samp{ruler}: | ||
| 1036 | |||
| 1037 | @smallexample | ||
| 1038 | pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" | ||
| 1039 | |||
| 1040 | style "default" | ||
| 1041 | @{ | ||
| 1042 | font_name = "helvetica 12" | ||
| 1043 | |||
| 1044 | bg[NORMAL] = @{ 0.83, 0.80, 0.73 @} | ||
| 1045 | bg[SELECTED] = @{ 0.0, 0.55, 0.55 @} | ||
| 1046 | bg[INSENSITIVE] = @{ 0.77, 0.77, 0.66 @} | ||
| 1047 | bg[ACTIVE] = @{ 0.0, 0.55, 0.55 @} | ||
| 1048 | bg[PRELIGHT] = @{ 0.0, 0.55, 0.55 @} | ||
| 1049 | |||
| 1050 | fg[NORMAL] = "black" | ||
| 1051 | fg[SELECTED] = @{ 0.9, 0.9, 0.9 @} | ||
| 1052 | fg[ACTIVE] = "black" | ||
| 1053 | fg[PRELIGHT] = @{ 0.9, 0.9, 0.9 @} | ||
| 1054 | |||
| 1055 | base[INSENSITIVE] = "#777766" | ||
| 1056 | text[INSENSITIVE] = @{ 0.60, 0.65, 0.57 @} | ||
| 1057 | |||
| 1058 | bg_pixmap[NORMAL] = "background.xpm" | ||
| 1059 | bg_pixmap[INSENSITIVE] = "background.xpm" | ||
| 1060 | bg_pixmap[ACTIVE] = "background.xpm" | ||
| 1061 | bg_pixmap[PRELIGHT] = "<none>" | ||
| 1062 | |||
| 1063 | @} | ||
| 1064 | |||
| 1065 | style "ruler" = "default" | ||
| 1066 | @{ | ||
| 1067 | font_name = "helvetica 8" | ||
| 1068 | @} | ||
| 1069 | |||
| 1070 | @end smallexample | ||
| 1071 | |||
| 1072 | The style @samp{ruler} inherits from @samp{default}. This way you can build | ||
| 1073 | on existing styles. The syntax for fonts and colors is described below. | ||
| 1074 | |||
| 1075 | As this example shows, it is possible to specify several values for | ||
| 1076 | foreground and background depending on the widget's @dfn{state}. The | ||
| 1077 | possible states are: | ||
| 1078 | |||
| 1079 | @table @code | ||
| 1080 | @item NORMAL | ||
| 1081 | This is the default state for widgets. | ||
| 1082 | @item ACTIVE | ||
| 1083 | This is the state for a widget that is ready to do something. It is | ||
| 1084 | also for the trough of a scroll bar, i.e. @code{bg[ACTIVE] = "red"} | ||
| 1085 | sets the scroll bar trough to red. Buttons that have been pressed but | ||
| 1086 | not released yet (``armed'') are in this state. | ||
| 1087 | @item PRELIGHT | ||
| 1088 | This is the state for a widget that can be manipulated, when the mouse | ||
| 1089 | pointer is over it---for example when the mouse is over the thumb in | ||
| 1090 | the scroll bar or over a menu item. When the mouse is over a button | ||
| 1091 | that is not pressed, the button is in this state. | ||
| 1092 | @item SELECTED | ||
| 1093 | This is the state for data that has been selected by the user. It can | ||
| 1094 | be selected text or items selected in a list. This state is not used | ||
| 1095 | in Emacs. | ||
| 1096 | @item INSENSITIVE | ||
| 1097 | This is the state for widgets that are visible, but they can not be | ||
| 1098 | manipulated in the usual way---for example, buttons that can't be | ||
| 1099 | pressed, and disabled menu items. To display disabled menu items in | ||
| 1100 | yellow, use @code{fg[INSENSITIVE] = "yellow"}. | ||
| 1101 | @end table | ||
| 1102 | |||
| 1103 | Here are the things that can go in a style declaration: | ||
| 1104 | |||
| 1105 | @table @code | ||
| 1106 | @item bg[@var{state}] = @var{color} | ||
| 1107 | This specifies the background color for the widget. Note that | ||
| 1108 | editable text doesn't use @code{bg}; it uses @code{base} instead. | ||
| 1109 | |||
| 1110 | @item base[@var{state}] = @var{color} | ||
| 1111 | This specifies the background color for editable text. In Emacs, this | ||
| 1112 | color is used for the background of the text fields in the file | ||
| 1113 | dialog. | ||
| 1114 | |||
| 1115 | @item bg_pixmap[@var{state}] = "@var{pixmap}" | ||
| 1116 | This specifies an image background (instead of a background color). | ||
| 1117 | @var{pixmap} should be the image file name. GTK can use a number of | ||
| 1118 | image file formats, including XPM, XBM, GIF, JPEG and PNG. If you | ||
| 1119 | want a widget to use the same image as its parent, use | ||
| 1120 | @samp{<parent>}. If you don't want any image, use @samp{<none>}. | ||
| 1121 | @samp{<none>} is the way to cancel a background image inherited from a | ||
| 1122 | parent style. | ||
| 1123 | |||
| 1124 | You can't specify the file by its absolute file name. GTK looks for | ||
| 1125 | the pixmap file in directories specified in @code{pixmap_path}. | ||
| 1126 | @code{pixmap_path} is a colon-separated list of directories within | ||
| 1127 | double quotes, specified at the top level in a @file{gtkrc} file | ||
| 1128 | (i.e. not inside a style definition; see example above): | ||
| 1129 | |||
| 1130 | @smallexample | ||
| 1131 | pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" | ||
| 1132 | @end smallexample | ||
| 1133 | |||
| 1134 | @item fg[@var{state}] = @var{color} | ||
| 1135 | This specifies the foreground color for widgets to use. It is the | ||
| 1136 | color of text in menus and buttons, and the color for the arrows in | ||
| 1137 | the scroll bar. For editable text, use @code{text}. | ||
| 1138 | |||
| 1139 | @item text[@var{state}] = @var{color} | ||
| 1140 | This is the color for editable text. In Emacs, this color is used for the | ||
| 1141 | text fields in the file dialog. | ||
| 1142 | |||
| 1143 | @item font_name = "@var{font}" | ||
| 1144 | This specifies the font for text in the widget. @var{font} is a | ||
| 1145 | Pango font name, for example @samp{Sans Italic 10}, @samp{Helvetica | ||
| 1146 | Bold 12}, @samp{Courier 14}, @samp{Times 18}. See below for exact | ||
| 1147 | syntax. The names are case insensitive. | ||
| 1148 | @end table | ||
| 1149 | |||
| 1150 | There are three ways to specify a color: by name, in hexadecimal | ||
| 1151 | form, and with an RGB triplet. | ||
| 1152 | |||
| 1153 | @noindent | ||
| 1154 | A color name is written within double quotes, for example @code{"red"}. | ||
| 1155 | |||
| 1156 | @noindent | ||
| 1157 | Hexadecimal form is the same as in X: | ||
| 1158 | @code{#@var{rrrr}@var{gggg}@var{bbbb}}, where all three color specs | ||
| 1159 | must have the same number of hex digits (1, 2, 3 or 4). | ||
| 1160 | |||
| 1161 | @noindent | ||
| 1162 | An RGB triplet looks like @code{@{ @var{r}, @var{g}, @var{b} @}}, | ||
| 1163 | where @var{r}, @var{g} and @var{b} are either integers in the range | ||
| 1164 | 0-65535 or floats in the range 0.0-1.0. | ||
| 1165 | |||
| 1166 | Pango font names have the form ``@var{family-list} @var{style-options} | ||
| 1167 | @var{size}.'' | ||
| 1168 | @cindex Pango font name | ||
| 1169 | @noindent | ||
| 1170 | @var{family-list} is a comma separated list of font families optionally | ||
| 1171 | terminated by a comma. This way you can specify several families and the | ||
| 1172 | first one found will be used. @var{family} corresponds to the second part in | ||
| 1173 | an X font name, for example in | ||
| 1174 | |||
| 1175 | @smallexample | ||
| 1176 | -adobe-times-medium-r-normal--12-120-75-75-p-64-iso10646-1 | ||
| 1177 | @end smallexample | ||
| 1178 | |||
| 1179 | @noindent | ||
| 1180 | the family name is @samp{times}. | ||
| 1181 | |||
| 1182 | @noindent | ||
| 1183 | @var{style-options} is a whitespace separated list of words where each word | ||
| 1184 | is a style, variant, weight, or stretch. The default value for all of | ||
| 1185 | these is @code{normal}. | ||
| 1186 | |||
| 1187 | @noindent | ||
| 1188 | A `style' corresponds to the fourth part of an X font name. In X font | ||
| 1189 | names it is the character @samp{r}, @samp{i} or @samp{o}; in Pango | ||
| 1190 | font names the corresponding values are @code{normal}, @code{italic}, | ||
| 1191 | or @code{oblique}. | ||
| 1192 | |||
| 1193 | @noindent | ||
| 1194 | A `variant' is either @code{normal} or @code{small-caps}. | ||
| 1195 | Small caps is a font with the lower case characters replaced by | ||
| 1196 | smaller variants of the capital characters. | ||
| 1197 | |||
| 1198 | @noindent | ||
| 1199 | Weight describes the ``boldness'' of a font. It corresponds to the third | ||
| 1200 | part of an X font name. It is one of @code{ultra-light}, @code{light}, | ||
| 1201 | @code{normal}, @code{bold}, @code{ultra-bold}, or @code{heavy}. | ||
| 1202 | |||
| 1203 | @noindent | ||
| 1204 | Stretch gives the width of the font relative to other designs within a | ||
| 1205 | family. It corresponds to the fifth part of an X font name. It is one of | ||
| 1206 | @code{ultra-condensed}, @code{extra-condensed}, @code{condensed}, | ||
| 1207 | @code{semi-condensed}, @code{normal}, @code{semi-expanded}, | ||
| 1208 | @code{expanded}, @code{extra-expanded}, or @code{ultra-expanded}. | ||
| 1209 | |||
| 1210 | @noindent | ||
| 1211 | @var{size} is a decimal number that describes the font size in points. | ||
| 1212 | @end ifnottex | ||
| 1213 | |||
| 1214 | @ignore | ||
| 1215 | arch-tag: 9b6ff773-48b6-41f6-b2f9-f114b8bdd97f | ||
| 1216 | @end ignore | ||