MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 18.217.207.112
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/emacs/24.3/lisp/cedet/srecode/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/emacs/24.3/lisp/cedet/srecode/document.elc
;ELC
;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:11:30 2024
;;; from file /builddir/build/BUILD/emacs-24.3/lisp/cedet/srecode/document.el
;;; in Emacs version 24.3.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\210\300\310!\210\300\311!\210\312\313\314\315\316\317\316\320&\210\321\322\323\324\316\313\325\326&\210\321\327\330\331\316\313\325\332&\210\321\322\333\324\316\313\325\334&\210\321\335\336\337\316\313\325\340&\210\321\341\342\343\316\313\325\344&\210\321\345\346\347\316\313\325\350&\210\321\351\352\353\316\313\325\354&\207" [require srecode/args srecode/dictionary srecode/extract srecode/insert srecode/semantic semantic semantic/tag semantic/doc pulse custom-declare-group document nil "File and tag browser frame." :group texinfo srecode custom-declare-variable srecode-document-autocomment-common-nouns-abbrevs '(("sock\\(et\\)?" . "socket") ("addr\\(ess\\)?" . "address") ("buf\\(f\\(er\\)?\\)?" . "buffer") ("cur\\(r\\(ent\\)?\\)?" . "current") ("dev\\(ice\\)?" . "device") ("doc" . "document") ("i18n" . "internationalization") ("file" . "file") ("line" . "line") ("l10n" . "localization") ("msg\\|message" . "message") ("name" . "name") ("next\\|nxt" . "next") ("num\\(ber\\)?" . "number") ("port" . "port") ("host" . "host") ("obj\\|object" . "object") ("previous\\|prev" . "previous") ("str\\(ing\\)?" . "string") ("use?r" . "user") ("\\(^\\|\\s-\\)id\\($\\|\\s-\\)" . "Identifier")) "List of common English abbreviations or full words.\nThese are nouns (as opposed to verbs) for use in creating expanded\nversions of names.  This is an alist with each element of the form:\n (MATCH . RESULT)\nMATCH is a regexp to match in the type field.\nRESULT is a string." :type (repeat (cons (string :tag "Regexp") (string :tag "Doc Text"))) srecode-document-autocomment-function-alist '(("abort" . "Aborts the") ("realloc" . "moves or ") ("alloc\\(ate\\)?" . "Allocates and initializes a new ") ("clean" . "Cleans up the") ("clobber" . "Removes") ("close" . "Cleanly closes") ("check" . "Checks the") ("comp\\(are\\)?" . "Compares the") ("create" . "Creates a new ") ("find" . "Finds ") ("free" . "Frees up space") ("gen\\(erate\\)?" . "Generates a new ") ("get\\|find" . "Looks for the given ") ("gobble" . "Removes") ("he?lp" . "Provides help for") ("li?ste?n" . "Listens for ") ("connect" . "Connects to ") ("acc?e?pt" . "Accepts a ") ("load" . "Loads in ") ("match" . "Check that parameters match") ("name" . "Provides a name which ") ("new" . "Allocates a ") ("parse" . "Parses the parameters and returns ") ("print\\|display" . "Prints out") ("read" . "Reads from") ("reset" . "Resets the parameters and returns") ("scan" . "Scans the ") ("setup\\|init\\(ialize\\)?" . "Initializes the ") ("select" . "Chooses the ") ("send" . "Sends a") ("re?c\\(v\\|ieves?\\)" . "Receives a ") ("to" . "Converts ") ("update" . "Updates the ") ("wait" . "Waits for ") ("write" . "Writes to")) "List of names to string match against the function name.\nThis is an alist with each element of the form:\n (MATCH . RESULT)\nMATCH is a regexp to match in the type field.\nRESULT is a string.\n\nCertain prefixes may always mean the same thing, and the same comment\ncan be used as a beginning for the description.  Regexp should be\nlower case since the string they are compared to is downcased.\nA string may end in a space, in which case, last-alist is searched to\nsee how best to describe what can be returned.\nDoesn't always work correctly, but that is just because English\ndoesn't always work correctly." (repeat (cons (string :tag "Regexp") (string :tag "Doc Text"))) '(("sock\\(et\\)?" . "socket") ("addr\\(ess\\)?" . "address") ("buf\\(f\\(er\\)?\\)?" . "buffer") ("cur\\(r\\(ent\\)?\\)?" . "current") ("dev\\(ice\\)?" . "device") ("file" . "file") ("line" . "line") ("msg\\|message" . "message") ("name" . "name") ("next\\|nxt" . "next") ("port" . "port") ("host" . "host") ("obj\\|object" . "object") ("previous\\|prev" . "previous") ("str\\(ing\\)?" . "string") ("use?r" . "user") ("num\\(ber\\)?" . "number") ("\\(^\\|\\s-\\)id\\($\\|\\s-\\)" . "Identifier")) (repeat (cons (string :tag "Regexp") (string :tag "Doc Text"))) srecode-document-autocomment-return-first-alist '(("static" . "Locally defined function which ") ("Bool\\|BOOL" . "Status of ")) "List of regexp matches for types.\nThey provide a little bit of text when typing information is\ndescribed.\nThis is an alist with each element of the form:\n (MATCH . RESULT)\nMATCH is a regexp to match in the type field.\nRESULT is a string." (repeat (cons (string :tag "Regexp") (string :tag "Doc Text"))) srecode-document-autocomment-return-last-alist '(("static[ 	\n]+struct \\([a-zA-Z0-9_]+\\)" . "%s") ("struct \\([a-zA-Z0-9_]+\\)" . "%s") ("static[ 	\n]+union \\([a-zA-Z0-9_]+\\)" . "%s") ("union \\([a-zA-Z0-9_]+\\)" . "%s") ("static[ 	\n]+enum \\([a-zA-Z0-9_]+\\)" . "%s") ("enum \\([a-zA-Z0-9_]+\\)" . "%s") ("static[ 	\n]+\\([a-zA-Z0-9_]+\\)" . "%s") ("\\([a-zA-Z0-9_]+\\)" . "of type %s")) "List of regexps which provide the type of the return value.\nThis is an alist with each element of the form:\n (MATCH . RESULT)\nMATCH is a regexp to match in the type field.\nRESULT is a string, which can contain %s, which is replaced with\n`match-string' 1." (repeat (cons (string :tag "Regexp") (string :tag "Doc Text"))) srecode-document-autocomment-param-alist '(("[Cc]txt" . "Context") ("[Ii]d" . "Identifier of") ("[Tt]ype" . "Type of") ("[Nn]ame" . "Name of") ("argc" . "Number of arguments") ("argv" . "Argument vector") ("envp" . "Environment variable vector")) "Alist of common variable names appearing as function parameters.\nThis is an alist with each element of the form:\n (MATCH . RESULT)\nMATCH is a regexp to match in the type field.\nRESULT is a string of text to use to describe MATCH.\nWhen one is encountered, document-insert-parameters will automatically\nplace this comment after the parameter name." (repeat (cons (string :tag "Regexp") (string :tag "Doc Text"))) srecode-document-autocomment-param-type-alist '(("const" . "Constant") ("void" . "Empty") ("char[ ]*\\*" . "String ") ("\\*\\*" . "Pointer to ") ("\\*" . "Pointer ") ("char[ ]*\\([^ 	*]\\|$\\)" . "Character") ("int\\|long" . "Number of") ("FILE" . "File of") ("float\\|double" . "Value of") ("Bool\\|BOOL" . "Flag") ("Window" . "Window") ("GC" . "Graphic Context") ("Widget" . "Widget")) "Alist of input parameter types and strings describing them.\nThis is an alist with each element of the form:\n (MATCH . RESULT)\nMATCH is a regexp to match in the type field.\nRESULT is a string." (repeat (cons (string :tag "Regexp") (string :tag "Doc Text")))] 8)
#@364 Insert some comments.
Whack any comments that may be in the way and replace them.
If the region is active, then insert group function comments.
If the cursor is in a comment, figure out what kind of comment it is
  and replace it.
If the cursor is in a function, insert a function comment.
If the cursor is on a one line prototype, then insert post-fcn comments.
(defalias 'srecode-document-insert-comment #[nil "\306 \210\307 	\204\n\310=\204\203/\f\203/`\311 V\203'\312\311 `\"\202\253\312`\311 \"\202\253\313\232\203Q\212\314 \210\315 )\203E\314 \210\202Q\316 \211\203P\317
!\210)\315 \203\223\315 \320\211\211A@)*=\203u\321\315 !\203u\322 \202\253\315 \323\211\211A@)*=\203\215\324 \202\253\325\326!\202\253\327\330!\211;\205\252G\331U?\205\252\332!))\207" [ctxt srecode-handle-region-when-non-active-flag last-command transient-mark-mode mark-active tag semantic-fetch-tags srecode-calculate-context mouse-drag-region mark srecode-document-insert-group-comments ("declaration" "comment") back-to-indentation semantic-current-tag semantic-find-tag-by-overlay-next semantic-go-to-tag variable srecode-document-one-line-tag-p srecode-document-insert-variable-one-line-comment function srecode-document-insert-function-comment error "Not sure what to comment" read-string "Section Title (RET to skip): " 0 srecode-document-insert-section-comment class title] 4 (#$ . 7080) nil])
#@38 Insert a section comment with TITLE.
(defalias 'srecode-document-insert-section-comment #[(&optional title) "\304!\210\304\305\"\210\306 \204\307\310\"\210\311 \312\306 \313\314\305$\211\204&\307\315!\210\2030\316	\317#\210\320\n	\"*\207" [major-mode dict temp title srecode-load-tables-for-mode document srecode-table error "No template table found for mode %s" srecode-create-dictionary srecode-template-get-table "section-comment" "declaration" "No templates for inserting section comments" srecode-dictionary-set-value "TITLE" srecode-insert-fcn] 6 (#$ . 8510) "sSection Title: "])
#@41 Strip stray whitespace from around STR.
(defalias 'srecode-document-trim-whitespace #[(str) "\301\302\"\203\303\304\305\211$\301\306\"\203\303\304\305\211$\207" [str string-match "^\\(\\s-\\|\n\\)+" replace-match "" t "\\(\\s-\\|\n\\)+$"] 5 (#$ . 9113)])
#@227 Insert or replace a function comment.
FCN-IN is the Semantic tag of the function to add a comment too.
If FCN-IN is not provided, the current tag is used instead.
It is assumed that the comment occurs just in front of FCN-IN.
(defalias 'srecode-document-insert-function-comment #[(&optional fcn-in) "\306!\210\306\307\"\210\310 \204\311\312\"\210\313 \314\310 \315\316\307$\211\204&\311\317!\210\2040\320 \210\321 \203D\322\211\211A@)\f*=\204H\311\323!\210p\324!=\204T\311\325!\210\326!\210\327 \210\330u\210\331\332\"\333!3\2114\203T4\2115\2115A@\247\204\2025AA\202\2055A)@)64\2115\2115A@\247\204\2375AA\202\2425A)A)7\334\2126b\210\335\336!)!8\336\337\340\2179\3417\211\342
8):\343:!\203\325\344:!\202\331:\345H*\";\2126b\210\346 \210\321 )\211<\204R\34767\"\210;\350V\203\351\352!\203R;\350V\2037b\210\353 \210\354 \2108\20349\2044\351\355!\203'8367|\2106b\210\202R9\203R\351\356!\203R67|\2106b\210\334\3579\360\"!3.\327 \210\361=>\362\n	\".\207" [major-mode dict temp fcn-in class tag srecode-load-tables-for-mode document srecode-table error "No template table found for mode %s" srecode-create-dictionary srecode-template-get-table "function-comment" "declaration" "No templates for inserting function comments" semantic-fetch-tags semantic-current-tag function "No tag of class 'function to insert comment for" semantic-tag-buffer "Only insert comments for tags in the current buffer" semantic-go-to-tag beginning-of-line -1 semantic-documentation-comment-preceeding-tag lex srecode-document-function-name-comment srecode-document-trim-whitespace semantic-doc-snarf-comment-for-tag nil (srecode-extract temp s e) ((error)) count-lines 4 semantic-overlay-p semantic-overlay-start 0 back-to-indentation pulse-momentary-highlight-region 2 y-or-n-p "Replace this comment? " delete-horizontal-space delete-blank-lines "Convert old-style comment to Template with old text? " "Refresh pre-existing comment (recycle old doc)? " srecode-dictionary-lookup-name "DOC" #[(tag dict) "\304\305	\n=\203
\202\306	!#\207" [dict tag fcn-in doctext srecode-dictionary-set-value "DOC" srecode-document-parameter-comment] 5] srecode-insert-fcn doctext lextok token s e plaintext extract o distance belongelsewhere srecode-semantic-apply-tag-augment-hook srecode-semantic-selected-tag] 6 (#$ . 9386) nil])
#@221 Insert or replace a variable comment.
VAR-IN is the Semantic tag of the function to add a comment too.
If VAR-IN is not provided, the current tag is used instead.
It is assumed that the comment occurs just after VAR-IN.
(defalias 'srecode-document-insert-variable-one-line-comment #[(&optional var-in) "\306!\210\306\307\"\210\310 \204\311\312\"\210\313 \314\310 \315\316\307$\211\204&\311\317!\210\2040\320 \210\321 \203D\322\211\211A@)\f*=\204H\311\323!\210p\324!=\204T\311\325!\210\211\326
8)*\327*!\203l\330*!\202p*\331H*b\210\332\333\334 \"\210\335\336!\211+\203\340+\211,\211,A@\247\204\227,AA\202\232,A)@)+\211,\211,A@\247\204\262,AA\202\265,A)A)-.\337.-\"\210\340\341!\204\315\311\342!\210\343\n.-#\210.-|\210.b\210*)\344\210\345 \210\346/\347\"\210`\334 W\203\367\344\210\35001\351\n	\",\207" [major-mode dict temp var-in class tag srecode-load-tables-for-mode document srecode-table error "No template table found for mode %s" srecode-create-dictionary srecode-template-get-table "variable-same-line-comment" "declaration" "No templates for inserting variable comments" semantic-fetch-tags semantic-current-tag variable "No tag of class 'variable to insert comment for" semantic-tag-buffer "Only insert comments for tags in the current buffer" 4 semantic-overlay-p semantic-overlay-end 1 skip-syntax-forward "-" point-at-eol semantic-doc-snarf-comment-for-tag lex pulse-momentary-highlight-region y-or-n-p "A comment already exists.  Replace? " "Quit" srecode-extract nil delete-horizontal-space move-to-column t #[(tag dict) "\302\303\304	!#\207" [dict tag srecode-dictionary-set-value "DOC" srecode-document-parameter-comment] 5] srecode-insert-fcn o lextok token e s comment-column srecode-semantic-apply-tag-augment-hook srecode-semantic-selected-tag] 6 (#$ . 11781) nil])
#@223 Insert group comments around the active between BEG and END.
If the region includes only parts of some tags, expand out
to the beginning and end of the tags on the region.
If there is only one tag in the region, complain.
(defalias 'srecode-document-insert-group-comments #[(beg end) "\306!\210\306\307\"\210\310 \204\311\312\"\210\313 \314\315\211\212
b\210\316 \206'\317 )$\212%b\210\316 \2066\320 )&\315'
(%)$\203\223&\203\223$\211**\321*8)+\322+!\203i\323+!\202m+\324H*&\211**\321*8)+\322+!\203\212\325+!\202\216+\326H*V\203\231\315\211$&$\203I$&=\203\322$\203\322$\327,\211*\211*A@),*=\203\322$'\317
!$\320%!&\202\374\330$!&=\203\351&'\320%!&\202\374$\330&!=\203\374$'\317
!$'\203\331$\211**\321*8)+\322+!\203\325+!\202#+\326H*(&\211**\321*8)+\322+!\203B\323+!\202F+\324H*)\332\310 \333\n\307$\332\310 \334\n\307$\203a\f\204e\311\335!\210\336	\337\340\341!#\210)b\210\315\210\342\f	\"\210(b\210\343 \210\342	\".	\207" [major-mode dict context temp-start temp-end beg srecode-load-tables-for-mode document srecode-table error "No template table found for mode %s" srecode-create-dictionary "declaration" nil semantic-current-tag semantic-find-tag-by-overlay-next semantic-find-tag-by-overlay-prev 4 semantic-overlay-p semantic-overlay-end 1 semantic-overlay-start 0 type semantic-find-tag-parent-by-overlay "classdecl" srecode-template-get-table "group-comment-start" "group-comment-end" "No templates for inserting group comments" srecode-dictionary-set-value "GROUPNAME" read-string "Name of group: " srecode-insert-fcn beginning-of-line tag-start end tag-end parent-tag first-pos second-pos tag o class] 6 (#$ . 13638) "r"])
#@292 Create documentation for the function defined in TAG.
If we can identify a verb in the list followed by some
name part then check the return value to see if we can use that to
finish off the sentence.  That is, any function with 'alloc' in it will be
allocating something based on its type.
(defalias 'srecode-document-function-name-comment #[(tag) "\306\211\307	\211@)	\211\310\311	\312	8)\n\"+\206\307<\203.@\203T\313@@\227\"\203K
@AP\314\306A\211\2043\211\203\224\313@@\f\227\"\203\213
\203u@A\227\202y@AP\211\211GSH\315U\203\210\314\306A\211\204\\\211\203\307\313@@\f\227\"\203\276
\203\265@A\227\202\271@AP\306A\211\204\234\203\375\211\203\375\313@@\227\"\203\364
\316\317@A\320\321\224\321\225O!\"Q\306A\211\204\324
.\207" [srecode-document-autocomment-return-first-alist tag attribute retval fname news nil "" :type plist-get 2 string-match t 32 " " format srecode-document-programmer->english 1 tailit dropit al srecode-document-autocomment-function-alist srecode-document-autocomment-common-nouns-abbrevs srecode-document-autocomment-return-last-alist] 9 (#$ . 15391)])
#@230 Convert tag or string PARAM into a name,comment pair.
Optional COMMENTLIST is list of previously existing comments to
use instead in alist form.  If the name doesn't appear in the list of
standard names, then english it instead.
(defalias 'srecode-document-parameter-comment #[(param &optional commentlist) "\306\307	;\203\f	\202	\211@)	;?\205'	\211\310\311\n\312\n8)\"+\f<\203:\f\211@)\203^\313@@
\"\203U\314@APA\211\204?G\315U\203\254	;\204\204	\211\316\311\n\312\n8)\"+\203\204\317P\211\203\254\f\203\254\313@@\f\"\203\243@APA\211\204\214\204\272\320\321
!Q-\207" [srecode-document-autocomment-param-alist param tag attribute tt name "" nil :type plist-get 2 string-match t 0 :typemodifiers "array of " " " srecode-document-programmer->english fnd aso cmt srecode-document-autocomment-param-type-alist] 8 (#$ . 16592)])
#@319 Take PROGRAMMER and convert it into English.
Works with the following rules:
  1) convert all _ into spaces.
  2) inserts spaces between CamelCasing word breaks.
  3) expands noun names based on common programmer nouns.

  This function is designed for variables, not functions.  This does
