emacs/000075500000000000000000000000001067754073500121625ustar00rootroot00000000000000emacs/doc/000075500000000000000000000000001067754073500127275ustar00rootroot00000000000000emacs/doc/inhibit-site-start.ru.txt000064400000000000000000000033601067754073500176420ustar00rootroot00000000000000From vsu@altlinux.ru Sun Nov 17 23:31:58 2002 Date: Sat, 12 Oct 2002 16:48:54 +0400 From: Sergey Vlasov Reply-To: devel@altlinux.ru To: ALT Developers List Subject: [devel] /etc/emacs/site-start.el Hello! Итак, я опять по поводу скриптов запуска Emacs. Я посмотрел на пакет emacsen-startscripts-0.0.1-alt3 - на мой взгляд, это неправильно. Как известно, site-start.el загружается до ~/.emacs, и нет простого способа отменить его загрузку (отключается только опцией --no-site-file). Точнее, на самом деле способ есть - export EMACSLOADPATH=...:/usr/share/emacs/21.2/lisp и свой site-start.el в указанном первым каталоге, но выглядит это довольно некрасиво, да и требует правки при смене версии Emacs. Кроме того, зачастую мешают лишь отдельные файлы из /etc/emacs/site-start.d (например, 10fontlock.el). Предлагается модифицированная версия site-start.el, позволяющая пользователю отключить автозагрузку отдельных файлов из site-start.d, либо полностью отключить site-start.el: 1) При наличии файла ~/.emacs.d/site-start.el этот файл загружается и больше никакие функции стандартного site-start.el не выполняются. 2) Файлы *.el для автозагрузки ищутся не только в /etc/emacs/site-start.d, но и в ~/.emacs.d/site-start.d; при наличии файлов с совпадающими именами загружается пользовательский файл. Таким образом можно отменить загрузку определенного файла из /etc/emacs/site-start.d (путем создания пустого файла с тем же именем в ~/.emacs.d/site-start.d), либо загрузить версию с персональными модификациями. -- Sergey Vlasov [ Part 1.2, Application/OCTET-STREAM (Name: "site-start.el") 4.9KB. ] [ Unable to print this part. ] [ Part 2, Application/PGP-SIGNATURE 196bytes. ] [ Unable to print this part. ] emacs/doc/inhibit-site-start.txt000064400000000000000000000011251067754073500172120ustar00rootroot00000000000000Added support for personal overrides of the whole site-start.el and specific startup files: 1) If ~/.emacs.d/site-start.el exists, it is loaded instead of processing the rest of this file. This way the user can turn off automatic loading of the system startup files completely. 2) Startup *.el files are searched in ~/.emacs.d/site-start.d and /etc/emacs/site-start.d; personal files override the system startup files. This way the user can turn off (or fix) the offending startup file without disabling this startup system altogether. vsu@altlinux.ru, October 2002 emacs/site-start.d/000075500000000000000000000000001067754073500145035ustar00rootroot00000000000000emacs/site-start.d/00macros.el000064400000000000000000000037451067754073500164620ustar00rootroot00000000000000;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Some useful macros ;; Macros to detect what kind of Emacs is being run. ; Currently they are not used in the site configuration files ; (they are supposed to be separate for different kinds of Emacs), ; but these macros can be used in personal ~/.emacs files. (defmacro GNUEmacs (&rest x) "Evaluate body only if this is GNU Emacs running. Added in ALT's distribution." (list 'if (string-match "GNU Emacs " (version)) (cons 'progn x))) (defmacro XEmacs (&rest x) "Evaluate body only if this is XEmacs 21 running. Added in ALT's distribution." (list 'if (string-match "XEmacs 21" (version)) (cons 'progn x))) (defmacro GNUEmacs22 (&rest x) "Evaluate body only if this is GNU Emacs 22 running. Added in ALT's distribution." (list 'if (string-match "GNU Emacs 22" (version)) (cons 'progn x))) (defmacro GNUEmacs21 (&rest x) "Evaluate body only if this is GNU Emacs 21 running. Added in ALT's distribution." (list 'if (string-match "GNU Emacs 21" (version)) (cons 'progn x))) (defmacro Interactive-launch(&rest x) "Evaluate body only if Emacs has been launched with an interactive terminal (not in batch mode). Added in ALT's distribution." (list 'if (not noninteractive) (cons 'progn x))) (defmacro Batch-launch(&rest x) "Evaluate body only if Emacs has been launched in the batch mode (without an interactive terminal). Added in ALT's distribution." (list 'if noninteractive (cons 'progn x))) ;; Macro to detect if we are under X. (defmacro Xlaunch (&rest x) "Evaluate body only if Emacs has been launched in X Window System. Added in ALT's distribution." (Interactive-launch (list 'if (eq window-system 'x)(cons 'progn x)))) (defmacro TTYlaunch (&rest x) "Evaluate body only if Emacs has not been launched in any (e.g. X) Window System (i.e. when it is running in a terminal). Added in ALT's distribution." (Interactive-launch (list 'if (null window-system)(cons 'progn x)))) ; End of the useful macros ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; emacs/site-start.d/10initial-features.el000064400000000000000000000040161067754073500204340ustar00rootroot00000000000000;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Default initial modes, editing properties, etc. ;; (set up only when launched in non-batch mode (interactively)) (Interactive-launch ; Don't add lines on the end of lines unless we want. ;; (setq next-line-add-newlines nil) ;; Show parenthesis mode (show-paren-mode t) ;; Show column number: (column-number-mode t) (defun flyspell-mode-noerr() "Defined mainly for use in hook lists. Try to call flyspell-mode (turn it on) and catch any fatal errors that can happen. On failure, write a message and turn it off. The errors I'm concerned with when defining this function are: wrong ispell-dictionary value, some problems launching ispell, etc. You could use, for example, \(add-hook 'text-mode-hook 'flyspell-mode-noerr\) or \(remove-hook 'text-mode-hook 'flyspell-mode-noerr\) to add or remove the autostart of Flyspell in text-modes." (condition-case errdata (flyspell-mode t) ('error (message "Failed turning Flyspell mode on, ignoring: %s" (cadr errdata)) (condition-case errdata2 (flyspell-mode nil) ('error (message "Failed turning Flyspell mode off, ignoring: %s" (cadr errdata2))))))) ; Use remove-hook to turn-off (add-hook 'text-mode-hook 'turn-on-auto-fill) (add-hook 'text-mode-hook 'flyspell-mode-noerr) (setq ispell-dictionary (getenv "DICTIONARY")) ;; By default start in text mode. (setq initial-major-mode 'text-mode) ;; Show short documentation for elements of Emacs Lisp: (add-hook 'emacs-lisp-mode-hook 'eldoc-mode) ; Don't ask to revert for TAGS (setq revert-without-query (cons "TAGS" revert-without-query)) ;; Save positions in files between sessions (require 'saveplace) (setq-default save-place t)) ;; End of default initial modes section -- end of Interactive-launch block ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq sendmail-program "/usr/lib/sendmail") ; Use the following for i18n ;(standard-display-european t) ;(GNUEmacs (set-language-environment "latin-1")) emacs/site-start.d/10keys.el000064400000000000000000000010661067754073500161440ustar00rootroot00000000000000 ; Under X to get the suppr key working. ;; (Xlaunch (define-key global-map [(delete)] "\C-d")) ;;; XEmacs compatibility (global-set-key [(control tab)] `other-window) ;; (global-set-key [(meta g)] `goto-line) (defun switch-to-other-buffer () (interactive) (switch-to-buffer (other-buffer))) (global-set-key [(meta control ?l)] `switch-to-other-buffer) ;; (global-set-key [(meta O) ?H] 'beginning-of-line) ;; (global-set-key [(meta O) ?F] 'end-of-line) ;; to prevent break C-s when change XKB's group switch ;; (define-key special-event-map [key-8] 'ignore-event) emacs/site-start.d/10mouse.el000064400000000000000000000021111067754073500163110ustar00rootroot00000000000000;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Try to read mouse events in Linux console and Xterm: (TTYlaunch (xterm-mouse-mode t) (condition-case nil (progn (require 't-mouse nil "no error") (t-mouse-run)) nil)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Turn on mouse wheel support. ; This function is compatible with XEmacs: ;; (mwheel-install) ;; (setq mouse-wheel-follow-mouse t) ; Mouse wheel support should be turned on now ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; There is a special mouse-sel mode ; It offres alternaitve bindings for ; selection manipulation with mouse. ; This setting fits better to the rest of selection handling ; (it should be set already in mouse-sel.el): ; ALT's GNU Emacs by default works with X clippoard, ; not the primary selection. ;(if x-select-enable-clipboard ; (setq mouse-sel-default-bindings 'interprogram-cut-paste)) ; And here you can actually load the mode (uncomment the next line): ;(require 'mouse-sel) ; End of the mouse-sel section ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;emacs/site-start.d/10selection.el000064400000000000000000000043461067754073500171620ustar00rootroot00000000000000;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Key bindings for selection manipulation ; These are the default bindings: ;; (global-set-key [S-delete] 'kill-region) ;; (global-set-key [C-insert] 'kill-ring-save) ;; (global-set-key [S-insert] 'yank) ; They are fine. ; Make the corresponding keys on the KeyPad behave the same way as ; their normal counterparts. We add them to function-key-map in order ; for them to be translated into the normal keys. (define-key function-key-map [S-kp-0] [S-insert]) (define-key function-key-map [C-kp-0] [C-insert]) (define-key function-key-map [S-kp-decimal] [S-delete]) (define-key function-key-map [C-kp-decimal] [C-delete]) ; The same physical keys once more -- not to be dependent of NumLock state ; and other related strange interpretations of Shift+: (define-key function-key-map [S-kp-insert] [S-insert]) (define-key function-key-map [C-kp-insert] [C-insert]) (define-key function-key-map [S-kp-delete] [S-delete]) (define-key function-key-map [C-kp-delete] [C-delete]) ; You can still override the translation for KeyPad keys ; caused by function-key-map; just make a specific setting like this: ;; (global-set-key [S-kp-0] (lambda () (interactive) (insert "A"))) ; ; And to revert back to the standard behaviour: ;; (global-unset-key [S-kp-0]) ; Shift-arrows a la windows... (setq pc-select-meta-moves-sexps t) (pc-selection-mode) ; Don't manipulate the selection when it is inactive ; (and thus not even highlighted). (setq mark-even-if-inactive nil) ;; Turn on selection and change the default color (setq transient-mark-mode 't highlight-nonselected-windows 't) ; Old bindings (can be found in emacs pkgs before 21.1-alt10) ; for X selection manipulation. ; I don't see any reason to use them rather than the standard functions ; described above (they interact with X Window System, too). ;; (defun x-own-selection (s) (x-set-selection `PRIMARY s)) ;; (global-set-key [(shift insert)] '(lambda () (interactive) (insert (x-get-selection)))) ;; (global-set-key [(control insert)] '(lambda () (interactive) ;; (x-own-selection (buffer-substring (point) (mark))))) ; End of the bindings for selection manipulation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; emacs/site-start.el000064400000000000000000000071321067754073500146060ustar00rootroot00000000000000; -*- mode: emacs-lisp; -*- ;;; ALT's configuration for GNU Emacs, derived from ;;; Linux-Mandrake Configuration for GNU/Emacs. ; Chmouel Boudjnah ; Pixel ; Frederic Lepied ; Changes by AEN ; Changes by Ivan Zakharyaschev (Dec 2001, Feb 2002) ; Thanks to Oleg Tikhonov. ; Changes by Sergey Vlasov (Oct 2002) ; See http://www.emacs.org/ for more information and configuration ; examples. ; Most (all!) of the distribution specific configuration ; that used to be here before ; now moved to site-start.d/0[01]*.el scripts. ; ; It has been split into small logical parts. ; This way it is easier for an administrator ; to customize each part and maintain them during package upgrades. ; ; The collection of options that were difficult to classify ; were put to site-start.d/10initial-features.el ; ; ; Here are the places where you may put configuration options for ; GNU Emacs: ; system-wide: this file, any of the existing /etc/emacs/site-start.d/*.el, ; any new (created by you) /etc/emacs/site-start.d/*.el, ; /etc/X11/app-defaults/Emacs (and localized versions of this), ; /etc/X11/Xresources*; ; personal: ~/.emacs, ~/.Xdefaults. ; ; ; imz@altlinux.ru, February 2002. ; ; ; Added support for personal overrides of the whole site-start.el and ; specific startup files: ; ; 1) If ~/.emacs.d/site-start.el exists, it is loaded instead of ; processing the rest of this file. This way the user can turn ; off automatic loading of the system startup files completely. ; ; 2) Startup *.el files are searched in ~/.emacs.d/site-start.d and ; /etc/emacs/site-start.d; personal files override the system ; startup files. This way the user can turn off (or fix) the ; offending startup file without disabling this startup system ; altogether. ; ; vsu@altlinux.ru, October 2002 (if (file-exists-p (expand-file-name "~/.emacs.d/site-start.el")) ;; Just load the personal override file. (load-file "~/.emacs.d/site-start.el") ;; Load package or local system startup files. (let* ( ;; List of directories which are searched for the startup files. (paths '("~/.emacs.d/site-start.d" "/etc/emacs/site-start.d")) ;; Get a list of all the files in all the specified directories ;; that match the pattern. (all-files (apply 'nconc (mapcar #'(lambda (dir) (condition-case nil (directory-files dir t "^.*\\.el$" nil) (error nil))) paths))) ;; Convert the file name list into the list of pairs ;; (FILE-NAME-NONDIRECTORY . FULL-FILE-NAME). Sort the list by ;; the name part, in reverse order (the order is reversed back ;; at the next step), stably (important for overriding). (all-file-pairs (sort (mapcar #'(lambda (file) (cons (file-name-nondirectory file) file)) all-files) #'(lambda (a b) (string< (car b) (car a))))) ;; List of used files is built here. (file-pairs nil)) ;; Build list of all files (really the name and full name pairs) ;; which need to be loaded. If several files have the same name ;; part, the first of them overrides all others. This step ;; reverses the order again. (dolist (pair all-file-pairs) (unless (and file-pairs (string= (car pair) (caar file-pairs))) (setq file-pairs (cons pair file-pairs)))) ;; Load the required files. (dolist (pair file-pairs) (let ((file (cdr pair))) (if debug-on-error (load-file file) (condition-case nil (load file nil) (error (message "Error while loading %s" file)))))) ) )