From 0bdd552b8bdd70e083f91b139726ca6c64c87d0a Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 25 May 2010 08:35:48 +0200 Subject: compatibility fixes for Emacs running in the terminal --- emacs | 32 ++++++++++++++++++++------------ 1 file 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) -- cgit v1.2.3