home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / gnu-emacs-faq / part2 < prev    next >
Encoding:
Text File  |  1995-07-25  |  49.6 KB  |  1,190 lines

  1. Subject: GNU Emacs FAQ (2/5, 28-86): Common Requests/Problems
  2. Newsgroups: gnu.emacs.help,comp.emacs,news.answers,comp.answers
  3. From: sbyrnes@rice.edu (Steven Byrnes)
  4. Date: Tue, 4 May 1993 02:52:18 GMT
  5.  
  6. Archive-Name: GNU-Emacs-FAQ/part2
  7. Last-Modified: Tue, 4 May 1993 02:22:35 GMT
  8. Last-Posted: Tue, 4 May 1993 02:52:18 GMT
  9.  
  10.                  GNU Emacs FAQ: Common Requests/Problems
  11.  
  12. If you are viewing this text in a GNU Emacs Buffer, you can type "M-2 C-x $" to
  13. get an overview of just the questions.  Then, when you want to look at the text
  14. of the answers, just type "C-x $".
  15.  
  16. To search for a question numbered XXX, type "M-C-s ^XXX:", followed by a C-r if
  17. that doesn't work, then type ESC to end the search.
  18.  
  19. A `+' in the 78th column means something was inserted on the line.  A `-' means
  20. something was deleted and a `!' means some combination of insertions and
  21. deletions occurred.
  22.  
  23. Full instructions for getting the latest FAQ are in question 22.  Also see the
  24. `Introduction to news.answers' posting in the `news.answers' newsgroup, or send
  25. e-mail to `mail-server@rtfm.mit.edu' with `help' on a body line, or use FTP,
  26. WAIS, or Prospero to rtfm.mit.edu.
  27.  
  28.  
  29.  
  30. Common Things People Want To Do 
  31.  
  32. 28:  How do I set up a .emacs file properly?
  33.   
  34.   See `Init File' in the on-line manual.
  35.   
  36.   WARNING: In general, new Emacs users should not have .emacs files, because
  37.   it causes confusing non-standard behavior.  Then they send questions to
  38.   help-gnu-emacs asking why Emacs isn't behaving as documented.  :-)
  39.   
  40. 29:  How do I debug a .emacs file?
  41.   
  42.   First start Emacs with the `-q' command line option.  Then, in the
  43.   *scratch* buffer, type the following:
  44.   
  45.     (setq debug-on-error t) LFD
  46.     (load-file "~/.emacs") LFD
  47.   
  48.   (Type LFD by pressing C-j.)
  49.   
  50.   If you have an error in your .emacs file, this will invoke the debugger
  51.   when the error occurs.  If you don't know how to use the debugger do
  52.   (setq stack-trace-on-error t) instead.
  53.   
  54.   WARNING: this will not discover errors caused by trying to do something
  55.   that requires the terminal/window-system initialization code to have
  56.   been loaded.  See question 127.
  57.   
  58. 30:  How do I make Emacs display the current line (or column) number?
  59.   
  60.   To find out what line of the buffer you are on right now, do "M-x
  61.   what-line".  Use "M-x goto-line" to go to a specific line.  To find the
  62.   current column number, type "M-ESC (current-column)".
  63.   
  64.   Typing "C-x l" will also tell you what line you are on, provided the
  65.   buffer isn't separated into "pages" with C-l characters.  In that case, it
  66.   will only tell you what line of the current "page" you are on.  WARNING:
  67.   "C-x l" gives the wrong value when point is at the beginning of a line.
  68.   
  69.   There is no "correct" way to constantly display the current (or total)
  70.   line (or column) number on the mode line in Emacs 18, or to display the
  71.   line numbers next to the lines like vi can.  Emacs is not a line-oriented
  72.   editor, and really has no idea what "lines" of the buffer are displayed in
  73.   the window.  It would require a lot of work at the C code level to make
  74.   Emacs keep track of this.  It would not be that hard to get the column
  75.   number, but it would still require changes at the C code level.
  76.   
  77.   None of the vi emulation modes provide the `set number' capability of vi
  78.   (as far as I know).
  79.   
  80.   Emacs 19 will probably be able to show the line number on the mode-line,
  81.   but probably very inefficiently.
  82.   
  83.   People have written various kludges to display line numbers.  One is
  84.   `display-line-numbers' by Wayne Mesard <wmesard@tofu.oracle.com,
  85.   Mesard@bbn.com>.  Look in the Lisp Code Directory.  (See question
  86.   88.)
  87.   
  88. 31:  How do I turn on Abbrevs by default just in mode XXX?
  89.   
  90.   Put this in your .emacs file:
  91.   
  92.     (condition-case ()
  93.     (read-abbrev-file nil t)
  94.       (file-error nil))
  95.   
  96.     (setq XXX-mode-hook
  97.       (function
  98.        (lambda ()
  99.          (setq abbrev-mode t))))
  100.   
  101. 32:  How do I turn on Auto-Fill mode by default?
  102.   
  103.   To turn on Auto-Fill mode just once for one buffer, use "M-x
  104.   auto-fill-mode".  To turn it on for every buffer in, for example, Text
  105.   mode, do this:
  106.   
  107.     (setq text-mode-hook 'turn-on-auto-fill)
  108.   
  109.   If you want Auto-Fill mode on in all major modes, do this:
  110.   
  111.     (setq-default auto-fill-hook 'do-auto-fill)
  112.   
  113. 33:  How do I make Emacs use a certain major mode for certain files?
  114.   
  115.   If you want to use XXX mode for all files which end with the extension
  116.   `.YYY', this will do it for you:
  117.   
  118.     (setq auto-mode-alist (cons '("\\.YYY\\'" . XXX-mode) auto-mode-alist))
  119.   
  120.   Otherwise put this somewhere in the first line of any file you want to
  121.   edit in XXX mode:
  122.   
  123.     -*-XXX-*-
  124.   
  125. 34:  How do I search for, delete, or replace unprintable (8-bit or control)
  126.  characters?
  127.   
  128.   To search for a single character that appears in the buffer as, for
  129.   example, `\237', you can type "C-s C-q 2 3 7".  (This assumes the value of
  130.   search-quote-char is 17 (ie., C-q).)  Searching for ALL unprintable
  131.   characters is best done with a "regexp" search.  The easiest regexp to use
  132.   for the unprintable chars is the complement of the regexp for the
  133.   printable chars.
  134.   
  135.   Regexp for the printable chars: [\t\n\r\f -~]
  136.   
  137.   Regexp for the unprintable chars: [^\t\n\r\f -~]
  138.   
  139.   To type some of these special characters in an interactive argument to
  140.   isearch-forward-regexp or re-search-forward, you need to use C-q.  (`\t',
  141.   `\n', `\r', and `\f' stand respectively for TAB, LFD, RET, and C-l.)  So,
  142.   to search for unprintable characters using re-search-forward:
  143.   
  144.     M-x re-search-forward RET [^ TAB C-q LFD C-q RET C-q C-l SPC -~] RET
  145.   
  146.   Using isearch-forward-regexp:
  147.   
  148.     M-C-s [^ TAB RET C-q RET C-q C-l SPC -~]
  149.   
  150.   To delete all unprintable characters, simply use a replace-regexp:
  151.   
  152.     M-x replace-regexp RET [^ TAB C-q LFD C-q RET C-q C-l SPC -~] RET RET
  153.   
  154.   Replacing is similar to the above.  {I need to write the text for this
  155.   part of the answer!}
  156.   
  157.   Notes:
  158.   
  159.   * With isearch, you can type RET to get a quoted LFD (not a quoted RET).
  160.   
  161.   * You don't need to quote TAB with either isearch or typing something in
  162.     the minibuffer.
  163.   
  164.   Here are the Emacs Lisp forms of the above regexps:
  165.   
  166.     ;; regexp matching all printable characters:
  167.     "[\t\n\r\f -~]"
  168.   
  169.     ;; regexp matching all unprintable characters:
  170.     "[^\t\n\r\f -~]"
  171.   
  172. 35:  How can I highlight a region of text in Emacs?
  173.   
  174.   There are ways to get highlighting (reverse video, inverse video) in GNU
  175.   Emacs 18.59, but either they require patching the C code of Emacs and
  176.   rebuilding, or they are slow and the highlighting disappears if you scroll
  177.   or redraw the screen and it can not follow the point.  Howard Gayle's
  178.   patches for 8-bit output appear to allow highlighting (see question
  179.   ^8-bit-output).  Another patch for highlighting is by Kenichi Handa
  180.   <handa@etl.go.jp>.  There is a patch for use with X by Andy Norman
  181.   <ange@hplb.hpl.hp.com> (and modified for 18.57 by Matthieu Herrb
  182.   <matthieu@laas.fr>), which is available for FTP:
  183.   
  184.     /laas.laas.fr:pub/emacs/patch-X11-18.55
  185.     /laas.laas.fr:pub/emacs/patch-X11-18.57
  186.   
  187.   You can highlight regions in a variety of ways in Epoch and Lucid Emacs.
  188.   GNU Emacs 19 may not be able to just temporarily highlight a region.
  189.   
  190.   Similar comments apply to displaying text in different fonts, except that
  191.   it is even harder.
  192.   
  193. 36:  How do I control Emacs's case-sensitivity when searching/replacing?
  194.     
  195.   For searching, the value of the variable case-fold-search determines
  196.   whether they are case sensitive:
  197.   
  198.     (setq case-fold-search nil) ; make searches case sensitive
  199.     (setq case-fold-search t)   ; make searches case insensitive
  200.   
  201.   Similarly, for replacing the variable case-replace determines whether
  202.   replacements preserve case.
  203.   
  204.   To change the case sensitivity just for one major mode, use the major
  205.   mode's hook.  For example:
  206.   
  207.     (setq XXX-mode-hook
  208.           (function
  209.        (lambda ()
  210.          (setq case-fold-search nil))))
  211.   
  212. 37:  How do I make Emacs wrap words for me?
  213.   
  214.   M-x auto-fill-mode.  The default maximum line width is 74, determined by
  215.   the variable fill-column.  To find how to turn this on automatically see
  216.   question 32.
  217.   
  218. 38:  Where can I get a better spelling checker for Emacs?
  219.   
  220.   Use Ispell.  See question 119.
  221.   
  222. 39:  How can I spell-check TeX or *roff documents?
  223.   
  224.   If you want to spell-check TeX or *roff documents with Ispell, you need to
  225.   arrange for a filter program that understands how to strip TeX or *roff
  226.   formatting commands to be run.  In the TeX distribution, there are several
  227.   different programs named `detex', all with incompatible options, and a
  228.   very old pair of programs named `detex' and `delatex', which should
  229.   probably be avoided.  The most useful one for Ispell is `detex' by Daniel
  230.   Trinkle.  A more recent version is available via FTP:
  231.   
  232.     /arthur.cs.purdue.edu:pub/trinkle/detex-2.4.tar
  233.   
  234.   Raphael Cerf <cerf@clipper.ens.fr> recently released a program for this
  235.   named `xetal':
  236.   
  237.     /spi.ens.fr:pub/unix/tex/
  238.   
  239.   There is a program that comes with Unix named `deroff' for stripping
  240.   formatting commands from *roff files.
  241.   
  242.   Here is an example of code you can put in a .emacs file to use these
  243.   programs:
  244.   
  245.     ;; Based on suggestions by David G. Grubbs <dgg@ksr.com> and Paul Palmer
  246.     ;; <palmerp@math.orst.edu>.
  247.   
  248.     ;; Assuming the use of detex 2.3 by Daniel Trinkle:
  249.     ;; -w means one word per line.
  250.     ;; -n means don't expand \input or \include commands.
  251.     ;; -l means force LaTeX mode.
  252.   
  253.     (require 'ispell) ; for the make-variable-buffer-local statements
  254.     (setq plain-TeX-mode-hook
  255.       (function
  256.        (lambda ()
  257.          (setq ispell-filter-hook "detex")
  258.              (setq ispell-filter-hook-args '("-nw")))))
  259.     (setq LaTeX-mode-hook
  260.       (function
  261.        (lambda ()
  262.          (setq ispell-filter-hook "detex")
  263.              (setq ispell-filter-hook-args '("-lnw")))))
  264.     (setq nroff-mode-hook
  265.       (function
  266.        (lambda ()
  267.          (setq ispell-filter-hook "deroff")
  268.              (setq ispell-filter-hook-args '("-w")))))
  269.   
  270.   You will have to adjust the arguments for programs other than Trinkle's
  271.   detex or for other versions of deroff.  Experiment running the command
  272.   from the shell to find the correct options.  If you don't have a filter
  273.   that knows how to output one word per line, you must pipe its output
  274.   through another filter to break up the output.
  275.   
  276. 40:  How do I change load-path?
  277.   
  278.   In general, you should only *add* to the load-path.  You can add
  279.   directory /XXX/YYY to the load path like this:
  280.   
  281.     (setq load-path (append load-path '("/XXX/YYY/")))
  282.   
  283.   To do this relative to your home directory:
  284.   
  285.     (setq load-path (append load-path (list (expand-file-name "~/YYY/"))))
  286.   
  287. 41:  How do I use an already running Emacs from another window?
  288.   
  289.   The `emacsclient' program is for editing a file using an already running
  290.   Emacs rather than starting up a new Emacs.  It does this by sending a
  291.   request to the already running Emacs, which must be expecting the request.
  292.   
  293.   * Setup
  294.   
  295.     Emacs must have executed the `server-start' function for emacsclient to
  296.     work.  This can be done either by a command line option:
  297.   
  298.       emacs -f server-start
  299.   
  300.     or by invoking server-start from the .emacs file:
  301.   
  302.       (if (some conditions are met) (server-start))
  303.   
  304.     When this is done, Emacs starts a subprocess running a program called
  305.     `server'.  `server' creates a Unix domain socket in the user's home
  306.     directory named `.emacs_server'.
  307.   
  308.     To get your news reader, mail reader, etc., to invoke emacsclient, try
  309.     setting the environment variable EDITOR (or sometimes VISUAL) to the
  310.     value `emacsclient'.  You may have to specify the full pathname of the
  311.     emacsclient program instead.  Examples:
  312.   
  313.       # csh commands:
  314.       setenv EDITOR emacsclient
  315.       setenv EDITOR /usr/local/emacs/etc/emacsclient  # using full pathname
  316.   
  317.       # sh command:
  318.       EDITOR=emacsclient export EDITOR
  319.   
  320.   * Normal use
  321.   
  322.     When emacsclient is run, it connects to the `.emacs_server' socket and
  323.     passes its command line options to `server'.  When `server' receives
  324.     these requests, it sends this information on the the Emacs process,
  325.     which at the next opportunity will visit the files specified.  (Line
  326.     numbers can be specified just like with Emacs.)  The user will have to
  327.     switch to the Emacs window by hand.  When the user is done editing a
  328.     file, the user can type "C-x #" to indicate this.  This will switch to
  329.     another buffer created at the request of emacsclient if there are any.
  330.     When "C-x #" has been invoked on all of the files that the emacsclient
  331.     requested to be edited, Emacs will send notification of this to `server'
  332.     which will pass this on to the emacsclient, which will then exit.
  333.   
  334.   NOTE: `emacsclient' and `server' must be running on machines which share
  335.   the same filesystem for this to work.  The pathnames that emacsclient
  336.   specifies should be correct for the filesystem that the Emacs process
  337.   sees.  The Emacs process should not be suspended at the time emacsclient
  338.   is invoked.  emacsclient should either be invoked from another X window or
  339.   from a shell window inside Emacs itself.
  340.   
  341.   There is an enhanced version of emacsclient/server called `gnuserv' by
  342.   Andy Norman <ange@hplb.hpl.hp.com> which is available in the Emacs Lisp
  343.   Archive.  gnuserv uses Internet domain sockets, so it can work across most
  344.   network connections.  It also supports the execution of arbitrary Emacs
  345.   Lisp forms and also does not require the client program to wait for
  346.   completion.  It is available via anonymous FTP (Emacs Lisp Archive:
  347.   packages/gnuserv.shar).
  348.   
  349. 42:  How do I make Emacs recognize my compiler's funny error messages?
  350.   
  351.   Write a program which runs the compiler as a child and filters its output,
  352.   rearranging as necessary.  Install with same name as compiler somewhere in
  353.   path.
  354.   
  355.   Keith Moore <moore@cs.utk.edu> wrote one such for a C compiler under AIX.
  356.   Available via FTP:
  357.   
  358.     /cs.utk.edu:readonly/aixcc.lex
  359.   
  360.   Jim Frost <jimf@saber.com> wrote another for the IBM xlc compiler on the
  361.   RS/6000.  (I don't know if these are both for the same compiler.)
  362.   Johnathan Vail <vail@tegra.COM> wrote something for a High C compiler
  363.   (`hc', which is one of the compilers on the RS/6000, although I think
  364.   Johnathan wrote his program for hc on a different computer).
  365.   
  366. 43:  How do I indent switch statements like this?
  367.   
  368.   Many people want to indent their switch statements like this:
  369.   
  370.     f()
  371.     {
  372.       switch(x) {
  373.         case A:
  374.           x1;
  375.           break;
  376.         case B:
  377.           x2;
  378.           break;
  379.         default:
  380.           x3;
  381.       }
  382.     }
  383.   
  384.   I don't believe there is any way to do this exactly without modifying the
  385.   Lisp code in c-mode.el.  You can set c-indent-level to 4 and
  386.   c-label-offset to -2, but this has bad effects elsewhere.  {Anyone have a
  387.   solution?}
  388.   
  389. 44:  How can I make Emacs automatically scroll horizontally?
  390.   
  391.   There is no completely correct way of doing this that does not involve
  392.   rewriting all commands or writing your own top-level command loop (not a
  393.   completely bad idea).  Wayne Mesard <wmesard@pescadero.stanford.edu> has
  394.   written a particularly advanced kludge called `hscroll.el' that checks
  395.   once a second to make sure point is visible.
  396.   
  397. 45:  How do I make Emacs "typeover" or "overwrite" instead of inserting?
  398.   
  399.   M-x overwrite-mode (a minor mode).
  400.   
  401. 46:  How do I stop Emacs from beeping on a terminal?
  402.   
  403.   Martin R. Frank <martin@cc.gatech.edu> writes:
  404.   
  405.     Tell Emacs to use the 'visible bell' instead of the audible bell, and
  406.     set the visible bell to nothing.
  407.   
  408.     Put this in your TERMCAP environment variable:
  409.   
  410.       ... :vb=: ...                       
  411.   
  412.     And evaluate this:
  413.   
  414.       (setq visible-bell t)
  415.   
  416. 47:  How do I turn down the bell volume in Emacs running under X Windows?
  417.   
  418.   Under versions of Emacs before 18.58, the bell volume was annoying loud
  419.   and difficult to turn off.  So upgrading to 18.58 or higher will reduce
  420.   the volume.  If you want to turn it off completely, use `xset'.  There is
  421.   no way to turn the bell off just for Emacs without affecting all other
  422.   programs.
  423.   
  424.   Under Epoch you can do:
  425.   
  426.     (setq epoch::bell-volume 20)
  427.   
  428.   Stu Grossman <grossman@sunburn.stanford.edu> wrote a patch that allows the
  429.   bell volume to be adjusted from inside Emacs just for Emacs.
  430.   
  431. 48:  How do I tell Emacs to automatically indent a new line to the
  432.  indentation of the previous line?
  433.   
  434.   One solution is Indented Text Mode (M-x indented-text-mode).
  435.   
  436.   If you have Auto-Fill mode on (a minor mode, see question 32), you can
  437.   tell Emacs to prefix every line with a certain character sequence, the
  438.   "fill prefix".  Type the prefix at the beginning of a line, position point
  439.   after it, and then type "C-x ." (set-fill-prefix) to set the fill prefix.
  440.   Thereafter, auto-filling will automatically put the fill prefix at the
  441.   beginning of new lines, and M-q (fill-paragraph) will maintain any fill
  442.   prefix when refilling the paragraph.
  443.   
  444.   NOTE: If you have paragraphs with different levels of indentation, you
  445.   will have to set the fill prefix to the correct value each time you move
  446.   to a new paragraph.  To avoid this hassle, try one of the many packages
  447.   available from the Emacs Lisp Archive.  Look up `fill' and `indent' in the
  448.   Lisp Code Directory for guidance.
  449.   
  450. 49:  How do I show which parenthesis matches the one I'm looking at?
  451.   
  452.   If you're looking at a right parenthesis (or brace or bracket) you can
  453.   delete it and reinsert it.  Emacs will blink the cursor on the matching
  454.   parenthesis.
  455.   
  456.   M-C-f (forward-sexp) and M-C-b (backward-sexp) will skip over balanced
  457.   parentheses, so you can see which parentheses match.  (You can train it to
  458.   skip over balanced brackets and braces at the same time by modifying the
  459.   syntax table.)
  460.   
  461.   Here is some Emacs Lisp that will make the % key show the matching
  462.   parenthesis, like in vi.  In addition, if the cursor isn't over a
  463.   parenthesis, it simply inserts a % like normal.
  464.   
  465.     ;; By an unknown contributor
  466.   
  467.     (global-set-key "%" 'match-paren)
  468.   
  469.     (defun match-paren (arg)
  470.       "Go to the matching parenthesis if on parenthesis otherwise insert %."
  471.       (interactive "p")
  472.       (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
  473.         ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
  474.         (t (self-insert-command (or arg 1)))))
  475.   
  476. 50:  In C mode, can I show just the lines that will be left after #ifdef
  477.  commands are handled by the compiler?
  478.   
  479.   M-x hide-ifdef-mode.  (This is a minor mode.)
  480.   
  481.   You may have to (load "hideif") first.  If you want to do this regularly,
  482.   put this in your .emacs file:
  483.   
  484.     (autoload 'hide-ifdef-mode "hideif" nil t)
  485.   
  486.   {Yes, I know, this should be in lisp/loaddefs.el already.}
  487.   
  488. 51:  Is there an equivalent to the `.' (dot) command of vi?
  489.   
  490.   (`.' is the redo command in vi.  It redoes the last insertion/deletion.)
  491.   
  492.   No, not really.
  493.   
  494.   You can type "C-x ESC" (repeat-complex-command) to reinvoke commands that
  495.   used the minibuffer to get arguments.  In repeat-complex-command you can
  496.   type M-p and M-n to scan through all the different complex commands you've
  497.   typed.
  498.   
  499.   To repeat something on each line I recommend using keyboard macros.
  500.   
  501. 52:  What are the valid X resource settings (ie., stuff in .Xdefaults)?
  502.   
  503.   See the Emacs man page, or the etc/OPTIONS file.  Ignore the information
  504.   in etc/XDOC which is way out of date.
  505.   
  506. 53:  How do I execute a piece of Emacs Lisp code?
  507.   
  508.   There are a number of ways to execute (called "evaluate") an Emacs Lisp
  509.   "form":
  510.   
  511.   * If you want it evaluated every time you run Emacs, put it in a file
  512.     named `.emacs' in your home directory.
  513.   
  514.   * You can type the form in the *scratch* buffer, and then type LFD (or
  515.     C-j) after it.  The result of evaluating the form will be inserted in
  516.     the buffer.
  517.   
  518.   * In Emacs-Lisp mode, typing M-C-x evaluates a top-level form before or
  519.     around point.
  520.   
  521.   * Typing "C-x C-e" in any buffer evaluates the Lisp form immediately
  522.     before point and prints its value in the echo area.
  523.   
  524.   * Typing M-ESC or M-x eval-expression allows you to type a Lisp form in
  525.     the minibuffer which will be evaluated.
  526.   
  527.   * You can use M-x load-file to have Emacs evaluate all the Lisp forms in
  528.     a file.  (To do this from Lisp use the function `load' instead.)
  529.   
  530.   These functions are also used for evaluating Lisp forms:
  531.   
  532.     load-library, eval-region, eval-current-buffer, require, autoload
  533.   
  534. 54:  How do I change Emacs's idea of the tab character's length?
  535.   
  536.   Example: (setq default-tab-width 10).
  537.   
  538. 55:  How do I insert `>' at the beginning of every line?
  539.   
  540.   Type "M-x replace-regexp RET ^ RET > RET".
  541.   
  542.   To do this only in the region, type "C-x n M-x replace-regexp RET ^ RET
  543.   > RET C-x w".
  544.   
  545.   WARNING: The command narrow-to-region (C-x n) is disabled by default
  546.   because it can be very confusing (ie., "Oh no!  Where did my file go?").
  547.   
  548. 56:  How do I insert `_^H' before each character in a paragraph to get an
  549.  underlined paragraph?
  550.   
  551.   M-x underline-region.
  552.   
  553. 57:  How do I repeat a command as many times as possible?
  554.   
  555.   Use "C-x (" and "C-x )" to make a keyboard macro that invokes the command
  556.   and then type "M-0 C-x e".
  557.   
  558.   WARNING: any messages your command prints in the echo area will be
  559.   suppressed.
  560.   
  561. 58:  How do I make Emacs behave like this: when I go up or down, the cursor
  562.  should stay in the same column even if the line is too short?
  563.   
  564.   M-x picture-mode.  (This is a minor mode, in theory anyway ...)
  565.   
  566. 59:  How do I tell Emacs to iconify itself?
  567.   
  568.   You need to modify C source and recompile.  Either that or get Epoch or
  569.   Lucid Emacs instead.  Patches have been written by Robert Forsman
  570.   <thoth@reef.cis.ufl.edu> and Johan Vromans <jv@mh.nl> to allow Emacs to
  571.   iconify itself and by Matt Wette <mwette@mr-ed.jpl.nasa.gov> and
  572.   Manavendra K. Thakur <thakur@zerkalo.harvard.edu> (for 18.57, plus icon
  573.   geometry) to allow Emacs to start up iconified.  I don't know which of
  574.   these patches work together.
  575.   
  576.   Anonymous FTP:
  577.     /csi.jpl.nasa.gov:pub/emax.patch1  (Matt Wette)
  578.     /ftp.eu.net:gnu/emacs/FP-Xfun.Z  (Johan Vromans)
  579.     /ftp.urc.tue.nl:/pub/tex/emacs/FP-Xfun  (Johan Vromans)
  580.   
  581. 60:  How do I use regexps (regular expressions) in Emacs?
  582.   
  583.   See `Regexps' in the online manual.
  584.   
  585.   WARNING: The "or" operator is `\|', not `|', and the grouping operators
  586.   are `\(' and `\)'.  Also, the string syntax for a backslash is "\\".
  587.   Thus, the string syntax for a regular expression like xxx\(foo\|bar\) is
  588.   "xxx\\(foo\\|bar\\)".  Notice the duplicated backslashes!
  589.   
  590.   WARNING: Unlike in Unix grep, sed, etc., a complement character set
  591.   ([^...])  can match a newline character (LFD aka C-j aka \n), unless
  592.   newline is mentioned as one of the characters not to match.
  593.   
  594.   WARNING: The character syntax regexps (eg. `\sw') are not meaningful
  595.   inside character set regexps (eg. `[aeiou]').  (This is actually typical
  596.   for regexp syntax.)
  597.   
  598. 61:  How do I perform a replace operation across more than one file?
  599.   
  600.   The "tags" feature of Emacs includes the command tags-query-replace which
  601.   performs a query-replace across all the files mentioned in the TAGS file.
  602.   See `Tags:Tags Search' in the online manual.
  603.   
  604.   In addition, Martin Boyer has written a package named global-replace which
  605.   will perform a query-replace across all the files mentioned in the
  606.   *compilation* buffer (usually done after a `grep'), which is available via
  607.   anonymous FTP:
  608.   
  609.     /ireq-robot.hydro.qc.ca:pub/emacs/lisp/compile.el.Z
  610.     /ireq-robot.hydro.qc.ca:pub/emacs/lisp/global-replace.el.Z
  611.     /ireq-robot.hydro.qc.ca:pub/emacs/lisp/query.el.Z
  612.   
  613. 62:  Where is the documentation for `etags'?
  614.   
  615.   `etags' takes options just like a prior version of ctags, so your ctags
  616.   manual (if any) may be useful.  Eoin Woods, in comp.emacs, writes the      !
  617.   following:                                                                 !
  618.                                                                              !
  619.     From reading the source (!) the way I use it is:                         !
  620.                                                                              !
  621.       for f in `find <args>`                                                 !
  622.       do                                                                     !
  623.          etags -at -f ETAGS $f                                               !
  624.       done                                                                   !
  625.                                                                              !
  626.     The "-t" option means to create tags for typedefs as well as functions.  !
  627.     The "-a" option tells it to append to the output file. If you have a     !
  628.     small number of files (up to a few hundred I think) you can use it       !
  629.     direct as:                                                               !
  630.                                                                              !
  631.       etags -f ETAGS file1 file2 file3 ... filen                             !
  632.                                                                              !
  633.     The option list is:                                                      !
  634.                                                                              !
  635.             -f file -  Specify the output file name (Default is "TAGS")      !
  636.             -a      -  Append to the output file. (Default is to rewrite it) !
  637.             -t      -  Create tags for typedefs (default is just functions)  !
  638.             -u      -  Update the output file. Do not re-create it.          !
  639.             -w      -  Suppress warnings                                     !
  640.             -v      -  Create vgrind style indexed output (What is vgrind??) !
  641.             -x      -  Create cxref style output (default is Emacs Tags)     !
  642.             -e      -  Emacs tags style output (the default the way I        !
  643.                        compile it)                                           !
  644.                                                                              !
  645.     Having got it working, it works fine!                                    !
  646.   
  647.  
  648.  
  649. Bugs/Problems
  650.  
  651. 63:  Does Emacs have problems with files larger than 8 megabytes?
  652.   
  653.   Most installed versions of GNU Emacs will use 24-bit signed integers (and
  654.   24-bit pointers) internally.  This limits the file size that Emacs can
  655.   handle to 8,388,607 bytes (2^23 - 1).
  656.   
  657.   Leonard N. Zubkoff <lnz@lucid.com> suggests putting the following two
  658.   lines in src/config.h before compiling Emacs to allow for 26-bit integers
  659.   and pointers (and thus filesizes of up to 33,554,431 bytes):
  660.   
  661.     #define VALBITS 26
  662.     #define GCTYPEBITS 5
  663.   
  664.   WARNING: This method may result in `ILLEGAL DATATYPE' and other random
  665.   errors on some machines.
  666.   
  667.   David Gillespie <daveg@csvax.cs.caltech.edu> gives an explanation of why
  668.   Emacs uses 24 bit integers and pointers:
  669.   
  670.     Emacs is largely written in a dialect of Lisp; Lisp is a freely-typed
  671.     language in the sense that you can put any value of any type into any
  672.     variable, or return it from a function, and so on.  So each value must
  673.     carry a "tag" along with it identifying what kind of thing it is, eg.,
  674.     integer, pointer to a list, pointer to an editing buffer, and so on.
  675.     Emacs uses standard 32-bit integers for data objects, taking the top 8
  676.     bits for the tag and the bottom 24 bits for the value.  So integers (and
  677.     pointers) are somewhat restricted compared to true C integers and
  678.     pointers.
  679.   
  680.     Emacs uses 8-bit tags because that's a little faster on byte-oriented
  681.     machines, but there are only really enough tags to require 6 bits.
  682.   
  683. 64:  Why can't Emacs find files in current directory on startup?
  684.   
  685.   The PWD bug has been fixed as of GNU Emacs 18.59.  Read on if you are
  686.   running an older version of Emacs.
  687.  
  688.   Most likely, you have an environment variable named PWD that is set to a
  689.   value other than the name of your current directory.  This is most
  690.   likely caused by using two different shell programs.  `ksh' and (some
  691.   versions of) `csh' set and maintain the value of the PWD environment
  692.   variable, but `sh' doesn't.  If you start sh from ksh, change your
  693.   current directory inside sh, and then start Emacs from inside sh, PWD
  694.   will have the wrong value but Emacs will use this value.  An invalid
  695.   setting for PWD can also be a problem if you use X Windows and csh on an
  696.   RS/6000.  See the etc/OPTIONS file for more details.
  697.   
  698.   Perhaps an easier solution is not to use two shells.  The `chsh' program
  699.   can often be used to change one's default login shell.
  700.   
  701.   You may have PWD set for other reasons.  Another possibility is that you
  702.   are setting default-directory from your .emacs file.
  703.   
  704.   Here is a fix by Jim Blandy <jimb@occs.cs.oberlin.edu>:
  705.   
  706.     >--- emacs/jjj/emacs-18.58/lisp/startup.el    Tue Jan 15 23:19:04 1991
  707.     >+++ startup.el    Mon Apr 20 00:21:01 1992
  708.     >@@ -81,5 +81,7 @@
  709.     >     ;; In presence of symlinks, switch to cleaner form of default directory.
  710.     >     (if (and (not (eq system-type 'vax-vms))
  711.     >-         (getenv "PWD"))
  712.     >+         (getenv "PWD")
  713.     >+          (equal (nthcdr 10 (file-attributes default-directory))
  714.     >+             (nthcdr 10 (file-attributes (getenv "PWD")))))
  715.     >     (setq default-directory (file-name-as-directory (getenv "PWD"))))
  716.     >     (unwind-protect
  717.   
  718. 65:  How do I get rid of the ^M junk in my Shell buffer?
  719.   
  720.   For tcsh, put this in your `.cshrc' (or `.tcshrc') file:
  721.   
  722.     if ($?EMACS) then
  723.         if ("$EMACS" == t) then
  724.         if ($?tcsh) unset edit
  725.         stty nl
  726.     endif
  727.     endif
  728.   
  729.   Or put this in your .emacs_tcsh file:
  730.   
  731.     unset edit
  732.     stty nl
  733.   
  734.   Alternatively, use csh in your Shell buffers instead of tcsh.  One way
  735.   is:
  736.   
  737.     (setq explicit-shell-file-name "/bin/csh") 
  738.   
  739.   and another is to do this in your .cshrc (or .tcshrc) file:
  740.   
  741.     setenv ESHELL /bin/csh
  742.   
  743.   (You must start Emacs over again with the environment variable properly
  744.   set for this to take effect.)
  745.   
  746. 66:  Why do I get `Process shell exited abnormally with code 1'?
  747.   
  748.   The most likely reason for this message is that the `env' program is not
  749.   properly installed.  This program should be compiled (for the correct
  750.   architecture!) and installed with execute permission for everyone in
  751.   Emacs's program directory, which is normally /usr/local/emacs/etc.  You
  752.   can find what this directory is at your site by inspecting the value of
  753.   the variable exec-directory by typing "C-h v exec-directory RET".  `env'
  754.   should also be for the correct architecture (check using `file' command).
  755.   
  756.   You should also check for other programs named `env' in your path (eg.,
  757.   SunOS has a program named /usr/bin/env).  I don't understand why this can
  758.   cause a failure and I don't know a general solution for working around the
  759.   problem in this case.
  760.   
  761.   The `make clean' command will remove `env' and other vital programs, so be
  762.   careful when using it.
  763.   
  764.   It has been reported that this sometimes happened when Emacs was started
  765.   as an X client from an xterm window (ie. had a controlling tty) but the
  766.   xterm was later terminated.
  767.   
  768.   See also etc/PROBLEMS for other possible causes of this message.
  769.   
  770. 67:  Why can't I cut from Emacs and paste in other X programs?
  771.   
  772.   Emacs stores things you "cut" in the X "cut buffers".  It also pastes from
  773.   the cut buffer `CUT_BUFFER0'.  This is obsolete.  Most modern X programs
  774.   now expect to work with "selections" instead of cut buffers, although some
  775.   like `xterm' will try to use the cut buffers if the selection is null.
  776.   
  777.   Emacs 18.58 contains a "fix" that makes xterm work by default.  This
  778.   "fix" is that Emacs clears the `PRIMARY' selection when it stores
  779.   something in the cut buffer.  By making the selection null, xterm will
  780.   then fetch from the cut buffer when you try to paste.
  781.   
  782.   For versions of Emacs prior to 18.58, you can make pasting from Emacs into
  783.   xterm work with the following X resources:
  784.   
  785.     ! Solution by Thomas Narten, should work under X11R3 and later GNU
  786.     ! Emacs only copies to CUT_BUFFER0.  xterm by default wants to paste
  787.     ! from the PRIMARY selection.
  788.     XTerm*VT100.Translations: #override \
  789.         ~Meta <Btn2Up>: insert-selection(CUT_BUFFER0,PRIMARY)
  790.   
  791.   You may have problems copying between Emacs and programs other than xterm
  792.   that won't store cut text in the cut buffers or look in the cut buffers
  793.   for text to paste (for backwards compatibility with obsolete applications
  794.   like Emacs :-).  The best workaround is to use the `xcutsel' program as an
  795.   intermediary.
  796.   
  797.   This problem does not exist for Epoch or Lucid Emacs.
  798.   
  799. 68:  Where is the termcap/terminfo entry for terminal type `emacs'?
  800.   
  801.   The termcap entry for terminal type `emacs' is ordinarily put in the
  802.   TERMCAP environment variable of subshells.  It may help in certain
  803.   situations (eg., using rlogin from shell buffer) to add an entry for
  804.   `emacs' to the system-wide termcap file.  Here is a correct termcap entry
  805.   for `emacs':
  806.   
  807.     emacs:tc=unknown:
  808.   
  809.   To make a terminfo entry for `emacs', use `tic' or `captoinfo'.  You need
  810.   to generate /usr/lib/terminfo/e/emacs.  It may work to simply copy
  811.   /usr/lib/terminfo/d/dumb to /usr/lib/terminfo/e/emacs.
  812.   
  813.   Having a termcap/terminfo entry will not enable the use of full screen
  814.   programs in shell buffers.  Use M-x terminal-emulator for that instead.
  815.   
  816.   A workaround to the problem of missing termcap/terminfo entries is to
  817.   change terminal type `emacs' to type `dumb' or `unknown' in your shell
  818.   start up file.  `csh' users could put this in their .cshrc files:
  819.   
  820.     if ("$term" == emacs) set term=dumb
  821.   
  822. 69:  Why does Emacs spontaneously start displaying `I-search:' and beeping?
  823.   
  824.   Your terminal (or something between your terminal and the computer) is
  825.   sending C-s and C-q for flow control, and Emacs is receiving these
  826.   characters and interpreting them as commands.  (The C-s character normally
  827.   invokes the isearch-forward command.)  For possible solutions, see
  828.   question 131.
  829.   
  830. 70:  Why can't Emacs talk to certain hosts (or certain hostnames)?
  831.   
  832.   The problem may be that Emacs is linked with a wimpier version of
  833.   gethostbyname than the rest of the programs on the machine.  This is often
  834.   manifested as a message on startup of `X server not responding.  Check
  835.   your DISPLAY environment variable.' or a message of `Unknown host' from
  836.   open-network-stream.
  837.   
  838.   On a Sun, this may be because Emacs had to be linked with the static C
  839.   library.  The version of gethostbyname in the static C library may only
  840.   look in /etc/hosts and the NIS (YP) maps, while the version in the dynamic
  841.   C library may be smart enough to check DNS in addition to or instead of
  842.   NIS.  On a Motorola Delta running System V R3.6, the version of
  843.   gethosbyname in the standard library works, but the one that works with
  844.   NIS doesn't (the one you get with -linet).  Other operating systems have
  845.   similar problems.
  846.   
  847.   Try these options:
  848.   
  849.   * Explicitly add the host you want to communicate with to /etc/hosts.
  850.   
  851.   * Relink Emacs with this line in src/config.h:
  852.   
  853.       #define LIBS_SYSTEM -lresolv
  854.   
  855.   * Replace gethostbyname and friends in libc.a with more useful versions
  856.     such as the ones in libresolv.a.  Then relink Emacs.
  857.   
  858.   * If you are actually running NIS, make sure that `ypbind' is properly
  859.     told to do DNS lookups with the correct command line switch.
  860.   
  861.   * Use tcp.el and tcp.c from GNUS.  This has the additional advantage that
  862.     you can use numeric IP addresses instead of names.  open-network-stream
  863.     currently can't handle numeric addresses.  Brian Thomson
  864.     <thomson@hub.toronto.edu> has a enhancement to open-network-stream to
  865.     allow it to handle numeric addresses.
  866.   
  867. 71:  Why does Emacs say `Error in init file'?
  868.   
  869.   An error occurred while loading either your .emacs file or the system-wide
  870.   lisp/default.el file.  For information on how to debug your .emacs file,
  871.   see question 29.
  872.   
  873.   It may be the case that you may need to load some package first, or use a
  874.   hook that will be evaluated after the package is loaded.  A common case of
  875.   this is explained in question 127.
  876.   
  877. 72:  Why does Emacs ignore my X resources (my .Xdefaults file)?
  878.   
  879.   * Try compiling Emacs with the XBACKWARDS macro defined.  There is a bug
  880.     in some implementations of XGetDefault, which do not correspond to the
  881.     documentation or the header files.
  882.   
  883.   * Make sure you are either using the class name of `Emacs' (oops,
  884.     apparently this is buggy in Emacs 18.58!) or the correct instance name.
  885.     The instance name is normally the same as the name of the file Emacs is
  886.     in (ie., the last part of argv[0]), but this can be overridden by -rn
  887.     command line option or the WM_RES_NAME environment variable.
  888.   
  889.     WARNING: Reports say using the class name fails in Emacs 18.58.
  890.   
  891.     WARNING: The advice the man page gives to use `emacs' is often wrong.
  892.   
  893.     WARNING: Older versions of Emacs got the class name wrong.
  894.   
  895.   * Emacs currently ignores the -xrm command line argument.
  896.   
  897.   * Emacs does not yet handle X11R5 screen-specific resources.
  898.   
  899.   * Emacs has a bug where it ignores color specifications if running on a
  900.     1-bit display (ie. a non-color display).
  901.   
  902.   * I don't think Emacs will use either of the application-specific resource
  903.     files.  Thus these environment variables don't affect it: XAPPLRESDIR,
  904.     XUSERFILESEARCHPATH, XFILESEARCHPATH.  {Correct?}
  905.   
  906. 73:  Why does Emacs take 20 seconds to visit a file?
  907.   
  908.   The usual cause is that the master lock file, `!!!SuperLock!!!' has been
  909.   left in the lock directory somehow.  Delete it.
  910.   
  911.   Mark Meuer <meuer@geom.umn.edu> says that NeXT NFS has a bug where an
  912.   exclusive create succeeds but returns an error status.  This can cause the
  913.   same problem.  Since Emacs's file locking doesn't work over NFS anyway,
  914.   the best solution is to recompile Emacs with CLASH_DETECTION undefined.
  915.   
  916. 74:  How do I edit a file with a `$' in its name?
  917.   
  918.   When entering a filename in the minibuffer, Emacs will attempt to expand
  919.   a `$' followed by a word as an environment variable.  To suppress this
  920.   behavior, type "$$" instead.
  921.   
  922. 75:  Why does Shell mode lose track of the shell's current directory?
  923.   
  924.   Emacs has no way of knowing when the shell actually changes its directory.
  925.   This is an intrinsic limitation of Unix.  So it tries to guess by
  926.   recognizing `cd' commands.  If you type `cd' followed by a directory name
  927.   with a variable reference (`cd $HOME/bin') or with a shell metacharacter
  928.   (`cd ../lib*'), Emacs will fail to correctly guess the shell's new current
  929.   directory.  A huge variety of fixes and enhancements to Shell mode for
  930.   this problem have been written to handle this problem.  Check the Lisp
  931.   Code Directory (see question 88).
  932.   
  933. 76:  Why doesn't my change to load-path work?
  934.   
  935.   If you added a directory name containing a tilde (~) to your load-path,
  936.   expecting the tilde to be interpreted as your home directory, then you
  937.   need to do something like this:
  938.   
  939.     (setq load-path (mapcar 'expand-file-name load-path))
  940.   
  941. 77:  Why does the cursor always go to the wrong column when I move up or
  942.  down one line?
  943.   
  944.   You have inadvertently typed "C-x C-n" (set-goal-column) which sets the
  945.   "goal column" to the column where the cursor was.  To undo this type
  946.   "C-u C-x C-n".
  947.   
  948.   If you make this mistake frequently, you might want to unbind or disable
  949.   this command by doing one of these two:
  950.   
  951.     (define-key ctl-x-map "\C-n" nil)
  952.     (put 'set-goal-column 'disabled t)
  953.   
  954. 78:  Why does Emacs hang with message `Unknown XMenu error' with X11R4?
  955.   
  956.   Many different X errors can produce this message.  Here is the solution
  957.   to one problem:
  958.   
  959.   X11 Release 4 (and later, including OpenWindows) enforces some conditions
  960.   in the X protocol that were previously allowed to pass unnoticed.  You
  961.   need to put the X11R4 server into X11R3 bug compatibility mode for Emacs's
  962.   Xmenu code to work.  You can do this with the command `xset bc'.
  963.   
  964. 79:  Why doesn't display-time show the load average in the mode line
  965.  anymore?
  966.   
  967.   In GNU Emacs 18.56, a change was made in the display-time code.
  968.   Formerly, in version 18.55, Emacs used a program named `loadst' to
  969.   notify Emacs of the change in time every minute.  loadst also sent Emacs
  970.   the system load average if it was installed with sufficient privilege to
  971.   get that information (or was on a system where no such privilege was
  972.   needed).  Emacs then displayed this information in the mode line.
  973.   
  974.   In version 18.56, this code was changed to use a program named `wakeup'.
  975.   wakeup doesn't send Emacs any information, it's only purpose is to send
  976.   Emacs *something* every minute, thus invoking the filter function in
  977.   Emacs once a minute.  The filter function in Emacs does all the work of
  978.   finding the time, date, and load average.  However, getting the load
  979.   average requires the privilege to read kernel memory on most systems.
  980.   Since giving Emacs this privilege would destroy any security a system
  981.   might have, for almost everyone this is not an option.  In addition,
  982.   Emacs does not have the code built into it to get this information on
  983.   the systems which have special system calls for this purpose, even
  984.   though loadst had code for this.
  985.   
  986.   The solution I use is to get the files lisp/display-time.el and
  987.   etc/loadst.c from version 18.55 and use those with 18.58.  (I have heard
  988.   a rumor that loadst disappeared because of the legal action Unipress
  989.   threatened against IBM.)
  990.   
  991.   WARNING:  Do not install Emacs setgid kmem unless you wish to destroy
  992.   any security your system might have!!!!!!!!!!
  993.   
  994.   If you are using Emacs 18.55 or earlier, or already using the solution I
  995.   describe above, read further:
  996.   
  997.   The most likely cause of the problem is that `loadst' can't read the
  998.   special file /dev/kmem.  To properly install loadst, it should be either
  999.   setuid to the owner of /dev/kmem, or is should be setgid to the group to
  1000.   which /dev/kmem belongs.  In either case, /dev/kmem should be readable by
  1001.   its owner or its group, respectively.  Assuming the existence of a group
  1002.   named `kmem', here is an example of how to do this:
  1003.   
  1004.     chgrp kmem /dev/kmem
  1005.     chmod g+r /dev/kmem
  1006.     chgrp kmem /usr/local/emacs/etc/loadst
  1007.     chmod g+s /usr/local/emacs/etc/loadst
  1008.   
  1009.   Another possibility is that your version of Unix doesn't have the load
  1010.   average data available in /dev/kmem.  Your version of Unix might have a
  1011.   special system call to retrieve this information (eg., inq_stats under
  1012.   UMAX), and loadst might not have been enhanced to cope with this.
  1013.   
  1014. 80:  Why does ispell sometimes ignore the local dictionary?
  1015.   
  1016.   You need to update the version of Ispell to 2.0.02.  (Or you can switch to
  1017.   version 3.0 which is still in beta-testing.)  A patch is available via
  1018.   anonymous FTP:
  1019.  
  1020.     /archive.cis.ohio-state.edu:pub/gnu/ispell/patch2.Z
  1021.   
  1022.   You also need to change a line in ispell.el from:
  1023.   
  1024.     (defconst ispell-version "2.0.01") ; Check against output of "ispell -v".
  1025.   
  1026.   to:
  1027.   
  1028.     (defconst ispell-version "2.0.02") ; Check against output of "ispell -v".
  1029.   
  1030. 81:  Why does Ispell treat each line as a single word?
  1031.   
  1032.   Ispell expects to get its input one word per line.  The ispell filter,
  1033.   which is specified by the variables ispell-filter-hook and
  1034.   ispell-filter-hook-args, should output at most one word per line.
  1035.   
  1036. 82:  Are there any security risks in GNU Emacs?
  1037.   
  1038.   * the `movemail' incident (No, this is not a risk.)
  1039.   
  1040.     Cliff Stoll in his book `The Cuckoo's Egg' describes this in chapter 4.
  1041.     The site at LBL had installed the `etc/movemail' program setuid root.
  1042.     Since `movemail' had not been designed for this situation, a security
  1043.     hole was created and users could get root priveleges.
  1044.   
  1045.     `movemail' has since been changed so that even if it is installed setuid
  1046.     root this security hole will not be a result.
  1047.   
  1048.     I have heard unverified reports that the Internet worm took advantage of
  1049.     this configuration problem.
  1050.   
  1051.   * the file-local-variable feature (Yes, a risk, but easy to change.)
  1052.   
  1053.     There is an Emacs feature that allows the setting of local values for
  1054.     variables when editing a file by including specially formatted text near
  1055.     the end of the file.  This feature also includes the ability to have
  1056.     arbitrary Emacs Lisp code evaluated when the file is visited.
  1057.     Obviously, there is a potential for Trojan horses to exploit this
  1058.     feature.
  1059.   
  1060.     If you set the variable inhibit-local-variables to a non-nil value,
  1061.     Emacs will display the special local variable settings of a file that
  1062.     you visit and ask you if you really want them.  This variable is not
  1063.     mentioned in the manual.
  1064.   
  1065.     It is wise to do this in lisp/site-init.el before building Emacs:
  1066.   
  1067.       (setq inhibit-local-variables t)
  1068.   
  1069.     If Emacs has already been built, the expression can be put in
  1070.     lisp/default.el instead, or an individual can put it in their own .emacs
  1071.     file.
  1072.   
  1073.     The ability to exploit this feature by sending e-mail to an RMAIL user
  1074.     was fixed sometime after Emacs 18.52.  However, any new package that
  1075.     uses find-file or find-file-noselect has to be careful about this.
  1076.   
  1077.     For more information, see `File Variables' in the online manual (which,
  1078.     incidentally, does not describe how to disable the feature).
  1079.   
  1080.     There is a new variable in Emacs 18.58 named ignore-local-eval which
  1081.     turns out to be useless as currently implemented.  Ignore it.
  1082.   
  1083.   * synthetic X events (Yes, a risk, use MIT-MAGIC-COOKIE-1 or better.)
  1084.   
  1085.     Emacs accepts synthetic X events generated by the SendEvent request as
  1086.     though they were regular events.  As a result, if you are using the
  1087.     trivial host-based authentication, other users who can open X
  1088.     connections to your X workstatation can make your Emacs process do
  1089.     anything, including run other processes with your priveleges.
  1090.   
  1091.     The only fix for this is to prevent other users from being able to open
  1092.     X connections.  The standard way to prevent this is to use a real
  1093.     authentication mechanism, such as MIT-MAGIC-COOKIE-1.  If using the
  1094.     `xauth' program has any effect, then you are probably using
  1095.     MIT-MAGIC-COOKIE-1.  Your site may be using a superior authentication
  1096.     method; ask your system administrator.
  1097.   
  1098.     If real authentication is not a possibility, you may be satisfied by
  1099.     just allowing hosts access for brief intervals while you start your X
  1100.     programs, then removing the access.  This reduces the risk somewhat by
  1101.     narrowing the time window when hostile users would have access, but DOES
  1102.     NOT ELIMINATE THE RISK.
  1103.   
  1104.     Lucid GNU Emacs does not accept synthetic X events unless you set a
  1105.     variable.
  1106.   
  1107.   * autosave file permissions (Yes, a risk, hard to work around.)
  1108.   
  1109.     The file permissions for autosave files are determined solely by the
  1110.     Emacs process's `umask' value.  The permissions of the file being
  1111.     autosaved are not used.  The easiest workaround is to keep sensitive
  1112.     files in protected directories.  Sebastian Kremer has written an
  1113.     enhanced version of the autosave file name picking code that can avoid
  1114.     this problem by keeping autosave files in a protected directory.  {FTP
  1115.     information please?}  This problem will be fixed in Emacs 19.
  1116.   
  1117.  
  1118.  
  1119. Difficulties Building/Installing/Porting Emacs
  1120.  
  1121. 83:  What should I do if I have trouble building Emacs?
  1122.   
  1123.   First look in the file etc/PROBLEMS to see if there is already a solution
  1124.   for your problem.  Next check the FAQ (you're reading it).  If you don't
  1125.   find a solution, then report your problem via e-mail to
  1126.   bug-gnu-emacs@prep.ai.mit.edu.  Please do not post it to gnu.emacs.help or
  1127.   e-mail it to help-gnu-emacs@prep.ai.mit.edu.  For further guidelines, see
  1128.   question 8.
  1129.   
  1130. 84:  How do I stop Emacs from failing when the executable is stripped?
  1131.   
  1132.   Don't do that.
  1133.   
  1134.   This problem has been reported on SGI Indigo machines running Irix 4.0.*
  1135.   and RS/6000 machines.  Scott Henry <scotth@hoshi.corp.SGi.COM> posted a
  1136.   patch that fixes the problem for Irix.
  1137.   
  1138. 85:  Why does linking Emacs with -lX11 fail?
  1139.   
  1140.   Emacs needs to be linked with the static version of the X11 library,
  1141.   libX11.a.  This may be missing.
  1142.   
  1143.   Under OpenWindows, you may need to use `add_services' to add the
  1144.   `OpenWindows Programmers' optional software category from the CD-ROM.
  1145.   
  1146.   Under HP-UX 8.0, you may need to run `update' again to load the
  1147.   X11-PRG `fileset'.  This may be missing even if you specified `all
  1148.   filesets' the first time.  If libcurses.a is missing, you may need to load
  1149.   the `Berkeley Development Option' {???}.
  1150.   
  1151.   If you are building the MIT X11 sources, you may need to modify your
  1152.   `site.cf' file to get static versions of the libraries.  (Info from David
  1153.   Zuhn <zoo@cygnus.com>.)
  1154.   
  1155.   Other systems may have similar problems.  You can always define
  1156.   CANNOT_DUMP and link with the shared libraries instead.
  1157.   
  1158.   To get the Xmenu stuff to work, you need to find a copy of MIT's
  1159.   liboldX.a.
  1160.   
  1161. 86:  Why does Emacs 18.55 say `Fatal error (6).Abort' under SunOS 4.1?
  1162.   
  1163.   I had hoped this question would go away after Emacs 18.57 was released,
  1164.   but people continue to compile 18.55.  Easiest solution: upgrade.
  1165.   
  1166.   This is a result of the SunOS localtime/tzsetwall malloc bug, which was
  1167.   (finally!) fixed in SunOS 4.1.2.  If you actually need the full
  1168.   explanation, send me e-mail.  If you absolutely must compile Emacs 18.55
  1169.   (eg., you are compiling Nemacs), the easiest workaround was to put
  1170.   `#define SYSTEM_MALLOC' in src/config.h.
  1171.   
  1172.  
  1173.  
  1174. ----------------------------------------------------------------------
  1175. Copyright (C) 1990, 1991, 1992 Joseph Brian Wells
  1176. Copyright (C) 1992, 1993 Steven Byrnes
  1177.  
  1178. This list of frequently asked questions about GNU Emacs with answers
  1179. ("FAQ") may be translated into other languages, transformed into other
  1180. formats (e.g. Texinfo, Info, WWW, WAIS, etc.), and updated with new
  1181. information.  The same conditions apply to any derivative of the FAQ as
  1182. apply to the FAQ itself.  Every copy of the FAQ must include this notice
  1183. or an approved translation, information on who is currently maintaining
  1184. the FAQ and how to contact them (including their e-mail address), and
  1185. information on where the latest version of the FAQ is archived (including
  1186. FTP information).  The FAQ may be copied and redistributed under these
  1187. conditions, except that the FAQ may not be embedded in a larger literary
  1188. work unless that work itself allows free copying and redistribution.
  1189.  
  1190.