BioPerl
view release on metacpan or search on metacpan
ide/bioperl-mode/site-lisp/bioperl-init.el view on Meta::CPAN
;;
;; Author: Mark A. Jensen
;; Email : maj -at- fortinbras -dot- us
;;
;; Part of The Documentation Project
;; http://www.bioperl.org/wiki/The_Documentation_Project
;;
;;
;; Copyright (C) 2009 Mark A. Jensen
;; 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, write to the Free
;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301 USA
(defconst bioperl-init-revision "$Id$"
"The revision string of bioperl-init.el")
;;
;; menu bar keymaps
;;
(defvar menu-bar-bioperl-doc-menu
(let (
(map (make-sparse-keymap "BioPerl Docs"))
)
(define-key map [bp-pod-apx]
'(menu-item "View appendix" bioperl-view-pod-appendix
:help "View pod APPENDIX of a module (where most methods are described)"
:keys "\\[bioperl-view-pod-appendix]"))
(define-key map [bp-pod-dsc]
'(menu-item "View description" bioperl-view-pod-description
:help "View pod DESCRIPTION of a module"
:keys "\\[bioperl-view-pod-description]"))
(define-key map [bp-pod-syn]
'(menu-item "View synopsis" bioperl-view-pod-synopsis
:help "View pod SYNOPSIS of a module"
:keys "\\[bioperl-view-pod-synopsis]"))
(define-key map [bp-pod]
'(menu-item "View pod" bioperl-view-pod
:help "Examine entire pod of a module"
:keys "\\[bioperl-view-pod]"))
(define-key map [bp-pod-mth]
'(menu-item "View method pod" bioperl-view-pod-method
:help "View pod (Title:, Usage:, etc) for a single method"
:keys "\\[bioperl-view-pod-method]"))
map)
"Menu-bar map for doc functions in bioperl-mode.")
(defvar menu-bar-bioperl-ins-menu
(let (
(map (make-sparse-keymap "BioPerl Ins"))
)
(define-key map [bp-ins-arr]
'(menu-item "Insert container template" bioperl-insert-array-accessor
:help "Insert template functions for an object array"
:keys "\\[bioperl-insert-array-accessor]"))
(define-key map [bp-ins-obj]
'(menu-item "Insert class/object template" bioperl-insert-class
:help "Insert full object template plus std pod"
:keys "\\[bioperl-insert-class]"))
(define-key map [bp-ins-mthpod]
'(menu-item "Insert method pod template" bioperl-insert-method-pod
:help "Insert Bioperl standard method pod template"
:keys "\\[bioperl-insert-method-pod]"))
(define-key map [bp-ins-genpod]
'(menu-item "Insert generic class pod template" bioperl-insert-generic-class
:help "Insert package declaration plus std pod"
:keys "\\[bioperl-insert-generic-class]"))
(define-key map [bp-ins-acc]
'(menu-item "Insert accessor template" bioperl-insert-accessor
:help "Insert accessor (getter/setter) with std pod"
:keys "\\[bioperl-insert-accessor]"))
(define-key map [bp-ins-mod]
'(menu-item "Insert module identifier" bioperl-insert-module
:help "Insert module identifier, with completion"
:keys "\\[bioperl-insert-module]"))
map)
"Menu-bar map for insertion functions in bioperl-mode")
;;
;; keymap
;;
;; principles:
;; C-c accesses mode functions
;; meta key commands - documentation reading (pod display, etc.)
;; control key command - documentation writing (template insertions, etc.)
;;
(defvar bioperl-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-c\M-p" 'bioperl-view-pod)
(define-key map "\C-c\M-d" 'bioperl-view-pod-description)
(define-key map "\C-c\M-s" 'bioperl-view-pod-synopsis)
(define-key map "\C-c\M-a" 'bioperl-view-pod-appendix)
(define-key map "\C-c\M-f" 'bioperl-view-pod-method)
(define-key map "\C-c\M-m" 'bioperl-view-pod-method)
(define-key map "\C-cm" 'bioperl-insert-module)
(define-key map "\C-c\C-a" 'bioperl-insert-accessor)
(define-key map "\C-c\C-v" 'bioperl-insert-accessor)
(define-key map "\C-c\C-A" 'bioperl-insert-array-accessor)
(define-key map "\C-c\C-b" 'bioperl-insert-class)
(define-key map "\C-c\C-M" 'bioperl-insert-class)
(define-key map "\C-c\C-k" 'bioperl-insert-generic-class)
(define-key map "\C-c\C-g" 'bioperl-insert-generic-class)
(define-key map "\C-c\C-p" 'bioperl-insert-method-pod)
(define-key map [menu-bar] nil)
(define-key map [menu-bar bp-ins]
(list 'menu-item "BP Templs" menu-bar-bioperl-ins-menu))
(define-key map [menu-bar bp-doc]
(list 'menu-item "BP Docs" menu-bar-bioperl-doc-menu))
map)
"Keymap for Bioperl minor mode")
;;
;; finders
;;
(defun bioperl-find-module-path (&optional symb val)
"Find path to Bioperl modules and set `bioperl-module-path'.
This path points to the directory containing Bio; same principle
as 'use lib'. SYMB and VAL are dummies allowing `defcustom' to do
initializaton."
(let (
(old-exec-path exec-path)
(pth) )
;; ask BPMODE_PATH first...
(setq pth (getenv "BPMODE_PATH"))
;; try the environment
(unless pth
(let (
( plib (concat (getenv "PERL5LIB") path-separator (getenv "PATH")))
( pths )
)
(if plib
(progn
(setq pths (split-string plib path-separator))
( run in 0.849 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )