;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Mon Apr 17 19:48:51 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/regi.el ;;; emacs version 19.28.90.26. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/gd/gnu/emacs/19.0/lisp/regi.el' was compiled for Emacs 19")) #@361 Return the character position at various buffer positions. Optional POSITION can be one of the following symbols: `bol' == beginning of line `boi' == beginning of indentation `eol' == end of line [default] `bonl' == beginning of next line `bopl' == beginning of previous line Optional COL-P non-nil returns `current-column' instead of character position. (defalias 'regi-pos #[(&optional position col-p) "ŠΑ=ƒ Βyˆ‚4Γ=ƒΔ ˆ‚4Ε=ƒ%Ζyˆ‚4Η=ƒ1Θyˆ‚4Ιˆ\nƒ=i‚>`)‡" [position bol 0 boi back-to-indentation bonl 1 bopl -1 nil col-p] 2 (#$ . 478)]) #@204 Build a regi frame where each element of PREDLIST appears exactly once. The frame contains elements where each member of PREDLIST is associated with FUNC, and optionally NEGATE-P and CASE-FOLD-SEARCH-P. (defalias 'regi-mapcar #[(predlist func &optional negate-p case-fold-search-p) "ΐ‰ „\f\fƒ C\fƒΕ \fC\"ƒA@D ƒ1Ε \"Ε\nC\"A)‚\n*‡" [nil tail frame negate-p case-fold-search-p append predlist func element] 3 (#$ . 1043)]) #@3343 Interpret the regi frame FRAME. If optional START and END are supplied, they indicate the region of interest, and the buffer is narrowed to the beginning of the line containing START, and beginning of the line after the line containing END. Otherwise, point and mark are not set and processing continues until your FUNC returns the `abort' symbol (see below). Beware! Not supplying a START or END could put you in an infinite loop. A regi frame is a list of entries of the form: (PRED FUNC [NEGATE-P [CASE-FOLD-SEARCH]]) PRED is a predicate against which each line in the region is tested, and if a match occurs, FUNC is `eval'd. Point is then moved to the beginning of the next line, the frame is reset and checking continues. If a match doesn't occur, the next entry is checked against the current line until all entries in the frame are checked. At this point, if no match occurred, the frame is reset and point is moved to the next line. Checking continues until every line in the region is checked. Optional NEGATE-P inverts the result of PRED before FUNC is called and `case-fold-search' is bound to the optional value of CASE-FOLD-SEARCH for the PRED check. PRED can be a string, variable, function or one of the following symbols: t, nil, `begin', `end', and `every'. If PRED is a string, or a variable or list that evaluates to a string, it is interpreted as a regular expression and is matched against the current line (from the beginning) using `looking-at'. If PRED does not evaluate to a string, it is interpreted as a binary value (nil or non-nil). PRED can also be one of the following symbols: t -- always produces a true outcome `begin' -- always executes before anything else `end' -- always executes after everything else `every' -- execute after frame is matched on a line Note that NEGATE-P and CASE-FOLD-SEARCH are meaningless if PRED is one of these special symbols. Only the first occurance of each symbol in a frame entry is used, the rest are ignored. Your FUNC can return values which control regi processing. If a list is returned from your function, it can contain any combination of the following elements: the symbol `continue' Tells regi to continue processing frame-entries after a match, instead of resetting to the first entry and advancing to the next line, as is the default behavior. When returning this symbol, you must take care not to enter an infinite loop. the symbol `abort' Tells regi to terminate processing this frame. any end frame-entry is still processed. the list `(frame . NEWFRAME)' Tells regi to use NEWFRAME as its current frame. In other words, your FUNC can modify the executing regi frame on the fly. the list `(step . STEP)' Tells regi to move STEP number of lines forward during normal processing. By default, regi moves forward 1 line. STEP can be negative, but be careful of infinite loops. You should usually take care to explicitly return nil from your function if no action is to take place. Your FUNC will always be `eval'ed. The following variables will be temporarily bound to some useful information: `curline' the current line in the buffer, as a string `curframe' the full, current frame being executed `curentry' the current frame entry being executed. (defalias 'regi-interpret #[(frame &optional start end) "ŠŒΐ‰‰‰‰‰ƒ:ƒ: ^‰]‰bˆΚΛ!bˆΚΜ!}ˆ+ΝΞ\"ˆΠ!ˆ\n „ym„y @‰@A@Τ8Φ8ΐΩڍˆ.Π\f!ˆ‚GΠ !.‡" [nil donep working-frame current-frame every-tag end-tag begin-tag start end tstart regi-pos bonl bol mapcar #[(entry) "@A@‰Γ=ƒ ‰‚6\nΕ=ƒ ‰‚6\nΗ=ƒ- ‰‚6Ι\nC\"‰\n*‡" [entry func pred begin begin-tag end end-tag every every-tag append working-frame] 4] frame eval entry pred func 2 negate-p 3 case-fold-search match-p regi-throw-top (byte-code "„ ΒyˆΓΔΕ\"ˆ‚\"Ζ!‰;ƒ\"Ι!\nƒ,?ƒ…ΛΜ!ΛΝ!{Ζ!ΤžA†PΒΥžƒ_ΥžAΦ>ƒlA‚ryˆ Χ>ƒΕΓΔΕ\"ˆ-‚ˆAΒ‡" [current-frame working-frame 1 throw regi-throw-top t eval pred match-p looking-at negate-p regi-pos bol eol curline curframe entry curentry func result step frame continue abort donep] 3)] 7 (#$ . 1503)]) (provide (quote regi))