;ELC   
;;; Compiled
;;; in Emacs version 25.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.

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


(require 'calc-bin)
#@367 Parse the text around point for a number and return a vector
with the following elements if found:

0: base
1: beginning position of the literal
2: position for a sign; if nil, no negative number is allowed for this literal
3: beginning position of the number part
4: end position of the number part
5: end position of the literal

Return nil if no number is found.
(defalias 'oon--parse-number-at-point #[nil "\306\211\211\212\307\310!\203 \311u\210\212\312 \211\205' \313\314!\211\205' \315	@f\316\"?)\203[ 	@	Af\315\317\"\206? \315\320\"\211+\203J T\202K ,\321\322\211,\f\211&-\202}\212\323\324!\203f \325\225b\210\307\326\327 \330#)\203\206 \321\331\325\224\332\224\206{ \333\224\334\224\334\225\325\225&\202}\212\323\335!\203\221 \325\225b\210\307\336\327 \330#)\203\321 \325\224\332\224\332\225-,\321\331\306,-,\206\264 `Sf\337U\203\311 -f\340U\203\311 -T\202\313 -&+\202}\212\323\341!\203\334 \325\225b\210\323\310!?\205\351 \307\342\327 \330#)\203\321\343\325\224\332\224\206\370 \333\224\334\224\334\225\325\225&\202}\212\323\344!\203\325\225b\210\307\345\327 \330#)\203(\321\343\325\224\306\346\224\346\225\325\225&\202}\212\323\347!\2033\325\225b\210\323\310!?\205@\307\350\327 \330#)\203Z\321\332\325\224\332\224\206O\333\224\334\224\334\225\325\225&\202}\212\323\351!\203e\325\225b\210\307\352\327 \330#)\205}\321\322\325\224\346\224\332\224\332\225\325\225&,\207" [case-fold-search bounds num beg end char nil looking-back "[[:digit:]]" -1 number-at-point bounds-of-thing-at-point sexp char-equal 35 45 43 vector 10 looking-at "\\([+-]?0?[xX]?\\|#?[xX]?[+-]?\\)[[:xdigit:]]*" 0 "\\(\\([+-]\\|\\b\\)0[xX]\\|#[xX]\\([+-]?\\)\\)\\([[:xdigit:]]+\\)" line-beginning-position t 16 2 3 4 "\\(\\\\?[ux]?{?\\|U?\\+?\\)[[:xdigit:]]*" "\\(\\\\[ux]{?\\|\\bU\\+\\)\\([[:xdigit:]]+\\)" 123 125 "\\([+-]?0?[oO]?\\|#?[oO]?[+-]?\\)[0-7]*" "\\(\\([+-]\\|\\b\\)0[oO]\\|#[oO]\\([+-]?\\)\\)\\([0-7]+\\)" 8 "\\\\?[0-7]\\{1,3\\}" "\\\\\\([0-7]\\{3\\}\\)" 1 "\\([+-]?0?[bB]?\\|#?[bB]?[+-]?\\)[01]*" "\\(\\([+-]\\|\\b\\)0[bB]\\|#[bB]\\([+-]?\\)\\)\\([01]+\\)" "[+-]?[[:digit:]]*" "\\([+-]\\)?\\([[:digit:]]+\\)" sign nbeg nend] 9 (#$ . 431)])
#@52 Format an absolute number ABS in BASE like SAMPLE.
(defalias 'oon--format-number #[(abs base sample) "\306U\203 \307\310	\"\202' \311\312	!\211!\313\314\315\"\203$ \202& \227+	\250\203Q \314\316\"\203Q GGZ\317!\204F \202M \320\321\"P)\202R )\207" [base abs calc-number-radix str case-fold-search sample 10 format "%s" math-format-radix floor nil string-match "[A-Z]" "\\`0[[:xdigit:]]+\\'" natnump make-string 48 zlen] 3 (#$ . 2621)])
#@52 Parse a vector PARSED into a number it represents.
(defalias 'oon--parsed-number #[(parsed) "\306\234\307\234\310\234\311\234\312\f\"\313	\"\n\203, \nf\314U\203, [\202. .\207" [parsed base spos nbeg nend str 0 2 3 4 buffer-substring-no-properties string-to-number 45 abs] 3 (#$ . 3085)])
(defalias 'oon--original-number-for-display #[(parsed) "\306\234\307\234\310\234\311\n\"\312!\313!\203 \314\202  \315	\316U\203/ \fP\202; \317\320	\"\f\317\321\"R.\207" [parsed base nbeg nend str num 0 3 4 buffer-substring-no-properties oon--parsed-number natnump "" "-" 10 format "%d#" " (%s)" ssign] 6])
#@51 Replace a number specified by PARSED with NUMBER.
(defalias 'oon--replace-number #[(parsed number) "\306\234\307\234\310\234\311\234\312\234\313\f\"\314!\f\315!\203+ \316\202, \317\204= \317U\203= \320\321!\210\fb\210\f|\210\322\f	#c\210\205n \212b\210\323\324!\203b \325\307!\210\202i \317U\205m \326!).\207" [parsed base beg spos nbeg nend 0 1 2 3 4 buffer-substring-no-properties abs natnump 43 45 error "cannot replace with a negative number!" oon--format-number looking-at "[+-]" delete-char insert-char str number sign] 4 (#$ . 3723)])
#@160 Search the current line till EOL for a number.
If a pure number is found, move point to the end of the number
and return the value.  Raise an error otherwise.
(defalias 'find-number-at-point #[nil "\301 \206 \302\303!\211\304\234b\210\305!)\207" [parsed oon--parse-number-at-point error "No number found at point" 4 oon--parsed-number] 3 (#$ . 4306) nil])
(byte-code "\300\301\302\303\304\305\306\307&\210\310\311\312\313\314\315\316\317\306\301&	\207" [custom-declare-group operate-on-number nil "Operate on number at point." :prefix "apply-on-number-at-point-" :group editing custom-declare-variable operate-on-number-at-point-alist '((43 (1) +) (45 (1) -) (42 (2) *) (47 (2) /) (92 (2) % :read t) (94 (2) expt) (60 (1) ash :display "<<") (62 (1) (lambda (a b) (ash a (- b))) :display ">>") (98 nil math-format-binary) (111 nil (lambda (a) (format "%o" a))) (120 nil (lambda (a) (format "%x" a))) (88 nil (lambda (a) (format "%X" a))) (35 (10) (lambda (a b) (let ((calc-number-radix b)) (math-format-radix a))) :display "in base" :read t) (37 ("%s") (lambda (a b) (format b a)) :display "formatted with" :read t)) "A list of (KEY DEFARGS FUNC ...).\n\nKEY is used immediately following `apply-on-number-at-point' to\nselect an operation.\n\nDEFARGS is a list of default arguments, which length is taken as\nthe number of additional operands required for the operation.\nCurrently this length must be zero or one.\n\nFUNC is a function for the operation.\n\nAfter that comes an optional inline property list in which the\nfollowing keys are available:\n\n:display	Specifies the human readable representation for\n		the operation.\n\n:read		If this property is non-nil,\n		`apply-operation-to-number-at-point' always asks\n		user for an additional argument, using a value in\n		DEFARGS as default." :type (repeat (list (character :tag "Key") (repeat :tag "Default Arguments" (sexp :tag "Argument")) (function :tag "Function") (repeat :inline t :tag "Property List" (list :inline t (symbol :tag "Option") (sexp :tag "Value"))))) :set #[(sym val) "\302\303\304	\"\"\207" [sym val set-default mapcar #[(entry) "@A@\3058\306\233\n<\203% \307\nGY\203% \310\f\nE	\"\202& ,\207" [entry plist arg2 arg1 key 2 3 1 append] 5]] 5]] 10)
#@112 Apply FUNC on a number at point with ARGS.
For possible keys of PLIST, see `operate-on-number-at-point-alist'.
(defalias 'apply-to-number-at-point #[(func args &optional plist) "\305 \206 \306\307!\310!\311\n	#\312\f\"+\207" [parsed num func args result oon--parse-number-at-point error "No number found at point" oon--parsed-number apply oon--replace-number] 4 (#$ . 6553)])
#@420 Apply an operation specified by KEY on a number at point.

If called interactively, use the last key input as KEY.

If the operation requires an additional operand, it is taken from
one of the following sources in the order named:

1. Prefix argument if given

2. Value read from keyboard if READ-ARGS is non-nil or the :read
   property is non-nil

3. Default argument predefined in `operate-on-number-at-point-alist'
(defalias 'apply-operation-to-number-at-point #[(&optional key read-args) "\205 \306!\307 \206 \310\311!\312\f\"A\206 \310\313\"\314\n!@\211@A@AA\315\316\"\206@ \317!\204K \320\202\216 \247\203Z 	\203Z 	C\202\216 \204g \315\321\"\203\214 \322\323#\247\203 \324\"\202\207 \325\320\211$)C\202\216 \326#.\n\207" [current-prefix-arg arg parsed key operate-on-number-at-point-alist oargs prefix-numeric-value oon--parse-number-at-point error "No number found at point" assoc "Unknown operator: %c" oon--original-number-for-display plist-get :display string nil :read format "Insert %s %s " read-number read-string apply-to-number-at-point formatted defargs defarg func plist display read-args prompt args] 6 (#$ . 6943) (list (let ((keys (this-command-keys-vector))) (elt keys (1- (length keys)))) nil)])
#@210 Operate on number at point.

The kind of operation to perform is specified by the following
key typed.

An optional number ARG becomes a counter operand to the number at
point for the operation if applicable.
(defalias 'operate-on-number-at-point #[(&optional arg) "\303 \206 \304\305!\306!\307\310\311	\"\312\"\313\n\312\"+\207" [parsed formatted key oon--parse-number-at-point error "No number found at point" oon--original-number-for-display read-char format "Apply on %s:" t apply-operation-to-number-at-point] 4 (#$ . 8232) "*p"])
(provide 'operate-on-number)
