Emacs: check for existence for loading, to avoid error.
parent
d401566687
commit
611260642a
|
@ -3,7 +3,7 @@
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
;; User plugin path.
|
;; User plugin path.
|
||||||
(add-to-list 'load-path "~/.emacs.d/plugins")
|
;; (add-to-list 'load-path "~/.emacs.d/plugins")
|
||||||
|
|
||||||
;;==============================================================================
|
;;==============================================================================
|
||||||
;; Yasnippet
|
;; Yasnippet
|
||||||
|
@ -17,11 +17,11 @@
|
||||||
|
|
||||||
;; Next follows a traditional, yet not-optimized configuration for Yasnippet.
|
;; Next follows a traditional, yet not-optimized configuration for Yasnippet.
|
||||||
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/yas")
|
;; (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" )
|
||||||
|
|
||||||
(setq yas-snippet-dirs "~/.emacs.d/snippets" )
|
(if (fboundp 'yas/initialize)
|
||||||
|
|
||||||
(if (fboundp 'yas/initialize)
|
|
||||||
;; Old yasnippet versions.
|
;; Old yasnippet versions.
|
||||||
(progn
|
(progn
|
||||||
(yas/initialize)
|
(yas/initialize)
|
||||||
|
@ -31,8 +31,10 @@
|
||||||
(progn
|
(progn
|
||||||
(yas-global-mode 1)
|
(yas-global-mode 1)
|
||||||
(yas-load-directory yas-snippet-dirs))
|
(yas-load-directory yas-snippet-dirs))
|
||||||
)
|
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
))
|
||||||
|
|
||||||
;;==============================================================================
|
;;==============================================================================
|
||||||
;; Lua
|
;; Lua
|
||||||
|
@ -44,33 +46,34 @@
|
||||||
;; MediaWiki
|
;; MediaWiki
|
||||||
;;==============================================================================
|
;;==============================================================================
|
||||||
|
|
||||||
(require 'mediawiki)
|
(if (require 'mediawiki nil t)
|
||||||
|
(progn
|
||||||
|
|
||||||
;; Macros.
|
(setq mediawiki-site-alist
|
||||||
;; Use C-( stuff C-) to record a macro.
|
|
||||||
;; Use 'name-last-kbd-macro' to give it a name.
|
|
||||||
;; Use 'insert-kbd-macro' in your init file to insert the code.
|
|
||||||
;; You can assign a key: (local-set-key (kbd "C-c a") 'my-macro)
|
|
||||||
(fset 'ltx-template-source-to-latex
|
|
||||||
"\C-@\C-s>\C-m\C-w\C-@\C-s</source\C-m\C-[Od\C-[[D\C-[[D\C-wltx\C-i\C-y\C-i\C-[d\C-d")
|
|
||||||
|
|
||||||
(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")
|
("Wikipedia" "http://en.wikipedia.org/w/" "Ambrevar" "" "Main Page")
|
||||||
("Wikibooks" "http://en.wikibooks.org/w/" "Ambrevar" "" "LaTeX")
|
("Wikibooks" "http://en.wikibooks.org/w/" "Ambrevar" "" "LaTeX")
|
||||||
("ArchLinux" "https://wiki.archlinux.org/" "Ambrevar" "" "Mutt"))
|
("ArchLinux" "https://wiki.archlinux.org/" "Ambrevar" "" "Mutt"))
|
||||||
)
|
)
|
||||||
|
|
||||||
;; The url-cookie timer is set to a high value because it seems that once the
|
;; Macros.
|
||||||
;; cookie has been saved, MediaWiki fails to upload files correctly. Is
|
;; Use C-( stuff C-) to record a macro.
|
||||||
;; 'url-do-setup' needed to make sure the url-cookie-save-interval variable is
|
;; Use 'name-last-kbd-macro' to give it a name.
|
||||||
;; taken into account? TODO: does not work.
|
;; Use 'insert-kbd-macro' in your init file to insert the code.
|
||||||
(setq url-cookie-save-interval 86400)
|
;; You can assign a key: (local-set-key (kbd "C-c a") 'my-macro)
|
||||||
|
(fset 'ltx-template-source-to-latex
|
||||||
|
"\C-@\C-s>\C-m\C-w\C-@\C-s</source\C-m\C-[Od\C-[[D\C-[[D\C-wltx\C-i\C-y\C-i\C-[d\C-d")
|
||||||
|
|
||||||
(setq mediawiki-mode-hook
|
(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")
|
||||||
|
|
||||||
|
;; 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
|
||||||
|
;; taken into account? TODO: does not work.
|
||||||
|
(setq url-cookie-save-interval 86400)
|
||||||
|
|
||||||
|
(setq mediawiki-mode-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(visual-line-mode 1)
|
(visual-line-mode 1)
|
||||||
(turn-off-auto-fill)
|
(turn-off-auto-fill)
|
||||||
|
@ -80,7 +83,9 @@
|
||||||
;; TODO: Bindings to not work???
|
;; TODO: Bindings to not work???
|
||||||
;; (local-set-key (kbd "C-c l L") 'ltx-template-source-to-latex)
|
;; (local-set-key (kbd "C-c l L") 'ltx-template-source-to-latex)
|
||||||
;; (local-set-key (kbd "C-c l U") 'ltx-template-source-to-usage)
|
;; (local-set-key (kbd "C-c l U") 'ltx-template-source-to-usage)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
))
|
||||||
|
|
||||||
;;==============================================================================
|
;;==============================================================================
|
||||||
;; DoxyMacs
|
;; DoxyMacs
|
||||||
|
@ -101,8 +106,8 @@
|
||||||
;;==============================================================================
|
;;==============================================================================
|
||||||
;; Zsh style completion.
|
;; Zsh style completion.
|
||||||
|
|
||||||
(require 'zlc)
|
(if (require 'zlc nil t)
|
||||||
(let ((map minibuffer-local-map))
|
(let ((map minibuffer-local-map))
|
||||||
;; Like Zsh menu select. Should not use arrows directly because it overrides
|
;; Like Zsh menu select. Should not use arrows directly because it overrides
|
||||||
;; default controls like previous entry, or previous/next char.
|
;; default controls like previous entry, or previous/next char.
|
||||||
(define-key map (kbd "C-<down>") 'zlc-select-next-vertical)
|
(define-key map (kbd "C-<down>") 'zlc-select-next-vertical)
|
||||||
|
@ -110,10 +115,11 @@
|
||||||
(define-key map (kbd "C-<right>") 'zlc-select-next)
|
(define-key map (kbd "C-<right>") 'zlc-select-next)
|
||||||
(define-key map (kbd "C-<left>") 'zlc-select-previous)
|
(define-key map (kbd "C-<left>") 'zlc-select-previous)
|
||||||
|
|
||||||
;;; Reset selection.
|
;; Reset selection.
|
||||||
(define-key map (kbd "C-c") 'zlc-reset)
|
(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.
|
||||||
)
|
)
|
||||||
|
)
|
||||||
;; (setq zlc-select-completion-immediately t)
|
|
||||||
|
|
||||||
;; To change style, M-x customize-face and input zlc-selected-completion-face.
|
|
||||||
|
|
Loading…
Reference in New Issue