.emacs-autogen.sh
changeset 699 9ec79850e725
parent 696 8b1976f24f56
child 702 0617020b53d8
--- a/.emacs-autogen.sh	Mon Sep 19 21:04:48 2011 +0300
+++ b/.emacs-autogen.sh	Mon Sep 19 21:05:09 2011 +0300
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 if [ -z "$1" ]; then
   echo "Where config file?"
@@ -34,6 +34,13 @@
   esac
 }
 
+print_header() {
+  echo
+  echo ';; ================================================================'
+  echo ";; ${FUNCNAME[1]}."
+  echo
+}
+
 check_ispell() {
   command -v ispell >/dev/null && return 0 || return 1
 }
@@ -59,11 +66,8 @@
   echo '(setq-default ispell-local-dictionary "en")'
 }
 
-check_speller() {
-  echo
-  echo ';; ================================================================'
-  echo ';; Speller settings (check_speller).'
-  echo
+print_speller() {
+  print_header
   check_ispell
   ispell_present=$?
   check_aspell
@@ -100,6 +104,15 @@
   esac
 }
 
+print_man() {
+  print_header
+  if man -a man >/dev/null 2>&1; then
+    echo '(setq Man-switches "-a")'
+  else
+    echo '(setq Man-switches "")'
+  fi
+}
+
 # Remove old auto-generated config and fill it by standard header.
 echo ";; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78 -*-
 ;;
@@ -107,4 +120,6 @@
 " >$cfg
 
 check_platform
-check_speller >>$cfg
+print_speller >>$cfg
+print_man >>$cfg
+