1 This is ../info/xemacs-faq.info, produced by makeinfo version 4.0 from
4 INFO-DIR-SECTION XEmacs Editor
6 * FAQ: (xemacs-faq). XEmacs FAQ.
10 File: xemacs-faq.info, Node: Q4.1.1, Next: Q4.1.2, Prev: Q4.0.12, Up: Subsystems
12 4.1: Web browsing with W3
13 =========================
18 W3 is an advanced graphical browser written in Emacs lisp that runs
19 on XEmacs. It has full support for cascaded style sheets, and more...
21 It has a home web page at
22 `http://www.cs.indiana.edu/elisp/w3/docs.html'.
25 File: xemacs-faq.info, Node: Q4.1.2, Next: Q4.1.3, Prev: Q4.1.1, Up: Subsystems
27 Q4.1.2: How do I run W3 from behind a firewall?
28 -----------------------------------------------
30 There is a long, well-written, detailed section in the W3 manual that
31 describes how to do this. Look in the section entitled "Firewalls".
34 File: xemacs-faq.info, Node: Q4.1.3, Next: Q4.2.1, Prev: Q4.1.2, Up: Subsystems
36 Q4.1.3: Is it true that W3 supports style sheets and tables?
37 ------------------------------------------------------------
39 Yes, and much more. W3, as distributed with the latest XEmacs is a
40 full-featured web browser.
43 File: xemacs-faq.info, Node: Q4.2.1, Next: Q4.2.2, Prev: Q4.1.3, Up: Subsystems
45 4.2: Reading Netnews and Mail with Gnus
46 =======================================
48 Q4.2.1: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, Quassia Gnus, argh!
49 --------------------------------------------------------------------------------
51 The Gnus numbering issues are not meant for mere mortals to know
52 them. If you feel you _must_ enter the muddy waters of Gnus, visit the
53 excellent FAQ, maintained by Justin Sheehy, at:
55 `http://www.ccs.neu.edu/software/contrib/gnus/'
57 See also Gnus home page
58 `http://www.gnus.org/'
61 File: xemacs-faq.info, Node: Q4.2.2, Next: Q4.2.3, Prev: Q4.2.1, Up: Subsystems
63 Q4.2.2: This question intentionally left blank.
64 -----------------------------------------------
66 Obsolete question, left blank to avoid renumbering.
69 File: xemacs-faq.info, Node: Q4.2.3, Next: Q4.2.4, Prev: Q4.2.2, Up: Subsystems
71 Q4.2.3: How do I make Gnus stay within a single frame?
72 ------------------------------------------------------
74 The toolbar code to start Gnus opens the new frame--and it's a
75 feature rather than a bug. If you don't like it, but would still like
76 to click on the seemly icon, use the following code:
78 (defun toolbar-news ()
81 It will redefine the callback function of the icon to just call
82 `gnus', without all the fancy frame stuff.
85 File: xemacs-faq.info, Node: Q4.2.4, Next: Q4.3.1, Prev: Q4.2.3, Up: Subsystems
87 Q4.2.4: How do I customize the From: line?
88 ------------------------------------------
90 How do I change the `From:' line? I have set gnus-user-from-line to
91 Gail Gurman <gail.gurman@sybase.com>
92 , but XEmacs Gnus doesn't use it. Instead it uses
93 Gail Mara Gurman <gailg@deall>
94 and then complains that it's incorrect. Also, as you perhaps can see,
95 my Message-ID is screwy. How can I change that?
97 Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:
99 Set `user-mail-address' to `gail.gurman@sybase.com' or
100 `mail-host-address' to `sybase.com'.
103 File: xemacs-faq.info, Node: Q4.3.1, Next: Q4.3.2, Prev: Q4.2.4, Up: Subsystems
105 4.3: Other Mail & News
106 ======================
108 Q4.3.1: How can I read and/or compose MIME messages?
109 ----------------------------------------------------
111 VM supports MIME natively.
113 You probably want to use the Tools for MIME (tm). *Note Q4.3.2::,
116 Trey Jackson <trey@cs.berkeley.edu> has an Emacs & MIME web page at
117 `http://bmrc.berkeley.edu/~trey/emacs/mime.html'.
119 Another possibility is RMIME. You may find RMIME at
120 `http://www.cinti.net/~rmoody/rmime/index.html'.
123 File: xemacs-faq.info, Node: Q4.3.2, Next: Q4.3.3, Prev: Q4.3.1, Up: Subsystems
125 Q4.3.2: What is TM and where do I get it?
126 -----------------------------------------
128 TM stands for "Tools for MIME" and not Tiny MIME. TM integrates
129 with all major XEmacs packages like Gnus (all flavors), VM, MH-E, and
130 mailcrypt. It provides totally transparent and trouble-free MIME
131 support. When appropriate a message will be decoded in place in an
134 TM now comes as a package with XEmacs 19.16 and XEmacs 20.2.
136 TM was written by MORIOKA Tomohiko <morioka@jaist.ac.jp> and
137 KOBAYASHI Shuhei <shuhei-k@jaist.ac.jp>.
139 It is based on the work of UMEDA Masanobu
140 <umerin@mse.kyutech.ac.jp>, the original writer of GNUS.
142 The following information is from the `README':
144 "tm" is a MIME package for GNU Emacs. tm has following functions:
146 * MIME style multilingual header.
148 * MIME message viewer (mime/viewer-mode).
150 * MIME message composer (mime/editor-mode).
152 * MIME extenders for mh-e, GNUS, RMAIL and VM.
154 tm is available from following anonymous ftp sites:
155 * `ftp://ftp.unicamp.br/pub/mail/mime/tm/' (Brasil).
157 * `ftp://ftp.th-darmstadt.de/pub/editors/GNU-Emacs/lisp/mime/'
160 * `ftp://ftp.tnt.uni-hannover.de/pub/editors/xemacs/contrib/'
163 Don't let the installation procedure & instructions stop you from
164 trying this package out--it's much simpler than it looks, and once
165 installed, trivial to use.
168 File: xemacs-faq.info, Node: Q4.3.3, Next: Q4.3.4, Prev: Q4.3.2, Up: Subsystems
170 Q4.3.3: Why isn't this `movemail' program working?
171 --------------------------------------------------
173 Ben Wing <ben@xemacs.org> writes:
175 It wasn't chown'ed/chmod'd correctly.
178 File: xemacs-faq.info, Node: Q4.3.4, Next: Q4.3.5, Prev: Q4.3.3, Up: Subsystems
180 Q4.3.4: Movemail is also distributed by Netscape? Can that cause problems?
181 ---------------------------------------------------------------------------
183 Steve Baur <steve@xemacs.org> writes:
185 Yes. Always use the movemail installed with your XEmacs. Failure
186 to do so can result in lost mail.
188 Please refer to Jamie Zawinski's <jwz@jwz.org> notes at
189 `http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/movemail.html'.
190 In particular, this document will show you how to make Netscape use the
191 version of movemail configured for your system by the person who built
195 File: xemacs-faq.info, Node: Q4.3.5, Next: Q4.4.1, Prev: Q4.3.4, Up: Subsystems
197 Q4.3.5: Where do I find pstogif (required by tm)?
198 -------------------------------------------------
200 pstogif is part of the latex2html package.
202 Jan Vroonhof <vroonhof@math.ethz.ch> writes:
204 latex2html is best found at the CTAN hosts and their mirrors in
205 `tex-archive/support/latex2html'.
209 * `ftp://ftp.tex.ac.uk/tex-archive/support/latex2html/'.
211 * `ftp://ftp.dante.de/tex-archive/support/latex2html/'.
213 There is a good mirror at ftp.cdrom.com;
214 `ftp://ftp.cdrom.com/pub/tex/ctan/support/latex2html/'.
217 File: xemacs-faq.info, Node: Q4.4.1, Next: Q4.4.2, Prev: Q4.3.5, Up: Subsystems
219 4.4: Sparcworks, EOS, and WorkShop
220 ==================================
222 Q4.4.1: What is SPARCworks, EOS, and WorkShop?
223 ----------------------------------------------
225 John Turner <turner@lanl.gov> writes:
227 SPARCworks is SunSoft's development environment, comprising
228 compilers (C, C++, FORTRAN 77, Fortran 90, Ada, and Pascal), a
229 debugger, and other tools such as TeamWare (for configuration
230 management), MakeTool, etc.
232 See `http://www.sun.com/software/Developer-products/' for more info.
234 EOS stands for "Era on SPARCworks", but I don't know what Era stands
237 EOS is the integration of XEmacs with the SPARCworks debugger. It
238 allows one to use an XEmacs frame to view code (complete with
239 fontification, etc.), set breakpoints, print variables, etc., while
240 using the SPARCworks debugger. It works very well and I use it all the
243 Chuck Thompson <cthomp@xemacs.org> writes:
245 Era stood for "Emacs Rewritten Again". It was what we were
246 calling the modified version of Lucid Emacs for Sun when I was
247 dragged, er, allowed to work on this wonderful editor.
249 Martin Buchholz <martin@xemacs.org> writes:
251 EOS is being replaced with a new graphical development environment
252 called Sun WorkShop, which is currently (07/96) in Alpha Test.
253 For more details, check out
254 `http://www.sun.com/software/Products/Developer-products'.
257 File: xemacs-faq.info, Node: Q4.4.2, Next: Q4.5.1, Prev: Q4.4.1, Up: Subsystems
259 Q4.4.2: How do I start the Sun Workshop support in XEmacs 21?
260 -------------------------------------------------------------
262 Add the switch --with-workshop to the configure command when building
263 XEmacs and put the following in one of your startup files (e.g.
264 site-start.el or .emacs):
266 (when (featurep 'tooltalk)
267 (load "tooltalk-macros")
268 (load "tooltalk-util")
269 (load "tooltalk-init"))
270 (when (featurep 'sparcworks)
277 If you are not using the latest Workshop (5.0) you have to apply the
280 --- /opt/SUNWspro/lib/eserve.el.ORIG Fri May 14 15:23:26 1999
281 +++ /opt/SUNWspro/lib/eserve.el Fri May 14 15:24:54 1999
283 (defvar running-xemacs nil "t if we're running XEmacs")
284 (defvar running-emacs nil "t if we're running GNU Emacs 19")
286 -(if (string-match "^\\(19\\|20\\)\..*\\(XEmacs\\|Lucid\\)" emacs-version)
287 +(if (string-match "\\(XEmacs\\|Lucid\\)" emacs-version)
288 (setq running-xemacs t)
289 (setq running-emacs t))
292 File: xemacs-faq.info, Node: Q4.5.1, Next: Q4.6.1, Prev: Q4.4.2, Up: Subsystems
297 Q4.5.1: What is/was Energize?
298 -----------------------------
300 David N Gray <gray@meteor.harlequin.com> writes:
301 The files in `lisp/energize' are to enable Emacs to interface with
302 the "Energize Programming System", a C and C++ development
303 environment, which was a product of Lucid, Inc. Tragically, Lucid
304 went out of business in 1994, so although Energize is still a
305 great system, if you don't already have it, there isn't any way to
306 get it now. (Unless you happen to be in Japan; INS Engineering
307 may still be selling it there. Tartan bought the rights to sell
308 it in the rest of the world, but never did so.)
311 File: xemacs-faq.info, Node: Q4.6.1, Next: Q4.7.1, Prev: Q4.5.1, Up: Subsystems
316 Q4.6.1: What is Infodock?
317 -------------------------
319 InfoDock is an integrated productivity toolset, mainly aimed at
320 technical people. It is developed and supported by InfoDock
321 Associates, a firm that offers custom support and development for
322 InfoDock, XEmacs and GNU Emacs. ( `http://www.infodock.com',
323 <info@infodock.com>, +1 408 243 3300).
325 InfoDock is built atop the XEmacs variant of GNU Emacs and so has
326 all of the power of Emacs, but with an easier to use and more
327 comprehensive menu-based user interface. The bottom portion of this
328 text describes how it differs from XEmacs and GNU Emacs from the Free
331 InfoDock is aimed at people who want a free, turn-key productivity
332 environment. Although InfoDock is customizable, it is not intended for
333 people who like basic versions of Emacs which need to be customized
334 extensively for local use; standard Emacs distributions are better for
335 such uses. InfoDock is for those people who want a complete,
336 pre-customized environment in one package, which they need not touch
337 more than once or twice a year to update to new revisions.
339 InfoDock is pre-built for SPARC SunOS/Solaris systems, PA-RISC HP-UX,
340 and Intel Linux systems. It is intended for use on a color display,
341 although most features will work on monochrome monitors. Simply unpack
342 InfoDock according to the instructions in the ID-INSTALL file and you
345 The InfoDock Manual is concise, yet sufficient as a user guide for
346 users who have never used an Emacs-type editor before. For users who
347 are already familiar with Emacs, it supplements the information in the
350 InfoDock menus are much more extensive and more mature than standard
351 Emacs menus. Each menu offers a `Manual' item which displays
352 documentation associated with the menu's functions.
354 Four types of menubars are provided:
355 1. An extensive menubar providing access to global InfoDock commands.
357 2. Mode-specific menubars tailored to the current major mode.
359 3. A simple menubar for basic editing to help novices get started
362 4. The standard XEmacs menubar.
364 Most modes also include mode-specific popup menus. Additionally,
365 region and rectangle popup menus are included.
367 `Hyperbole', the everyday information manager, is a core part of
368 InfoDock. This provides context-sensitive mouse keys, a rolodex-type
369 contact manager, programmable hypertext buttons, and an autonumbered
370 outliner with embedded hyperlink anchors.
372 The `OO-Browser', a multi-language object-oriented code browser, is a
373 standard part of InfoDock.
375 InfoDock saves a more extensive set of user options than other Emacs
378 InfoDock inserts a useful file header in many file types, showing the
379 author, summary, and last modification time of each file. A summary
380 program can then be used to summarize all of the files in a directory,
381 for easy MANIFEST file creation.
383 Your working set of buffers is automatically saved and restored (if
384 you answer yes to a prompt) between InfoDock sessions.
386 Refined color choices for code highlighting are provided for both
387 dark and light background display frames.
389 The `C-z' key prefix performs frame-based commands which parallel the
390 `C-x' key prefix for window-based commands.
392 The Smart Menu system is included for producing command menus on dumb
395 Lisp libraries are better categorized according to function.
397 Extensions and improvements to many areas of Emacs are included,
398 such as: paragraph filling, mail reading with Rmail, shell handling,
399 outlining, code highlighting and browsing, and man page browsing.
401 InfoDock questions, answers and discussion should go to the mail list
402 <infodock@infodock.com>. Use <infodock-request@infodock.com> to be
403 added or removed from the list. Always include your InfoDock version
404 number when sending help requests.
406 InfoDock is available across the Internet via anonymous FTP. To get
407 it, first move to a directory into which you want the InfoDock archive
408 files placed. We will call this <DIST-DIR>.
412 Ftp to ftp.xemacs.org (Internet Host ID = 128.174.252.16):
414 prompt> ftp ftp.xemacs.org
416 Login as `anonymous' with your own <user-id>@<site-name> as a
419 Name (ftp.xemacs.org): anonymous
420 331 Guest login ok, send your complete e-mail address as password.
421 Password: -<your-user-id>@<your-domain>
422 230 Guest login ok, access restrictions apply.
424 Move to the location of the InfoDock archives:
428 Set your transfer mode to binary:
436 Interactive mode off.
438 Retrieve the InfoDock archives that you want, either by using a `get
439 <file>' for each file you want or by using the following to get a
440 complete distribution, including all binaries:
445 Close the FTP connection:
450 Read the `ID-INSTALL' file which you just retrieved for step-by-step
451 installation instructions.
454 File: xemacs-faq.info, Node: Q4.7.1, Next: Q4.7.2, Prev: Q4.6.1, Up: Subsystems
456 4.7: Other Unbundled Packages
457 =============================
459 Q4.7.1: What is AUC TeX? Where do you get it?
460 ----------------------------------------------
462 AUC TeX is a package written by Per Abrahamsen <abraham@dina.kvl.dk>.
463 Starting with XEmacs 19.16, AUC TeX is bundled with XEmacs. The
464 following information is from the `README' and website.
466 AUC TeX is an extensible package that supports writing and formatting
467 TeX files for most variants of GNU Emacs. Many different macro packages
468 are supported, including AMS TeX, LaTeX, and TeXinfo.
470 The most recent version is always available by ftp at
471 `ftp://sunsite.auc.dk/packages/auctex/auctex.tar.gz'.
473 In case you don't have access to anonymous ftp, you can get it by an
474 email request to <ftpmail@decwrl.dec.com>.
476 WWW users may want to check out the AUC TeX page at
477 `http://sunsite.auc.dk/auctex/'.
480 File: xemacs-faq.info, Node: Q4.7.2, Next: Q4.7.3, Prev: Q4.7.1, Up: Subsystems
482 Q4.7.2: Are there any Emacs Lisp Spreadsheets?
483 ----------------------------------------------
485 Yes. Check out "dismal" (which stands for Dis' Mode Ain't Lotus) at
486 `ftp://cs.nyu.edu/pub/local/fox/dismal/'.
489 File: xemacs-faq.info, Node: Q4.7.3, Next: Q4.7.4, Prev: Q4.7.2, Up: Subsystems
491 Q4.7.3: [This question intentionally left blank]
492 ------------------------------------------------
495 File: xemacs-faq.info, Node: Q4.7.4, Next: Q4.7.5, Prev: Q4.7.3, Up: Subsystems
497 Q4.7.4: Problems installing AUC TeX.
498 ------------------------------------
500 Jan Vroonhof <vroonhof@math.ethz.ch> writes:
502 AUC TeX works fine on both stock Emacs and XEmacs has been doing
503 so for a very very long time. This is mostly due to the work of
504 Per Abrahamsen <abraham@dina.kvl.dk> (clap clap) in particular his
505 `easymenu' package. Which leads to what is probably the problem...
507 Most problems with AUC TeX are one of two things:
509 * The TeX-lisp-directory in `tex-site.el' and the makefile don't
512 Fix: make sure you configure AUC TeX properly *before* installing.
514 * You have an old version of easymenu.el in your path.
516 Fix: use `locate-library' and remove old versions to make sure it
517 *only* finds the one that came with XEmacs.
520 File: xemacs-faq.info, Node: Q4.7.5, Next: Q4.7.6, Prev: Q4.7.4, Up: Subsystems
522 Q4.7.5: Is there a reason for an Emacs package not to be included in XEmacs?
523 ----------------------------------------------------------------------------
525 The reason for an Emacs package not to be included in XEmacs is
526 usually one or more of the following:
528 1. The package has not been ported to XEmacs. This will typically
529 happen when it uses GNU-Emacs-specific features, which make it
532 Porting a package to XEmacs can range from a trivial amount of
533 change to a partial or full rewrite. Fortunately, the authors of
534 modern packages usually choose to support both Emacsen themselves.
536 2. The package has been decided not to be appropriate for XEmacs. It
537 may have an equivalent or better replacement within XEmacs, in
538 which case the developers may choose not to burden themselves with
539 supporting an additional package.
541 Each package bundled with XEmacs means more work for the
542 maintainers, whether they want it or not. If you are ready to
543 take over the maintenance responsibilities for the package you
544 port, be sure to say so--we will more likely include it.
546 3. The package simply hasn't been noted by the XEmacs development. If
547 that's the case, the messages like yours are very useful for
548 attracting our attention.
550 4. The package was noted by the developers, but they simply haven't
551 yet gotten around to including/porting it. Wait for the next
552 release or, even better, offer your help. It will be gladly
553 accepted and appreciated.
556 File: xemacs-faq.info, Node: Q4.7.6, Prev: Q4.7.5, Up: Subsystems
558 Q4.7.5: Is there a MatLab mode?
559 -------------------------------
561 Yes, a matlab mode and other items are available at the MathWorks'
562 emacs_add_ons ftp directory
563 (ftp://ftp.mathworks.com/pub/contrib/emacs_add_ons).
566 File: xemacs-faq.info, Node: Miscellaneous, Next: MS Windows, Prev: Subsystems, Up: Top
568 5 The Miscellaneous Stuff
569 *************************
571 This is part 5 of the XEmacs Frequently Asked Questions list. This
572 section is devoted to anything that doesn't fit neatly into the other
578 * Q5.0.1:: How can I do source code highlighting using font-lock?
579 * Q5.0.2:: I do not like cc-mode. How do I use the old c-mode?
580 * Q5.0.3:: How do I get `More' Syntax Highlighting on by default?
581 * Q5.0.4:: How can I enable auto-indent and/or Filladapt?
582 * Q5.0.5:: How can I get XEmacs to come up in text/auto-fill mode by default?
583 * Q5.0.6:: How do I start up a second shell buffer?
584 * Q5.0.7:: Telnet from shell filters too much.
585 * Q5.0.8:: Why does edt emulation not work?
586 * Q5.0.9:: How can I emulate VI and use it as my default mode?
587 * Q5.0.10:: [This question intentionally left blank]
588 * Q5.0.11:: [This question intentionally left blank]
589 * Q5.0.12:: How do I disable gnuserv from opening a new frame?
590 * Q5.0.13:: How do I start gnuserv so that each subsequent XEmacs is a client?
591 * Q5.0.14:: Strange things are happening in Shell Mode.
592 * Q5.0.15:: Where do I get the latest CC Mode?
593 * Q5.0.16:: I find auto-show-mode disconcerting. How do I turn it off?
594 * Q5.0.17:: How can I get two instances of info?
595 * Q5.0.18:: [This question intentionally left blank]
596 * Q5.0.19:: Is there something better than LaTeX mode?
597 * Q5.0.20:: Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient?
599 Emacs Lisp Programming Techniques:
600 * Q5.1.1:: The difference in key sequences between XEmacs and GNU Emacs?
601 * Q5.1.2:: Can I generate "fake" keyboard events?
602 * Q5.1.3:: Could you explain `read-kbd-macro' in more detail?
603 * Q5.1.4:: What is the performance hit of `let'?
604 * Q5.1.5:: What is the recommended use of `setq'?
605 * Q5.1.6:: What is the typical misuse of `setq'?
606 * Q5.1.7:: I like the `do' form of cl, does it slow things down?
607 * Q5.1.8:: I like recursion, does it slow things down?
608 * Q5.1.9:: How do I put a glyph as annotation in a buffer?
609 * Q5.1.10:: `map-extents' won't traverse all of my extents!
610 * Q5.1.11:: My elisp program is horribly slow. Is there an easy way to find out where it spends time?
613 * Q5.2.1:: How do I turn off the sound?
614 * Q5.2.2:: How do I get funky sounds instead of a boring beep?
615 * Q5.2.3:: What's NAS, how do I get it?
616 * Q5.2.4:: Sunsite sounds don't play.
619 * Q5.3.1:: How do you make XEmacs indent CL if-clauses correctly?
620 * Q5.3.2:: [This question intentionally left blank]
621 * Q5.3.3:: How can I print WYSIWYG a font-locked buffer?
622 * Q5.3.4:: Getting M-x lpr to work with postscript printer.
623 * Q5.3.5:: How do I specify the paths that XEmacs uses for finding files?
624 * Q5.3.6:: [This question intentionally left blank]
625 * Q5.3.7:: Can I have the end of the buffer delimited in some way?
626 * Q5.3.8:: How do I insert today's date into a buffer?
627 * Q5.3.9:: Are only certain syntactic character classes available for abbrevs?
628 * Q5.3.10:: How can I get those oh-so-neat X-Face lines?
629 * Q5.3.11:: How do I add new Info directories?
630 * Q5.3.12:: What do I need to change to make printing work?
633 File: xemacs-faq.info, Node: Q5.0.1, Next: Q5.0.2, Prev: Miscellaneous, Up: Miscellaneous
635 5.0: Major & Minor Modes
636 ========================
638 Q5.0.1: How can I do source code highlighting using font-lock?
639 --------------------------------------------------------------
641 For most modes, font-lock is already set up and just needs to be
642 turned on. This can be done by adding the line:
646 to your `init.el'/`.emacs'. (You can turn it on for the current
647 buffer and session only by `M-x font-lock-mode'.) See the file
648 `etc/sample.init.el' (`etc/sample.emacs' in XEmacs versions prior to
649 21.4) for more information.
651 See also `Syntax Highlighting' from the `Options' menu. Remember to
655 File: xemacs-faq.info, Node: Q5.0.2, Next: Q5.0.3, Prev: Q5.0.1, Up: Miscellaneous
657 Q5.0.2: I do not like cc-mode. How do I use the old c-mode?
658 ------------------------------------------------------------
660 Well, first off, consider if you really want to do this. cc-mode is
661 much more powerful than the old c-mode. If you're having trouble
662 getting your old offsets to work, try using `c-set-offset' instead.
663 You might also consider using the package `cc-compat'.
665 But, if you still insist, add the following lines to your
668 (fmakunbound 'c-mode)
669 (makunbound 'c-mode-map)
670 (fmakunbound 'c++-mode)
671 (makunbound 'c++-mode-map)
672 (makunbound 'c-style-alist)
673 (load-library "old-c-mode")
674 (load-library "old-c++-mode")
676 This must be done before any other reference is made to either
680 File: xemacs-faq.info, Node: Q5.0.3, Next: Q5.0.4, Prev: Q5.0.2, Up: Miscellaneous
682 Q5.0.3: How do I get `More' Syntax Highlighting on by default?
683 --------------------------------------------------------------
685 Use the following code in your `init.el'/`.emacs':
687 (setq-default font-lock-maximum-decoration t)
689 See also `Syntax Highlighting' from the `Options' menu. Remember to
693 File: xemacs-faq.info, Node: Q5.0.4, Next: Q5.0.5, Prev: Q5.0.3, Up: Miscellaneous
695 Q5.0.4: How can I enable auto-indent and/or Filladapt?
696 ------------------------------------------------------
698 Put the following line in your `init.el'/`.emacs':
700 (setq indent-line-function 'indent-relative-maybe)
702 If you want to get fancy, try the `filladapt' package available
703 standard with XEmacs. Put this into your `init.el'/`.emacs':
706 (setq-default filladapt-mode t)
707 (add-hook 'c-mode-hook 'turn-off-filladapt-mode)
709 This will enable Filladapt for all modes except C mode, where it
710 doesn't work well. To turn Filladapt on only in particular major
711 modes, remove the `(setq-default ...)' line and use
712 `turn-on-filladapt-mode', like this:
714 (add-hook 'text-mode-hook 'turn-on-filladapt-mode)
716 You can customize filling and adaptive filling with Customize.
717 Select from the `Options' menu `Advanced
718 (Customize)->Emacs->Editing->Fill->Fill...' or type `M-x customize
721 Note that well-behaving text-lookalike modes will run
722 `text-mode-hook' by default (e.g. that's what Message does). For the
723 nasty ones, you'll have to provide the `add-hook's yourself.
725 Please note that the `fa-extras' package is no longer useful.
728 File: xemacs-faq.info, Node: Q5.0.5, Next: Q5.0.6, Prev: Q5.0.4, Up: Miscellaneous
730 Q5.0.5: How can I get XEmacs to come up in text/auto-fill mode by default?
731 --------------------------------------------------------------------------
733 Try the following lisp in your `init.el'/`.emacs':
735 (setq default-major-mode 'text-mode)
736 (setq text-mode-hook 'turn-on-auto-fill)
738 *WARNING*: note that changing the value of `default-major-mode' from
739 `fundamental-mode' can break a large amount of built-in code that
740 expects newly created buffers to be in `fundamental-mode'. (Changing
741 from `fundamental-mode' to `text-mode' might not wreak too much havoc,
742 but changing to something more exotic like a lisp-mode would break many
745 Note that Emacs by default starts up in buffer `*scratch*' in
746 `initial-major-mode', which defaults to `lisp-interaction-mode'. Thus
747 adding the following form to your Emacs init file will cause the
748 initial `*scratch*' buffer to be put into auto-fill'ed `text-mode':
750 (setq initial-major-mode
753 (turn-on-auto-fill)))
755 Note that after your init file is loaded, if
756 `inhibit-startup-message' is `nil' (the default) and the startup buffer
757 is `*scratch*' then the startup message will be inserted into
758 `*scratch*'; it will be removed after a timeout by erasing the entire
759 `*scratch*' buffer. Keep in mind this default usage of `*scratch*' if
760 you desire any prior manipulation of `*scratch*' from within your Emacs
761 init file. In particular, anything you insert into `*scratch*' from
762 your init file will be later erased. Also, if you change the mode of
763 the `*scratch*' buffer, be sure that this will not interfere with
764 possible later insertion of the startup message (e.g. if you put
765 `*scratch*' into a nonstandard mode that has automatic font lock rules,
766 then the startup message might get fontified in a strange foreign
767 manner, e.g. as code in some programming language).
770 File: xemacs-faq.info, Node: Q5.0.6, Next: Q5.0.7, Prev: Q5.0.5, Up: Miscellaneous
772 Q5.0.6: How do I start up a second shell buffer?
773 ------------------------------------------------
775 In the `*shell*' buffer:
777 M-x rename-buffer <RET> *shell-1* <RET>
780 This will then start a second shell. The key is that no buffer named
781 `*shell*' can exist. It might be preferable to use `M-x
782 rename-uniquely' to rename the `*shell*' buffer instead of `M-x
785 Alternately, you can set the variable `shell-multiple-shells'. If
786 the value of this variable is non-nil, each time shell mode is invoked,
790 File: xemacs-faq.info, Node: Q5.0.7, Next: Q5.0.8, Prev: Q5.0.6, Up: Miscellaneous
792 Q5.0.7: Telnet from shell filters too much
793 ------------------------------------------
795 I'm using the Emacs `M-x shell' function, and I would like to invoke
796 and use a telnet session within it. Everything works fine except that
797 now all `^M''s are filtered out by Emacs. Fixes?
799 Use `M-x rsh' or `M-x telnet' to open remote sessions rather than
800 doing rsh or telnet within the local shell buffer. Starting with
801 XEmacs-20.3 you can also use `M-x ssh' to open secure remote session if
802 you have `ssh' installed.
805 File: xemacs-faq.info, Node: Q5.0.8, Next: Q5.0.9, Prev: Q5.0.7, Up: Miscellaneous
807 Q5.0.8: Why does edt emulation not work?
808 ----------------------------------------
810 We don't know, but you can use tpu-edt emulation instead, which works
811 fine and is a little fancier than the standard edt emulation. To do
812 this, add the following line to your `init.el'/`.emacs':
816 If you don't want it to replace `C-h' with an edt-style help menu
819 (global-set-key [(control h)] 'help-for-help)
822 File: xemacs-faq.info, Node: Q5.0.9, Next: Q5.0.10, Prev: Q5.0.8, Up: Miscellaneous
824 Q5.0.9: How can I emulate VI and use it as my default mode?
825 -----------------------------------------------------------
827 Our recommended VI emulator is viper. To make viper-mode the default,
828 add this to your `init.el'/`.emacs':
832 Michael Kifer <kifer@CS.SunySB.EDU> writes:
834 This should be added as close to the top of `init.el'/`.emacs' as
835 you can get it, otherwise some minor modes may not get viper-ized.
838 File: xemacs-faq.info, Node: Q5.0.10, Next: Q5.0.11, Prev: Q5.0.9, Up: Miscellaneous
840 Q5.0.10: [This question intentionally left blank]
841 -------------------------------------------------
843 Obsolete question, left blank to avoid renumbering
846 File: xemacs-faq.info, Node: Q5.0.11, Next: Q5.0.12, Prev: Q5.0.10, Up: Miscellaneous
848 Q5.0.11: [This question intentionally left blank]
849 -------------------------------------------------
851 Obsolete question, left blank to avoid renumbering
854 File: xemacs-faq.info, Node: Q5.0.12, Next: Q5.0.13, Prev: Q5.0.11, Up: Miscellaneous
856 Q5.0.12: How do I disable gnuserv from opening a new frame?
857 -----------------------------------------------------------
859 If you set the `gnuserv-frame' variable to the frame that should be
860 used to display buffers that are pulled up, a new frame will not be
861 created. For example, you could put
863 (setq gnuserv-frame (selected-frame))
865 early on in your `init.el'/`.emacs', to ensure that the first frame
866 created is the one used for your gnuserv buffers.
868 There is an option to set the gnuserv target to the current frame.
869 See `Options->Display->"Other Window" Location->Make Current Frame
872 Starting with XEmacs-20.3 you can also change this with Customize.
873 Select from the `Options' menu `Advanced
874 (Customize)->Emacs->Environment->Gnuserv->Gnuserv Frame...' or type
875 `M-x customize <RET> gnuserv <RET>'.
878 File: xemacs-faq.info, Node: Q5.0.13, Next: Q5.0.14, Prev: Q5.0.12, Up: Miscellaneous
880 Q5.0.13: How do I start gnuserv so that each subsequent XEmacs is a client?
881 ---------------------------------------------------------------------------
883 Put the following in your `init.el'/`.emacs' file to start the
888 Start your first XEmacs as usual. After that, you can do:
890 gnuclient randomfilename
892 from the command line to get your existing XEmacs process to open a
893 new frame and visit randomfilename in that window. When you're done
894 editing randomfilename, hit `C-x #' to kill the buffer and get rid of
897 See also man page of gnuclient.
900 File: xemacs-faq.info, Node: Q5.0.14, Next: Q5.0.15, Prev: Q5.0.13, Up: Miscellaneous
902 Q5.0.14: Strange things are happening in Shell Mode.
903 ----------------------------------------------------
905 Sometimes (i.e. it's not repeatable, and I can't work out why it
906 happens) when I'm typing into shell mode, I hit return and only a
907 portion of the command is given to the shell, and a blank prompt is
908 returned. If I hit return again, the rest of the previous command is
911 Martin Buchholz <martin@xemacs.org> writes:
913 There is a known problem with interaction between `csh' and the
914 `filec' option and XEmacs. You should add the following to your
917 if ( "$TERM" == emacs || "$TERM" == unknown ) unset filec
920 File: xemacs-faq.info, Node: Q5.0.15, Next: Q5.0.16, Prev: Q5.0.14, Up: Miscellaneous
922 Q5.0.15: Where do I get the latest CC Mode?
923 -------------------------------------------
925 Barry A. Warsaw <bwarsaw@cnri.reston.va.us> writes:
927 This can be had from `http://www.python.org/emacs/'.
930 File: xemacs-faq.info, Node: Q5.0.16, Next: Q5.0.17, Prev: Q5.0.15, Up: Miscellaneous
932 Q5.0.16: I find auto-show-mode disconcerting. How do I turn it off?
933 --------------------------------------------------------------------
935 `auto-show-mode' controls whether or not a horizontal scrollbar
936 magically appears when a line is too long to be displayed. This is
937 enabled by default. To turn it off, put the following in your
940 (setq auto-show-mode nil)
941 (setq-default auto-show-mode nil)
944 File: xemacs-faq.info, Node: Q5.0.17, Next: Q5.0.18, Prev: Q5.0.16, Up: Miscellaneous
946 Q5.0.17: How can I get two instances of info?
947 ---------------------------------------------
949 Before 21.4, you can't. The `info' package does not provide for
950 multiple info buffers. In 21.4, this should be fixed. #### how?
953 File: xemacs-faq.info, Node: Q5.0.18, Next: Q5.0.19, Prev: Q5.0.17, Up: Miscellaneous
955 Q5.0.18: [This question intentionally left blank]
956 -------------------------------------------------
959 File: xemacs-faq.info, Node: Q5.0.19, Next: Q5.0.20, Prev: Q5.0.18, Up: Miscellaneous
961 Q5.0.19: Is there something better than LaTeX mode?
962 ---------------------------------------------------
964 David Kastrup <dak@fsnif.neuroinformatik.ruhr-uni-bochum.de> writes:
966 The standard TeX modes leave much to be desired, and are somewhat
967 leniently maintained. Serious TeX users use AUC TeX (*note
971 File: xemacs-faq.info, Node: Q5.0.20, Next: Q5.1.1, Prev: Q5.0.19, Up: Miscellaneous
973 Q5.0.20: Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient?
974 ---------------------------------------------------------------------------------------------------------
976 Jan Vroonhof <vroonhof@math.ethz.ch> writes:
977 Here is one of the solutions, we have this in a script called
980 if gnuclient -batch -eval t >/dev/null 2>&1
982 exec gnuclient ${1+"$@"}
984 xemacs -unmapped -f gnuserv-start &
985 until gnuclient -batch -eval t >/dev/null 2>&1
989 exec gnuclient ${1+"$@"}
992 Note that there is a known problem when running XEmacs and
993 'gnuclient -nw' on the same TTY.
996 File: xemacs-faq.info, Node: Q5.1.1, Next: Q5.1.2, Prev: Q5.0.20, Up: Miscellaneous
998 5.1: Emacs Lisp Programming Techniques
999 ======================================
1001 Q5.1.1: What is the difference in key sequences between XEmacs and GNU Emacs?
1002 -----------------------------------------------------------------------------
1004 Erik Naggum <clerik@naggum.no> writes;
1006 Emacs has a legacy of keyboards that produced characters with
1007 modifier bits, and therefore map a variety of input systems into
1008 this scheme even today. XEmacs is instead optimized for X events.
1009 This causes an incompatibility in the way key sequences are
1010 specified, but both Emacs and XEmacs will accept a key sequence as
1011 a vector of lists of modifiers that ends with a key, e.g., to bind
1012 `M-C-a', you would say `[(meta control a)]' in both Emacsen.
1013 XEmacs has an abbreviated form for a single key, just (meta
1014 control a). Emacs has an abbreviated form for the Control and the
1015 Meta modifiers to string-characters (the ASCII characters), as in
1016 `\M-\C-a'. XEmacs users need to be aware that the abbreviated
1017 form works only for one-character key sequences, while Emacs users
1018 need to be aware that the string-character is rather limited.
1019 Specifically, the string-character can accommodate only 256
1020 different values, 128 of which have the Meta modifier and 128 of
1021 which have not. In each of these blocks, only 32 characters have
1022 the Control modifier. Whereas `[(meta control A)]' differs from
1023 `[(meta control a)]' because the case differs, `\M-\C-a' and
1024 `\M-\C-A' do not. Programmers are advised to use the full common
1025 form, both because it is more readable and less error-prone, and
1026 because it is supported by both Emacsen.
1028 Another (even safer) way to be sure of the key-sequences is to use
1029 the `read-kbd-macro' function, which takes a string like `C-c <up>',
1030 and converts it to the internal key representation of the Emacs you
1031 use. The function is available both on XEmacs and GNU Emacs.
1034 File: xemacs-faq.info, Node: Q5.1.2, Next: Q5.1.3, Prev: Q5.1.1, Up: Miscellaneous
1036 Q5.1.2: Can I generate "fake" keyboard events?
1037 ----------------------------------------------
1039 I wonder if there is an interactive function that can generate
1040 "fake" keyboard events. This way, I could simply map them inside
1045 (defun cg--generate-char-event (ch)
1046 "Generate an event, as if ch has been typed"
1047 (dispatch-event (character-to-event ch)))
1049 ;; Backspace and Delete stuff
1050 (global-set-key [backspace]
1051 (lambda () (interactive) (cg--generate-char-event 127)))
1052 (global-set-key [unknown_keysym_0x4]
1053 (lambda () (interactive) (cg--generate-char-event 4)))
1056 File: xemacs-faq.info, Node: Q5.1.3, Next: Q5.1.4, Prev: Q5.1.2, Up: Miscellaneous
1058 Q5.1.3: Could you explain `read-kbd-macro' in more detail?
1059 ----------------------------------------------------------
1061 The `read-kbd-macro' function returns the internal Emacs
1062 representation of a human-readable string (which is its argument).
1065 (read-kbd-macro "C-c C-a")
1066 => [(control ?c) (control ?a)]
1068 (read-kbd-macro "C-c C-. <up>")
1069 => [(control ?c) (control ?.) up]
1071 In GNU Emacs the same forms will be evaluated to what GNU Emacs
1072 understands internally--the sequences `"\C-x\C-c"' and `[3 67108910
1075 The exact "human-readable" syntax is defined in the docstring of
1076 `edmacro-mode'. I'll repeat it here, for completeness.
1078 Format of keyboard macros during editing:
1080 Text is divided into "words" separated by whitespace. Except for
1081 the words described below, the characters of each word go directly
1082 as characters of the macro. The whitespace that separates words is
1083 ignored. Whitespace in the macro must be written explicitly, as in
1084 `foo <SPC> bar <RET>'.
1086 * The special words `RET', `SPC', `TAB', `DEL', `LFD', `ESC',
1087 and `NUL' represent special control characters. The words
1088 must be written in uppercase.
1090 * A word in angle brackets, e.g., `<return>', `<down>', or
1091 `<f1>', represents a function key. (Note that in the standard
1092 configuration, the function key `<return>' and the control key
1093 <RET> are synonymous.) You can use angle brackets on the
1094 words <RET>, <SPC>, etc., but they are not required there.
1096 * Keys can be written by their ASCII code, using a backslash
1097 followed by up to six octal digits. This is the only way to
1098 represent keys with codes above \377.
1100 * One or more prefixes `M-' (meta), `C-' (control), `S-'
1101 (shift), `A-' (alt), `H-' (hyper), and `s-' (super) may
1102 precede a character or key notation. For function keys, the
1103 prefixes may go inside or outside of the brackets: `C-<down>'
1104 == `<C-down>'. The prefixes may be written in any order:
1107 Prefixes are not allowed on multi-key words, e.g., `C-abc',
1108 except that the Meta prefix is allowed on a sequence of
1109 digits and optional minus sign: `M--123' == `M-- M-1 M-2 M-3'.
1111 * The `^' notation for control characters also works: `^M' ==
1114 * Double angle brackets enclose command names: `<<next-line>>'
1115 is shorthand for `M-x next-line <RET>'.
1117 * Finally, `REM' or `;;' causes the rest of the line to be
1118 ignored as a comment.
1120 Any word may be prefixed by a multiplier in the form of a decimal
1121 number and `*': `3*<right>' == `<right> <right> <right>', and
1122 `10*foo' == `foofoofoofoofoofoofoofoofoofoo'.
1124 Multiple text keys can normally be strung together to form a word,
1125 but you may need to add whitespace if the word would look like one
1126 of the above notations: `; ; ;' is a keyboard macro with three
1127 semicolons, but `;;;' is a comment. Likewise, `\ 1 2 3' is four
1128 keys but `\123' is a single key written in octal, and `< right >'
1129 is seven keys but `<right>' is a single function key. When in
1130 doubt, use whitespace.
1133 File: xemacs-faq.info, Node: Q5.1.4, Next: Q5.1.5, Prev: Q5.1.3, Up: Miscellaneous
1135 Q5.1.4: What is the performance hit of `let'?
1136 ---------------------------------------------
1138 In most cases, not noticeable. Besides, there's no avoiding
1139 `let'--you have to bind your local variables, after all. Some pose a
1140 question whether to nest `let's, or use one `let' per function. I
1141 think because of clarity and maintenance (and possible future
1142 implementation), `let'-s should be used (nested) in a way to provide
1146 File: xemacs-faq.info, Node: Q5.1.5, Next: Q5.1.6, Prev: Q5.1.4, Up: Miscellaneous
1148 Q5.1.5: What is the recommended use of `setq'?
1149 ----------------------------------------------
1153 You will typically `defvar' your global variable to a default
1154 value, and use `setq' to set it later.
1156 It is never a good practice to `setq' user variables (like
1157 `case-fold-search', etc.), as it ignores the user's choice
1158 unconditionally. Note that `defvar' doesn't change the value of a
1159 variable if it was bound previously. If you wish to change a
1160 user-variable temporarily, use `let':
1162 (let ((case-fold-search nil))
1163 ... ; code with searches that must be case-sensitive
1166 You will notice the user-variables by their docstrings beginning
1167 with an asterisk (a convention).
1171 Bind them with `let', which will unbind them (or restore their
1172 previous value, if they were bound) after exiting from the `let'
1173 form. Change the value of local variables with `setq' or whatever
1174 you like (e.g. `incf', `setf' and such). The `let' form can even
1175 return one of its local variables.
1179 ;; iterate through the elements of the list returned by
1180 ;; `hairy-function-that-returns-list'
1181 (let ((l (hairy-function-that-returns-list)))
1183 ... do something with (car l) ...
1186 Another typical usage includes building a value simply to work
1189 ;; Build the mode keymap out of the key-translation-alist
1190 (let ((inbox (file-truename (expand-file-name box)))
1192 ... code dealing with inbox ...
1195 This piece of code uses the local variable `inbox', which becomes
1196 unbound (or regains old value) after exiting the form. The form
1197 also returns the value of `inbox', which can be reused, for
1200 (setq foo-processed-inbox
1204 File: xemacs-faq.info, Node: Q5.1.6, Next: Q5.1.7, Prev: Q5.1.5, Up: Miscellaneous
1206 Q5.1.6: What is the typical misuse of `setq' ?
1207 ----------------------------------------------
1209 A typical misuse is probably `setq'ing a variable that was meant to
1210 be local. Such a variable will remain bound forever, never to be
1211 garbage-collected. For example, the code doing:
1213 (defun my-function (whatever)
1215 ... build a large list ...
1218 does a bad thing, as `a' will keep consuming memory, never to be
1219 unbound. The correct thing is to do it like this:
1221 (defun my-function (whatever)
1222 (let (a) ; default initialization is to nil
1223 ... build a large list ...
1224 ... and exit, unbinding `a' in the process ...)
1226 Not only is this prettier syntactically, but it makes it possible for
1227 Emacs to garbage-collect the objects which `a' used to reference.
1229 Note that even global variables should not be `setq'ed without
1230 `defvar'ing them first, because the byte-compiler issues warnings. The
1231 reason for the warning is the following:
1233 (defun flurgoze nil) ; ok, global internal variable
1236 (setq flurghoze t) ; ops! a typo, but semantically correct.
1237 ; however, the byte-compiler warns.
1239 While compiling toplevel forms:
1240 ** assignment to free variable flurghoze
1243 File: xemacs-faq.info, Node: Q5.1.7, Next: Q5.1.8, Prev: Q5.1.6, Up: Miscellaneous
1245 Q5.1.7: I like the `do' form of cl, does it slow things down?
1246 -------------------------------------------------------------
1248 It shouldn't. Here is what Dave Gillespie has to say about cl.el
1251 Many of the advanced features of this package, such as `defun*',
1252 `loop', and `setf', are implemented as Lisp macros. In
1253 byte-compiled code, these complex notations will be expanded into
1254 equivalent Lisp code which is simple and efficient. For example,
1260 are expanded at compile-time to the Lisp forms
1263 (setcar p (cons x (car p)))
1265 which are the most efficient ways of doing these respective
1266 operations in Lisp. Thus, there is no performance penalty for
1267 using the more readable `incf' and `push' forms in your compiled
1270 _Interpreted_ code, on the other hand, must expand these macros
1271 every time they are executed. For this reason it is strongly
1272 recommended that code making heavy use of macros be compiled. (The
1273 features labelled "Special Form" instead of "Function" in this
1274 manual are macros.) A loop using `incf' a hundred times will
1275 execute considerably faster if compiled, and will also
1276 garbage-collect less because the macro expansion will not have to
1277 be generated, used, and thrown away a hundred times.
1279 You can find out how a macro expands by using the `cl-prettyexpand'
1283 File: xemacs-faq.info, Node: Q5.1.8, Next: Q5.1.9, Prev: Q5.1.7, Up: Miscellaneous
1285 Q5.1.8: I like recursion, does it slow things down?
1286 ---------------------------------------------------
1288 Yes. Emacs byte-compiler cannot do much to optimize recursion. But
1289 think well whether this is a real concern in Emacs. Much of the Emacs
1290 slowness comes from internal mechanisms such as redisplay, or from the
1291 fact that it is an interpreter.
1293 Please try not to make your code much uglier to gain a very small
1294 speed gain. It's not usually worth it.
1297 File: xemacs-faq.info, Node: Q5.1.9, Next: Q5.1.10, Prev: Q5.1.8, Up: Miscellaneous
1299 Q5.1.9: How do I put a glyph as annotation in a buffer?
1300 -------------------------------------------------------
1302 Here is a solution that will insert the glyph annotation at the
1303 beginning of buffer:
1305 (make-annotation (make-glyph '([FORMAT :file FILE]
1306 [string :data "fallback-text"]))
1311 Replace `FORMAT' with an unquoted symbol representing the format of
1312 the image (e.g. `xpm', `xbm', `gif', `jpeg', etc.) Instead of `FILE',
1313 use the image file name (e.g.
1314 `/usr/local/lib/xemacs-21.4/etc/recycle.xpm').
1316 You can turn this to a function (that optionally prompts you for a
1317 file name), and inserts the glyph at `(point)' instead of `(point-min)'.