;;; hippie-help.el --- Hippie Help, customizing the Emacs help system

;; Copyleft (C) 2009 Cecil Curry <http://raiazome.com>

;; Author:     Cecil Curry <http://raiazome.com>
;; Maintainer: Cecil Curry <http://raiazome.com>
;; Time-stamp: "2009-06-15 19:13:50 leycec"
;; Created: 1 Mar 2009
;; Version: 0.0.1
;; URL: http://hippie.raiazome.com
;; Keywords: abbrev,c,convenience,data,emulations,faces,files,lisp,matching,tools

;; This file is not part of GNU Emacs.

;;; Commentary:
; --------------------( CONTRIBUTORS                       )--------------------
; `hippie-help' customizes the Emacs help system. The "Emacs help system" is,
; actually, the collection of all major modes implementing a help service. This
; means major modes like `apropos-mode', `help-mode', and `Info-mode'.
;
; --------------------( CONTRIBUTORS                       )--------------------
; `hippie-help' is thanks to gracious contributions from:
;
; * OMouse <???>, who contributed portions of `hippie-help/apropos-feature'.
;
; --------------------( TODO                               )--------------------

;;; History:
;; 
;; 2009-05-01  Cecil Curry  <http://raiazome.com>
;;   * Created.

; ....................{ APROPOS                            }....................
;;;###autoload
(defun hippie-help/apropos-feature (feature-name)
  "Display documentation for feature FEATURE-NAME. Display the first line of
docstring for all symbols defined by this feature and having a docstring."
  (interactive "sEnter the feature name: ")
  (let ((feature-name-prefix
         (concat (if (string-match "\\`hippie" feature-name) "/" "-"))))
    (setq apropos-accumulator (apropos (concat "^" feature-name-prefix)))
    (apropos-print nil nil (concat "Feature prefix: " feature-name-prefix))
    (set-buffer "*Apropos*")
    (toggle-read-only -1)
    ; Fontify the following heading.
    (search-forward "Feature prefix: ")
    (let ((start (point)))
      (end-of-line)
      (put-text-property start (point) 'face apropos-symbol-face))
    ; Hide this feature name's prefix.
    (while (not (null (search-forward feature-name-prefix nil t)))
      (let ((end (point)))
        (beginning-of-line)
        (put-text-property (point) end 'invisible t)
        (end-of-line)))
    (toggle-read-only 1)))

; --------------------( COPYRIGHT AND LICENSE              )--------------------
; The information below applies to everything in this distribution,
; except where noted.
; 
; Copyleft 2009 by Cecil Curry <http://hippie.raiazome.com>.
; 
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see L<http://www.gnu.org/licenses/>.
;
; --------------------( LIBRARY                            )--------------------
(provide 'hippie-help)

;;; hippie-help.el ends here
