1 |
;;; erbunlisp.el --- Help Simplify functions for nonlisp channels. |
;;; erbunlisp.el --- Help Simplify functions for nonlisp channels. |
2 |
;; Time-stamp: <2003-06-19 12:25:56 deego> |
;; Time-stamp: <2005-08-11 20:26:45 deego> |
3 |
;; Copyright (C) 2003 D. Goel |
;; Copyright (C) 2003 D. Goel |
4 |
;; Emacs Lisp Archive entry |
;; Emacs Lisp Archive entry |
5 |
;; Filename: erbunlisp.el |
;; Filename: erbunlisp.el |
33 |
;; Boston, MA 02111-1307, USA. |
;; Boston, MA 02111-1307, USA. |
34 |
|
|
35 |
|
|
36 |
;; See also: |
(defconst erbunlisp-version "0.0dev") |
|
|
|
|
|
|
|
;; Quick start: |
|
|
(defconst erbunlisp-quick-start |
|
|
"Help..." |
|
|
) |
|
|
|
|
|
(defun erbunlisp-quick-start () |
|
|
"Provides electric help from variable `erbunlisp-quick-start'." |
|
|
(interactive) |
|
|
(with-electric-help |
|
|
'(lambda () (insert erbunlisp-quick-start) nil) "*doc*")) |
|
|
|
|
|
;;; Introduction: |
|
|
;; Stuff that gets posted to gnu.emacs.sources |
|
|
;; as introduction |
|
|
(defconst erbunlisp-introduction |
|
|
"Help..." |
|
|
) |
|
|
|
|
|
;;;###autoload |
|
|
(defun erbunlisp-introduction () |
|
|
"Provides electric help from variable `erbunlisp-introduction'." |
|
|
(interactive) |
|
|
(with-electric-help |
|
|
'(lambda () (insert erbunlisp-introduction) nil) "*doc*")) |
|
|
|
|
|
;;; Commentary: |
|
|
(defconst erbunlisp-commentary |
|
|
"Help..." |
|
|
) |
|
|
|
|
|
(defun erbunlisp-commentary () |
|
|
"Provides electric help from variable `erbunlisp-commentary'." |
|
|
(interactive) |
|
|
(with-electric-help |
|
|
'(lambda () (insert erbunlisp-commentary) nil) "*doc*")) |
|
|
|
|
|
;;; History: |
|
|
|
|
|
;;; Bugs: |
|
|
|
|
|
;;; New features: |
|
|
(defconst erbunlisp-new-features |
|
|
"Help..." |
|
|
) |
|
|
|
|
|
(defun erbunlisp-new-features () |
|
|
"Provides electric help from variable `erbunlisp-new-features'." |
|
|
(interactive) |
|
|
(with-electric-help |
|
|
'(lambda () (insert erbunlisp-new-features) nil) "*doc*")) |
|
|
|
|
|
(defconst erbunlisp-version "0.0-DUMMY") |
|
|
(defun erbunlisp-version (&optional arg) |
|
|
"Display erbunlisp's version string. |
|
|
With prefix ARG, insert version string into current buffer at point." |
|
|
(interactive "P") |
|
|
(if arg |
|
|
(insert (message "erbunlisp version %s" erbunlisp-version)) |
|
|
(message "erbunlisp version %s" erbunlisp-version))) |
|
37 |
|
|
38 |
;;========================================== |
;;========================================== |
39 |
;;; Requires: |
;;; Requires: |
52 |
:group 'erbunlisp) |
:group 'erbunlisp) |
53 |
(run-hooks 'erbunlisp-before-load-hooks) |
(run-hooks 'erbunlisp-before-load-hooks) |
54 |
|
|
55 |
(defcustom erbunlisp-verbosity 0 |
|
|
"How verbose to be. |
|
|
Once you are experienced with this lib, 0 is the recommended |
|
|
value. Values between -90 to +90 are \"sane\". The |
|
|
rest are for debugging." |
|
|
:type 'integer |
|
|
:group 'erbunlisp) |
|
|
(defcustom erbunlisp-interactivity 0 |
|
|
"How interactive to be. |
|
|
Once you are experienced with this lib, 0 is the recommended |
|
|
value. Values between -90 and +90 are \"sane\". The rest are for |
|
|
debugging." |
|
|
:type 'integer |
|
|
:group 'erbunlisp) |
|
|
(defcustom erbunlisp-y-or-n-p-function 'erbunlisp-y-or-n-p |
|
|
"Function to use for interactivity-dependent `y-or-n-p'. |
|
|
Format same as that of `erbunlisp-y-or-n-p'." |
|
|
:type 'function |
|
|
:group 'erbunlisp) |
|
|
(defcustom erbunlisp-n-or-y-p-function 'erbunlisp-y-or-n-p |
|
|
"Function to use for interactivity-dependent `n-or-y-p'. |
|
|
Format same as that of `erbunlisp-n-or-y-p'." |
|
|
:type 'function |
|
|
:group 'erbunlisp) |
|
|
(defun erbunlisp-message (points &rest args) |
|
|
"Signal message, depending on POINTS anderbunlisp-verbosity. |
|
|
ARGS are passed to `message'." |
|
|
(unless (minusp (+ points erbunlisp-verbosity)) |
|
|
(apply #'message args))) |
|
|
(defun erbunlisp-y-or-n-p (add prompt) |
|
|
"Query or assume t, based on `erbunlisp-interactivity'. |
|
|
ADD is added to `erbunlisp-interactivity' to decide whether |
|
|
to query using PROMPT, or just return t." |
|
|
(if (minusp (+ add erbunlisp-interactivity)) |
|
|
t |
|
|
(funcall 'y-or-n-p prompt))) |
|
|
(defun erbunlisp-n-or-y-p (add prompt) |
|
|
"Query or assume t, based on `erbunlisp-interactivity'. |
|
|
ADD is added to `erbunlisp-interactivity' to decide whether |
|
|
to query using PROMPT, or just return t." |
|
|
(if (minusp (+ add erbunlisp-interactivity)) |
|
|
nil |
|
|
(funcall 'y-or-n-p prompt))) |
|
56 |
|
|
57 |
;;; Real Code: |
;;; Real Code: |
58 |
|
|