not account for verb parts.
(defalias 'srecode-document-programmer->english #[(programmer) "\306\230\203\306\207\307\310\211\211\211GW\2032\n\fH\311U\203$\312\202)\313\fH!P\fT\211\202\n\310\307\211GW\203s\n\fH\211\314Y\203X
\315X\203X\316\313
!\202i\203f\310\312\313
!P\202i\313
!)P\fT\211\2029\310\307\n\310\317\320\"\203\310\321\224\321\225O\321\225\310	\203\261\317	@@\227\"\203\252\n	@AP\316	A\211\204\227\204\272\nP\n\312P\310O*\202{\n,\207" [programmer al newstr llow ind tc "" 0 nil 95 " " char-to-string 97 122 t string-match "^\\s-*\\([^ 	\n]+\\)" 1 end ts srecode-document-autocomment-common-nouns-abbrevs] 5 (#$ . 17506)])
#@49 Does TAG fit on one line with space on the end?
(defalias 'srecode-document-one-line-tag-p #[(tag) "\212\302!\210\211\3038)\304	!\203\305	!\202	\306H*\307 X\205D\211\3038)\304	!\2039\305	!\202<	\306H*b\205Di\310W)\207" [tag o semantic-go-to-tag 4 semantic-overlay-p semantic-overlay-end 1 point-at-eol 70] 3 (#$ . 18505)])
(provide 'srecode/document)

MMCT - 2023