%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/ |
Current File : //usr/local/share/emacs/27.2/lisp/skeleton.elc |
;ELC ;;; Compiled ;;; in Emacs version 27.2 ;;; 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. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvaralias 'skeleton-transformation 'skeleton-transformation-function) #@232 If non-nil, function applied to literal strings before they are inserted. It should take strings and characters and return them transformed, or nil which means no transformation. Typical examples might be `upcase' or `capitalize'. (defvar skeleton-transformation-function 'identity (#$ . 482)) (put 'skeleton-transformation-function 'variable-interactive "aTransformation function: ") #@309 Controls wrapping behavior of functions created with `define-skeleton'. When the region is visible (due to `transient-mark-mode' or marking a region with the mouse) and this is non-nil and the function was called without an explicit ARG, then the ARG defaults to -1, i.e. wrapping around the visible region. (defvar skeleton-autowrap t (#$ . 874)) (make-obsolete-variable 'skeleton-autowrap nil "24.5") #@71 If non-nil, make sure that the skeleton inserted ends with a newline. (defvar skeleton-end-newline t (#$ . 1283)) #@132 Hook called at end of skeleton but before going to point of interest. The variables `v1' and `v2' are still set when calling this. (defvar skeleton-end-hook nil (#$ . 1404)) (defvaralias 'skeleton-filter 'skeleton-filter-function) #@71 Function for transforming a skeleton proxy's aliases' variable value. (defvar skeleton-filter-function 'identity (#$ . 1641)) #@68 When non-nil untabifies when deleting backwards with element -ARG. (defvar skeleton-untabify nil (#$ . 1773)) #@107 When non-nil, indent rigidly under current line for element `\n'. Else use mode's `indent-line-function'. (defvar skeleton-newline-indent-rigidly nil (#$ . 1890)) #@240 A buffer-local varlist (see `let') of mode specific skeleton elements. These variables are bound while interpreting a skeleton. Their value may in turn be any valid skeleton element if they are themselves to be used as skeleton elements. (defvar skeleton-further-elements nil (#$ . 2060)) (make-variable-buffer-local 'skeleton-further-elements) #@58 Replacement for %s in prompts of recursive subskeletons. (defvar skeleton-subprompt (substitute-command-keys "RET, \\<minibuffer-local-map>\\[abort-recursive-edit] or \\[help-command]") (#$ . 2412)) #@65 If non-nil `define-skeleton' will override previous definition. (defvar skeleton-debug nil (#$ . 2617)) #@206 List of positions marked with @, after skeleton insertion. The list describes the most recent skeleton insertion, and its elements are integer buffer positions in the reverse order of the insertion order. (defvar skeleton-positions nil (#$ . 2728)) (put 'skeleton-edebug-spec 'edebug-form-spec '([&or null stringp (stringp &rest stringp) [[¬ atom] sexp]] &rest &or "n" "_" "-" ">" "@" "&" "!" "|" "resume:" ("quote" def-form) skeleton-edebug-spec def-form)) #@156 Define a user-configurable COMMAND that enters a statement skeleton. DOCUMENTATION is that of the command. SKELETON is as defined under `skeleton-insert'. (defalias 'define-skeleton '(macro . #[(command documentation &rest skeleton) "\203 \nL\210\304\305\306 D\307BB\310 \311\312\313\"\203 \314\202 \315\316Q\317\320\306\nD\321BB\257E\207" [skeleton-debug command skeleton documentation progn put quote ('no-self-insert t) defun (&optional str arg) string-match "\n\\'" "" "\n" "\nThis is a skeleton command (see `skeleton-insert').\nNormally the skeleton text is inserted at point, with nothing \"inside\".\nIf there is a highlighted region, the skeleton text is wrapped\naround the region text.\n\nA prefix argument ARG says to wrap the skeleton around the next ARG words.\nA prefix argument of -1 says to wrap around region, even if not highlighted.\nA prefix argument of zero says to wrap around zero words---that is, nothing.\nThis is a way of overriding the use of a highlighted region." (interactive "*P\nP") skeleton-proxy-new (str arg)] 10 (#$ . 3196)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put define-skeleton doc-string-elt 2 put edebug-form-spec (&define name stringp skeleton-edebug-spec)] 5) #@493 Insert SKELETON. Prefix ARG allows wrapping around words or regions (see `skeleton-insert'). If no ARG was given, but the region is visible, ARG defaults to -1 depending on `skeleton-autowrap'. An ARG of M-0 will prevent this just for once. This command can also be an abbrev expansion (3rd and 4th columns in \[edit-abbrevs] buffer: "" command-name). Optional second argument STR may also be a string which will be the value of `str' whereas the skeleton's interactor is then ignored. (defalias 'skeleton-proxy-new #[(skeleton &optional str arg) "\306 !\n\204\f \203 \307\n\206 !\202. \f\205. \310=\204* \f\205. \205. \311 \210\312;\2056 #\210\313\207" [skeleton-filter-function skeleton arg current-prefix-arg skeleton-autowrap last-command skeleton-insert prefix-numeric-value mouse-drag-region deactivate-mark -1 t transient-mark-mode mark-active str] 4 (#$ . 4443)]) #@3445 Insert the complex statement skeleton SKELETON describes very concisely. With optional second argument REGIONS, wrap first interesting point (`_') in skeleton around next REGIONS words, if REGIONS is positive. If REGIONS is negative, wrap REGIONS preceding interregions into first REGIONS interesting positions (successive `_'s) in skeleton. An interregion is the stretch of text between two contiguous marked points. If you marked A B C [] (where [] is the cursor) in alphabetical order, the 3 interregions are simply the last 3 regions. But if you marked B A [] C, the interregions are B-A, A-[], []-C. The optional third argument STR, if specified, is the value for the variable `str' within the skeleton. When this is non-nil, the interactor gets ignored, and this should be a valid skeleton element. When done with skeleton, but before going back to `_'-point, add a newline (unless `skeleton-end-newline' is nil) and run the hook `skeleton-end-hook'. SKELETON is made up as (INTERACTOR ELEMENT ...). INTERACTOR may be nil if not needed, a prompt-string or an expression for complex read functions. If ELEMENT is a string or a character it gets inserted (see also `skeleton-transformation-function'). Other possibilities are: \n go to next line and indent according to mode, unless this is the first/last element of a skeleton and point is at bol/eol _ interesting point, interregion here - interesting point, no interregion interaction, overrides interesting point set by _ > indent line (or interregion if > _) according to major mode @ add position to `skeleton-positions' & do next ELEMENT if previous moved point | do next ELEMENT if previous didn't move point -NUM delete NUM preceding characters (see `skeleton-untabify') resume: skipped, continue here if quit is signaled nil skipped After termination, point will be positioned at the last occurrence of - or at the first occurrence of _ or at the end of the inserted text. Note that \n as the last element of the skeleton only inserts a newline if not at eol. If you want to unconditionally insert a newline at the end of the skeleton, use "\n" instead. Likewise with \n as the first element when at bol. Further elements can be defined via `skeleton-further-elements'. ELEMENT may itself be a SKELETON with an INTERACTOR. The user is prompted repeatedly for different inputs. The SKELETON is processed as often as the user enters a non-empty string. \[keyboard-quit] terminates skeleton insertion, but continues after `resume:' and positions at `_' if any. If INTERACTOR in such a subskeleton is a prompt-string which contains a ".. %s .." it is formatted with `skeleton-subprompt'. Such an INTERACTOR may also be a list of strings with the subskeleton being repeated once for each string. Quoted Lisp expressions are evaluated for their side-effects. Other Lisp expressions are evaluated and the value treated as above. Note that expressions may not return t since this implies an endless loop. Modes can define other symbols by locally setting them to any valid skeleton element. The following local variables are available: str first time: read a string according to INTERACTOR then: insert previously read string once more help help-form during interaction with the user or nil input initial input (string or cons with index) while reading str v1, v2 local variables for memorizing anything you want (defalias 'skeleton-insert #[(skeleton &optional regions str) "\211\203X \306V\203 \307`\310\"\212\311 !\210\312 )D\202J [\313 \nB\307`\310\"C\f\203E \306V\203E \307\f\211A\242\310\"B S\202* \314\315\"*\211\203X @b\203X A`\316\211\211\211\211\211\211\316\317\216\320\321 \"!\320\322 \"\"\323#\316$!\203\246 !\211A!\242\324\"\211A\"\242DD$B$\202\210 \325\326$\327\324#DDE!.\207" [regions skeleton-regions mark-ring l2 l1 v2 0 copy-marker t forward-word-strictly point-marker mark-marker sort < nil #[nil "l\204 \203 \303 \210\304\305!\210\306\307!\210\310 p=\203' \311 !\204' b\210\312\307!\210\n\205- \nb\207" [skeleton-end-newline beg skeleton-point newline-and-indent run-hooks skeleton-end-hook sit-for 0 window-buffer pos-visible-in-window-p recenter] 2] mapcar car #[(x) "\301A@!\207" [x eval] 2] #[nil "\302 \"\207" [skeleton str skeleton-internal-list] 3] quote eval let funcall v1 input help resume: skeleton-point skeleton-modified beg skeleton-positions skeleton-further-elements #1=#:syms #2=#:vals #3=#:body #4=#:binds] 9 (#$ . 5342)]) #@629 Function for reading a string from the minibuffer within skeletons. PROMPT must be a string or a function that evaluates to a string. It may also be a form that evaluates to a string (deprecated). It may contain a `%s' which will be replaced by `skeleton-subprompt'. If non-nil second arg INITIAL-INPUT or variable `input' is a string or cons with index to insert before reading. If third arg RECURSIVE is non-nil i.e. we are handling the iterator of a subskeleton, returns empty string if user didn't modify input. While reading, the value of `minibuffer-help-form' is variable `help' if that is non-nil or a default string. (defalias 'skeleton-read #[(prompt &optional initial-input recursive) "\306\307!\203 \307J\206 \203 \310\202 \311l \204 \212\312c\210)\313\216;\2038 \314\315\f\" \2062 \316J\211\"\202F \317!\203C \202F \320!+\203h \203c \321\230\204c \232\204c \242\232\203h \322\323\324\"\207\207" [recursive eolp minibuffer-help-form prompt skeleton-subprompt initial-input boundp help "As long as you provide input you will insert another subskeleton.\n\nIf you enter the empty string, the loop inserting subskeletons is\nleft, and the current one is removed as far as it has been entered.\n\nIf you quit, the current subskeleton is removed as far as it has been\nentered. No more of the skeleton will be inserted, except maybe for a\nsyntactically necessary termination." "You are inserting a skeleton. Standard text gets inserted into the buffer\nautomatically, and you are prompted to fill in the variable parts." "\n" #[nil "\206 \301\302!\207" [eolp delete-char 1] 2] read-string format input functionp eval "" signal quit t] 4 (#$ . 9898)]) (defalias 'skeleton-internal-list #[(skeleton-il &optional str recursive) "\306 i\307 {\310\f\204 \311\304\312\313 @D\310FE A@\314=\203<