;ELC ;;; Compiled by proclus@darwintel on Wed Jan 2 15:45:52 2008 ;;; from file /mnt/gmirror/ports/deskutils/howm/work/howm-1.3.4/action-lock.el ;;; in Emacs version 21.2.1 ;;; with bytecomp version 1.1.1.4 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`action-lock.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311\312%\207" [require howm-cl easy-mmode font-lock cheat-font-lock custom-declare-group action-lock nil "Invoke magic action by RET key on spell strings." :group convenience] 6) #@31 *Face for action-lock spells. (defvar action-lock-face 'action-lock-face (#$ . -895)) (byte-code "\306\307\310\311!\203\203\312\202\313\314\211 *D\315\316\317\316\320&\210\304 B\321\304!\204,\322\305 B\321\305!\2048\323\306\207" [window-system fail-safe underline current-load-list action-lock-magic-return-key action-lock-lighter custom-declare-face action-lock-face fboundp set-face-underline (((class color)) (:underline "dark cyan")) (((class color)) (:underline t)) (t (:inverse-video t)) "*Face for action-lock spells." :group action-lock howm-faces boundp " " " AL"] 9) #@39 Inhibit font-lock-verbose if non-nil. (defvar action-lock-silent t (#$ . 1494)) (byte-code "\301B\303\301!\204\f\304\302B\303\302!\204\305\301\207" [current-load-list action-lock-switch-default action-lock-date-default boundp ("{ }" "{*}" "{-}") ("{_}" "[%Y-%m-%d %H:%M]")] 2) #@101 Non-nil if Action-Lock mode is enabled. Use the command `action-lock-mode' to change this variable. (defvar action-lock-mode nil (#$ . 1787)) (make-variable-buffer-local 'action-lock-mode) #@197 With no argument, this command toggles the mode. Non-null prefix argument turns on the mode. Null prefix argument turns off the mode. \[action-lock-magic-return] Envoke the action on the field  (defalias 'action-lock-mode #[(&optional arg) "\203\f\302!\303V\202 ?\304\305 \203\306\202\307\"\210t\203-\310\311 \203*\312\202+\313\"\210\314 \210 \207" [arg action-lock-mode prefix-numeric-value 0 run-hooks action-lock-mode-hook action-lock-mode-on-hook action-lock-mode-off-hook message "Action-Lock mode %sabled" "en" "dis" force-mode-line-update] 3 (#$ . 1983) nil]) #@53 Hook run at the end of function `action-lock-mode'. (custom-declare-variable 'action-lock-mode-hook 'nil '(#$ . 2571) :group 'action-lock :type 'hook) #@32 Keymap for `action-lock-mode'. (defvar action-lock-mode-map (byte-code "\302BC\303 !\203 \202! <\203\304 !\202!\305\306\302BC\")\207" [action-lock-magic-return-key m action-lock-magic-return keymapp easy-mmode-define-keymap error "Invalid keymap %S"] 4) (#$ . 2728)) (byte-code "\305\306\307#\210\310\311\312\"\210\310\313\314\"\210\302 B\315\302!\204\316\303 B\315\303!\204(\316\304 B\315\304!\2044\316\317\302!\210\317\303!\210\317\304!\207" [action-lock-mode-map current-load-list action-lock-rules action-lock-original-font-lock-keywords action-lock-original-return add-minor-mode action-lock-mode action-lock-lighter add-hook action-lock-mode-on-hook action-lock-initialize-buffer action-lock-mode-off-hook action-lock-restore-buffer boundp nil make-variable-buffer-local] 4) (defalias 'action-lock-switch #[(label-list) "\302\303\304#\211\305\306\307\310\311\312\313\314\211@C\"DD\315BBB\316BBE)D\207" [label-list regexp mapconcat regexp-quote "\\|" lambda (&optional dummy) let* (b (match-beginning 0)) (e (match-end 0)) ring quote append ((s (match-string-no-properties 0)) (next (cadr (member s ring)))) ((delete-region b e) (insert next) (goto-char b))] 12]) (defalias 'action-lock-date #[(regexp time-format) "\302\303\304\305\306 DDFD\207" [regexp time-format lambda (&optional dummy) (delete-region (match-beginning 0) (match-end 0)) insert format-time-string] 7]) (defalias 'action-lock-open #[(regexp arg-pos &optional hilit-pos) "\303\304 \n\305%\207" [regexp arg-pos hilit-pos action-lock-general action-lock-find-file t] 6]) (defalias 'action-lock-find-file #[(f u) "\203\302 !\207\303 !\207" [u f find-file-other-window find-file] 2]) (byte-code "\301B\302\301!\204\f\303\303\207" [current-load-list action-lock-no-browser boundp nil] 2) (defalias 'action-lock-browse-url #[(url) "\302\303\304#\305\306\"\210 \203\307!\207\310!\207" [url action-lock-no-browser replace-regexp-in-string "^[htp]+\\(s?\\)://" "http\\1://" message "%s" kill-new browse-url] 4]) (defalias 'action-lock-browse #[(regexp arg-pos &optional hilit-pos) "\303\304 \n$\207" [regexp arg-pos hilit-pos action-lock-general action-lock-browse-url] 5]) #@446 Generate an action-lock rule. FUNC is called when action-lock is invoked on a string which matches to REGEXP. ARG-POS specifies a position of subexpression in REGEXP, and matched substring is passed to FUNC. HILIT-POS specifies another position of subexpression in REGEXP, and matched substring is highlighted in buffers. FUNC will receive an additional argument for action, as is described at the beginning of this file, when ARG-P is non-nil. (defalias 'action-lock-general #[(func regexp arg-pos &optional hilit-pos arg-p) "\305\306 \307\nD \205\f\310BBE\fE\207" [regexp func arg-pos arg-p hilit-pos lambda (&optional arg) match-string (arg)] 6 (#$ . 4914)]) #@80 A regular expression probably matching the host, path or e-mail part of a URL. (defvar action-lock-url-path-regexp "\\([-!@#$%^&*()_+|=:~/?a-zA-Z0-9.,;]*[-!@#$%^&*()_+|=:~/?a-zA-Z0-9]+\\)" (#$ . 5584)) (defalias 'action-lock-url-regexp #[(head &optional tail) " \n\206\303Q\207" [head action-lock-url-path-regexp tail ""] 3]) (byte-code "\301B\306\301!\204\307\310\311\"\302B\306\302!\204\312\303B\306\303!\204*\307\313\314\"\304B\306\304!\2046\315\316B\306\316!\204e\317 !\320\321@!\211A@)\"\322\307\323\324\"\325\"\322 \n\"\326 \f\"\257\327B\306\327!\204r\330\301\207" [current-load-list action-lock-open-regexp action-lock-open-regexp-pos action-lock-browse-regexp action-lock-browse-regexp-pos action-lock-switch-default boundp action-lock-url-regexp "\\/?\\)" 2 "\\<\\([htp][htp][htp][htp]?[htp]?s?\\|ftp\\)://" "\\>/?" 0 action-lock-default-rules action-lock-switch action-lock-date regexp-quote action-lock-open "URL:\\(file://\\)?\\(localhost\\)?" ">))" 3 action-lock-browse action-lock-bury-minor-mode-p t action-lock-date-default x] 8) (defalias 'action-lock-initialize-buffer #[nil "\302 \210\303!\210 \205\304\305!\207" [action-lock-default-rules action-lock-bury-minor-mode-p action-lock-initialize-magic-return action-lock-set-rules action-lock-bury-minor-mode action-lock-mode] 2 nil nil]) (defalias 'action-lock-restore-buffer #[nil "\300 \207" [action-lock-restore-font-lock] 1]) (defalias 'action-lock-magic-return #[(&optional arg) "\305!\206 \203\306\307\n!\310 !*\207\310\f!\207" [arg action-lock-mode action-lock-magic-return-key f action-lock-original-return action-lock-invoke nil key-binding call-interactively] 2 nil "P"]) (defalias 'action-lock-invoke #[(&optional arg) "\302 \211\205\f !\210\303)\207" [action arg action-lock-get-action t] 3]) (defalias 'action-lock-initialize-magic-return #[nil "?\205 \303\304\n!\211)\207" [action-lock-original-return action-lock-mode action-lock-magic-return-key nil key-binding] 2]) (defalias 'action-lock-rules #[nil "\207" [action-lock-rules] 1]) (defalias 'action-lock-set-rules #[(rules) "\302!\303 \207" [rules action-lock-rules howm-cl-remove-duplicates action-lock-font-lock] 2]) (defalias 'action-lock-add-rules #[(rules &optional prepend-p) "\302\203 \303 \304 \"\202\303\304 \"!\207" [prepend-p rules action-lock-set-rules append action-lock-rules] 4]) #@47 Bury MODE to the last in minor-mode-map-alist (defalias 'action-lock-bury-minor-mode #[(mode) "\303 \"\211\205\304\305\n \"\nC\"\211)\207" [mode minor-mode-map-alist pair assoc append remove] 5 (#$ . 8016)]) (byte-code "\301B\303\301!\204\f\304\302B\303\302!\204\305\304\207" [current-load-list action-lock-case-fold-search action-lock-use-case-fold-search boundp nil t] 2) (defalias 'action-lock-matcher #[(regexp) "\203\302\303\304\305\306 \307BBEE\207 \207" [action-lock-use-case-fold-search regexp lambda (limit) let ((case-fold-search action-lock-case-fold-search)) re-search-forward (limit t)] 7]) (defalias 'action-lock-font-lock #[nil "\305!\210 \204 \n\202  \205 \306\307 \"\310\f!\210\311\312!)\207" [action-lock-silent action-lock-original-font-lock-keywords font-lock-keywords action-lock-rules entries cheat-font-lock-mode mapcar #[(pair) "@\306 !\211AA)@\206\307\211\310\311E\n ,B\207" [pair regexp matcher x pos hilit action-lock-matcher 0 action-lock-face prepend] 4] cheat-font-lock-append-keywords cheat-font-lock-fontify t] 3]) (defalias 'action-lock-restore-font-lock #[nil "\211\207" [action-lock-original-font-lock-keywords font-lock-keywords] 2]) (defalias 'action-lock-get-action #[nil "\300 @\207" [action-lock-get-action/range] 1]) (defalias 'action-lock-get-range #[nil "\300 A\207" [action-lock-get-action/range] 1]) (defalias 'action-lock-get-action/range #[nil "\306\306 \203> \204>\212 @ A\n@\n\211A@)\n\211AA)@ \307\f \"\211\n\203:\nB-\202 +\207" [action-lock-rules rules current found regexp x nil action-lock-regexp-range action pos range] 4]) (defalias 'action-lock-regexp-range #[(regexp &optional pos) "\206\306\212`\307 \310 \203\n\202 \f\311 \210`\fX\203Q\312 \313#\203Q\f\204Q\224\225\211\fX\203M\fW\203MD*\202\f-\207" [pos action-lock-use-case-fold-search action-lock-case-fold-search case-fold-search range eol 0 line-end-position nil beginning-of-line re-search-forward no-error c regexp end beg] 5]) (defalias 'action-lock-regexp #[nil "\301\302\303#\207" [action-lock-rules mapconcat car "\\|"] 4]) (defalias 'action-lock-skip-one-link #[(reverse) "\303  \203 \304\202\f\305\205\n8b*\207" [r reverse border action-lock-get-range 0 1] 2]) (defalias 'action-lock-goto-next-link #[(&optional reverse) "\203\302\202 \303\304!\210 \210\305 \204 \210\202\205#\304!)\207" [reverse move backward-char forward-char action-lock-skip-one-link action-lock-get-action] 2 nil nil]) (defalias 'action-lock-goto-previous-link #[nil "\300\301!\207" [action-lock-goto-next-link t] 2 nil nil]) (provide 'action-lock)