site-start.el.emacs23 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;; GNU Emacs EMACS_VERSION default settings for Vine Linux
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4. (setq emacs-build-system
  5. (concat emacs-build-system ", modified for Vine Linux"))
  6. (setq report-emacs-bug-address "Vine@vinelinux.org")
  7. (defcustom emacs-ime (getenv "EMACS_IME")
  8. "A variable of default Input Method Editor"
  9. :type 'string)
  10. (if (null emacs-ime)
  11. (setq emacs-ime "ibus-el"))
  12. (defconst vine-default-major-version VINE_DEFAULT_MAJOR_VERSION "\
  13. Major version number of this version of vine-default.
  14. This variable equals the major version number of Vine Linux that is running.")
  15. (defconst vine-default-minor-version 0 "\
  16. Minor version number of this version of vine-default.
  17. This variable is the system number for vine-default-major-version.")
  18. (defconst vine-default-version (+ vine-default-major-version (/ (float vine-default-minor-version) 10)) "\
  19. The version of vine-default.")
  20. (defcustom vine-default t
  21. "A boolean for all Vine Linux default settings"
  22. :type 'boolean)
  23. (if (equal (getenv "LOGNAME") "root")
  24. (setq vine-default nil))
  25. (defcustom vine-default-base t
  26. "A boolean for vine-default-base"
  27. :type 'boolean)
  28. (defcustom vine-default-faces t
  29. "A boolean for vine-default-faces"
  30. :type 'boolean)
  31. (defvar vine-default-setup-hook nil
  32. "List of functions to be called at vine-default-setup")
  33. ;; (defvar after-vine-default-setup-hook nil
  34. ;; "This hook is obsolete! Please do not use this hook.
  35. ;; List of functions to be called at the end of vine-default-setup")
  36. (defun vine-default-setup ()
  37. "A function for setup to default configurations of Vine Linux"
  38. (when vine-default
  39. (message "Starting vine-default-setup ...")
  40. (when vine-default-base
  41. (message "Loading vine-default-base ...")
  42. (require 'vine-default-base))
  43. (when vine-default-faces
  44. (message "Loading vine-default-faces ...")
  45. (require 'vine-default-faces))
  46. (run-hooks 'vine-default-setup-hook)
  47. ;; (run-hooks 'after-vine-default-setup-hook); obsolete
  48. )
  49. )
  50. (defun show-vine-default ()
  51. "A function to show current vine-default configurations"
  52. (interactive)
  53. (shell-command
  54. "/usr/lib/emacsen-common/show-vine-default.sh EMACS_VERSION"))
  55. (defun drop-vine-default-from-load-path (regex)
  56. "A function to drop a path matching to REGEX from load-path"
  57. (setq load-path
  58. (let (list)
  59. (dolist (x (reverse load-path) list)
  60. (unless (string-match regex x)
  61. (setq list (cons x list))))
  62. )
  63. )
  64. )
  65. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  66. ;;; run functions from the /etc/emacs-EMACS_VERSION/site-start.d directory
  67. ;;; Files in this directory ending with ".el" are run on startup
  68. (mapc 'load (directory-files "/etc/emacs-EMACS_VERSION/site-start.d" t "\\.el\\'"))
  69. ;;; load local configuration
  70. (if (file-exists-p (expand-file-name "/etc/emacs/emacs23-local.el"))
  71. (load (expand-file-name "/etc/emacs/emacs23-local.el")))
  72. ;;; load vine-default configuration per user before vine-default-setup
  73. (if (file-exists-p (expand-file-name "~/.emacs.d/emacs23-vine-default.el"))
  74. (load (expand-file-name "~/.emacs.d/emacs23-vine-default.el")))
  75. ;;; run vine-default-setup
  76. (vine-default-setup)
  77. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  78. ;; Local Variables:
  79. ;; mode: emacs-lisp
  80. ;; End: