;ELC ;;; Compiled by proclus@darwintel on Wed Jan 2 15:45:51 2008 ;;; from file /mnt/gmirror/ports/deskutils/howm/work/howm-1.3.4/howm-common.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 "`howm-common.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'howm-vars) (defalias 'howm-sort #[(evaluator comparer obj-list) "\303\304\"\305 \306\"\303\307\n\"*\207" [obj-list orig sorted mapcar #[(obj) " ! B\207" [evaluator obj] 2] sort #[(x y) " @\n@\"\207" [comparer x y] 3] cdr] 3]) #@114 For the directory DIR, check whether TARGET is under it. When TARGET and DIR are same, (not STRICT) is returned. (defalias 'howm-subdirectory-p #[(dir target &optional strict) ";\205#\303 !\303! \230\203\n?\207\304\305! \"\205#\306\224\306U\207" [dir target strict howm-normalize-file-name string-match regexp-quote 0] 3 (#$ . 877)]) (byte-code "\301B\302\301!\204\f\303\301\207" [current-load-list howm-abbreviate-file-name boundp t] 2) (defalias 'howm-abbreviate-file-name #[(f) "\301 \203 \302!\207\207" [f howm-abbreviate-file-name-p abbreviate-file-name] 2]) (byte-code "\303\301!\203\301B\303\301!\204\304\303\302!\203$\302B\303\302!\204$\304\304\207" [current-load-list howm-template-file-abbrev howm-view-header-abbrev boundp nil] 2) (defalias 'howm-abbreviate-file-name-p #[nil "\303\300!\203\207\303\301!\203 \207\n\207" [howm-template-file-abbrev howm-view-header-abbrev howm-abbreviate-file-name boundp] 2]) (defalias 'howm-fontify #[(&optional i-dont-understand-this) "\301!\207" [i-dont-understand-this cheat-font-lock-fontify] 2]) (byte-code "\300\301!\204 \302\301\303\"\210\300\304!\204\302\304\305\"\210\300\306!\204 \306\307M\210\310\311\312\313#\207" [fboundp line-beginning-position defalias point-at-bol line-end-position point-at-eol match-string-no-properties #[(num &optional string) "\224\205! \203 \224\225O\303\304\nG\305\n$\210\n)\207\306\224\225\"\207" [num string result set-text-properties 0 nil buffer-substring-no-properties] 5 "Return string of text matched by last search, without text properties.\nNUM specifies which parenthesized expression in the last regexp.\n Value is nil if NUMth pair didn't match, or there were less than NUM pairs.\nZero means the entire text matched by the whole regexp or whole string.\nSTRING should be given if the last search was by `string-match' on STRING."] put howm-message-time lisp-indent-hook 1] 4) (defalias 'howm-message-time '(macro . #[(name &rest body) "\302\303\304\305B\306\307\310\311\312 \313BBBBEEE\207" [body name let ((howm-message-time-0 (current-time))) prog1 progn when howm-message-time message "%s (%s: %.2f sec)" (or (current-message) "") ((howm-time-difference-second (current-time) howm-message-time-0))] 11])) (defalias 'howm-time-difference-second #[(ti1 ti0) "@ @Z\211A@) \211A@)Z\211AA)@ \211AA)@Z\211\306_\f\\ \307_\\+\207" [ti1 ti0 x m l h 65536 1e-06] 5]) (defalias 'howm-xor #[(a b) "\203 ?\207 \207" [a b] 1]) (defalias 'howm-buffer-empty-p #[(&optional buf) "r\206pq\210\301 \302U)\207" [buf buffer-size 0] 2]) (defalias 'howm-point-beginning-of-line #[nil "\212\300 \210`)\207" [beginning-of-line] 1]) (defalias 'howm-point-end-of-line #[nil "\212\300\210`)\207" [nil] 1]) (defalias 'howm-inhibit-warning-in-compilation #[(&rest dummy) "\300\301!\207" [error "This is dummy function to inhibit warning in compilation."] 2]) (defalias 'howm-get-value #[(z) "\301!\203  \207\207" [z functionp] 2]) #@104 Map with index. For example, (howm-map-with-index #'cons '(a b c)) returns ((a . 0) (b . 1) (c . 2)). (defalias 'howm-map-with-index #[(f seq) "\302\303\304 \")\207" [howm-map-with-index-count seq -1 mapcar #[(x) "T\303 \nD\"\207" [howm-map-with-index-count f x apply] 4]] 3 (#$ . 3856)]) #@43 Return nil iff STR has no capital letter. (defalias 'howm-capital-p #[(str) "\302\303\304 \")\207" [case-fold-search str nil string-match "[A-Z]"] 3 (#$ . 4156)]) (defalias 'howm-single-element-p #[(a) "\205A?\207" [a] 1]) #@730 Read a string from minibuffer with some extensions to `read-string'. (1) When the first input char is in IMMEDIATE-CHARS string, this function returns the char as one letter string without waiting for rest input and RET key. (2) Otherwise, when the char is in CONTINUED-CHARS, this function is equivalent to read-string. (3) When the char is not in either IMMEDIATE-CHARS or CONTINUED-CHARS, the behavior depends on PASS-THROUGH. If PASS-THROUGH is nil, error is raised. If PASS-THROUGH is non-nil, the input event is unread and nil is returned. (4) Note that RET key at the first char is the special case. If PASS-RET-THROUGH is nil, empty string is returned. If PASS-RET-THROUGH is non-nil, RET is unread and nil is returned.  (defalias 'howm-read-string #[(prompt &optional immediate-chars continued-chars pass-through pass-ret-through) "\204\302 !\207\303\213\207" [immediate-chars prompt read-string ((byte-code "\306\307\"\210\310\311 !\210\312 \313 !\314\n!\203%\315 \n \f &\202+\316 #*\207" [prompt ev ch immediate-chars continued-chars pass-through message "%s" select-window minibuffer-window howm-read-event howm-event-to-character howm-characterp howm-read-string-sub howm-read-string-fail pass-ret-through] 8))] 2 (#$ . 4391)]) (defalias 'howm-read-string-sub #[(event char prompt immediate-chars continued-chars pass-through pass-ret-through) "\206\306\307 \310\") \206\306\307 \310\") \f\311\f! \f\n\235\203- \202I\f\f\235\203A\312 \211GTB\"\202I\313#,\207" [immediate-chars string ichars continued-chars cchars char "" string-to-sequence list char-to-string read-string howm-read-string-fail first-char first-str prompt event pass-through pass-ret-through] 4]) (defalias 'howm-read-string-fail #[(event pass-through pass-ret-through) "\303!\203\f \204\f\304\207\n\203\305!\210\306\207\307\310!\207" [event pass-ret-through pass-through howm-ret-key-event-p "" howm-unread-event nil error "Invalid input."] 2]) (defalias 'howm-unread-event #[(event) " B\211\207" [event unread-command-events] 2]) #@146 Return the subsequence of SEQ from start to N-th item. (howm-first-n '(a b c d e) 3) ==> (a b c) (howm-first-n '(a b c d e) 10) ==> (a b c d e)  (defalias 'howm-first-n #[(seq n) "G X\203 \207\302\303 #\207" [seq n howm-cl-subseq 0] 4 (#$ . 6461)]) (byte-code "\302\303\304\305\"\210*\304\207" [qa seq (a b c d e) ((0) (4 a b c d) (5 a b c d e) (7 a b c d e)) mapc #[(z) "\303 @\"\211 A\232?\205\304\305\n #)\207" [seq z ans howm-first-n error "howm-first-n is wrong: %s for %s"] 5]] 3) (defalias 'howm-replace-region #[(beg end val) " |\210\n;\203 \n\202\303\304\n\"c\207" [beg end val format "%s"] 3]) (put 'howm-edit-read-only-buffer 'lisp-indent-hook 0) (defalias 'howm-edit-read-only-buffer '(macro . #[(&rest body) "\301\302\303\304\305\"BBB\207" [body progn (buffer-disable-undo) (setq buffer-read-only nil) append ((set-buffer-modified-p nil) (setq buffer-read-only t))] 6])) (put 'howm-rewrite-read-only-buffer 'lisp-indent-hook 0) (defalias 'howm-rewrite-read-only-buffer '(macro . #[(&rest body) "\301\302BB\207" [body howm-edit-read-only-buffer (erase-buffer)] 3])) #@319 Write MESSAGE with format FMT to the top of FILE. FORMAT must have two %s; the formar is time and the latter is message. When LIMIT is non-nil, only that number of recent messages are recorded. When REMOVE-FMT is non-nil, it is used to generate regular expression to remove matched lines. REMOVE-FMT must have one %s. (defalias 'howm-write-log #[(message fmt file &optional limit remove-fmt) "\212r\306!q\210eb\210 \203\212\307\310 \311\n!\"!\210)\310 \312\f\313 \"\n#\314\261\210 \2038eb\210 y\315U\2038`d|\210\316 *\207" [file remove-fmt message fmt howm-dtime-format limit find-file-noselect flush-lines format regexp-quote format-time-string current-time "\n" 0 howm-basic-save-buffer] 5 (#$ . 7563)]) #@227 Return the canonical symbol for a specified name. If SOFT is non-nil, return nil when the corresponding symbol does not exist. Name of returned symbol is concatenation of ARGS. Both strings and symbols are acceptable in ARGS. (defalias 'howm-get-symbol #[(soft &rest args) "\203\302\202 \303\304\305 \306#!\207" [soft args intern-soft intern mapconcat #[(s) "\301!\203\2079\203\302!\207\303\304\"\207" [s sequencep symbol-name error "Not supported: %S"] 3] ""] 5 (#$ . 8282)]) #@31 Return t if BUFFER is killed. (defalias 'howm-buffer-killed-p #[(buffer) "\301!?\207" [buffer buffer-name] 2 (#$ . 8778)]) #@278 Classify elements in given list. CLASSIFIER is criterion of classification for list LIS. If REVERSE is non-nil, order of elements are reversed (faster). For example, (howm-classify (lambda (s) (substring s 0 1)) '("aaa" "abc" "xyz")) returns (("a" "aaa" "abc") ("x" "xyz")). (defalias 'howm-classify #[(classifier lis &optional reverse) "\303\304\305 \"\210\n\203\202\302\306\307\"!)\207" [ans lis reverse nil mapc #[(x) " !\305\n \"\211\204\n CB B\211\202\f \fAB\241*\207" [classifier x label ans pair assoc] 4] mapcar #[(pair) "@\301A!B\207" [pair reverse] 3]] 4 (#$ . 8909)]) #@124 for internal use. Don't set this variable directly. Use `howm-view-in-background' and `howm-view-in-background-p' instead. (defvar *howm-view-in-background* nil (#$ . 9514)) (put 'howm-view-in-background 'lisp-indent-hook 0) (defalias 'howm-view-in-background '(macro . #[(&rest body) "\301\302BB\207" [body let ((*howm-view-in-background* t))] 3])) (defalias 'howm-view-in-background-p #[nil "\207" [*howm-view-in-background*] 1]) (defalias 'howm-exclude-p #[(filename) "\300\301\302 \"?\207" [howm-cl-find-if-not #[(dir) "\303 \n#\207" [dir howm-excluded-file-regexp filename howm-folder-match-under-p] 4] howm-search-path] 3]) (defalias 'howm-item-exclude-p #[(item) "\300\207" [nil] 1]) (defalias 'howm-list-exclude #[nil "\300\207" [nil] 1]) (defalias 'howm-view-item-exclude-p #[(name-checker item) "\300\207" [nil] 1]) (byte-code "\301B\303\301!\204\f\304\302B\303\302!\204\305\301\207" [current-load-list howm-history-format howm-history-remove-format boundp "> %s | %s" "| %s$"] 2) (defalias 'howm-write-history #[(message) "\205 \203 \306V\205\307\n  \f\205 %\207" [howm-history-file howm-history-limit message howm-history-format howm-history-unique howm-history-remove-format 0 howm-write-log] 6]) (defalias 'howm-history #[nil "\302\303 !)\207" [howm-menu-display-rules howm-history-file nil howm-menu-open] 2 nil nil]) #@199 List of arguments for last `howm-call-process'. This variable exists only for debug. You can reproduce the last call with the below code. (apply #'howm-call-process howm-call-process-last-command) (defvar howm-call-process-last-command nil (#$ . 10877)) (put 'howm-with-coding-system 'lisp-indent-hook 1) #@268 With CODING-SYSTEM, execute BODY. examples: (howm-with-coding-system 'euc-jp-unix ...) ;; for both read and write (howm-with-coding-system '(utf-8-unix . sjis-unix) ...) ;; (read . write) (howm-with-coding-system nil ...) ;; howm-process-coding-system is used. (defalias 'howm-with-coding-system '(macro . #[(coding-system &rest body) "\304 \206\305\306\n D\307\310\311\nD\nED\312\310\313\nD\nEDE *BB\207" [coding-system cs g body gensym howm-process-coding-system let* coding-system-for-read or car-safe coding-system-for-write cdr-safe] 7 (#$ . 11190)])) (defalias 'howm-call-process #[(command args &optional expected-return-value stdin-string) " \n F\306\307\310!!\311\216r q\210\211\242\206\243\206'\312 #\n\203B\nU\204B\313\314\n#\210\315 .\207" [command args expected-return-value stdin-string howm-call-process-last-command #1=#:temp-buffer get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) howm-call-process-here error "Process returns %s instead of expected %s." howm-buffer-lines howm-process-coding-system #2=#:G13350 coding-system-for-read coding-system-for-write r] 5]) (defalias 'howm-call-process-here #[(command args &optional stdin-string) "` \206\306c\210`\n \307\310\311\fBBBBBB\f\211 \242\206$  \243\206. \312\313 \".\207" [beg stdin-string end command args a "" t (t nil) nil apply call-process-region howm-process-coding-system #1=#:G13351 coding-system-for-read coding-system-for-write] 8]) (defalias 'howm-buffer-lines #[(&optional buf) "\212\203q\210\301ed{\302\")\207" [buf split-string "\n"] 3]) #@89 For internal use. Do not setq this variable. Use `howm-with-schedule-interval' instead. (defvar howm-reminder-schedule-interval nil (#$ . 12867)) (defalias 'howm-reminder-schedule-interval-from #[nil "@\207" [howm-reminder-schedule-interval] 1]) (defalias 'howm-reminder-schedule-interval-to #[nil "A\207" [howm-reminder-schedule-interval] 1]) #@298 Set the interval of visible schedule items in reminder list on menu. INTERVAL is a form like (-1 2), which means 'from yesterday to the day after tomorrow'. BODY is evaluated under this setting; `howm-reminder-schedule-interval-from' returns -1 and `howm-reminder-schedule-interval-to' returns 2. (defalias 'howm-with-schedule-interval '(macro . #[(interval &rest body) "\302\303\304BDC BB\207" [interval body let howm-reminder-schedule-interval cons] 4 (#$ . 13220)])) (put 'howm-with-schedule-interval 'lisp-indent-hook 1) (defalias 'howm-with-reminder-setting '(macro . #[(&rest body) "\301\302\303\304BBE\207" [body howm-with-schedule-interval (howm-menu-schedule-days-before howm-menu-schedule-days) let ((howm-todo-menu-types howm-reminder-menu-types))] 5])) (put 'howm-with-reminder-setting 'lisp-indent-hook 0) (defalias 'howm-xemacsp #[nil "\300\301!\207" [featurep xemacs] 2]) (put 'howm-defun-xemacs 'lisp-indent-hook 'defun) (defalias 'howm-defun-xemacs '(macro . #[(func args emacs-f xemacs-f) "\304 \305 \203\f\n\202 F\207" [func args xemacs-f emacs-f defun howm-xemacsp] 4])) (defalias 'howm-deactivate-mark #[nil "\205 \302\303\304!\207" [transient-mark-mode mark-active nil run-hooks deactivate-mark-hook] 2]) (defalias 'howm-read-event #[nil "\300 \207" [read-event] 1]) (defalias 'howm-ret-key-event #[nil "\300\301!\207" [event-convert-list (return)] 2]) (byte-code "\301B\302\301!\204 \301 \301\207" [current-load-list howm-ret-key-event boundp] 2) (defalias 'howm-ret-key-event-p #[(event) "\302\232\206  \232\207" [event howm-ret-key-event 13] 2]) (defalias 'howm-event-to-character #[(event) "\301!\205\207" [event howm-characterp] 2]) (defalias 'howm-characterp #[(x) "\247\207" [x] 1]) (byte-code "\301B\302\301!\204\303 \203\304\202\305\306\307!\207" [current-load-list howm-infinity boundp howm-xemacsp 1e+100 1.0e+INF provide howm-common] 2)