comparison etc/sample.init.el @ 558:ed498ef2108b

[xemacs-hg @ 2001-05-23 09:59:33 by ben] xemacs.mak: call `ver' to get the exact os version and put it in the installation; suggestion from adrian. behavior-defs.el: Add scroll-in-place, jka-compr, efs, fix up some things. pop.c: Remove BROKEN_CYGWIN. etc\sample.init.el: Rewrite to be much more careful about loading features -- now it decays gracefully even in the complete absence of packages. Also avoid doing obnoxious things when loading efs. configure.in: add some support for eventually turning on file coding by default. Fix numerous places where AC_MSG_WARN had quotes around its arg, which is bad. Replace with []. Same for AC_MSG_ERROR. s\cygwin32.h, s\mingw32.h: remove support for way old beta versions of cygwin. don't put -Wno-sign-compare in the system switches; this isn't a system issue. define BROKEN_SIGIO for cygwin to get C-g support. device-msw.c: signal an error rather than crash with an unavailable network printer (from Mike Alexander). event-msw.c: cleanup headers. fix (hopefully) an error with data corruption when sending to a network connection. fileio.c: Fix evil code that attempts to handle the ~user prefix by (a) always assuming we're referencing ourselves and not even verifying the user -- hence any file with a tilde as its first char is invalid! (b) if there wasn't a slash following the filename, the pointer was set *past* the end of file and we started reading from uninitialized memory. Now we simply treat these as files, always. optionally for 21.4 (doc fix): lread.c: cambia de pas_de_lache_ici -- al minimo usa la palabra certa. frame.c: fix warnings. emacs.c, nt.c, ntproc.c, process-nt.c, realpath.c, unexnt.c: rename MAX_PATH to standard PATH_MAX. process-nt.c, realpath.c: cleanup headers. process-unix.c, sysdep.c, systime.h, syswindows.h: kill BROKEN_CYGWIN and support for way old beta versions of cygwin. sysfile.h: use _MAX_PATH (Windows) preferentially for PATH_MAX if defined. include io.h on Cygwin (we need get_osfhandle()). include sys/fcntl.h always, since we were including it in various header files anyway. unexcw.c: fix up style to conform to standard. remove duplicate definition of PERROR. buffer.c: comment change. database.c, debug.h, device-tty.c, dired-msw.c, glyphs-msw.c: header cleanups (remove places that directly include a system header file, because we have our own layer to do this more cleanly and portably); indentation fixes.
author ben
date Wed, 23 May 2001 09:59:48 +0000
parents 52626a2f02ef
children 943eaba38521
comparison
equal deleted inserted replaced
557:f486da5f1a3b 558:ed498ef2108b
223 ; (emacs-version>= 20 0)) 223 ; (emacs-version>= 20 0))
224 ; ;; 224 ; ;;
225 ; ;; Code specific to GNU Emacs 20 or newer (not XEmacs) goes here 225 ; ;; Code specific to GNU Emacs 20 or newer (not XEmacs) goes here
226 ; ;; 226 ; ;;
227 ; )) 227 ; ))
228
229 (defun Init-safe-require (feat)
230 "Try to REQUIRE the specified feature. Errors occurring are silenced.
231 \(Perhaps in the future there will be a way to get at the error.)
232 Returns t if the feature was successfully required."
233 (condition-case nil
234 (progn (require feat) t)
235 (error nil)))
228 236
229 237
230 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 238 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
231 ;; Key Definitions ;; 239 ;; Key Definitions ;;
232 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 240 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
613 ;; (hopefully) even work under TTY's. 621 ;; (hopefully) even work under TTY's.
614 (global-set-key '(meta K) 'kill-sentence) 622 (global-set-key '(meta K) 'kill-sentence)
615 623
616 ;; Make sure we get Windows-like shifted-motion key selection behavior 624 ;; Make sure we get Windows-like shifted-motion key selection behavior
617 ;; on recent XEmacs versions. 625 ;; on recent XEmacs versions.
618 (if (boundp 'shifted-motion-keys-select-region) 626 (cond ((boundp 'shifted-motion-keys-select-region)
619 (setq shifted-motion-keys-select-region t) 627 (setq shifted-motion-keys-select-region t))
620 ;; otherwise, try the pc-select package -- 628 ;; otherwise, try the pc-select package --
621 (condition-case nil 629 ((Init-safe-require 'pc-select)
622 (progn 630 (pc-select-mode 1)))
623 (require 'pc-select)
624 (pc-select-mode 1))
625 (error nil)))
626 631
627 ;; The following commented-out code rearranges the keymap in an 632 ;; The following commented-out code rearranges the keymap in an
628 ;; unconventional but extremely useful way for programmers. Parens 633 ;; unconventional but extremely useful way for programmers. Parens
629 ;; and braces are both available without using the shift key (using 634 ;; and braces are both available without using the shift key (using
630 ;; the bracket keys and f11/f12, respectively). Brackets (much less 635 ;; the bracket keys and f11/f12, respectively). Brackets (much less
927 932
928 ;;; pending-delete-mode causes typed text to replace a selection, 933 ;;; pending-delete-mode causes typed text to replace a selection,
929 ;;; rather than append -- standard behavior under all window systems 934 ;;; rather than append -- standard behavior under all window systems
930 ;;; nowadays. 935 ;;; nowadays.
931 936
932 (pending-delete-mode 1) 937 (if (fboundp 'pending-delete-mode)
933 938 (pending-delete-mode 1))
934 ;;; enable region selection with shift+arrows (on by default in 21.5
935 ;;; and up)
936 (setq shifted-motion-keys-select-region t)
937 939
938 ;;; NOTE: In this context, `windows-nt' actually refers to all MS 940 ;;; NOTE: In this context, `windows-nt' actually refers to all MS
939 ;;; Windows operating systems! 941 ;;; Windows operating systems!
940 (when (eq system-type 'windows-nt) 942 (when (eq system-type 'windows-nt)
941 ;; Get mail working under Windows. 943 ;; Get mail working under Windows.
970 ;; in C mode, M-c (use Sh-M-c instead) 972 ;; in C mode, M-c (use Sh-M-c instead)
971 973
972 (setq menu-accelerator-enabled 'menu-force) 974 (setq menu-accelerator-enabled 'menu-force)
973 975
974 ;; Make Cygwin `make' work inside a shell buffer. 976 ;; Make Cygwin `make' work inside a shell buffer.
975 (setenv "MAKE_MODE" "UNIX")) 977 (if (boundp 'setenv) (setenv "MAKE_MODE" "UNIX")))
976 978
977 ;; This shows how to set up the XEmacs side of tags. (To create the 979 ;; This shows how to set up the XEmacs side of tags. (To create the
978 ;; TAGS table, use the `etags' program found in the XEmacs bin 980 ;; TAGS table, use the `etags' program found in the XEmacs bin
979 ;; directory. Run it in the root directory of your source tree and 981 ;; directory. Run it in the root directory of your source tree and
980 ;; specify all source and include files on the command line.) 982 ;; specify all source and include files on the command line.)
1021 ;; (Note that sampled sounds only work if XEmacs was compiled with 1023 ;; (Note that sampled sounds only work if XEmacs was compiled with
1022 ;; sound support and we're running on MS Windows, on a machine which 1024 ;; sound support and we're running on MS Windows, on a machine which
1023 ;; has a NetAudio or ESD server, or on the console of a Linux, Sparc, 1025 ;; has a NetAudio or ESD server, or on the console of a Linux, Sparc,
1024 ;; HP, or SGI machine. Otherwise, you just get the standard beep.) 1026 ;; HP, or SGI machine. Otherwise, you just get the standard beep.)
1025 1027
1026 (cond ((or (and (getenv "DISPLAY") 1028 (cond ((and (fboundp 'load-default-sounds)
1027 (string-match ":0" (getenv "DISPLAY"))) 1029 (or (and (getenv "DISPLAY")
1028 (and (eq (console-type) 'mswindows) 1030 (string-match ":0" (getenv "DISPLAY")))
1029 (device-sound-enabled-p))) 1031 (and (eq (console-type) 'mswindows)
1030 (load-default-sounds) 1032 (device-sound-enabled-p))))
1031 ;; On Windows, at least, the sound "quiet-beep", which is normally 1033 (condition-case nil
1032 ;; given the symbolic name `quiet' and is used for Quit and such, 1034 (progn
1033 ;; is just totally disgusting. So make this name correspond to a 1035 (load-default-sounds)
1034 ;; more innocuous sound. 1036 ;; On Windows, at least, the sound "quiet-beep", which is normally
1035 (load-sound-file "drum-beep" 'quiet 80)) 1037 ;; given the symbolic name `quiet' and is used for Quit and such,
1038 ;; is just totally disgusting. So make this name correspond to a
1039 ;; more innocuous sound.
1040 (load-sound-file "drum-beep" 'quiet 80))
1041 (error nil)))
1036 (t 1042 (t
1037 (setq bell-volume 40) 1043 (setq bell-volume 40)
1038 (setq sound-alist 1044 (setq sound-alist
1039 (append sound-alist '((no-completion :pitch 500)))) 1045 (append sound-alist '((no-completion :pitch 500))))
1040 )) 1046 ))
1180 ;;; ******************** 1186 ;;; ********************
1181 ;;; Load efs, which uses the FTP protocol as a pseudo-filesystem. 1187 ;;; Load efs, which uses the FTP protocol as a pseudo-filesystem.
1182 ;;; When this is loaded, the pathname syntax /user@host:/remote/path 1188 ;;; When this is loaded, the pathname syntax /user@host:/remote/path
1183 ;;; refers to files accessible through ftp. 1189 ;;; refers to files accessible through ftp.
1184 ;;; 1190 ;;;
1185 (require 'dired) 1191 (Init-safe-require 'dired)
1186 ;; compatible ange-ftp/efs initialization derived from code 1192
1187 ;; from John Turner <turner@lanl.gov> 1193 (or (Init-safe-require 'efs-auto) (Init-safe-require 'ange-ftp))
1188 ;;
1189 ;; The environment variable EMAIL_ADDRESS is used as the password
1190 ;; for access to anonymous ftp sites, if it is set. If not, one is
1191 ;; constructed using the environment variables USER and DOMAINNAME
1192 ;; (e.g. turner@lanl.gov), if set.
1193
1194 (condition-case nil
1195 (progn
1196 (require 'efs-auto)
1197 (if (getenv "USER")
1198 (setq efs-default-user (getenv "USER")))
1199 (if (getenv "EMAIL_ADDRESS")
1200 (setq efs-generate-anonymous-password (getenv "EMAIL_ADDRESS"))
1201 (if (and (getenv "USER")
1202 (getenv "DOMAINNAME"))
1203 (setq efs-generate-anonymous-password
1204 (concat (getenv "USER")"@"(getenv "DOMAINNAME")))))
1205 (setq efs-auto-save 1))
1206 (error
1207 (require 'ange-ftp)
1208 (if (getenv "USER")
1209 (setq ange-ftp-default-user (getenv "USER")))
1210 (if (getenv "EMAIL_ADDRESS")
1211 (setq ange-ftp-generate-anonymous-password (getenv "EMAIL_ADDRESS"))
1212 (if (and (getenv "USER")
1213 (getenv "DOMAINNAME"))
1214 (setq ange-ftp-generate-anonymous-password
1215 (concat (getenv "USER")"@"(getenv "DOMAINNAME")))))
1216 (setq ange-ftp-auto-save 1)
1217 ))
1218
1219 1194
1220 ;;; ******************** 1195 ;;; ********************
1221 ;;; Load the default-dir.el package which installs fancy handling of 1196 ;;; Load the default-dir.el package which installs fancy handling of
1222 ;;; the initial contents in the minibuffer when reading file names. 1197 ;;; the initial contents in the minibuffer when reading file names.
1223 1198 ;; #### but it seems to cause some breakage.
1224 ;(condition-case nil 1199 ;(Init-safe-require 'default-dir))
1225 ; (require 'default-dir)
1226 ; (error nil))
1227
1228 1200
1229 ;;; ******************** 1201 ;;; ********************
1230 ;;; Put all of your autosave files in one place, instead of scattering 1202 ;;; Put all of your autosave files in one place, instead of scattering
1231 ;;; them around the file system. This has many advantages -- e.g. it 1203 ;;; them around the file system. This has many advantages -- e.g. it
1232 ;;; will eliminate slowdowns caused by editing files on a slow NFS 1204 ;;; will eliminate slowdowns caused by editing files on a slow NFS
1233 ;;; server. (*Provided* that your home directory is local or on a 1205 ;;; server. (*Provided* that your home directory is local or on a
1234 ;;; fast server! If not, pick a value for `auto-save-directory' that 1206 ;;; fast server! If not, pick a value for `auto-save-directory' that
1235 ;;; is fast fast fast!) 1207 ;;; is fast fast fast!)
1236 ;;; 1208 ;;;
1237 ;;; Unfortunately, the code that implements this (auto-save.el) is 1209 ;;; Unfortunately, the code that implements this (auto-save.el) is
1238 ;;; broken on Windows in 21.4 and earlier. 1210 ;;; broken on Windows prior to 21.4.
1239 (unless (and (eq system-type 'windows-nt) 1211 (unless (and (eq system-type 'windows-nt)
1240 (not (emacs-version>= 21 5))) 1212 (not (emacs-version>= 21 4)))
1241 (setq auto-save-directory (expand-file-name "~/.autosave/") 1213 (setq auto-save-directory (expand-file-name "~/.autosave/")
1242 auto-save-directory-fallback auto-save-directory 1214 auto-save-directory-fallback auto-save-directory
1243 auto-save-hash-p nil 1215 auto-save-hash-p nil
1244 efs-auto-save t 1216 efs-auto-save t
1245 efs-auto-save-remotely nil 1217 efs-auto-save-remotely nil
1246 ;; now that we have auto-save-timeout, let's crank this up 1218 ;; now that we have auto-save-timeout, let's crank this up
1247 ;; for better interactive response. 1219 ;; for better interactive response.
1248 auto-save-interval 2000 1220 auto-save-interval 2000
1249 ) 1221 )
1250 ;; We load this afterwards because it checks to make sure the
1251 ;; auto-save-directory exists (creating it if not) when it's loaded.
1252 (require 'auto-save)
1253 ) 1222 )
1254 1223
1255 1224
1256 ;;; ******************** 1225 ;;; ********************
1257 ;;; cc-mode (the mode you're in when editing C, C++, and Objective C files) 1226 ;;; cc-mode (the mode you're in when editing C, C++, and Objective C files)
1271 ;;; search multiple words instead of just prefixes; for example, the command 1240 ;;; search multiple words instead of just prefixes; for example, the command
1272 ;;; `M-x byte-compile-and-load-file RET' can be abbreviated as `M-x b-c-a RET' 1241 ;;; `M-x byte-compile-and-load-file RET' can be abbreviated as `M-x b-c-a RET'
1273 ;;; because there are no other commands whose first three words begin with 1242 ;;; because there are no other commands whose first three words begin with
1274 ;;; the letters `b', `c', and `a' respectively. 1243 ;;; the letters `b', `c', and `a' respectively.
1275 ;;; 1244 ;;;
1276 (load-library "completer") 1245 (Init-safe-require 'completer)
1277 1246
1278 1247
1279 ;;; ******************** 1248 ;;; ********************
1280 ;;; Load crypt, which is a package for automatically decoding and reencoding 1249 ;;; Load crypt, which is a package for automatically decoding and reencoding
1281 ;;; files by various methods - for example, you can visit a .Z or .gz file, 1250 ;;; files by various methods - for example, you can visit a .Z or .gz file,
1285 crypt-confirm-password t ; make sure new passwords are correct 1254 crypt-confirm-password t ; make sure new passwords are correct
1286 ;crypt-never-ever-decrypt t ; if you don't encrypt anything, set this to 1255 ;crypt-never-ever-decrypt t ; if you don't encrypt anything, set this to
1287 ; tell it not to assume that "binary" files 1256 ; tell it not to assume that "binary" files
1288 ; are encrypted and require a password. 1257 ; are encrypted and require a password.
1289 ) 1258 )
1290 (require 'crypt) 1259 (Init-safe-require 'crypt)
1291 1260
1292 1261
1293 ;;; ******************** 1262 ;;; ********************
1294 ;;; Filladapt is a syntax-highlighting package. When it is enabled it 1263 ;;; Filladapt is a syntax-highlighting package. When it is enabled it
1295 ;;; makes filling (e.g. using M-q) much much smarter about paragraphs 1264 ;;; makes filling (e.g. using M-q) much much smarter about paragraphs
1296 ;;; that are indented and/or are set off with semicolons, dashes, etc. 1265 ;;; that are indented and/or are set off with semicolons, dashes, etc.
1297 1266
1298 (require 'filladapt) 1267 (Init-safe-require 'filladapt)
1299 (setq-default filladapt-mode t) 1268 (setq-default filladapt-mode t)
1300 (add-hook 'c-mode-hook 'turn-off-filladapt-mode) 1269 (when (fboundp 'turn-off-filladapt-mode)
1270 (add-hook 'c-mode-hook 'turn-off-filladapt-mode)
1271 (add-hook 'outline-mode-hook 'turn-off-filladapt-mode))
1301 1272
1302 1273
1303 ;;; ******************** 1274 ;;; ********************
1304 ;;; Font-Lock is a syntax-highlighting package. When it is enabled and you 1275 ;;; Font-Lock is a syntax-highlighting package. When it is enabled and you
1305 ;;; are editing a program, different parts of your program will appear in 1276 ;;; are editing a program, different parts of your program will appear in
1322 ; ;; but I want to specify my own colors, so I turn off all 1293 ; ;; but I want to specify my own colors, so I turn off all
1323 ; ;; default values. 1294 ; ;; default values.
1324 ; (setq font-lock-use-default-fonts nil) 1295 ; (setq font-lock-use-default-fonts nil)
1325 ; (setq font-lock-use-default-colors nil) 1296 ; (setq font-lock-use-default-colors nil)
1326 1297
1327 (require 'font-lock) 1298 (Init-safe-require 'font-lock)
1328 1299
1329 ; ;; Mess around with the faces a bit. Note that you have 1300 ; ;; Mess around with the faces a bit. Note that you have
1330 ; ;; to change the font-lock-use-default-* variables *before* 1301 ; ;; to change the font-lock-use-default-* variables *before*
1331 ; ;; loading font-lock, and wait till *after* loading font-lock 1302 ; ;; loading font-lock, and wait till *after* loading font-lock
1332 ; ;; to customize the faces. 1303 ; ;; to customize the faces.
1358 ;;; by doing it "on-the-fly" -- only the visible portion of the 1329 ;;; by doing it "on-the-fly" -- only the visible portion of the
1359 ;;; buffer is fontified. The results may not always be quite as 1330 ;;; buffer is fontified. The results may not always be quite as
1360 ;;; accurate as using full font-lock or fast-lock, but it's *much* 1331 ;;; accurate as using full font-lock or fast-lock, but it's *much*
1361 ;;; faster. No more annoying pauses when you load files. 1332 ;;; faster. No more annoying pauses when you load files.
1362 1333
1363 (add-hook 'font-lock-mode-hook 'turn-on-lazy-lock) 1334 (if (fboundp 'turn-on-lazy-lock)
1335 (add-hook 'font-lock-mode-hook 'turn-on-lazy-lock))
1336
1364 ;; I personally don't like "stealth mode" (where lazy-lock starts 1337 ;; I personally don't like "stealth mode" (where lazy-lock starts
1365 ;; fontifying in the background if you're idle for 30 seconds) 1338 ;; fontifying in the background if you're idle for 30 seconds)
1366 ;; because it takes too long to wake up again on my piddly Sparc 1+. 1339 ;; because it takes too long to wake up again.
1367 (setq lazy-lock-stealth-time nil) 1340 (setq lazy-lock-stealth-time nil)
1368 1341
1369 1342
1370 ;;; ******************** 1343 ;;; ********************
1371 ;;; func-menu is a package that scans your source file for function 1344 ;;; func-menu is a package that scans your source file for function
1375 ;;; Scanning the buffer takes some time, but not much. 1348 ;;; Scanning the buffer takes some time, but not much.
1376 ;;; 1349 ;;;
1377 ;;; Send bug reports, enhancements etc to: 1350 ;;; Send bug reports, enhancements etc to:
1378 ;;; David Hughes <ukchugd@ukpmr.cs.philips.nl> 1351 ;;; David Hughes <ukchugd@ukpmr.cs.philips.nl>
1379 ;;; 1352 ;;;
1380 (cond (running-xemacs 1353 (cond ((and running-xemacs (Init-safe-require 'func-menu))
1381 (require 'func-menu)
1382 (global-set-key '(shift f12) 'function-menu) 1354 (global-set-key '(shift f12) 'function-menu)
1383 (add-hook 'find-file-hooks 'fume-add-menubar-entry) 1355 (add-hook 'find-file-hooks 'fume-add-menubar-entry)
1384 (global-set-key "\C-cl" 'fume-list-functions) 1356 (global-set-key "\C-cl" 'fume-list-functions)
1385 (global-set-key "\C-cg" 'fume-prompt-function-goto) 1357 (global-set-key "\C-cg" 'fume-prompt-function-goto)
1386 1358
1427 1399
1428 ;;; ******************** 1400 ;;; ********************
1429 ;;; resize-minibuffer-mode makes the minibuffer automatically 1401 ;;; resize-minibuffer-mode makes the minibuffer automatically
1430 ;;; resize as necessary when it's too big to hold its contents. 1402 ;;; resize as necessary when it's too big to hold its contents.
1431 1403
1432 (autoload 'resize-minibuffer-mode "rsz-minibuf" nil t) 1404 (when (fboundp 'resize-minibuffer-mode)
1433 (resize-minibuffer-mode) 1405 (resize-minibuffer-mode)
1434 (setq resize-minibuffer-window-exactly nil) 1406 (setq resize-minibuffer-window-exactly nil))
1435 1407
1436 1408
1437 ;;; ******************** 1409 ;;; ********************
1438 ;;; scroll-in-place is a package that keeps the cursor on the same line (and in the same column) when scrolling by a page using PgUp/PgDn. 1410 ;;; scroll-in-place is a package that keeps the cursor on the same line (and in the same column) when scrolling by a page using PgUp/PgDn.
1439 1411
1440 (require 'scroll-in-place) 1412 (if (Init-safe-require 'scroll-in-place)
1441 (turn-on-scroll-in-place) 1413 (turn-on-scroll-in-place))
1442 1414
1443 1415
1444 ;;; ******************** 1416 ;;; ********************
1445 ;;; W3 is a browser for the World Wide Web, and takes advantage of the very 1417 ;;; W3 is a browser for the World Wide Web, and takes advantage of the very
1446 ;;; latest redisplay features in XEmacs. You can access it simply by typing 1418 ;;; latest redisplay features in XEmacs. You can access it simply by typing