Emacs: check for existence for loading, to avoid error.

master
Pierre Neidhardt 2013-01-10 18:05:10 +01:00
parent d401566687
commit 611260642a
1 changed files with 66 additions and 60 deletions

View File

@ -3,7 +3,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; User plugin path.
(add-to-list 'load-path "~/.emacs.d/plugins")
;; (add-to-list 'load-path "~/.emacs.d/plugins")
;;==============================================================================
;; Yasnippet
@ -17,8 +17,8 @@
;; Next follows a traditional, yet not-optimized configuration for Yasnippet.
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/yas")
(require 'yasnippet) ;; not yasnippet-bundle
(if (require 'yasnippet nil t)
(progn
(setq yas-snippet-dirs "~/.emacs.d/snippets" )
(if (fboundp 'yas/initialize)
@ -31,8 +31,10 @@
(progn
(yas-global-mode 1)
(yas-load-directory yas-snippet-dirs))
)
))
;;==============================================================================
;; Lua
@ -44,7 +46,15 @@
;; MediaWiki
;;==============================================================================
(require 'mediawiki)
(if (require 'mediawiki nil t)
(progn
(setq mediawiki-site-alist
'(
("Wikipedia" "http://en.wikipedia.org/w/" "Ambrevar" "" "Main Page")
("Wikibooks" "http://en.wikibooks.org/w/" "Ambrevar" "" "LaTeX")
("ArchLinux" "https://wiki.archlinux.org/" "Ambrevar" "" "Mutt"))
)
;; Macros.
;; Use C-( stuff C-) to record a macro.
@ -57,13 +67,6 @@
(fset 'ltx-template-source-to-usage
"\C-@\C-s>\C-w\C-?\C-m\C-w\C-d\C-@\C-s</source\C-m\C-[Od\C-[[D\C-[[D\C-[[D\C-wltxu\C-i\C-y\C-i\C-k\C-k")
(setq mediawiki-site-alist
'(
("Wikipedia" "http://en.wikipedia.org/w/" "Ambrevar" "" "Main Page")
("Wikibooks" "http://en.wikibooks.org/w/" "Ambrevar" "" "LaTeX")
("ArchLinux" "https://wiki.archlinux.org/" "Ambrevar" "" "Mutt"))
)
;; The url-cookie timer is set to a high value because it seems that once the
;; cookie has been saved, MediaWiki fails to upload files correctly. Is
;; 'url-do-setup' needed to make sure the url-cookie-save-interval variable is
@ -82,6 +85,8 @@
;; (local-set-key (kbd "C-c l U") 'ltx-template-source-to-usage)
))
))
;;==============================================================================
;; DoxyMacs
;;==============================================================================
@ -101,7 +106,7 @@
;;==============================================================================
;; Zsh style completion.
(require 'zlc)
(if (require 'zlc nil t)
(let ((map minibuffer-local-map))
;; Like Zsh menu select. Should not use arrows directly because it overrides
;; default controls like previous entry, or previous/next char.
@ -110,10 +115,11 @@
(define-key map (kbd "C-<right>") 'zlc-select-next)
(define-key map (kbd "C-<left>") 'zlc-select-previous)
;;; Reset selection.
;; Reset selection.
(define-key map (kbd "C-c") 'zlc-reset)
)
;; (setq zlc-select-completion-immediately t)
;; To change style, M-x customize-face and input zlc-selected-completion-face.
)
)