site-start.el.emacs24 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. (run-hooks 'vine-default-setup-hook)
  44. ;; (run-hooks 'after-vine-default-setup-hook); obsolete
  45. )
  46. )
  47. (defun show-vine-default ()
  48. "A function to show current vine-default configurations"
  49. (interactive)
  50. (shell-command
  51. "/usr/lib/emacsen-common/show-vine-default.sh EMACS_VERSION"))
  52. (defun drop-vine-default-from-load-path (regex)
  53. "A function to drop a path matching to REGEX from load-path"
  54. (setq load-path
  55. (let (list)
  56. (dolist (x (reverse load-path) list)
  57. (unless (string-match regex x)
  58. (setq list (cons x list))))
  59. )
  60. )
  61. )
  62. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  63. ;;; run functions from the /etc/emacs-EMACS_VERSION/site-start.d directory
  64. ;;; Files in this directory ending with ".el" are run on startup
  65. (mapc 'load (directory-files "/etc/emacs-EMACS_VERSION/site-start.d" t "\\.el\\'"))
  66. ;;; load local configuration
  67. (if (file-exists-p (expand-file-name "/etc/emacs/emacs24-local.el"))
  68. (load (expand-file-name "/etc/emacs/emacs24-local.el")))
  69. ;;; load vine-default configuration per user before vine-default-setup
  70. (if (file-exists-p (expand-file-name "~/.emacs.d/emacs24-vine-default.el"))
  71. (load (expand-file-name "~/.emacs.d/emacs24-vine-default.el")))
  72. ;;; run vine-default-setup
  73. (vine-default-setup)
  74. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  75. ;; Local Variables:
  76. ;; mode: emacs-lisp
  77. ;; End: