;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:20:33 2007 ;;; from file /home/cyd/emacs/lisp/button.el ;;; in Emacs version 22.0.99 ;;; 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 "`button.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-face 'button '((((type pc) (class color)) (:foreground "lightblue")) (((type tty)) (:inherit link)) (t :underline t)) "Default face used for buttons." :group 'basic-faces) #@25 Keymap used by buttons. (defvar button-map (byte-code "\301 \302\303\304#\210\302\305\304#\210)\207" [map make-sparse-keymap define-key " " push-button [mouse-2]] 4) (#$ . 747)) #@114 Keymap useful for buffers containing buttons. Mode-specific keymaps may want to use this as their parent keymap. (defvar button-buffer-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\306#\210)\207" [map make-sparse-keymap define-key [9] forward-button " " backward-button [backtab]] 4) (#$ . 936)) (byte-code "\301\302\303\304#\210\301\302\305\306#\210\301\302\307#\210\301\302\310\304#\210\301\302\311\312#\210\301\302\313\314#\210\301\302\315\316#\210\301\302\317\316#\210\301\304\320\302#\207" [button-map put default-button face button mouse-face highlight keymap type action ignore help-echo "mouse-2, RET: Push this button" evaporate t rear-nonsticky button-category-symbol] 4) #@139 Return the symbol used by button-type TYPE to store properties. Buttons inherit them by setting their `category' property to that symbol. (defalias 'button-category-symbol #[(type) "\301N\206\n\302\303\"\207" [type button-category-symbol error "Unknown button type `%s'"] 3 (#$ . 1650)]) (put 'button-category-symbol 'byte-optimizer 'byte-compile-inline-expand) #@557 Define a `button type' called NAME. The remaining arguments form a sequence of PROPERTY VALUE pairs, specifying properties to use as defaults for buttons with this type (a button's type may be set by giving it a `type' property when creating the button, using the :type keyword argument). In addition, the keyword argument :supertype may be used to specify a button-type from which NAME inherits its default property values (however, the inheritance happens only when NAME is defined; subsequent changes to a supertype are not reflected in its subtypes). (defalias 'define-button-type #[(name &rest properties) "\306\307!\310P!\311 \312\"\206\311 \313\"\206\314\211\315N\206!\316\317\n\")\320\315\f#\210\321 ! \203C\320\f \211A@ \211A@#\210\202.)\320\f\302#\210 \203m \211A@\211\313=\203^\312\320\f \211A@#\210)\202J\f\312N\204y\320\f\312\314#\210*\207" [name properties type super-catsym catsym default-props make-symbol symbol-name "-button" plist-get supertype :supertype button button-category-symbol error "Unknown button type `%s'" put symbol-plist prop] 6 (#$ . 2022)]) #@50 Set the button-type TYPE's PROP property to VAL. (defalias 'button-type-put #[(type prop val) "\303\211\304N\206 \305\306\") \n#\207" [type prop val put button-category-symbol error "Unknown button type `%s'"] 5 (#$ . 3135)]) #@50 Get the property of button-type TYPE named PROP. (defalias 'button-type-get #[(type prop) "\211\302N\206\f\303\304\") N\207" [type prop button-category-symbol error "Unknown button type `%s'"] 4 (#$ . 3371)]) #@57 Return t if button-type TYPE is a subtype of SUPERTYPE. (defalias 'button-type-subtype-p #[(type supertype) " =\206\205\302\303\301\" \"\207" [type supertype button-type-subtype-p button-type-get] 4 (#$ . 3590)]) #@45 Return the position at which BUTTON starts. (defalias 'button-start #[(button) "\301!\203\n\302!\207\303T\300\"\206e\207" [button overlayp overlay-start previous-single-property-change] 3 (#$ . 3816)]) #@43 Return the position at which BUTTON ends. (defalias 'button-end #[(button) "\301!\203\n\302!\207\303\300\"\206d\207" [button overlayp overlay-end next-single-property-change] 3 (#$ . 4030)]) #@47 Get the property of button BUTTON named PROP. (defalias 'button-get #[(button prop) "\302!\203 \303 \"\207\304 \"\207" [button prop overlayp overlay-get get-text-property] 3 (#$ . 4233)]) #@36 Set BUTTON's PROP property to VAL. (defalias 'button-put #[(button prop val) "\304>\203\305 \211\306N\206\307\310\n\")\202#\305=\203#\307\311!\210\312 !\203/\313  #\207\314\315 T\303\"\2069e\316 \303\"\206Ad $\207" [prop val type button (type :type) category button-category-symbol error "Unknown button type `%s'" "Button `category' property may not be set directly" overlayp overlay-put put-text-property previous-single-property-change next-single-property-change] 6 (#$ . 4431)]) #@197 Call BUTTON's action property. If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action instead of its normal action; if the button has no mouse-action, the normal action is used instead. (defalias 'button-activate #[(button &optional use-mouse-action) "\203 \305 \306\"\206\305 \302\"\307\n!\2034\310 \311\312\313 \"r\314\216\315\316\317\n!!!\210\nb\210\320\321!,\2027\n !)\207" [use-mouse-action button action save-selected-window-alist save-selected-window-window button-get mouse-action markerp selected-window mapcar #[(frame) "\301!D\207" [frame frame-selected-window] 3] frame-list ((byte-code "\305\211\203/\n@\306 @!\203(\307 \211A@)!\203(\310 @ \211A@)\"\210\nA\211\204*\307\f!\203:\311\f!\210\305\207" [save-selected-window-alist elt #1=#:--cl-dolist-temp-- x save-selected-window-window nil frame-live-p window-live-p set-frame-selected-window select-window] 4)) select-window display-buffer marker-buffer recenter 0] 4 (#$ . 4938)]) (put 'button-activate 'byte-optimizer 'byte-compile-inline-expand) #@29 Return BUTTON's text label. (defalias 'button-label #[(button) "\301\302!\303!\"\207" [button buffer-substring-no-properties button-start button-end] 4 (#$ . 5989)]) #@30 Return BUTTON's button-type. (defalias 'button-type #[(button) "\301\302\"\207" [button button-get type] 3 (#$ . 6163)]) (put 'button-type 'byte-optimizer 'byte-compile-inline-expand) #@69 Return t if BUTTON has button-type TYPE, or one of TYPE's subtypes. (defalias 'button-has-type-p #[(button type) "\302\303\301\" \"\207" [button type button-type-subtype-p button-get] 4 (#$ . 6354)]) #@353 Make a button from BEG to END in the current buffer. The remaining arguments form a sequence of PROPERTY VALUE pairs, specifying properties to add to the button. In addition, the keyword argument :type may be used to specify a button-type from which to inherit other properties; see `define-button-type'. Also see `make-text-button', `insert-button'. (defalias 'make-button #[(beg end &rest properties) "\304 \305\306\305% \203\307\n \211A@ \211A@#\210\202\310\n\311\n#\210\312\n\313\"\2040\310\n\313\314#\210\n)\207" [beg end overlay properties make-overlay nil t button-put overlay-put button overlay-get category default-button] 6 (#$ . 6562)]) #@338 Insert a button with the label LABEL. The remaining arguments form a sequence of PROPERTY VALUE pairs, specifying properties to add to the button. In addition, the keyword argument :type may be used to specify a button-type from which to inherit other properties; see `define-button-type'. Also see `insert-text-button', `make-button'. (defalias 'insert-button #[(label &rest properties) "\302\303`c\210` $\207" [label properties apply make-button] 5 (#$ . 7227)]) #@560 Make a button from BEG to END in the current buffer. The remaining arguments form a sequence of PROPERTY VALUE pairs, specifying properties to add to the button. In addition, the keyword argument :type may be used to specify a button-type from which to inherit other properties; see `define-button-type'. This function is like `make-button', except that the button is actually part of the text instead of being a property of the buffer. Creating large numbers of buttons can also be somewhat faster using `make-text-button'. Also see `insert-text-button'. (defalias 'make-text-button #[(beg end &rest properties) "\305\302\"\206 \305\306\"\307\310\"\203\311\312!\210 \204$\310\313BB\202; \310\240\210 A A@\211\314N\2068\311\315\n\")\240\210)\316 \f\317\320CBB#\210 \207" [properties type-entry type beg end plist-member :type plist-get category error "Button `category' property may not be set directly" default-button button-category-symbol "Unknown button type `%s'" add-text-properties button t] 7 (#$ . 7701)]) #@546 Insert a button with the label LABEL. The remaining arguments form a sequence of PROPERTY VALUE pairs, specifying properties to add to the button. In addition, the keyword argument :type may be used to specify a button-type from which to inherit other properties; see `define-button-type'. This function is like `insert-button', except that the button is actually part of the text instead of being a property of the buffer. Creating large numbers of buttons can also be somewhat faster using `insert-text-button'. Also see `make-text-button'. (defalias 'insert-text-button #[(label &rest properties) "\302\303`c\210` $\207" [label properties apply make-text-button] 5 (#$ . 8740)]) #@66 Return the button at position POS in the current buffer, or nil. (defalias 'button-at #[(pos) "\302\301\"\303 !\204 \204 \202\304\305\")\207" [pos button get-char-property overlayp copy-marker t] 3 (#$ . 9431)]) #@174 Return the next button after position POS in the current buffer. If COUNT-CURRENT is non-nil, count any button at POS in the search, instead of starting at the next button. (defalias 'next-button #[(pos &optional count-current) "\204 \302 \303\" dW\205\304 !\206\305 !\207" [count-current pos next-single-char-property-change button button-at next-button] 3 (#$ . 9659)]) #@179 Return the previous button before position POS in the current buffer. If COUNT-CURRENT is non-nil, count any button at POS in the search, instead of starting at the next button. (defalias 'previous-button #[(pos &optional count-current) "\304!\211\2033\n\203 \202H\305\306 !\301\"\304!\211\203,\306 !U?\205/ \202/\307!)\202H\305\301\"\304!\206HeV\205H\304S!)\207" [pos button count-current new-button button-at previous-single-char-property-change button-start previous-button] 4 (#$ . 10045)]) #@570 Perform the action specified by a button at location POS. POS may be either a buffer position or a mouse-event. If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action instead of its normal action; if the button has no mouse-action, the normal action is used instead. The action may be either a function to call or a marker to display. POS defaults to point, except when `push-button' is invoked interactively as the result of a mouse-event, in which case, the mouse event is used. If there's no button at POS, do nothing and return nil, otherwise return t. (defalias 'push-button #[(&optional pos use-mouse-action) "\250\204\200\211\250\203#\306\307 \310\311\312\313\"S!\"!\203#\314\315 !!\206= 9\203. \316N\206= :\205= @9\205= @\316N)\203\200\211:\203N\313\n8\202T\317 `\320\321F)r\322 \321\f8)!q\210\323 \324\f8\206{\313\f8:\203x\313\f8@\202{\313\f8)\325\"*\207\326\206\206`!\211\205\325 ###\203\236\327 \330\"\206\242\327 \331\"\332!\203\315\317 \333\334\335 \"$%r\336\216\337\340\341!!!\210b\210\342\321!,\202\321 !)\210*\325)\207" [pos obj event posn position button zerop logand lognot lsh 134217728 1 char-valid-p event-basic-type event-symbol-elements selected-window (0 . 0) 0 window-buffer push-button 5 t button-at button-get mouse-action action markerp mapcar #[(frame) "\301!D\207" [frame frame-selected-window] 3] frame-list ((byte-code "\305\211\203/\n@\306 @!\203(\307 \211A@)!\203(\310 @ \211A@)\"\210\nA\211\204*\307\f!\203:\311\f!\210\305\207" [save-selected-window-alist elt #1=#:--cl-dolist-temp-- x save-selected-window-window nil frame-live-p window-live-p set-frame-selected-window select-window] 4)) select-window display-buffer marker-buffer recenter use-mouse-action save-selected-window-alist save-selected-window-window] 8 (#$ . 10569) (list (if (integerp last-command-event) (point) last-command-event))]) #@371 Move to the Nth next button, or Nth previous button if N is negative. If N is 0, move to the start of any button at point. If WRAP is non-nil, moving past either end of the buffer continues from the other end. If DISPLAY-MESSAGE is non-nil, the button's help-echo string is displayed. Any button with a non-nil `skip' property is skipped over. Returns the button found. (defalias 'forward-button #[(n &optional wrap display-message) "\306\307 !\203\310`!\211\203i\311!b\210\202i \312V\203\"\313\202#\314 \312V\203-e\202.d\315 !\316 \312V\203h\203h `!\211\204Q\f\203Q \n\316\"\2036\311!b\210\317\320\"\2046 S\211\2027*\204{\321\f\203v\322\202w\323!\202\221 \205\203\317\324\"\211\203\217\325\326\"\210))\207" [button n wrap-start iterator wrap display-message nil zerop button-at button-start 0 next-button previous-button abs t button-get skip error "No buttons!" "No more buttons" help-echo message "%s" msg] 4 (#$ . 12485) "p\nd\nd"]) #@371 Move to the Nth previous button, or Nth next button if N is negative. If N is 0, move to the start of any button at point. If WRAP is non-nil, moving past either end of the buffer continues from the other end. If DISPLAY-MESSAGE is non-nil, the button's help-echo string is displayed. Any button with a non-nil `skip' property is skipped over. Returns the button found. (defalias 'backward-button #[(n &optional wrap display-message) "\303[ \n#\207" [n wrap display-message forward-button] 4 (#$ . 13471) "p\nd\nd"]) (provide 'button)