aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2001-03-25 14:05:00 +0000
committerEli Zaretskii2001-03-25 14:05:00 +0000
commitd891bf0119fc71e1e37141c1efaf560b45796541 (patch)
treef546cedc3e175cb5df874b76d7eeeb8adc12cc57
parent50b5719962b1bfbc280a5e01fb65584ae951dd9c (diff)
downloademacs-d891bf0119fc71e1e37141c1efaf560b45796541.tar.gz
emacs-d891bf0119fc71e1e37141c1efaf560b45796541.zip
(Emacs for Windows): Mention a port for Windows CE.
(^M in the shell buffer): Add another solution, with shell-strip-ctrl-m. (Problems with Shell Mode on MS-Windows): New section. (Customizing C and C++ indentation): New section. (Shell process exits abnormally, Problems building Emacs) (Emacs for MS-DOS): Give the correct location of PROBLEMS.
-rw-r--r--man/faq.texi164
1 files changed, 149 insertions, 15 deletions
diff --git a/man/faq.texi b/man/faq.texi
index 652a3b78841..cf67af446b2 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -1195,6 +1195,7 @@ and on @code{xterm} with @kbd{emacs -nw}.
1195* Using an already running Emacs process:: 1195* Using an already running Emacs process::
1196* Compiler error messages:: 1196* Compiler error messages::
1197* Indenting switch statements:: 1197* Indenting switch statements::
1198* Customizing C and C++ indentation::
1198* Horizontal scrolling:: 1199* Horizontal scrolling::
1199* Overwrite mode:: 1200* Overwrite mode::
1200* Turning off beeping:: 1201* Turning off beeping::
@@ -1709,7 +1710,7 @@ following to inform Emacs of your changes:
1709 compilation-error-regexp-alist)) 1710 compilation-error-regexp-alist))
1710@end lisp 1711@end lisp
1711 1712
1712@node Indenting switch statements, Horizontal scrolling, Compiler error messages, Common requests 1713@node Indenting switch statements, Customizing C and C++ indentation, Compiler error messages, Common requests
1713@section How do I change the indentation for @code{switch}? 1714@section How do I change the indentation for @code{switch}?
1714@cindex @code{switch}, indenting 1715@cindex @code{switch}, indenting
1715@cindex Indenting of @code{switch} 1716@cindex Indenting of @code{switch}
@@ -1746,7 +1747,91 @@ C programming in Emacs 20 and later) and add the following line to yoyr
1746 1747
1747There appears to be no way to do this with the old @code{c-mode}. 1748There appears to be no way to do this with the old @code{c-mode}.
1748 1749
1749@node Horizontal scrolling, Overwrite mode, Indenting switch statements, Common requests 1750@node Customizing C and C++ indentation, Horizontal scrolling, Indenting switch statements, Common requests
1751@section How to customize indentation in C, C@t{++}, and Java buffers?
1752@cindex Indentation, how to customize
1753@cindex Customize indentation
1754
1755The Emacs @code{cc-mode} features an interactive procedure for
1756customizing the indentation style, which is fully explained in the
1757@cite{CC Mode} manual that is part of the Emacs distribution, see
1758@ref{Customizing Indentation, , Customization Indentation, ccmode,
1759The CC Mode Manual}. Here's a short summary of the procedure:
1760
1761@enumerate
1762@item
1763Go to the beginning of the first line where you don't like the
1764indentation and type @kbd{C-c C-o}. Emacs will prompt you for the
1765syntactic symbol; type @key{RET} to accept the default it suggests.
1766
1767@item
1768Emacs now prompts for the offset of this syntactic symbol, showing the
1769default (the current definition) inside parentheses. You can choose
1770one of these:
1771
1772@table @code
1773@item 0
1774No extra indentation.
1775@item +
1776Indent one basic offset.
1777@item -
1778Outdent one basic offset.
1779@item ++
1780Indent two basic offsets
1781@item --
1782Outdent two basic offsets.
1783@item *
1784Indent half basic offset.
1785@item /
1786Outdent hal basic offset.
1787@end table
1788
1789@item
1790After choosing one of these symbols, type @kbd{C-c C-q} to reindent
1791the line or the block according to what you just specified.
1792
1793@item
1794If you don't like the result, go back to step 1. Otherwise, add the
1795following line to your @file{.emacs}:
1796
1797@lisp
1798(c-set-offset '@var{syntactic-symbol} @var{offset})
1799@end lisp
1800
1801@noindent
1802where @var{syntactic-symbol} is the name Emacs shows in the minibuffer
1803when you type @kbd{C-c C-o} at the beginning of the line, and
1804@var{offset} is one of the indentation symbols listed above (@code{+},
1805@code{/}, @code{0}, etc.) that you've chosen during the interactive
1806procedure.
1807
1808@item
1809Go to the next line whose indentation is not to your liking and repeat
1810the process there.
1811@end enumerate
1812
1813It is recommended to put all the resulting @code{(c-set-offset ...)}
1814customizations inside a C mode hook, like this:
1815
1816@lisp
1817(defun my-c-mode-hook ()
1818 (c-set-offset ...)
1819 (c-set-offset ...))
1820(add-hook 'c-mode-hook 'my-c-mode-hook)
1821@end lisp
1822
1823@noindent
1824Using @code{c-mode-hook} avoids the need to put a @w{@code{(require
1825'cc-mode)}} into your @file{.emacs} file, because @code{c-set-offset}
1826might be unavailable when @code{cc-mode} is not loaded.
1827
1828Note that @code{c-mode-hook} runs for C source files only; use
1829@code{c++-mode-hook} for C@t{++} sources, @code{java-mode-hook} for
1830Java sources, etc. If you want the same customizations to be in
1831effect in @emph{all} languages supported by @code{cc-mode}, use
1832@code{c-mode-common-hook}.
1833
1834@node Horizontal scrolling, Overwrite mode, Customizing C and C++ indentation, Common requests
1750@section How can I make Emacs automatically scroll horizontally? 1835@section How can I make Emacs automatically scroll horizontally?
1751@cindex @code{hscroll-mode} 1836@cindex @code{hscroll-mode}
1752@cindex Horizontal scrolling 1837@cindex Horizontal scrolling
@@ -2609,6 +2694,7 @@ later), which converts these ANSI escape sequences into colors.
2609* Problems with very large files:: 2694* Problems with very large files::
2610* ^M in the shell buffer:: 2695* ^M in the shell buffer::
2611* Shell process exits abnormally:: 2696* Shell process exits abnormally::
2697* Problems with Shell Mode on MS-Windows::
2612* Termcap/Terminfo entries for Emacs:: 2698* Termcap/Terminfo entries for Emacs::
2613* Spontaneous entry into isearch-mode:: 2699* Spontaneous entry into isearch-mode::
2614* Problems talking to certain hosts:: 2700* Problems talking to certain hosts::
@@ -2720,6 +2806,16 @@ with the following Lisp form,
2720(setenv "ESHELL" "/bin/csh") 2806(setenv "ESHELL" "/bin/csh")
2721@end lisp 2807@end lisp
2722 2808
2809The above solutions try to prevent the shell from producing the
2810@samp{^M} characters in the first place. If this is not possible
2811(e.g., if you use a Windows shell), you can get Emacs to remove these
2812characters from the buffer by adding this to your @file{.emacs} init
2813file:
2814
2815@smalllisp
2816(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m)
2817@end smalllisp
2818
2723On a related note: If your shell is echoing your input line in the shell 2819On a related note: If your shell is echoing your input line in the shell
2724buffer, you might want to try the following command in your shell 2820buffer, you might want to try the following command in your shell
2725start-up file: 2821start-up file:
@@ -2728,7 +2824,7 @@ start-up file:
2728stty -icrnl -onlcr -echo susp ^Z 2824stty -icrnl -onlcr -echo susp ^Z
2729@end example 2825@end example
2730 2826
2731@node Shell process exits abnormally, Termcap/Terminfo entries for Emacs, ^M in the shell buffer, Bugs and problems 2827@node Shell process exits abnormally, Problems with Shell Mode on MS-Windows, ^M in the shell buffer, Bugs and problems
2732@section Why do I get "Process shell exited abnormally with code 1"? 2828@section Why do I get "Process shell exited abnormally with code 1"?
2733@cindex Abnormal exits from @code{shell-mode} 2829@cindex Abnormal exits from @code{shell-mode}
2734@cindex @code{shell-mode} exits 2830@cindex @code{shell-mode} exits
@@ -2753,10 +2849,39 @@ It has been reported that this sometimes happened when Emacs was started
2753as an X client from an xterm window (i.e., had a controlling tty) but the 2849as an X client from an xterm window (i.e., had a controlling tty) but the
2754xterm was later terminated. 2850xterm was later terminated.
2755 2851
2756See also @samp{PROBLEMS} (in the top-level directory when you unpack the 2852See also @samp{PROBLEMS} (in the @file{etc} subdirectory of the
2757Emacs source) for other possible causes of this message. 2853top-level directory when you unpack the Emacs source) for other
2854possible causes of this message.
2855
2856@node Problems with Shell Mode on MS-Windows, Termcap/Terminfo entries for Emacs, Shell process exits abnormally, Bugs and problems
2857@section Why do I get an error message when I try to run @kbd{M-x shell}?
2858
2859@cindex Shell Mode, and MS-Windows
2860@cindex @code{explicit-shell-file-name}
2861On MS-Windows, this might happen because Emacs tries to look for the
2862shell in a wrong place. The default file name @file{/bin/sh} is
2863usually incorrect for non-Unix systems. If you know where your shell
2864executable is, set the variable @code{explicit-shell-file-name} in
2865your @file{.emacs} file to point to its full file name, like this:
2866
2867@lisp
2868(setq explicit-shell-file-name "d:/shells/bash.exe")
2869@end lisp
2870
2871If you don't know what shell does Emacs use, try the @kbd{M-!}
2872command; if that works, put the following line into your
2873@file{.emacs}:
2874
2875@lisp
2876(setq explicit-shell-file-name shell-file-name)
2877@end lisp
2758 2878
2759@node Termcap/Terminfo entries for Emacs, Spontaneous entry into isearch-mode, Shell process exits abnormally, Bugs and problems 2879@cindex Antivirus programs, and Shell Mode
2880Some people have trouble with Shell Mode because of intrusive
2881antivirus software; disabling the resident antivirus program solves
2882the problems in those cases.
2883
2884@node Termcap/Terminfo entries for Emacs, Spontaneous entry into isearch-mode, Problems with Shell Mode on MS-Windows, Bugs and problems
2760@section Where is the termcap/terminfo entry for terminal type "emacs"? 2885@section Where is the termcap/terminfo entry for terminal type "emacs"?
2761@cindex Termcap 2886@cindex Termcap
2762@cindex Terminfo 2887@cindex Terminfo
@@ -3293,10 +3418,10 @@ files before you upgrade, and you shouldn't have too much trouble.
3293@cindex Problems building Emacs 3418@cindex Problems building Emacs
3294@cindex Errors when building Emacs 3419@cindex Errors when building Emacs
3295 3420
3296First look in the file @file{PROBLEMS} (in the top-level directory when 3421First look in the file @file{etc/PROBLEMS} (where you unpack the Emacs
3297you unpack the Emacs source) to see if there is already a solution for 3422source) to see if there is already a solution for your problem. Next,
3298your problem. Next, look for other questions in this FAQ that have to 3423look for other questions in this FAQ that have to do with Emacs
3299do with Emacs installation and compilation problems. 3424installation and compilation problems.
3300 3425
3301If you'd like to have someone look at your problem and help solve it, 3426If you'd like to have someone look at your problem and help solve it,
3302see @ref{Help installing Emacs}. 3427see @ref{Help installing Emacs}.
@@ -3640,9 +3765,9 @@ All of these utilities are available at
3640 3765
3641@end table 3766@end table
3642 3767
3643The files @file{INSTALL} (near its end) and @file{PROBLEMS} in the 3768The files @file{INSTALL} (near its end) and @file{etc/PROBLEMS} in the
3644top-level directory of the Emacs source contains some additional 3769directory of the Emacs sources contains some additional information
3645information regarding Emacs under MS-DOS. 3770regarding Emacs under MS-DOS.
3646 3771
3647For a list of other MS-DOS implementations of Emacs (and Emacs 3772For a list of other MS-DOS implementations of Emacs (and Emacs
3648look-alikes), consult the list of "Emacs implementations and literature," 3773look-alikes), consult the list of "Emacs implementations and literature,"
@@ -3656,9 +3781,9 @@ lack certain features, such as the Emacs Lisp extension language.
3656@node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages 3781@node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages
3657@section Where can I get Emacs for Microsoft Windows 3782@section Where can I get Emacs for Microsoft Windows
3658@cindex FAQ for NT Emacs 3783@cindex FAQ for NT Emacs
3784@cindex Emacs for MS-Windows
3659@cindex Microsoft Windows, Emacs for 3785@cindex Microsoft Windows, Emacs for
3660@cindex Windows NT and Windows 2K, Emacs for 3786@cindex Windows 9X, ME, NT, 2K, and CE, Emacs for
3661@cindex Windows 95, 98, and ME, Emacs for
3662 3787
3663For information on Emacs for Windows 95 and NT, read the FAQ produced by 3788For information on Emacs for Windows 95 and NT, read the FAQ produced by
3664@email{voelker@@cs.washington.edu, Geoff Voelker}, available at 3789@email{voelker@@cs.washington.edu, Geoff Voelker}, available at
@@ -3667,6 +3792,15 @@ For information on Emacs for Windows 95 and NT, read the FAQ produced by
3667 3792
3668@xref{Emacs for MS-DOS}, for Windows 3.1. 3793@xref{Emacs for MS-DOS}, for Windows 3.1.
3669 3794
3795A port of Emacs 20.7 for Windows CE, based on NTEmacs, is available at
3796
3797@uref{http://www.rainer-keuchel.de/software.html}
3798
3799@noindent
3800This port was done by @email{coyxc@@rainer-keuchel.de, Rainer Keuchel},
3801and supports all Emacs features except async subprocesses and menus.
3802You will need MSVC 6.0 and a Windows CE SDK to build this port.
3803
3670@node Emacs for OS/2, Emacs for Atari ST, Emacs for Windows, Finding Emacs and related packages 3804@node Emacs for OS/2, Emacs for Atari ST, Emacs for Windows, Finding Emacs and related packages
3671@section Where can I get Emacs for my PC running OS/2? 3805@section Where can I get Emacs for my PC running OS/2?
3672@cindex OS/2, Emacs for 3806@cindex OS/2, Emacs for