comparison etc/sample.emacs @ 100:4be1180a9e89 r20-1b2

Import from CVS: tag r20-1b2
author cvs
date Mon, 13 Aug 2007 09:15:11 +0200
parents 6a378aca36af
children a145efe76779
comparison
equal deleted inserted replaced
99:2d83cbd90d8d 100:4be1180a9e89
256 ; nil ;; do the normal operation 256 ; nil ;; do the normal operation
257 ; (kill-region (point) (mark)) 257 ; (kill-region (point) (mark))
258 ; t ;; don't do the normal operations. 258 ; t ;; don't do the normal operations.
259 ; ))) 259 ; )))
260 260
261
262 )) 261 ))
263 262
264 )) 263 ))
264
265 ;; Oh, and here's a cute hack you might want to put in the sample .emacs
266 ;; file: it changes the color of the window if it's not on the local
267 ;; machine, or if it's running as root:
268
269 ;; local emacs background: whitesmoke
270 ;; remote emacs background: palegreen1
271 ;; root emacs background: coral2
272 (cond
273 ((and (string-match "XEmacs" emacs-version)
274 (eq window-system 'x)
275 (boundp 'emacs-major-version)
276 (= emacs-major-version 19)
277 (>= emacs-minor-version 12))
278 (let* ((root-p (eq 0 (user-uid)))
279 (dpy (or (getenv "DISPLAY") ""))
280 (remote-p (not
281 (or (string-match "^\\(\\|unix\\|localhost\\):" dpy)
282 (let ((s (system-name)))
283 (if (string-match "\\.\\(netscape\\|mcom\\)\\.com" s)
284 (setq s (substring s 0 (match-beginning 0))))
285 (string-match (concat "^" (regexp-quote s)) dpy)))))
286 (bg (cond (root-p "coral2")
287 (remote-p "palegreen1")
288 (t nil))))
289 (cond (bg
290 (let ((def (color-name (face-background 'default)))
291 (faces (list-faces)))
292 (while faces
293 (let ((obg (face-background (car faces))))
294 (if (and obg (equal def (color-name obg)))
295 (set-face-background (car faces) bg)))
296 (setq faces (cdr faces)))))))))
297
265 298
266 ;;; Older versions of emacs did not have these variables 299 ;;; Older versions of emacs did not have these variables
267 ;;; (emacs-major-version and emacs-minor-version.) 300 ;;; (emacs-major-version and emacs-minor-version.)
268 ;;; Let's define them if they're not around, since they make 301 ;;; Let's define them if they're not around, since they make
269 ;;; it much easier to conditionalize on the emacs version. 302 ;;; it much easier to conditionalize on the emacs version.
318 ;; Customization of Specific Packages ;; 351 ;; Customization of Specific Packages ;;
319 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 352 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
320 353
321 354
322 ;;; ******************** 355 ;;; ********************
323 ;;; Load ange-ftp, which uses the FTP protocol as a pseudo-filesystem. 356 ;;; Load efs, which uses the FTP protocol as a pseudo-filesystem.
324 ;;; When this is loaded, the pathname syntax /user@host:/remote/path 357 ;;; When this is loaded, the pathname syntax /user@host:/remote/path
325 ;;; refers to files accessible through ftp. 358 ;;; refers to files accessible through ftp.
326 ;;; 359 ;;;
327 (require 'dired) 360 (require 'dired)
328 (require 'ange-ftp) 361 ;; compatible ange-ftp/efs initialization derived from code
329 (setq ange-ftp-default-user "anonymous" ; id to use for /host:/remote/path 362 ;; from John Turner <turner@lanl.gov>
330 ange-ftp-generate-anonymous-password t ; use $USER@`hostname` 363 ;; As of 19.15, efs is bundled instead of ange-ftp.
331 ange-ftp-binary-file-name-regexp "." ; always transfer in binary mode 364 ;; NB: doesn't handle 20.0 properly, efs didn't appear until 20.1.
365 ;;
366 ;; The environment variable EMAIL_ADDRESS is used as the password
367 ;; for access to anonymous ftp sites, if it is set. If not, one is
368 ;; constructed using the environment variables USER and DOMAINNAME
369 ;; (e.g. turner@lanl.gov), if set.
370
371 (if (and running-xemacs (< emacs-major-version 20) (>= emacs-minor-version 15))
372 (progn
373 (message "Loading and configuring bundled packages... efs")
374 (require 'efs-auto)
375 (if (getenv "USER")
376 (setq efs-default-user (getenv "USER")))
377 (if (getenv "EMAIL_ADDRESS")
378 (setq efs-generate-anonymous-password (getenv "EMAIL_ADDRESS"))
379 (if (and (getenv "USER")
380 (getenv "DOMAINNAME"))
381 (setq efs-generate-anonymous-password
382 (concat (getenv "USER")"@"(getenv "DOMAINNAME")))))
383 (setq efs-auto-save 1)
384 ))
385 (if (and running-xemacs (< emacs-major-version 20) (< emacs-minor-version 15))
386 (progn
387 (message "Loading and configuring bundled packages... ange-ftp")
388 (require 'ange-ftp)
389 (if (getenv "USER")
390 (setq ange-ftp-default-user (getenv "USER")))
391 (if (getenv "EMAIL_ADDRESS")
392 (setq ange-ftp-generate-anonymous-password (getenv "EMAIL_ADDRESS"))
393 (if (and (getenv "USER")
394 (getenv "DOMAINNAME"))
395 (setq ange-ftp-generate-anonymous-password
396 (concat (getenv "USER")"@"(getenv "DOMAINNAME")))))
397 (setq ange-ftp-auto-save 1)
332 ) 398 )
399 )
333 400
334 401
335 ;;; ******************** 402 ;;; ********************
336 ;;; Load the auto-save.el package, which lets you put all of your autosave 403 ;;; Load the auto-save.el package, which lets you put all of your autosave
337 ;;; files in one place, instead of scattering them around the file system. 404 ;;; files in one place, instead of scattering them around the file system.
338 ;;; 405 ;;;
339 (setq auto-save-directory (expand-file-name "~/autosave/") 406 (setq auto-save-directory (expand-file-name "~/autosave/")
340 auto-save-directory-fallback auto-save-directory 407 auto-save-directory-fallback auto-save-directory
341 auto-save-hash-p nil 408 auto-save-hash-p nil
342 ange-ftp-auto-save t 409 efs-auto-save t
343 ange-ftp-auto-save-remotely nil 410 efs-auto-save-remotely nil
344 ;; now that we have auto-save-timeout, let's crank this up 411 ;; now that we have auto-save-timeout, let's crank this up
345 ;; for better interactive response. 412 ;; for better interactive response.
346 auto-save-interval 2000 413 auto-save-interval 2000
347 ) 414 )
348 ;; We load this afterwards because it checks to make sure the 415 ;; We load this afterwards because it checks to make sure the