site-start.el.emacs24 2.7 KB

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