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.0.12, Next: Q4.1.1, Prev: Q4.0.11, Up: Subsystems
12 Q4.0.12: Customization of VM not covered in the manual, or here.
13 ----------------------------------------------------------------
15 giacomo boffi <boffi@hp735.stru.polimi.it> writes:
17 The meta-answer is to look into the file `vm-vars.el', in the vm
18 directory of the lisp library.
20 `vm-vars.el' contains, initializes and carefully describes, with
21 examples of usage, the plethora of user options that _fully_
22 control VM's behavior.
24 Enter vm-vars, `forward-search' for toolbar, find the variables
25 that control the toolbar placement, appearance, existence, copy to
26 your `.emacs' or `.vm' and modify according to the detailed
29 The above also applies to all the various features of VM: search
30 for some keywords, maybe the first you conjure isn't appropriate,
31 find the appropriate variables, copy and experiment.
34 File: xemacs-faq.info, Node: Q4.1.1, Next: Q4.1.2, Prev: Q4.0.12, Up: Subsystems
36 4.1: Web browsing with W3
37 =========================
42 W3 is an advanced graphical browser written in Emacs lisp that runs
43 on XEmacs. It has full support for cascaded style sheets, and more...
45 It has a home web page at
46 `http://www.cs.indiana.edu/elisp/w3/docs.html'.
49 File: xemacs-faq.info, Node: Q4.1.2, Next: Q4.1.3, Prev: Q4.1.1, Up: Subsystems
51 Q4.1.2: How do I run W3 from behind a firewall?
52 -----------------------------------------------
54 There is a long, well-written, detailed section in the W3 manual that
55 describes how to do this. Look in the section entitled "Firewalls".
58 File: xemacs-faq.info, Node: Q4.1.3, Next: Q4.2.1, Prev: Q4.1.2, Up: Subsystems
60 Q4.1.3: Is it true that W3 supports style sheets and tables?
61 ------------------------------------------------------------
63 Yes, and much more. W3, as distributed with the latest XEmacs is a
64 full-featured web browser.
67 File: xemacs-faq.info, Node: Q4.2.1, Next: Q4.2.2, Prev: Q4.1.3, Up: Subsystems
69 4.2: Reading Netnews and Mail with Gnus
70 =======================================
72 Q4.2.1: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, Quassia Gnus, argh!
73 --------------------------------------------------------------------------------
75 The Gnus numbering issues are not meant for mere mortals to know
76 them. If you feel you _must_ enter the muddy waters of Gnus, visit the
77 excellent FAQ, maintained by Justin Sheehy, at:
79 `http://www.ccs.neu.edu/software/contrib/gnus/'
81 See also Gnus home page
82 `http://www.gnus.org/'
85 File: xemacs-faq.info, Node: Q4.2.2, Next: Q4.2.3, Prev: Q4.2.1, Up: Subsystems
87 Q4.2.2: This question intentionally left blank.
88 -----------------------------------------------
90 Obsolete question, left blank to avoid renumbering.
93 File: xemacs-faq.info, Node: Q4.2.3, Next: Q4.2.4, Prev: Q4.2.2, Up: Subsystems
95 Q4.2.3: How do I make Gnus stay within a single frame?
96 ------------------------------------------------------
98 The toolbar code to start Gnus opens the new frame--and it's a
99 feature rather than a bug. If you don't like it, but would still like
100 to click on the seemly icon, use the following code:
102 (defun toolbar-news ()
105 It will redefine the callback function of the icon to just call
106 `gnus', without all the fancy frame stuff.
109 File: xemacs-faq.info, Node: Q4.2.4, Next: Q4.3.1, Prev: Q4.2.3, Up: Subsystems
111 Q4.2.4: How do I customize the From: line?
112 ------------------------------------------
114 How do I change the `From:' line? I have set gnus-user-from-line to
115 Gail Gurman <gail.gurman@sybase.com>
116 , but XEmacs Gnus doesn't use it. Instead it uses
117 Gail Mara Gurman <gailg@deall>
118 and then complains that it's incorrect. Also, as you perhaps can see,
119 my Message-ID is screwy. How can I change that?
121 Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:
123 Set `user-mail-address' to `gail.gurman@sybase.com' or
124 `mail-host-address' to `sybase.com'.
127 File: xemacs-faq.info, Node: Q4.3.1, Next: Q4.3.2, Prev: Q4.2.4, Up: Subsystems
129 4.3: Other Mail & News
130 ======================
132 Q4.3.1: How can I read and/or compose MIME messages?
133 ----------------------------------------------------
135 VM supports MIME natively.
137 You probably want to use the Tools for MIME (tm). *Note Q4.3.2::,
140 Trey Jackson <trey@cs.berkeley.edu> has an Emacs & MIME web page at
141 `http://bmrc.berkeley.edu/~trey/emacs/mime.html'.
143 Another possibility is RMIME. You may find RMIME at
144 `http://www.cinti.net/~rmoody/rmime/index.html'.
147 File: xemacs-faq.info, Node: Q4.3.2, Next: Q4.3.3, Prev: Q4.3.1, Up: Subsystems
149 Q4.3.2: What is TM and where do I get it?
150 -----------------------------------------
152 TM stands for "Tools for MIME" and not Tiny MIME. TM integrates
153 with all major XEmacs packages like Gnus (all flavors), VM, MH-E, and
154 mailcrypt. It provides totally transparent and trouble-free MIME
155 support. When appropriate a message will be decoded in place in an
158 TM now comes as a package with XEmacs 19.16 and XEmacs 20.2.
160 TM was written by MORIOKA Tomohiko <morioka@jaist.ac.jp> and
161 KOBAYASHI Shuhei <shuhei-k@jaist.ac.jp>.
163 It is based on the work of UMEDA Masanobu
164 <umerin@mse.kyutech.ac.jp>, the original writer of GNUS.
166 The following information is from the `README':
168 "tm" is a MIME package for GNU Emacs. tm has following functions:
170 * MIME style multilingual header.
172 * MIME message viewer (mime/viewer-mode).
174 * MIME message composer (mime/editor-mode).
176 * MIME extenders for mh-e, GNUS, RMAIL and VM.
178 tm is available from following anonymous ftp sites:
179 * `ftp://ftp.unicamp.br/pub/mail/mime/tm/' (Brasil).
181 * `ftp://ftp.th-darmstadt.de/pub/editors/GNU-Emacs/lisp/mime/'
184 * `ftp://ftp.tnt.uni-hannover.de/pub/editors/xemacs/contrib/'
187 Don't let the installation procedure & instructions stop you from
188 trying this package out--it's much simpler than it looks, and once
189 installed, trivial to use.
192 File: xemacs-faq.info, Node: Q4.3.3, Next: Q4.3.4, Prev: Q4.3.2, Up: Subsystems
194 Q4.3.3: Why isn't this `movemail' program working?
195 --------------------------------------------------
197 Ben Wing <ben@xemacs.org> writes:
199 It wasn't chown'ed/chmod'd correctly.
202 File: xemacs-faq.info, Node: Q4.3.4, Next: Q4.3.5, Prev: Q4.3.3, Up: Subsystems
204 Q4.3.4: Movemail is also distributed by Netscape? Can that cause problems?
205 ---------------------------------------------------------------------------
207 Steve Baur <steve@xemacs.org> writes:
209 Yes. Always use the movemail installed with your XEmacs. Failure
210 to do so can result in lost mail.
212 Please refer to Jamie Zawinski's <jwz@jwz.org> notes at
213 `http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/movemail.html'.
214 In particular, this document will show you how to make Netscape use the
215 version of movemail configured for your system by the person who built
219 File: xemacs-faq.info, Node: Q4.3.5, Next: Q4.4.1, Prev: Q4.3.4, Up: Subsystems
221 Q4.3.5: Where do I find pstogif (required by tm)?
222 -------------------------------------------------
224 pstogif is part of the latex2html package.
226 Jan Vroonhof <vroonhof@math.ethz.ch> writes:
228 latex2html is best found at the CTAN hosts and their mirrors in
229 `tex-archive/support/latex2html'.
233 * `ftp://ftp.tex.ac.uk/tex-archive/support/latex2html/'.
235 * `ftp://ftp.dante.de/tex-archive/support/latex2html/'.
237 There is a good mirror at ftp.cdrom.com;
238 `ftp://ftp.cdrom.com/pub/tex/ctan/support/latex2html/'.
241 File: xemacs-faq.info, Node: Q4.4.1, Next: Q4.4.2, Prev: Q4.3.5, Up: Subsystems
243 4.4: Sparcworks, EOS, and WorkShop
244 ==================================
246 Q4.4.1: What is SPARCworks, EOS, and WorkShop?
247 ----------------------------------------------
249 John Turner <turner@lanl.gov> writes:
251 SPARCworks is SunSoft's development environment, comprising
252 compilers (C, C++, FORTRAN 77, Fortran 90, Ada, and Pascal), a
253 debugger, and other tools such as TeamWare (for configuration
254 management), MakeTool, etc.
256 See `http://www.sun.com/software/Developer-products/' for more info.
258 EOS stands for "Era on SPARCworks", but I don't know what Era stands
261 EOS is the integration of XEmacs with the SPARCworks debugger. It
262 allows one to use an XEmacs frame to view code (complete with
263 fontification, etc.), set breakpoints, print variables, etc., while
264 using the SPARCworks debugger. It works very well and I use it all the
267 Chuck Thompson <cthomp@xemacs.org> writes:
269 Era stood for "Emacs Rewritten Again". It was what we were
270 calling the modified version of Lucid Emacs for Sun when I was
271 dragged, er, allowed to work on this wonderful editor.
273 Martin Buchholz <martin@xemacs.org> writes:
275 EOS is being replaced with a new graphical development environment
276 called Sun WorkShop, which is currently (07/96) in Alpha Test.
277 For more details, check out
278 `http://www.sun.com/software/Products/Developer-products'.
281 File: xemacs-faq.info, Node: Q4.4.2, Next: Q4.5.1, Prev: Q4.4.1, Up: Subsystems
283 Q4.4.2: How do I start the Sun Workshop support in XEmacs 21?
284 -------------------------------------------------------------
286 Add the switch --with-workshop to the configure command when building
287 XEmacs and put the following in one of your startup files (e.g.
288 site-start.el or .emacs):
290 (when (featurep 'tooltalk)
291 (load "tooltalk-macros")
292 (load "tooltalk-util")
293 (load "tooltalk-init"))
294 (when (featurep 'sparcworks)
301 If you are not using the latest Workshop (5.0) you have to apply the
304 --- /opt/SUNWspro/lib/eserve.el.ORIG Fri May 14 15:23:26 1999
305 +++ /opt/SUNWspro/lib/eserve.el Fri May 14 15:24:54 1999
307 (defvar running-xemacs nil "t if we're running XEmacs")
308 (defvar running-emacs nil "t if we're running GNU Emacs 19")
310 -(if (string-match "^\\(19\\|20\\)\..*\\(XEmacs\\|Lucid\\)" emacs-version)
311 +(if (string-match "\\(XEmacs\\|Lucid\\)" emacs-version)
312 (setq running-xemacs t)
313 (setq running-emacs t))
316 File: xemacs-faq.info, Node: Q4.5.1, Next: Q4.6.1, Prev: Q4.4.2, Up: Subsystems
321 Q4.5.1: What is/was Energize?
322 -----------------------------
324 David N Gray <gray@meteor.harlequin.com> writes:
325 The files in `lisp/energize' are to enable Emacs to interface with
326 the "Energize Programming System", a C and C++ development
327 environment, which was a product of Lucid, Inc. Tragically, Lucid
328 went out of business in 1994, so although Energize is still a
329 great system, if you don't already have it, there isn't any way to
330 get it now. (Unless you happen to be in Japan; INS Engineering
331 may still be selling it there. Tartan bought the rights to sell
332 it in the rest of the world, but never did so.)
335 File: xemacs-faq.info, Node: Q4.6.1, Next: Q4.7.1, Prev: Q4.5.1, Up: Subsystems
340 Q4.6.1: What is Infodock?
341 -------------------------
343 InfoDock is an integrated productivity toolset, mainly aimed at
344 technical people. It is developed and supported by InfoDock
345 Associates, a firm that offers custom support and development for
346 InfoDock, XEmacs and GNU Emacs. ( `http://www.infodock.com',
347 <info@infodock.com>, +1 408 243 3300).
349 InfoDock is built atop the XEmacs variant of GNU Emacs and so has
350 all of the power of Emacs, but with an easier to use and more
351 comprehensive menu-based user interface. The bottom portion of this
352 text describes how it differs from XEmacs and GNU Emacs from the Free
355 InfoDock is aimed at people who want a free, turn-key productivity
356 environment. Although InfoDock is customizable, it is not intended for
357 people who like basic versions of Emacs which need to be customized
358 extensively for local use; standard Emacs distributions are better for
359 such uses. InfoDock is for those people who want a complete,
360 pre-customized environment in one package, which they need not touch
361 more than once or twice a year to update to new revisions.
363 InfoDock is pre-built for SPARC SunOS/Solaris systems, PA-RISC HP-UX,
364 and Intel Linux systems. It is intended for use on a color display,
365 although most features will work on monochrome monitors. Simply unpack
366 InfoDock according to the instructions in the ID-INSTALL file and you
369 The InfoDock Manual is concise, yet sufficient as a user guide for
370 users who have never used an Emacs-type editor before. For users who
371 are already familiar with Emacs, it supplements the information in the
374 InfoDock menus are much more extensive and more mature than standard
375 Emacs menus. Each menu offers a `Manual' item which displays
376 documentation associated with the menu's functions.
378 Four types of menubars are provided:
379 1. An extensive menubar providing access to global InfoDock commands.
381 2. Mode-specific menubars tailored to the current major mode.
383 3. A simple menubar for basic editing to help novices get started
386 4. The standard XEmacs menubar.
388 Most modes also include mode-specific popup menus. Additionally,
389 region and rectangle popup menus are included.
391 `Hyperbole', the everyday information manager, is a core part of
392 InfoDock. This provides context-sensitive mouse keys, a rolodex-type
393 contact manager, programmable hypertext buttons, and an autonumbered
394 outliner with embedded hyperlink anchors.
396 The `OO-Browser', a multi-language object-oriented code browser, is a
397 standard part of InfoDock.
399 InfoDock saves a more extensive set of user options than other Emacs
402 InfoDock inserts a useful file header in many file types, showing the
403 author, summary, and last modification time of each file. A summary
404 program can then be used to summarize all of the files in a directory,
405 for easy MANIFEST file creation.
407 Your working set of buffers is automatically saved and restored (if
408 you answer yes to a prompt) between InfoDock sessions.
410 Refined color choices for code highlighting are provided for both
411 dark and light background display frames.
413 The `C-z' key prefix performs frame-based commands which parallel the
414 `C-x' key prefix for window-based commands.
416 The Smart Menu system is included for producing command menus on dumb
419 Lisp libraries are better categorized according to function.
421 Extensions and improvements to many areas of Emacs are included,
422 such as: paragraph filling, mail reading with Rmail, shell handling,
423 outlining, code highlighting and browsing, and man page browsing.
425 InfoDock questions, answers and discussion should go to the mail list
426 <infodock@infodock.com>. Use <infodock-request@infodock.com> to be
427 added or removed from the list. Always include your InfoDock version
428 number when sending help requests.
430 InfoDock is available across the Internet via anonymous FTP. To get
431 it, first move to a directory into which you want the InfoDock archive
432 files placed. We will call this <DIST-DIR>.
436 Ftp to ftp.xemacs.org (Internet Host ID = 128.174.252.16):
438 prompt> ftp ftp.xemacs.org
440 Login as `anonymous' with your own <user-id>@<site-name> as a
443 Name (ftp.xemacs.org): anonymous
444 331 Guest login ok, send your complete e-mail address as password.
445 Password: -<your-user-id>@<your-domain>
446 230 Guest login ok, access restrictions apply.
448 Move to the location of the InfoDock archives:
452 Set your transfer mode to binary:
460 Interactive mode off.
462 Retrieve the InfoDock archives that you want, either by using a `get
463 <file>' for each file you want or by using the following to get a
464 complete distribution, including all binaries:
469 Close the FTP connection:
474 Read the `ID-INSTALL' file which you just retrieved for step-by-step
475 installation instructions.
478 File: xemacs-faq.info, Node: Q4.7.1, Next: Q4.7.2, Prev: Q4.6.1, Up: Subsystems
480 4.7: Other Unbundled Packages
481 =============================
483 Q4.7.1: What is AUC TeX? Where do you get it?
484 ----------------------------------------------
486 AUC TeX is a package written by Per Abrahamsen <abraham@dina.kvl.dk>.
487 Starting with XEmacs 19.16, AUC TeX is bundled with XEmacs. The
488 following information is from the `README' and website.
490 AUC TeX is an extensible package that supports writing and formatting
491 TeX files for most variants of GNU Emacs. Many different macro packages
492 are supported, including AMS TeX, LaTeX, and TeXinfo.
494 The most recent version is always available by ftp at
495 `ftp://sunsite.auc.dk/packages/auctex/auctex.tar.gz'.
497 In case you don't have access to anonymous ftp, you can get it by an
498 email request to <ftpmail@decwrl.dec.com>.
500 WWW users may want to check out the AUC TeX page at
501 `http://sunsite.auc.dk/auctex/'.
504 File: xemacs-faq.info, Node: Q4.7.2, Next: Q4.7.3, Prev: Q4.7.1, Up: Subsystems
506 Q4.7.2: Are there any Emacs Lisp Spreadsheets?
507 ----------------------------------------------
509 Yes. Check out "dismal" (which stands for Dis' Mode Ain't Lotus) at
510 `ftp://cs.nyu.edu/pub/local/fox/dismal/'.
513 File: xemacs-faq.info, Node: Q4.7.3, Next: Q4.7.4, Prev: Q4.7.2, Up: Subsystems
515 Q4.7.3: [This question intentionally left blank]
516 ------------------------------------------------
519 File: xemacs-faq.info, Node: Q4.7.4, Next: Q4.7.5, Prev: Q4.7.3, Up: Subsystems
521 Q4.7.4: Problems installing AUC TeX.
522 ------------------------------------
524 Jan Vroonhof <vroonhof@math.ethz.ch> writes:
526 AUC TeX works fine on both stock Emacs and XEmacs has been doing
527 so for a very very long time. This is mostly due to the work of
528 Per Abrahamsen <abraham@dina.kvl.dk> (clap clap) in particular his
529 `easymenu' package. Which leads to what is probably the problem...
531 Most problems with AUC TeX are one of two things:
533 * The TeX-lisp-directory in `tex-site.el' and the makefile don't
536 Fix: make sure you configure AUC TeX properly *before* installing.
538 * You have an old version of easymenu.el in your path.
540 Fix: use `locate-library' and remove old versions to make sure it
541 *only* finds the one that came with XEmacs.
544 File: xemacs-faq.info, Node: Q4.7.5, Next: Q4.7.6, Prev: Q4.7.4, Up: Subsystems
546 Q4.7.5: Is there a reason for an Emacs package not to be included in XEmacs?
547 ----------------------------------------------------------------------------
549 The reason for an Emacs package not to be included in XEmacs is
550 usually one or more of the following:
552 1. The package has not been ported to XEmacs. This will typically
553 happen when it uses GNU-Emacs-specific features, which make it
556 Porting a package to XEmacs can range from a trivial amount of
557 change to a partial or full rewrite. Fortunately, the authors of
558 modern packages usually choose to support both Emacsen themselves.
560 2. The package has been decided not to be appropriate for XEmacs. It
561 may have an equivalent or better replacement within XEmacs, in
562 which case the developers may choose not to burden themselves with
563 supporting an additional package.
565 Each package bundled with XEmacs means more work for the
566 maintainers, whether they want it or not. If you are ready to
567 take over the maintenance responsibilities for the package you
568 port, be sure to say so--we will more likely include it.
570 3. The package simply hasn't been noted by the XEmacs development. If
571 that's the case, the messages like yours are very useful for
572 attracting our attention.
574 4. The package was noted by the developers, but they simply haven't
575 yet gotten around to including/porting it. Wait for the next
576 release or, even better, offer your help. It will be gladly
577 accepted and appreciated.
580 File: xemacs-faq.info, Node: Q4.7.6, Prev: Q4.7.5, Up: Subsystems
582 Q4.7.5: Is there a MatLab mode?
583 -------------------------------
585 Yes, a matlab mode and other items are available at the MathWorks'
586 emacs_add_ons ftp directory
587 (ftp://ftp.mathworks.com/pub/contrib/emacs_add_ons).
590 File: xemacs-faq.info, Node: Miscellaneous, Next: MS Windows, Prev: Subsystems, Up: Top
592 5 The Miscellaneous Stuff
593 *************************
595 This is part 5 of the XEmacs Frequently Asked Questions list. This
596 section is devoted to anything that doesn't fit neatly into the other
602 * Q5.0.1:: How can I do source code highlighting using font-lock?
603 * Q5.0.2:: I do not like cc-mode. How do I use the old c-mode?
604 * Q5.0.3:: How do I get `More' Syntax Highlighting on by default?
605 * Q5.0.4:: How can I enable auto-indent?
606 * Q5.0.5:: How can I get XEmacs to come up in text/auto-fill mode by default?
607 * Q5.0.6:: How do I start up a second shell buffer?
608 * Q5.0.7:: Telnet from shell filters too much.
609 * Q5.0.8:: Why does edt emulation not work?
610 * Q5.0.9:: How can I emulate VI and use it as my default mode?
611 * Q5.0.10:: [This question intentionally left blank]
612 * Q5.0.11:: How do I turn on filladapt for all buffers?
613 * Q5.0.12:: How do I disable gnuserv from opening a new frame?
614 * Q5.0.13:: How do I start gnuserv so that each subsequent XEmacs is a client?
615 * Q5.0.14:: Strange things are happening in Shell Mode.
616 * Q5.0.15:: Where do I get the latest CC Mode?
617 * Q5.0.16:: I find auto-show-mode disconcerting. How do I turn it off?
618 * Q5.0.17:: How can I get two instances of info?
619 * Q5.0.18:: [This question intentionally left blank]
620 * Q5.0.19:: Is there something better than LaTeX mode?
621 * Q5.0.20:: Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient?
623 Emacs Lisp Programming Techniques:
624 * Q5.1.1:: The difference in key sequences between XEmacs and GNU Emacs?
625 * Q5.1.2:: Can I generate "fake" keyboard events?
626 * Q5.1.3:: Could you explain `read-kbd-macro' in more detail?
627 * Q5.1.4:: What is the performance hit of `let'?
628 * Q5.1.5:: What is the recommended use of `setq'?
629 * Q5.1.6:: What is the typical misuse of `setq'?
630 * Q5.1.7:: I like the `do' form of cl, does it slow things down?
631 * Q5.1.8:: I like recursion, does it slow things down?
632 * Q5.1.9:: How do I put a glyph as annotation in a buffer?
633 * Q5.1.10:: `map-extents' won't traverse all of my extents!
634 * Q5.1.11:: My elisp program is horribly slow. Is there an easy way to find out where it spends time?
637 * Q5.2.1:: How do I turn off the sound?
638 * Q5.2.2:: How do I get funky sounds instead of a boring beep?
639 * Q5.2.3:: What's NAS, how do I get it?
640 * Q5.2.4:: Sunsite sounds don't play.
643 * Q5.3.1:: How do you make XEmacs indent CL if-clauses correctly?
644 * Q5.3.2:: Fontifying hangs when editing a postscript file.
645 * Q5.3.3:: How can I print WYSIWYG a font-locked buffer?
646 * Q5.3.4:: Getting M-x lpr to work with postscript printer.
647 * Q5.3.5:: How do I specify the paths that XEmacs uses for finding files?
648 * Q5.3.6:: [This question intentionally left blank]
649 * Q5.3.7:: Can I have the end of the buffer delimited in some way?
650 * Q5.3.8:: How do I insert today's date into a buffer?
651 * Q5.3.9:: Are only certain syntactic character classes available for abbrevs?
652 * Q5.3.10:: How can I get those oh-so-neat X-Face lines?
653 * Q5.3.11:: How do I add new Info directories?
654 * Q5.3.12:: What do I need to change to make printing work?
657 File: xemacs-faq.info, Node: Q5.0.1, Next: Q5.0.2, Prev: Miscellaneous, Up: Miscellaneous
659 5.0: Major & Minor Modes
660 ========================
662 Q5.0.1: How can I do source code highlighting using font-lock?
663 --------------------------------------------------------------
665 For most modes, font-lock is already set up and just needs to be
666 turned on. This can be done by `M-x font-lock-mode', or by having
667 XEmacs automatically start it by adding lines like:
669 (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
670 (add-hook 'dired-mode-hook 'turn-on-font-lock)
672 to your `.emacs'. See the file `etc/sample.emacs' for more examples.
674 See also `Syntax Highlighting' from the `Options' menu. Remember to
678 File: xemacs-faq.info, Node: Q5.0.2, Next: Q5.0.3, Prev: Q5.0.1, Up: Miscellaneous
680 Q5.0.2: I do not like cc-mode. How do I use the old c-mode?
681 ------------------------------------------------------------
683 Well, first off, consider if you really want to do this. cc-mode is
684 much more powerful than the old c-mode. If you're having trouble
685 getting your old offsets to work, try using `c-set-offset' instead.
686 You might also consider using the package `cc-compat'.
688 But, if you still insist, add the following lines to your `.emacs':
690 (fmakunbound 'c-mode)
691 (makunbound 'c-mode-map)
692 (fmakunbound 'c++-mode)
693 (makunbound 'c++-mode-map)
694 (makunbound 'c-style-alist)
695 (load-library "old-c-mode")
696 (load-library "old-c++-mode")
698 This must be done before any other reference is made to either
702 File: xemacs-faq.info, Node: Q5.0.3, Next: Q5.0.4, Prev: Q5.0.2, Up: Miscellaneous
704 Q5.0.3: How do I get `More' Syntax Highlighting on by default?
705 --------------------------------------------------------------
707 Use the following code in your `.emacs':
709 (setq-default font-lock-maximum-decoration t)
711 In versions of XEmacs prior to 19.14, you had to use a kludgy
714 (setq c-font-lock-keywords c-font-lock-keywords-2
715 c++-font-lock-keywords c++-font-lock-keywords-2
716 lisp-font-lock-keywords lisp-font-lock-keywords-2)
718 It will work for C, C++ and Lisp.
720 See also `Syntax Highlighting' from the `Options' menu. Remember to
724 File: xemacs-faq.info, Node: Q5.0.4, Next: Q5.0.5, Prev: Q5.0.3, Up: Miscellaneous
726 Q5.0.4: How can I enable auto-indent?
727 -------------------------------------
729 Put the following line in your `.emacs':
731 (setq indent-line-function 'indent-relative-maybe)
733 If you want to get fancy, try the `filladapt' package available
734 standard with XEmacs. Put this into your `.emacs':
737 (add-hook 'text-mode-hook 'turn-on-filladapt-mode)
740 You can customize filling and adaptive filling with Customize.
741 Select from the `Options' menu
742 `Customize->Emacs->->Editing->Fill->Fill...' or type `M-x customize
745 Note that well-behaving text-lookalike modes will run
746 `text-mode-hook' by default (e.g. that's what Message does). For the
747 nasty ones, you'll have to provide the `add-hook's yourself.
749 Please note that the `fa-extras' package is no longer useful.
752 File: xemacs-faq.info, Node: Q5.0.5, Next: Q5.0.6, Prev: Q5.0.4, Up: Miscellaneous
754 Q5.0.5: How can I get XEmacs to come up in text/auto-fill mode by default?
755 --------------------------------------------------------------------------
757 Try the following lisp in your `.emacs':
759 (setq default-major-mode 'text-mode)
760 (setq text-mode-hook 'turn-on-auto-fill)
762 *WARNING*: note that changing the value of `default-major-mode' from
763 `fundamental-mode' can break a large amount of built-in code that
764 expects newly created buffers to be in `fundamental-mode'. (Changing
765 from `fundamental-mode' to `text-mode' might not wreak too much havoc,
766 but changing to something more exotic like a lisp-mode would break many
769 Note that Emacs by default starts up in buffer `*scratch*' in
770 `initial-major-mode', which defaults to `lisp-interaction-mode'. Thus
771 adding the following form to your Emacs init file will cause the
772 initial `*scratch*' buffer to be put into auto-fill'ed `text-mode':
774 (setq initial-major-mode
777 (turn-on-auto-fill)))
779 Note that after your init file is loaded, if
780 `inhibit-startup-message' is `nil' (the default) and the startup buffer
781 is `*scratch*' then the startup message will be inserted into
782 `*scratch*'; it will be removed after a timeout by erasing the entire
783 `*scratch*' buffer. Keep in mind this default usage of `*scratch*' if
784 you desire any prior manipulation of `*scratch*' from within your Emacs
785 init file. In particular, anything you insert into `*scratch*' from
786 your init file will be later erased. Also, if you change the mode of
787 the `*scratch*' buffer, be sure that this will not interfere with
788 possible later insertion of the startup message (e.g. if you put
789 `*scratch*' into a nonstandard mode that has automatic font lock rules,
790 then the startup message might get fontified in a strange foreign
791 manner, e.g. as code in some programming language).
794 File: xemacs-faq.info, Node: Q5.0.6, Next: Q5.0.7, Prev: Q5.0.5, Up: Miscellaneous
796 Q5.0.6: How do I start up a second shell buffer?
797 ------------------------------------------------
799 In the `*shell*' buffer:
801 M-x rename-buffer <RET> *shell-1* <RET>
804 This will then start a second shell. The key is that no buffer named
805 `*shell*' can exist. It might be preferable to use `M-x
806 rename-uniquely' to rename the `*shell*' buffer instead of `M-x
809 Alternately, you can set the variable `shell-multiple-shells'. If
810 the value of this variable is non-nil, each time shell mode is invoked,
814 File: xemacs-faq.info, Node: Q5.0.7, Next: Q5.0.8, Prev: Q5.0.6, Up: Miscellaneous
816 Q5.0.7: Telnet from shell filters too much
817 ------------------------------------------
819 I'm using the Emacs `M-x shell' function, and I would like to invoke
820 and use a telnet session within it. Everything works fine except that
821 now all `^M''s are filtered out by Emacs. Fixes?
823 Use `M-x rsh' or `M-x telnet' to open remote sessions rather than
824 doing rsh or telnet within the local shell buffer. Starting with
825 XEmacs-20.3 you can also use `M-x ssh' to open secure remote session if
826 you have `ssh' installed.
829 File: xemacs-faq.info, Node: Q5.0.8, Next: Q5.0.9, Prev: Q5.0.7, Up: Miscellaneous
831 Q5.0.8: Why does edt emulation not work?
832 ----------------------------------------
834 We don't know, but you can use tpu-edt emulation instead, which works
835 fine and is a little fancier than the standard edt emulation. To do
836 this, add the following line to your `.emacs':
840 If you don't want it to replace `C-h' with an edt-style help menu
843 (global-set-key [(control h)] 'help-for-help)
846 File: xemacs-faq.info, Node: Q5.0.9, Next: Q5.0.10, Prev: Q5.0.8, Up: Miscellaneous
848 Q5.0.9: How can I emulate VI and use it as my default mode?
849 -----------------------------------------------------------
851 Our recommended VI emulator is viper. To make viper-mode the default,
852 add this to your `.emacs':
856 Michael Kifer <kifer@CS.SunySB.EDU> writes:
858 This should be added as close to the top of `.emacs' as you can get
859 it, otherwise some minor modes may not get viper-ized.
862 File: xemacs-faq.info, Node: Q5.0.10, Next: Q5.0.11, Prev: Q5.0.9, Up: Miscellaneous
864 Q5.0.10: [This question intentionally left blank]
865 -------------------------------------------------
867 Obsolete question, left blank to avoid renumbering
870 File: xemacs-faq.info, Node: Q5.0.11, Next: Q5.0.12, Prev: Q5.0.10, Up: Miscellaneous
872 Q5.0.11: How do I turn on filladapt for all buffers?
873 ----------------------------------------------------
875 Filladapt is a minor mode and minor modes are traditionally off by
876 default. The following added to your `.emacs' will turn it on for all
879 (setq-default filladapt-mode t)
881 Use `turn-on-filladapt-mode' to turn Filladapt on in particular
882 major modes, like this:
884 (add-hook 'text-mode-hook 'turn-on-filladapt-mode)
887 File: xemacs-faq.info, Node: Q5.0.12, Next: Q5.0.13, Prev: Q5.0.11, Up: Miscellaneous
889 Q5.0.12: How do I disable gnuserv from opening a new frame?
890 -----------------------------------------------------------
892 If you set the `gnuserv-frame' variable to the frame that should be
893 used to display buffers that are pulled up, a new frame will not be
894 created. For example, you could put
896 (setq gnuserv-frame (selected-frame))
898 early on in your `.emacs', to ensure that the first frame created is
899 the one used for your gnuserv buffers.
901 Starting in 19.15, there is an option to set the gnuserv target to
902 the current frame. See `Options->"Other Window" Location->Make current
903 frame gnuserv target'
905 Starting with XEmacs-20.3 you can also change this with Customize.
906 Select from the `Options' menu
907 `Customize->Emacs->Environment->Gnuserv->Gnuserv Frame...' or type `M-x
908 customize <RET> gnuserv <RET>'.
911 File: xemacs-faq.info, Node: Q5.0.13, Next: Q5.0.14, Prev: Q5.0.12, Up: Miscellaneous
913 Q5.0.13: How do I start gnuserv so that each subsequent XEmacs is a client?
914 ---------------------------------------------------------------------------
916 Put the following in your `.emacs' file to start the server:
920 Start your first XEmacs as usual. After that, you can do:
922 gnuclient randomfilename
924 from the command line to get your existing XEmacs process to open a
925 new frame and visit randomfilename in that window. When you're done
926 editing randomfilename, hit `C-x #' to kill the buffer and get rid of
929 See also man page of gnuclient.
932 File: xemacs-faq.info, Node: Q5.0.14, Next: Q5.0.15, Prev: Q5.0.13, Up: Miscellaneous
934 Q5.0.14: Strange things are happening in Shell Mode.
935 ----------------------------------------------------
937 Sometimes (i.e. it's not repeatable, and I can't work out why it
938 happens) when I'm typing into shell mode, I hit return and only a
939 portion of the command is given to the shell, and a blank prompt is
940 returned. If I hit return again, the rest of the previous command is
943 Martin Buchholz <martin@xemacs.org> writes:
945 There is a known problem with interaction between `csh' and the
946 `filec' option and XEmacs. You should add the following to your
949 if ( "$TERM" == emacs || "$TERM" == unknown ) unset filec
952 File: xemacs-faq.info, Node: Q5.0.15, Next: Q5.0.16, Prev: Q5.0.14, Up: Miscellaneous
954 Q5.0.15: Where do I get the latest CC Mode?
955 -------------------------------------------
957 Barry A. Warsaw <bwarsaw@cnri.reston.va.us> writes:
959 This can be had from `http://www.python.org/emacs/'.
962 File: xemacs-faq.info, Node: Q5.0.16, Next: Q5.0.17, Prev: Q5.0.15, Up: Miscellaneous
964 Q5.0.16: I find auto-show-mode disconcerting. How do I turn it off?
965 --------------------------------------------------------------------
967 `auto-show-mode' controls whether or not a horizontal scrollbar
968 magically appears when a line is too long to be displayed. This is
969 enabled by default. To turn it off, put the following in your `.emacs':
971 (setq auto-show-mode nil)
972 (setq-default auto-show-mode nil)
975 File: xemacs-faq.info, Node: Q5.0.17, Next: Q5.0.18, Prev: Q5.0.16, Up: Miscellaneous
977 Q5.0.17: How can I get two instances of info?
978 ---------------------------------------------
980 You can't. The `info' package does not provide for multiple info
984 File: xemacs-faq.info, Node: Q5.0.18, Next: Q5.0.19, Prev: Q5.0.17, Up: Miscellaneous
986 Q5.0.18: [This question intentionally left blank]
987 -------------------------------------------------
990 File: xemacs-faq.info, Node: Q5.0.19, Next: Q5.0.20, Prev: Q5.0.18, Up: Miscellaneous
992 Q5.0.19: Is there something better than LaTeX mode?
993 ---------------------------------------------------
995 David Kastrup <dak@fsnif.neuroinformatik.ruhr-uni-bochum.de> writes:
997 The standard TeX modes leave much to be desired, and are somewhat
998 leniently maintained. Serious TeX users use AUC TeX (*note
1002 File: xemacs-faq.info, Node: Q5.0.20, Next: Q5.1.1, Prev: Q5.0.19, Up: Miscellaneous
1004 Q5.0.20: Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient?
1005 ---------------------------------------------------------------------------------------------------------
1007 Jan Vroonhof <vroonhof@math.ethz.ch> writes:
1008 Here is one of the solutions, we have this in a script called
1009 `etc/editclient.sh'.
1011 if gnuclient -batch -eval t >/dev/null 2>&1
1013 exec gnuclient ${1+"$@"}
1015 xemacs -unmapped -f gnuserv-start &
1016 until gnuclient -batch -eval t >/dev/null 2>&1
1020 exec gnuclient ${1+"$@"}
1023 Note that there is a known problem when running XEmacs and
1024 'gnuclient -nw' on the same TTY.
1027 File: xemacs-faq.info, Node: Q5.1.1, Next: Q5.1.2, Prev: Q5.0.20, Up: Miscellaneous
1029 5.1: Emacs Lisp Programming Techniques
1030 ======================================
1032 Q5.1.1: What is the difference in key sequences between XEmacs and GNU Emacs?
1033 -----------------------------------------------------------------------------
1035 Erik Naggum <clerik@naggum.no> writes;
1037 Emacs has a legacy of keyboards that produced characters with
1038 modifier bits, and therefore map a variety of input systems into
1039 this scheme even today. XEmacs is instead optimized for X events.
1040 This causes an incompatibility in the way key sequences are
1041 specified, but both Emacs and XEmacs will accept a key sequence as
1042 a vector of lists of modifiers that ends with a key, e.g., to bind
1043 `M-C-a', you would say `[(meta control a)]' in both Emacsen.
1044 XEmacs has an abbreviated form for a single key, just (meta
1045 control a). Emacs has an abbreviated form for the Control and the
1046 Meta modifiers to string-characters (the ASCII characters), as in
1047 `\M-\C-a'. XEmacs users need to be aware that the abbreviated
1048 form works only for one-character key sequences, while Emacs users
1049 need to be aware that the string-character is rather limited.
1050 Specifically, the string-character can accommodate only 256
1051 different values, 128 of which have the Meta modifier and 128 of
1052 which have not. In each of these blocks, only 32 characters have
1053 the Control modifier. Whereas `[(meta control A)]' differs from
1054 `[(meta control a)]' because the case differs, `\M-\C-a' and
1055 `\M-\C-A' do not. Programmers are advised to use the full common
1056 form, both because it is more readable and less error-prone, and
1057 because it is supported by both Emacsen.
1059 Another (even safer) way to be sure of the key-sequences is to use
1060 the `read-kbd-macro' function, which takes a string like `C-c <up>',
1061 and converts it to the internal key representation of the Emacs you
1062 use. The function is available both on XEmacs and GNU Emacs.
1065 File: xemacs-faq.info, Node: Q5.1.2, Next: Q5.1.3, Prev: Q5.1.1, Up: Miscellaneous
1067 Q5.1.2: Can I generate "fake" keyboard events?
1068 ----------------------------------------------
1070 I wonder if there is an interactive function that can generate
1071 "fake" keyboard events. This way, I could simply map them inside
1076 (defun cg--generate-char-event (ch)
1077 "Generate an event, as if ch has been typed"
1078 (dispatch-event (character-to-event ch)))
1080 ;; Backspace and Delete stuff
1081 (global-set-key [backspace]
1082 (lambda () (interactive) (cg--generate-char-event 127)))
1083 (global-set-key [unknown_keysym_0x4]
1084 (lambda () (interactive) (cg--generate-char-event 4)))
1087 File: xemacs-faq.info, Node: Q5.1.3, Next: Q5.1.4, Prev: Q5.1.2, Up: Miscellaneous
1089 Q5.1.3: Could you explain `read-kbd-macro' in more detail?
1090 ----------------------------------------------------------
1092 The `read-kbd-macro' function returns the internal Emacs
1093 representation of a human-readable string (which is its argument).
1096 (read-kbd-macro "C-c C-a")
1097 => [(control ?c) (control ?a)]
1099 (read-kbd-macro "C-c C-. <up>")
1100 => [(control ?c) (control ?.) up]
1102 In GNU Emacs the same forms will be evaluated to what GNU Emacs
1103 understands internally--the sequences `"\C-x\C-c"' and `[3 67108910
1106 The exact "human-readable" syntax is defined in the docstring of
1107 `edmacro-mode'. I'll repeat it here, for completeness.
1109 Format of keyboard macros during editing:
1111 Text is divided into "words" separated by whitespace. Except for
1112 the words described below, the characters of each word go directly
1113 as characters of the macro. The whitespace that separates words is
1114 ignored. Whitespace in the macro must be written explicitly, as in
1115 `foo <SPC> bar <RET>'.
1117 * The special words `RET', `SPC', `TAB', `DEL', `LFD', `ESC',
1118 and `NUL' represent special control characters. The words
1119 must be written in uppercase.
1121 * A word in angle brackets, e.g., `<return>', `<down>', or
1122 `<f1>', represents a function key. (Note that in the standard
1123 configuration, the function key `<return>' and the control key
1124 <RET> are synonymous.) You can use angle brackets on the
1125 words <RET>, <SPC>, etc., but they are not required there.
1127 * Keys can be written by their ASCII code, using a backslash
1128 followed by up to six octal digits. This is the only way to
1129 represent keys with codes above \377.
1131 * One or more prefixes `M-' (meta), `C-' (control), `S-'
1132 (shift), `A-' (alt), `H-' (hyper), and `s-' (super) may
1133 precede a character or key notation. For function keys, the
1134 prefixes may go inside or outside of the brackets: `C-<down>'
1135 == `<C-down>'. The prefixes may be written in any order:
1138 Prefixes are not allowed on multi-key words, e.g., `C-abc',
1139 except that the Meta prefix is allowed on a sequence of
1140 digits and optional minus sign: `M--123' == `M-- M-1 M-2 M-3'.
1142 * The `^' notation for control characters also works: `^M' ==
1145 * Double angle brackets enclose command names: `<<next-line>>'
1146 is shorthand for `M-x next-line <RET>'.
1148 * Finally, `REM' or `;;' causes the rest of the line to be
1149 ignored as a comment.
1151 Any word may be prefixed by a multiplier in the form of a decimal
1152 number and `*': `3*<right>' == `<right> <right> <right>', and
1153 `10*foo' == `foofoofoofoofoofoofoofoofoofoo'.
1155 Multiple text keys can normally be strung together to form a word,
1156 but you may need to add whitespace if the word would look like one
1157 of the above notations: `; ; ;' is a keyboard macro with three
1158 semicolons, but `;;;' is a comment. Likewise, `\ 1 2 3' is four
1159 keys but `\123' is a single key written in octal, and `< right >'
1160 is seven keys but `<right>' is a single function key. When in
1161 doubt, use whitespace.
1164 File: xemacs-faq.info, Node: Q5.1.4, Next: Q5.1.5, Prev: Q5.1.3, Up: Miscellaneous
1166 Q5.1.4: What is the performance hit of `let'?
1167 ---------------------------------------------
1169 In most cases, not noticeable. Besides, there's no avoiding
1170 `let'--you have to bind your local variables, after all. Some pose a
1171 question whether to nest `let's, or use one `let' per function. I
1172 think because of clarity and maintenance (and possible future
1173 implementation), `let'-s should be used (nested) in a way to provide
1177 File: xemacs-faq.info, Node: Q5.1.5, Next: Q5.1.6, Prev: Q5.1.4, Up: Miscellaneous
1179 Q5.1.5: What is the recommended use of `setq'?
1180 ----------------------------------------------
1184 You will typically `defvar' your global variable to a default
1185 value, and use `setq' to set it later.
1187 It is never a good practice to `setq' user variables (like
1188 `case-fold-search', etc.), as it ignores the user's choice
1189 unconditionally. Note that `defvar' doesn't change the value of a
1190 variable if it was bound previously. If you wish to change a
1191 user-variable temporarily, use `let':
1193 (let ((case-fold-search nil))
1194 ... ; code with searches that must be case-sensitive
1197 You will notice the user-variables by their docstrings beginning
1198 with an asterisk (a convention).
1202 Bind them with `let', which will unbind them (or restore their
1203 previous value, if they were bound) after exiting from the `let'
1204 form. Change the value of local variables with `setq' or whatever
1205 you like (e.g. `incf', `setf' and such). The `let' form can even
1206 return one of its local variables.
1210 ;; iterate through the elements of the list returned by
1211 ;; `hairy-function-that-returns-list'
1212 (let ((l (hairy-function-that-returns-list)))
1214 ... do something with (car l) ...
1217 Another typical usage includes building a value simply to work
1220 ;; Build the mode keymap out of the key-translation-alist
1221 (let ((inbox (file-truename (expand-file-name box)))
1223 ... code dealing with inbox ...
1226 This piece of code uses the local variable `inbox', which becomes
1227 unbound (or regains old value) after exiting the form. The form
1228 also returns the value of `inbox', which can be reused, for
1231 (setq foo-processed-inbox
1235 File: xemacs-faq.info, Node: Q5.1.6, Next: Q5.1.7, Prev: Q5.1.5, Up: Miscellaneous
1237 Q5.1.6: What is the typical misuse of `setq' ?
1238 ----------------------------------------------
1240 A typical misuse is probably `setq'ing a variable that was meant to
1241 be local. Such a variable will remain bound forever, never to be
1242 garbage-collected. For example, the code doing:
1244 (defun my-function (whatever)
1246 ... build a large list ...
1249 does a bad thing, as `a' will keep consuming memory, never to be
1250 unbound. The correct thing is to do it like this:
1252 (defun my-function (whatever)
1253 (let (a) ; default initialization is to nil
1254 ... build a large list ...
1255 ... and exit, unbinding `a' in the process ...)
1257 Not only is this prettier syntactically, but it makes it possible for
1258 Emacs to garbage-collect the objects which `a' used to reference.
1260 Note that even global variables should not be `setq'ed without
1261 `defvar'ing them first, because the byte-compiler issues warnings. The
1262 reason for the warning is the following:
1264 (defun flurgoze nil) ; ok, global internal variable
1267 (setq flurghoze t) ; ops! a typo, but semantically correct.
1268 ; however, the byte-compiler warns.
1270 While compiling toplevel forms:
1271 ** assignment to free variable flurghoze
1274 File: xemacs-faq.info, Node: Q5.1.7, Next: Q5.1.8, Prev: Q5.1.6, Up: Miscellaneous
1276 Q5.1.7: I like the `do' form of cl, does it slow things down?
1277 -------------------------------------------------------------
1279 It shouldn't. Here is what Dave Gillespie has to say about cl.el
1282 Many of the advanced features of this package, such as `defun*',
1283 `loop', and `setf', are implemented as Lisp macros. In
1284 byte-compiled code, these complex notations will be expanded into
1285 equivalent Lisp code which is simple and efficient. For example,
1291 are expanded at compile-time to the Lisp forms
1294 (setcar p (cons x (car p)))
1296 which are the most efficient ways of doing these respective
1297 operations in Lisp. Thus, there is no performance penalty for
1298 using the more readable `incf' and `push' forms in your compiled
1301 _Interpreted_ code, on the other hand, must expand these macros
1302 every time they are executed. For this reason it is strongly
1303 recommended that code making heavy use of macros be compiled. (The
1304 features labelled "Special Form" instead of "Function" in this
1305 manual are macros.) A loop using `incf' a hundred times will
1306 execute considerably faster if compiled, and will also
1307 garbage-collect less because the macro expansion will not have to
1308 be generated, used, and thrown away a hundred times.
1310 You can find out how a macro expands by using the `cl-prettyexpand'
1314 File: xemacs-faq.info, Node: Q5.1.8, Next: Q5.1.9, Prev: Q5.1.7, Up: Miscellaneous
1316 Q5.1.8: I like recursion, does it slow things down?
1317 ---------------------------------------------------
1319 Yes. Emacs byte-compiler cannot do much to optimize recursion. But
1320 think well whether this is a real concern in Emacs. Much of the Emacs
1321 slowness comes from internal mechanisms such as redisplay, or from the
1322 fact that it is an interpreter.
1324 Please try not to make your code much uglier to gain a very small
1325 speed gain. It's not usually worth it.