summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-05-25 08:35:48 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2010-05-25 08:37:54 +0200
commit0bdd552b8bdd70e083f91b139726ca6c64c87d0a (patch)
treeef29297110ad4c77653e514b5cfa32bbbf15c5c3
parent827a075f9f83610505b29509bb70666a9760df4b (diff)
downloaddotfiles-0bdd552b8bdd70e083f91b139726ca6c64c87d0a.tar.gz
dotfiles-0bdd552b8bdd70e083f91b139726ca6c64c87d0a.tar.xz
dotfiles-0bdd552b8bdd70e083f91b139726ca6c64c87d0a.zip
compatibility fixes for Emacs running in the terminal
-rw-r--r--emacs32
1 files changed, 20 insertions, 12 deletions
diff --git a/emacs b/emacs
index 05064b0..506b4f9 100644
--- a/emacs
+++ b/emacs
@@ -309,11 +309,11 @@
(global-set-key [f12] 'indent-region)
; Enable Doxygen syntax highlighting for C and C++
-(require 'doxymacs)
-(add-hook 'font-lock-mode-hook
- '(lambda ()
- (if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
- (doxymacs-font-lock))))
+(when (require 'doxymacs nil 'noerror)
+ (add-hook 'font-lock-mode-hook
+ '(lambda ()
+ (if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
+ (doxymacs-font-lock)))))
;; flyspell (with aspell for Unicode)
(setq ispell-program-name "aspell")
@@ -420,8 +420,10 @@
;; copy/paste enhancements
; share clipboard with other X11-Apps
-(setq x-select-enable-clipboard t)
-(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
+(when (fboundp 'x-cut-buffer-or-selection-value)
+ (progn
+ (setq x-select-enable-clipboard t)
+ (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)))
;; use cua-mode, but only for rectangle selections
(setq cua-enable-cua-keys nil)
@@ -499,12 +501,18 @@
(require 'dir-locals)
;; use sml-modeline if available
-(if (require 'sml-modeline nil 'noerror)
+(when (require 'sml-modeline nil 'noerror)
(progn
- (sml-modeline-mode 1) ;; show buffer pos in the mode line
- (scroll-bar-mode -1)) ;; turn off the scrollbar
- (scroll-bar-mode 1) ;; otherwise, show a scrollbar...
- (set-scroll-bar-mode 'right)) ;; ... on the right
+ ;; show buffer pos in the mode line
+ ;; and turn off the scrollbar
+ (sml-modeline-mode 1)
+ (when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)))
+ (when (fboundp 'scroll-bar-mode)
+ (progn
+ ;; otherwise, show a scrollbar...
+ ;; ... on the right
+ (scroll-bar-mode 1)
+ (set-scroll-bar-mode 'right))))
;; browse-kill-ring
(when (require 'browse-kill-ring nil 'noerror)