new.texi 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. @iftex
  2. @unnumbered XEmacs Features
  3. This section describes the difference between Emacs Version 18 and
  4. XEmacs.
  5. @unnumberedsec General Changes
  6. @itemize @bullet
  7. @ignore
  8. @item
  9. XEmacs has a new vi emulation mode called evi mode. To
  10. start evi mode in Emacs, type the command @kbd{M-x evi}. If you want
  11. Emacs to automatically put you in evi-mode all the time, include this
  12. line in your init file:
  13. @example
  14. (setq term-setup-hook 'evi)
  15. @end example
  16. @xref{evi Mode} for a brief discussion.
  17. @xref{Init File}.
  18. @end ignore
  19. @item
  20. XEmacs has a new vi emulation mode called ``viper'' mode. To start
  21. viper mode in XEmacs, type the command @kbd{M-x viper-mode}. If you
  22. want XEmacs to automatically put you in viper-mode all the time, include
  23. this line in your init file:
  24. @example
  25. (viper-mode)
  26. @end example
  27. @xref{Init File}.
  28. @item
  29. Earlier versions of Emacs only allowed keybindings to ASCII character
  30. sequences. XEmacs has greatly expanded this by allowing you to
  31. use a vector of key sequences which are in turn composed of a modifier
  32. and a keysym. @xref{Keystrokes} for more information.
  33. @item
  34. The keymap data structure has been reimplemented to allow the use of a
  35. character set larger than ASCII. Keymaps are no longer alists and/or
  36. vectors; they are a new primary data type. Consequently, code which
  37. manipulated keymaps with list or array manipulation functions will no
  38. longer work. It must use the functions @code{define-key} or
  39. @code{map-keymap} and @code{set-keymap-parent} (the new keymap
  40. functions). @xref{Key Bindings} for more information.
  41. @item
  42. Input and display of all ISO-8859-1 characters is supported.
  43. @item
  44. Multiple fonts, including variable-width fonts, and fonts of differing
  45. heights, are supported.
  46. @item
  47. There is a new @file{tags} package and a new UNIX manual browsing
  48. package. They are similar to earlier versions; for more information look
  49. at the source code.
  50. @item
  51. There is a new implementation of Dired, with many new features. The
  52. online info for Dired, @i{not} the Dired node of Emacs info, provides
  53. more detail.
  54. @item
  55. GNUS (a network news reader), VM (an alternative mail reader), ILISP (a
  56. package for interacting with inferior Lisp processes), ANGE-FTP (a package
  57. for making FTP-accessible files appear just like files on the local disk,
  58. even to Dired), Calendar (an Emacs-based calendar and appointment-
  59. management tool), and W3 (an interface to the World Wide Web) are a part
  60. of the XEmacs Lisp library. See the related documentation in the
  61. online info browser.
  62. @item
  63. Emacs now supports floating-point numbers.
  64. @item
  65. When you send mail, mail aliases are now expanded in the buffer. In
  66. earlier versions, they were expanded after the mail-sending command was
  67. executed.
  68. @item
  69. The initial value of @code{load-path} is computed when Emacs starts up,
  70. instead of being hardcoded in when Emacs is compiled. As a result, you
  71. can now move the Emacs executable and Lisp library to a
  72. different location in the file system without having to recompile.
  73. @item
  74. Any existing subdirectories of the Emacs Lisp directory are now added to the
  75. @code{load-path} by default.
  76. @item
  77. On some machines, you can change the audible bell using the
  78. @code{sound-alist} variable. @xref{Audible Bell} for more information.
  79. @item
  80. You can use multiple X windows to display multiple Emacs frames.
  81. @item
  82. You can use the X selection mechanism to copy material from other
  83. applications and into other applications. You can also use all Emacs
  84. region commands on a region selected with the mouse. @xref{Mouse
  85. Selection} for more information.
  86. @item
  87. By default, the variable @code{zmacs-regions} is set to highlight the region
  88. between point and the mark. This unifies X selection and Emacs selection
  89. behavior.
  90. @item
  91. XEmacs has a menu bar for mouse-controlled operations in addition to
  92. keystrokes. @xref{Pull-down Menus}.
  93. @item
  94. You can look in the file @file{/usr/local/lib/xemacs-19.11/etc/Emacs.ad} for
  95. a list of Emacs X resources. You can set these resources in your X
  96. environment to set your preferences for color, fonts, location, and the size
  97. of XEmacs frames. Refer to your X documentation for more information
  98. about resources.
  99. @unnumberedsec New Commands and Variables
  100. There are many new functions in XEmacs, and many existing functions
  101. whose semantics have been expanded. Most of these are only of interest
  102. to the Emacs-Lisp programmer; see the NEWS file @kbd{C-h n} for a complete
  103. list. What follows is a partial list of the new interactive commands:
  104. @findex byte-compile-and-load-file
  105. @findex byte-compile-buffer
  106. @item
  107. @code{byte-compile-and-load-file} and @code{byte-compile-buffer}
  108. byte-compile the contents of a file or buffer.
  109. @findex conx
  110. The new @code{conx} function lets you generate random sentences for your
  111. amusement.
  112. @findex compile-defun
  113. @item
  114. @code{compile-defun} compiles and evaluates the current top-level
  115. form.
  116. @findex find-this-file
  117. @findex find-this-file-other-window
  118. @item
  119. @code{find-this-file} and @code{find-this-file-other-window} can be used
  120. interactively with a prefix argument to switch to the filename at point
  121. in the buffer. @code{find-this-file-other-window} displays the file in
  122. another window.
  123. @findex invert-face
  124. @findex make-face-bold
  125. @findex make-face-bold-italic
  126. @findex make-face-italic
  127. @findex make-face-unbold
  128. @findex make-face-unitalic
  129. @findex set-face-background
  130. @findex set-face-background-pixmap
  131. @findex set-face-font
  132. @findex set-face-foreground
  133. @findex set-face-underline-p
  134. @item
  135. Several new functions have been added that allow you to customize the
  136. color and font attributes of a region of text: @code{invert-face},
  137. @code{make-face-bold}, @code{make-face-bold-italic},
  138. @code{make-face-italic}, @code{make-face-unbold},
  139. @code{make-face-unitalic}, @code{set-face-background},
  140. @code{set-face-background-pixmap}, @code{set-face-font},
  141. @code{set-face-foreground}, and @code{set-face-underline-p}.
  142. @findex load-default-sounds
  143. @findex load-sound-file
  144. @findex play-sound
  145. @item
  146. @code{load-default-sounds} and @code{load-sound-file} allow you to
  147. customize the audible bell sound. @code{load-default-sounds} loads and
  148. installs sound files. @code{load-sound-file} reads in audio files and
  149. adds them to the sound alist. @code{play-sound} plays the specified
  150. sound type.
  151. @findex locate-library
  152. @item
  153. @code{locate-library} finds the file that the function
  154. @code{load-library} loads, and it displays the file's full pathname.
  155. @findex make-directory
  156. @findex remove-directory
  157. @item
  158. @code{make-directory} creates a directory, while @code{remove-directory}
  159. removes a directory.
  160. @findex mark-beginning-of-buffer
  161. @findex mark-end-of-buffer
  162. @item
  163. @code{mark-beginning-of-buffer} and @code{mark-end-of-buffer} push the
  164. mark to the beginning or end of a buffer, respectively.
  165. @findex mouse-del-char
  166. @findex mouse-delete-window
  167. @findex mouse-keep-one-window
  168. @findex mouse-kill-line
  169. @findex mouse-line-length
  170. @findex mouse-scroll
  171. @findex mouse-select
  172. @findex mouse-select-and-split
  173. @findex mouse-set-mark
  174. @findex mouse-set-point
  175. @findex mouse-track
  176. @findex mouse-track-adjust
  177. @findex mouse-track-and-copy-to-cutbuffer
  178. @findex mouse-track-delete-and-insert
  179. @findex mouse-track-insert
  180. @findex mouse-window-to-region
  181. Several functions have been added that allow you to perform various
  182. editing, region, and window operations using the mouse:
  183. @code{mouse-del-char}, @code{mouse-delete-window},
  184. @code{mouse-keep-one-window}, @code{mouse-kill-line},
  185. @code{mouse-line-length}, @code{mouse-scroll}, @code{mouse-select},
  186. @code{mouse-select-and-split}, @code{mouse-set-mark},
  187. @code{mouse-set-point}, @code{mouse-track}, @code{mouse-track-adjust},
  188. @code{mouse-track-and-copy-to-cutbuffer},
  189. @code{mouse-track-delete-and-insert}, @code{mouse-track-insert}, and
  190. @code{mouse-window-to-region}.
  191. @findex compare-windows
  192. @item
  193. @code{compare-windows} takes an argument @var{ignore-whitespace}.
  194. The argument means ignore changes in whitespace.
  195. @end itemize
  196. You can conditionalize your @file{.emacs} file as follows so that XEmacs
  197. commands are invoked only when you are in XEmacs:
  198. @cindex version number
  199. @example
  200. (cond ((string-match "Lucid" emacs-version)
  201. ;;
  202. ;; Code for any version of Lucid Emacs or XEmacs goes here
  203. ;;
  204. ))
  205. (cond ((and (string-match "XEmacs" emacs-version)
  206. (or (> emacs-major-version 19)
  207. (>= emacs-minor-version 12)))
  208. ;;
  209. ;; Code which requires XEmacs version 19.12 or newer goes here
  210. ;;
  211. ))
  212. (cond ((>= emacs-major-version 19)
  213. ;;
  214. ;; Code for any vintage-19 emacs goes here
  215. ;;
  216. ))
  217. (cond ((and (not (string-match "Lucid" emacs-version))
  218. (= emacs-major-version 19))
  219. ;;
  220. ;; Code specific to FSF Emacs 19 (not XEmacs) goes here
  221. ;;
  222. ))
  223. (cond ((< emacs-major-version 19)
  224. ;;
  225. ;; Code specific to emacs 18 goes here
  226. ;;
  227. ))
  228. @end example
  229. Alternatively, use @file{.xemacs/init.el} for an init file. @xref{Init File}.
  230. Of particular interest for use in files are:
  231. @itemize @bullet
  232. @findex add-menu
  233. @findex add-menu-item
  234. @findex delete-menu-item
  235. @findex disable-menu-item
  236. @findex enable-menu-item
  237. @findex relabel-menu-item
  238. @item
  239. @code{add-menu} lets you add a new menu to the menubar or a submenu to a
  240. pull-down menu. @code{add-menu-item}, @code{disable-menu-item},
  241. @code{delete-menu-item}, @code{enable-menu-item}, and
  242. @code{relabel-menu-item} allow you to customize the XEmacs
  243. pull-down menus.
  244. @findex make-frame
  245. @item
  246. @code{make-frame} creates a new Emacs frame (X window).
  247. @end itemize
  248. These new variables are only present in XEmacs:
  249. @itemize @bullet
  250. @vindex minibuffer-confirm-incomplete
  251. @item
  252. @code{minibuffer-confirm-incomplete} prompts for confirmation in
  253. contexts where @code{completing-read} allows answers that are not valid
  254. completions.
  255. @vindex x-mode-pointer-shape
  256. @vindex x-nontext-pointer-shape
  257. @vindex x-pointer-background-color
  258. @vindex x-pointer-foreground-color
  259. @vindex x-pointer-shape
  260. @item
  261. Several variables have been added that allow you to customize the color
  262. and shape of the mouse pointer: @code{x-pointer-background-color},
  263. @code{x-pointer-foreground-color}, @code{x-mode-pointer-shape},
  264. @code{x-pointer-shape}, and @* @code{x-nontext-pointer-shape}.
  265. @vindex zmacs-regions
  266. @item
  267. @code{zmacs-regions} determines whether LISPM-style active regions
  268. should be used.
  269. @end itemize
  270. @unnumberedsec Changes in Key Bindings
  271. XEmacs has the following new default function keybindings:
  272. @table @kbd
  273. @item @key{HELP}
  274. Same as @kbd{C-h}.
  275. @item @key{UNDO}
  276. Same as @kbd{M-x undo}.
  277. @item @key{CUT}
  278. Same as the Cut menu item; that is, it copies the selected text to
  279. the X Clipboard selection.
  280. @item @key{COPY}
  281. Same as the Copy menu item.
  282. @item @key{PASTE}
  283. Same as the Paste menu item.
  284. @item @key{PGUP}
  285. Same as @kbd{M-v}.
  286. @item @key{PGDN}
  287. Same as @kbd{C-v}.
  288. @item @key{HOME}
  289. Same as @kbd{M-<}.
  290. @item @key{END}
  291. Same as @kbd{M->}.
  292. @item @key{LEFT-ARROW}
  293. Same as the function @code{backward-char}.
  294. @item @key{RIGHT-ARROW}
  295. Same as the function @code{forward-char}.
  296. @item @key{UP-ARROW}
  297. Same as the function @code{previous-line}.
  298. @item @key{DOWN-ARROW}
  299. Same as the function @code{next-line}.
  300. @end table
  301. @end iftex