Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
;ELC ;;; Compiled by leavens@CMC3251632-A on Thu Sep 04 23:07:36 2003 ;;; from file d:/emacs/eieio/chart.el ;;; in Emacs version 21.2.1 ;;; with bytecomp version 2.85.4.1 ;;; 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 "`chart.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'eieio) #@28 Keymap used in chart mode. (defvar chart-map nil (#$ . 609)) (byte-code "\204\301 \301\207" [chart-map make-sparse-keymap] 1) #@63 Local variable containing the locally displayed chart object. (defvar chart-local-object nil (#$ . 745)) (make-variable-buffer-local 'chart-local-object) #@139 Faces used to colorize charts. List is limited currently, which is ok since you really can't display too much in text characters anyways. (defvar chart-face-list nil (#$ . 906)) #@87 Colors to use when generating `chart-face-list'. Colors will be the background color. (defvar chart-face-color-list '("red" "green" "blue" "cyan" "yellow" "purple") (#$ . 1090)) #@102 If pixmaps are allowed, display these background pixmaps. Useful if new Emacs is used on B&W display (defvar chart-face-pixmap-list (byte-code "\300\301!\205\f\301 \205\f\302\207" [fboundp display-graphic-p ("dimple1" "scales" "dot" "cross_weave" "boxes" "dimple3")] 2) (#$ . 1275)) #@71 *Non-nil to use fancy pixmaps in the background of chart face colors. (custom-declare-variable 'chart-face-use-pixmaps 'nil '(#$ . -1566) :group 'eieio :type 'boolean) (byte-code "\306\307!\203 \307 \202\f\203k \204k\n \310\203j\311\312\313@\314 @R!!\310\315\316\217\203=\317\f@\"\210\202B\317\f\320\"\210\321\f\322\"\210\203[ \203[\306\323!\203[\310\324\325\217\210\f BA A\202+\310\207" [window-system chart-face-list chart-face-color-list chart-face-pixmap-list nf pl fboundp display-color-p nil make-face intern "chart-" "-" (byte-code "\300 \301V\207" [x-display-color-cells 4] 2) ((error t)) set-face-background "white" set-face-foreground "black" set-face-background-pixmap (byte-code "\302 @\"\207" [nf pl set-face-background-pixmap] 3) ((error (byte-code "\301\302@\"\207" [pl message "Cannot set background pixmap %s"] 3))) cl chart-face-use-pixmaps] 6) #@48 Define a mode in Emacs for displaying a chart. (defalias 'chart-mode #[nil "\303 \210\304!\210\305\306\307\310!\207" [chart-map major-mode mode-name kill-all-local-variables use-local-map chart-mode "CHART" run-hooks chart-mode-hook] 2 (#$ . 2469)]) #@96 Create a new buffer NAME in which the chart OBJ is displayed. Returns the newly created buffer (defalias 'chart-new-buffer #[(obj) "\212\302\303\304\305\306\"\"!q\210\307 \210p)\207" [obj chart-local-object get-buffer-create format "*%s*" eieio-oref title chart-mode] 6 (#$ . 2728)]) (eieio-defclass 'chart nil '((title :initarg :title :initform "Emacs Chart") (title-face :initarg :title-face :initform 'bold-italic) (x-axis :initarg :x-axis :initform nil) (x-margin :initarg :x-margin :initform 5) (x-width :initarg :x-width) (y-axis :initarg :y-axis :initform nil) (y-margin :initarg :y-margin :initform 5) (y-width :initarg :y-width) (key-label :initarg :key-label :initform "Key") (sequences :initarg :sequences :initform nil)) '("Superclass for all charts to be displayed in an emacs buffer")) (eieio-defmethod 'initialize-instance '(:AFTER ((obj chart) &rest fields) #[(obj &rest fields) "\301\302\303 \304Z#\210\301\305\306 \307Z#\207" [obj eieio-oset x-width window-width 10 y-width window-height 12] 5 "Initialize the chart OBJ being created with FIELDS. Make sure the width/height is correct."])) (byte-code "\300\301\302\303\304$\210\300\305\306\307\310$\210\300\311\312\313\314$\210\300\315\302\316\317$\210\300\320\321\322\323$\207" [eieio-defclass chart-axis nil ((name :initarg :name :initform "Generic Axis") (loweredge :initarg :loweredge :initform t) (name-face :initarg :name-face :initform 'bold) (labels-face :initarg :lables-face :initform 'italic) (chart :initarg :chart :initform nil)) ("Superclass used for display of an axis.") chart-axis-range (chart-axis) ((bounds :initarg :bounds :initform '(0.0 . 50.0))) ("Class used to display an axis defined by a range of values") chart-axis-names (chart-axis) ((items :initarg :items :initform nil)) ("Class used to display an axis which represents different named items") chart-sequece ((data :initarg :data :initform nil) (name :initarg :name :initform "Data")) ("Class used for all data in different charts") chart-bar (chart) ((direction :initarg :direction :initform vertical)) ("Subclass for bar charts. (Vertical or horizontal)")] 5) (eieio-defmethod 'chart-draw '(((c chart) &optional buff) #[(c &optional buff) "\212\203q\210\302 \210\303\304\305\"c\210\306 !\210\307 !\210\310\311!\210\312\313!\210\314 !\210\310\315!)\207" [buff c erase-buffer make-string 100 10 chart-draw-axis chart-draw-title message "Rendering chart..." sit-for 0 chart-draw-data "Rendering chart...done"] 3 "Start drawing a chart object C in optional BUFF. Erases current contents of buffer"])) (eieio-defmethod 'chart-draw-title '(((c chart)) #[(c) "\301\302\303\"\304\305\211\306 \302\307\"&\207" [c chart-display-label eieio-oref title horizontal 0 window-width title-face] 9 "Draw a title upon the chart. Argument C is the chart object."])) (eieio-defmethod 'chart-size-in-dir '(((c chart) dir) #[(c dir) "\302=\203 \303 \304\"\207\303 \305\"\207" [dir c vertical eieio-oref y-width x-width] 3 "Return the physical size of chart C in direction DIR."])) (eieio-defmethod 'chart-draw-axis '(((c chart)) #[(c) "\305\306\"\305\307\"\305\310\"\305\311\"\312\305\313\"\314 \305\211\313\"\315\"?\205' \211 \\&\210\312\305\316\"\317 \305\211\316\"\315\"?\205A \211 \\&,\207" [c xlen ylen xmarg ymarg eieio-oref y-margin x-margin y-width x-width chart-axis-draw y-axis vertical loweredge x-axis horizontal] 8 "Draw axis into the current buffer defined by chart C."])) (eieio-defmethod 'chart-axis-draw '(((a chart-axis) &optional dir margin zone start end) #[(a &optional dir margin zone start end) "\306 \203 \202 \307\\ $\210\310\311 \312\" \203# \\\313\\\202.\314=\203-\315\202.\307 \311 \316\"&\207" [dir margin zone start end a chart-draw-line 0 chart-display-label eieio-oref name 3 horizontal 1 name-face] 9 "Draw some axis for A in direction DIR at with MARGIN in boundry. ZONE is a zone specification. START and END represent the boundary."])) (eieio-defmethod 'chart-translate-xpos '(((c chart) x) #[(c x) "\303\211\304\"\305\"\303\306\"\307\310 @Z!\310\303\311\"!\310 A @Z!\245_!\\)\207" [c range x eieio-oref x-axis bounds x-margin round float x-width] 7 "Translate in chart C the coordinate X into a screen column."])) (eieio-defmethod 'chart-translate-ypos '(((c chart) y) #[(c y) "\303\211\304\"\305\"\303\306\"\303\307\"\310\311 @Z!\311\303\307\"!\311 A @Z!\245_!Z\\)\207" [c range y eieio-oref y-axis bounds x-margin y-width round float] 8 "Translate in chart C the coordinate Y into a screen row."])) (eieio-defmethod 'chart-axis-draw '(((a chart-axis-range) &optional dir margin zone start end) #[(a &optional dir margin zone start end) "\306 \210\307\310\"@\307\310\"A \203 \202\311\312 Z\211!\313\307\314\"\"\"\315\245\245#\312$#\311U\203;\316# X\205\323 \317V\203P\320\321 \322\245\"\202c \323V\203_\320\324 \325\245\"\202c\320\326 \"\"\327=\203\231% \\\307\330\"\203| G[\202}\316\\\211&\316W\203\211\316&\331&\332\307\314\" \"\"\210)\202\264\331\333\307\314\" \"% \\\307\330\"\203\260\334\202\261\316\\\"\210`$ c\210\335 G!\210\336$`\337\307\340\"$\210 #\\\211\202<.\207" [a i e zone z s call-next-method eieio-oref bounds 0 nil chart-size-in-dir chart 4 1 999999 format "%dM" 1000000 999 "%dK" 1000 "%d" vertical loweredge chart-goto-xy chart-translate-ypos chart-translate-xpos -1 chart-zap-chars put-text-property face labels-face rng dir j p1 margin x] 8 "Draw axis information based upon a range to be spread along the edge. A is the chart to draw. DIR is the direction. MARGIN, ZONE, START, and END specify restrictions in chart space."])) (eieio-defmethod 'chart-translate-namezone '(((c chart) n) #[(c n) "\306\307\"\211\310=\203\306\311\"\202\306\312\" \310=\203$\306\313\"\202(\306\314\"\306 \310=\2037\306\315\"\202;\306\316\"\317\"G\320\321 !\\\321 !\245 \322 \321!_!\\ \322 \323\321!\\_!\\\324\\-B\207" [c dir w m ns lpn eieio-oref direction vertical x-width y-width y-margin x-margin x-axis y-axis items 1.0 float round 1.0 -1 n] 8 "Return a dot-pair representing a positional range for a name. The name in chart C of the Nth name resides. Automatically compensates for for direction."])) (eieio-defmethod 'chart-axis-draw '(((a chart-axis-names) &optional dir margin zone start end) #[(a &optional dir margin zone start end) "\306 \210\307\310 \311\" \203 \202\307\312\312\312\312 \205\347 G\313\246\314U\315\310 \316\"\"\317=\203F @ A\\\313\245\202X @ A @Z\313\245\\ @G\313\245Z\317=\203\234 \\\310 \320\"\203q @G[\202t @G\\\211\314W\203\200\314 @GSV\203\221\\\321\"\210)\202\304\321 \\\310 \320\"\203\267\203\263\322\202\301\323\202\301\203\300\313\202\301\314\\\"\210` @c\210\324 @G!\210\325`\326\310 \327\"$\210T A\211\204#\312.\207" [i a s zone z r call-next-method 0 eieio-oref items nil 2 1 chart-translate-namezone chart vertical loweredge chart-goto-xy -2 -1 chart-zap-chars put-text-property face labels-face p odd p1 dir margin x] 8 "Draw axis information based upon A range to be spread along the edge. Optional argument DIR the direction of the chart. Optional argument MARGIN , ZONE, START and END specify boundaries of the drawing."])) (eieio-defmethod 'chart-draw-data '(((c chart-bar)) #[(c) "\306\307\"\306\310\"\211\311=\203\312\202\311 \205\306 @\301\"@;\204\377\313\306 @\301\" \203\376\314 \" \311=\203D\315 @\"\202I\316 @\" \311=\203X\315\313\"\202\\\316\313\"\203n G\2468\202o\317W\203\222\320 @$\210\320 A$\210\202\252\320 @T$\210\320 AT$\210@AU\204\316\320 @TA$\210\320 @AT$\210W\203\346\321 B$\210\202\363\321 B$\210, T A\211\2040* A\211\204\322+\207" [c data dir odir seq i eieio-oref sequences direction vertical horizontal 0 chart-translate-namezone chart-translate-ypos chart-translate-xpos default chart-draw-line chart-deface-rectangle nil rng dp zp chart-face-list fc] 6 "Display the data available in a bar chart C."])) (eieio-defmethod 'chart-add-sequence '(((c chart) &optional seq axis-label) #[(c &optional seq axis-label) "\203\234\306 \"\306 \307\"@;\2036\306 \307\" \204,\310 \311\306 \312\"\313 \314 &\2022\315 \316 #\210)\202\211\317\320B\306 \307\" \204Q\310\311\306 \312\"\314 %\203\201@@W\203g@\240\210@AV\203x@\241\210A\211\204V\315 \321#\210*\322=\203\225\315 \323\324#\210\315  #\210)\315 \325\326\306 \325\" C\"#\207" [axis-label c axis seq labels chart-axis-names eieio-oref data make-instance :name name :items :chart eieio-oset items 0 1 bounds x-axis loweredge nil sequences append l range chart-axis-range] 9 "Add to chart object C the sequence object SEQ. If AXIS-LABEL, then the axis stored in C is updated with the bounds of SEQ, or is created with the bounds of SEQ."])) (eieio-defmethod 'chart-trim '(((c chart) max) #[(c max) "\304\305\"\211\205&\304 @\306\"\211G V\203 S \233\307\241\210) A\211\204 \307)\207" [c s sl max eieio-oref sequences data nil] 4 "Trim all sequences in chart C to be at most MAX elements long."])) (eieio-defmethod 'chart-sort '(((c chart) pred) #[(c pred) "\306\307\"\211@ A@\310\306 \311\"@;\203%\312 #\210\306 \311\"\202C\306 \311\"@;\203<\312 #\210\306 \311\"\202C\313\314\315!\"\210\306\316\"\317=\203W\320\306\321\"\322 #\202_\320\306\323\"\322 #,\207" [c sl s1 s2 s pred eieio-oref sequences nil data chart-sort-matchlist error "Sorting of chart %s not supported" object-name direction horizontal eieio-oset y-axis items x-axis] 5 "Sort the data in chart C using predicate PRED. See `chart-sort-matchlist' for more details"])) #@202 Sort NAMELST and NUMLST (both SEQUENCE objects) based on predicate PRED. PRED should be the equivalent of '<, except it must expect two cons cells of the form (NAME . NUM). See SORT for more details. (defalias 'chart-sort-matchlist #[(namelst numlst pred) "\306\307\310\"\307 \310\" \203! @\n@B\fB A\nA\202\f\311\f \"\306\306\f\203A\f@@ B\f@A\nB\fA\211\204.\312\310\313 !#\210\312 \310\313\n!#+\207" [namelst numlst ulst alst newlist pred nil eieio-oref data sort eieio-oset reverse] 6 (#$ . 12446)]) #@74 Move cursor to position X Y in buffer, and add spaces and CRs if needed. (defalias 'chart-goto-xy #[(x y) "\305\306T! \307U\203i\307U\204\310\311!\210m\203\310 !\210 \307W\203'\307\307W\203/\307\312 ! U\206B` j\210\313\f`\314#)*\207" [y num indent-tabs-mode x p nil goto-line 0 newline 1 move-to-column remove-text-properties (face)] 4 (#$ . 12972)]) #@44 Zap up to N chars without deleteting EOLs. (defalias 'chart-zap-chars #[(n) "m?\205\212\301\210`)`ZW\203\302!\207`\212\301\210`)|\207" [n nil delete-char] 3 (#$ . 13345)]) #@144 Display LABEL in direction DIR in column/row ZONE between START and END. Optional argument FACE is the property we wish to place on this text. (defalias 'chart-display-label #[(label dir zone start end &optional face) "\306=\203+\307\310\n \nZ\311\245\fG\311\245Z\\ \"\210`\fc\210\312\fG!\210\313 `\314\f$)\207\315\n \nZ\311\245\fG\311\245Z\\\211\fGW\205h\310 \\\"\210\fHc\210\312\316!\210\313`S`\314\f$\210T\211\202=*\207" [dir p1 start end label zone horizontal nil chart-goto-xy 2 chart-zap-chars put-text-property face 0 1 stz i] 6 (#$ . 13532)]) #@106 Draw a line using line-drawing characters in direction DIR. Use column or row ZONE between START and END (defalias 'chart-draw-line #[(dir zone start end) "\304\305 Z\n\306=\203\307\202\310\"\n %\207" [end start dir zone chart-display-label make-string vertical 124 45] 6 (#$ . 14112)]) #@120 Colorize a rectangle in direction DIR across range R1 by range R2. R1 and R2 are dotted pairs. Colorize it with FACE. (defalias 'chart-deface-rectangle #[(dir r1 r2 face) "\306=\203\n \202 \n\306=\203\n\202 \211@\211\fAX\205>\307 @ \"\210\310`` A @ZT\\\311 $\210 T\211\202+\207" [dir r1 r2 range1 range2 y vertical chart-goto-xy put-text-property face] 6 (#$ . 14413)]) #@322 Wash over the complex eieio stuff and create a nice bar chart. Creat it going in direction DIR ['horizontal 'vertical] with TITLE using a name sequence NAMELST labeled NAMETITLE with values NUMLST labeled NUMTITLE. Optional arguments: Set the charts' max element display to MAX, and sort lists with SORT-PRED if desired. (defalias 'chart-bar-quickie #[(dir title namelst nametitle numlst numtitle &optional max sort-pred) "\306\307 \310\311\312\n&\n\313=\314\f\306 \315\316% \203\"\317\202#\320#\210\314\f\306 \315\316% \2038\320\2029\317#\210\203F\321\f\"\210\250\203R\322\f\"\210\323\324\f!!\210\325\f!*\207" [chart-bar title dir iv nc chart-sequece make-instance :title :key-label "8-m" :direction vertical chart-add-sequence :data :name x-axis y-axis chart-sort chart-trim switch-to-buffer chart-new-buffer chart-draw namelst nametitle numlst numtitle sort-pred max] 8 (#$ . 14807)]) #@37 Test out various charting features. (defalias 'chart-test-it-all #[nil "\300\301\302\303\304\305\306&\207" [chart-bar-quickie vertical "Test Bar Chart" ("U1" "ME2" "C3" "B4" "QT" "EZ") "Items" (5 -10 23 20 30 -3) "Values"] 7 (#$ . 15727) nil]) #@73 Draw a chart displaying the number of different file extentions in DIR. (defalias 'chart-file-count #[(dir) "\306\307\"\204 \310P\311\312!\210\313\314\211\315$\316C\317C\211\203q\306\320 @\"\321 @P!\2033\316\202>\f\205> @\322\224\322\225O\211\n\235 \203i\203a\nGGZ \233\211\211@T\240\210)\202i \nB\322 B+ A\211\204 \323\324\325\n\326 \327\330\331&+\207" [dir cntlst extlst flst j s string-match "/$" "/" message "Collecting statistics..." directory-files nil t "" 0 "[^\\.]\\(\\.[a-zA-Z]+\\|~\\|#\\)$" file-accessible-directory-p 1 chart-bar-quickie vertical "Files Extension Distribution" "File Extensions" "# of occurances" 10 (lambda (a b) (> (cdr a) (cdr b))) m cell] 10 (#$ . 15978) "DDirectory: "]) #@44 Display a top usage chart for directory D. (defalias 'chart-space-usage #[(d) "\306\307!\210\310\211\311\312!q\210\313 \210\314 \315\261\210\306\316 \"\210\317ed\320\321p\310&\210eb\210\306\322!\210\323\324\310\321#\203R\325\224\325\225{\326\224\326\225{\f\nB\327 !\330_ B*\202.\n\204Z\331\332!\210\333\334\335\336 \"\n\337 \340\341\342&+\207" [b cntlst nmlst d nam num message "Collecting statistics..." nil get-buffer-create " *du-tmp*" erase-buffer "cd " ";du -sk * \n" "Running `cd %s;du -sk *'..." call-process-region "csh" t "Scanning output ..." re-search-forward "^\\([0-9]+\\)[ ]+\\([^ \n]+\\)$" 2 1 string-to-int 1000 error "No files found!" chart-bar-quickie vertical format "Largest files in %s" "File Name" "File Size" 10 (lambda (a b) (> (cdr a) (cdr b)))] 9 (#$ . 16725) "DDirectory: "]) #@50 Chart the current storage requirements of Emacs. (defalias 'chart-emacs-storage #[nil "\303 \304\3058\306\245\3078@@@AA@@A@A\3068@\3068A\257\310\311\312 \313\n\314&+\207" [data names nums garbage-collect ("strings/2" "vectors" "conses" "free cons" "syms" "free syms" "markers" "free mark") 3 2 4 chart-bar-quickie vertical "Emacs Runtime Storage Usage" "Storage Items" "Objects"] 9 (#$ . 17549) nil]) #@48 Chart out the size of various important lists. (defalias 'chart-emacs-lists #[nil "\302\303 G\304 G\305 G\306 GF\307\310!\203#\311\312\"\311 \310 GC\"\313\314\315\316 \317&*\207" [names nums ("buffers" "frames" "processes" "faces") buffer-list frame-list process-list face-list fboundp x-display-list append ("x-displays") chart-bar-quickie vertical "Emacs List Size Chart" "Various Lists" "Objects"] 7 (#$ . 17969) nil]) #@65 If we are in an rmail summary buffer, then chart out the froms. (defalias 'chart-rmail-from #[nil "\306=\204\n\307\310!\210\311\211\212eb\210\312\313\311\314#\203K\315\224\315\225{\211\n\235\316\317 \"\210\f\203?\nG\fGZ \233\211\211@T\240\210)\202G \nB\315 B*\202)\320\321\322\n\323 \324\325\326&*\207" [major-mode cntlst nmlst nam m cell rmail-summary-mode error "You must invoke chart-rmail-from in an rmail summary buffer" nil re-search-forward "\\-[A-Z][a-z][a-z] +\\(\\w+\\)@\\w+" t 1 message "Scanned username %s" chart-bar-quickie vertical "Username Occurance in RMAIL box" "User Names" "# of occurances" 10 (lambda (a b) (> (cdr a) (cdr b)))] 10 (#$ . 18405) nil]) (provide 'chart)