home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / emacs / help / 5248 < prev    next >
Encoding:
Text File  |  1993-01-05  |  48.7 KB  |  1,178 lines

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