Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
marvel
GitHub Repository: marvel/qnf
Path: blob/master/elisp/boxquote.elc
987 views
;ELC
;;; Compiled by [email protected] on Sat Jun 12 01:31:27 2010
;;; from file /home/boggles/.elisp/boxquote.el
;;; in Emacs version 22.2.1
;;; 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 "`boxquote.el' was compiled for Emacs 19.29 or later"))

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


(byte-code "\300\301!\210\302\303!\204\303\304M\210\305\306M\210\302\307!\204\310\307\311\"\210\302\312!\204(\310\312\313\"\210\314\315\316\317\320\321\322\323&\207" [require rect fboundp defgroup (macro . #[(&rest rest) "\300\207" [nil] 1]) defcustom (macro . #[(symbol init docstring &rest rest) "\303	\nF\207" [symbol init docstring defvar] 4]) line-beginning-position defalias #[(&optional n) "\212\301!\210`)\207" [n beginning-of-line] 2 "Return the `point' of the beginning of the current line."] line-end-position #[(&optional n) "\212\210`)\207" [n] 1 "Return the `point' of the end of the current line."] custom-declare-group boxquote nil "Mark regions of text with a half-box." :group editing :prefix "boxquote-"] 8)
#@57 *Text that will be used at the top and tail of the box.
(custom-declare-variable 'boxquote-top-and-tail '"----" '(#$ . -1314) :type 'string :group 'boxquote)
#@43 *Text used for the top corner of the box.
(custom-declare-variable 'boxquote-top-corner '"," '(#$ . -1478) :type 'string :group 'boxquote)
#@46 *Text used for the bottom corner of the box.
(custom-declare-variable 'boxquote-bottom-corner '"`" '(#$ . -1623) :type 'string :group 'boxquote)
#@37 *Text used for the side of the box.
(custom-declare-variable 'boxquote-side '"| " '(#$ . -1774) :type 'string :group 'boxquote)
#@50 *Format string to use when creating a box title.
(custom-declare-variable 'boxquote-title-format '"[ %s ]" '(#$ . -1908) :type 'string :group 'boxquote)
#@68 *Should a `boxquote-insert-file' title the box with the file name?
(custom-declare-variable 'boxquote-title-files 't '(#$ . -2067) :type '(choice (const :tag "Title the box with the file name" t) (const :tag "Don't title the box with the file name" nil)) :group 'boxquote)
#@67 *Function to apply to a file's name when using it to title a box.
(custom-declare-variable 'boxquote-file-title-function '#'file-name-nondirectory '(#$ . -2346) :type 'function :group 'boxquote)
#@72 *Should a `boxquote-insert-buffer' title the box with the buffer name?
(custom-declare-variable 'boxquote-title-buffers 't '(#$ . -2547) :type '(choice (const :tag "Title the box with the buffer name" t) (const :tag "Don't title the box with the buffer name" nil)) :group 'boxquote)
#@69 *Function to apply to a buffer's name when using it to title a box.
(custom-declare-variable 'boxquote-buffer-title-function '#'identity '(#$ . -2836) :type 'function :group 'boxquote)
#@230 *Hooks to perform when on a region prior to boxquoting.

Note that all forms of boxquoting use `boxquote-region' to create the
boxquote. Because of this any hook you place here will be invoked by any of
the boxquoting functions.
(custom-declare-variable 'boxquote-region-hook 'nil '(#$ . -3028) :type 'hook :group 'boxquote)
#@59 *Hooks to perform on the yanked text prior to boxquoting.
(custom-declare-variable 'boxquote-yank-hook 'nil '(#$ . -3359) :type 'hook :group 'boxquote)
#@74 *Hooks to perform on the text from an inserted file prior to boxquoting.
(custom-declare-variable 'boxquote-insert-file-hook 'nil '(#$ . -3517) :type 'hook :group 'boxquote)
#@663 *Function for working out the title for a `boxquote-kill-ring-save'.

The string returned from this function will be used as the title for a
boxquote when the saved text is yanked into a buffer with \[boxquote-yank].

An example of a non-trivial value for this variable might be:

  (lambda ()
    (if (string= mode-name "Article")
        (aref gnus-current-headers 4)
      (buffer-name)))

In this case, if you are a `gnus' user, \[boxquote-kill-ring-save] could be
used to copy text from an article buffer and, when it is yanked into another
buffer using \[boxquote-yank], the title of the boxquote would be the ID of
the article you'd copied the text from.
(custom-declare-variable 'boxquote-kill-ring-save-title '#'buffer-name '(#$ . -3698) :type 'function :group 'boxquote)
#@72 *Format string to use when formatting a function description box title
(custom-declare-variable 'boxquote-describe-function-title-format '"C-h f %s RET" '(#$ . -4485) :type 'string :group 'boxquote)
#@72 *Format string to use when formatting a variable description box title
(custom-declare-variable 'boxquote-describe-variable-title-format '"C-h v %s RET" '(#$ . -4690) :type 'string :group 'boxquote)
#@67 *Format string to use when formatting a key description box title
(custom-declare-variable 'boxquote-describe-key-title-format '"C-h k %s" '(#$ . -4895) :type 'string :group 'boxquote)
#@74 *Format string to use when formatting a `where-is' description box title
(custom-declare-variable 'boxquote-where-is-title-format '"C-h w %s RET" '(#$ . -5086) :type 'string :group 'boxquote)
#@65 *Format string to use when formatting a `where-is' description.
(custom-declare-variable 'boxquote-where-is-body-format '"%s is on %s" '(#$ . -5284) :type 'string :group 'boxquote)
#@27 Are we running in XEmacs?
(defalias 'boxquote-xemacs-p #[nil "\300\301!\205\301J\207" [boundp running-xemacs] 2 (#$ . 5471)])
#@210 Find the start and end points of a boxquote.

If `point' is inside a boxquote then a cons is returned, the `car' is the
start `point' and the `cdr' is the end `point'. NIL is returned if no
boxquote is found.
(defalias 'boxquote-points #[nil "\212\306 \210\307\310!\310	!Q\307\310!P\307\310
!\310	!Q\311\312!\211\205(\312K\313\216\312\314M\210\315\n!\203?`\312!B\202_\315\f!\203Q\312\n\316\"\312!B\202_\315!\205_\312\n\316\"\317 B+\211@\205oA\205o-\207" [boxquote-top-corner boxquote-top-and-tail re-top boxquote-side re-left boxquote-bottom-corner beginning-of-line "^" regexp-quote fboundp find-box-end ((byte-code "\203\302	M\210\202\303\302!\210\302\207" [#1=#:--cl-letf-bound-- #2=#:--cl-letf-save-- find-box-end fmakunbound] 2)) #[(re &optional back) "\212\203
\302	\303\304#\202\305	\303\304#\205`)\207" [back re search-backward-regexp nil t search-forward-regexp] 4] looking-at t line-end-position re-bottom #1# #2# points] 5 (#$ . 5606)])
#@31 Is `point' inside a boxquote?
(defalias 'boxquote-quoted-p #[nil "\300 ??\207" [boxquote-points] 1 (#$ . 6601)])
#@66 Get the `boxquote-points' and flag an error of no box was found.
(defalias 'boxquote-points-with-check #[nil "\300 \206\301\302!\207" [boxquote-points error "I can't see a box here"] 2 (#$ . 6720)])
#@49 Return a regular expression to match the title.
(defalias 'boxquote-title-format-as-regexp #[nil "\302\303!\304\216rq\210\305	!c\210eb\210\306\307\310\311#\203 \312\313\310\311#\210\314 +\207" [#1=#:temp-buffer boxquote-title-format generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) regexp-quote search-forward "%s" nil t replace-match ".*" buffer-string] 4 (#$ . 6927)])
#@41 Get the title for the current boxquote.
(defalias 'boxquote-get-title #[nil "\306\307!\310\216rq\210\311\nc\210eb\210\312	!\210`	GZ\313Zd`Z,D\211@A@\212\214\314 \210ePG\\b\210\315\316 !\203K\317`\f\\\320 
Z\"\202L\321-\207" [#1=#:temp-buffer look-for boxquote-title-format #2=#:--cl-var-- prefix-len suffix-len generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) "%s" search-forward 1 boxquote-narrow-to-boxquote looking-at boxquote-title-format-as-regexp buffer-substring-no-properties line-end-position "" boxquote-top-corner boxquote-top-and-tail] 5 (#$ . 7368)])
#@169 Set the title of the current boxquote to TITLE.

If TITLE is an empty string the title is removed. Note that the title will
be formatted using `boxquote-title-format'.
(defalias 'boxquote-title #[(title) "\212\214\304 \210e	PG\\b\210l\204\305 \210\306\nG!?\205!\307\n\"c*\207" [boxquote-top-corner boxquote-top-and-tail title boxquote-title-format boxquote-narrow-to-boxquote kill-line zerop format] 3 (#$ . 8013) (list (read-from-minibuffer "Title: " (boxquote-get-title)))])
#@74 Draw a box around the left hand side of a region bounding START and END.
(defalias 'boxquote-region #[(start end) "\212\214\306\307!\211\205\f\307K\310\216\307\311M\210\306\312!\211\205\312K\313\216\312\314M\210\307\f!?\307
!?\f
}\210\315\316!\210eb\210\312\"\210\317 db\210\312\"\210\320db\210\321y\210\317 #.\207" [#1=#:--cl-letf-bound-- #2=#:--cl-letf-save-- #3=#:--cl-letf-bound-- #4=#:--cl-letf-save-- start end fboundp bol-at-p ((byte-code "\203\302	M\210\202\303\302!\210\302\207" [#1# #2# bol-at-p fmakunbound] 2)) #[(n) "b\210n\207" [n] 1] insert-corner ((byte-code "\203\302	M\210\202\303\302!\210\302\207" [#3# #4# insert-corner fmakunbound] 2)) #[(corner pre-break) "\203\303\202	\304	\n\303Rc\207" [pre-break corner boxquote-top-and-tail "\n" ""] 4] run-hooks boxquote-region-hook line-beginning-position string-rectangle -2 break-end break-start boxquote-top-corner start-point boxquote-bottom-corner boxquote-side] 5 (#$ . 8501) "r"])
#@44 Apply `boxquote-region' to a whole buffer.
(defalias 'boxquote-buffer #[nil "\300ed\"\207" [boxquote-region] 3 (#$ . 9498) nil])
#@210 Insert the contents of a file, boxed with `boxquote-region'.

If `boxquote-title-files' is non-nil the boxquote will be given a title that
is the result of applying `boxquote-file-title-function' to FILENAME.
(defalias 'boxquote-insert-file #[(filename) "\304\305!\306\216rq\210\307	\310\"\210\311\312!\210\313 \210\n\203 \314	!!\210\315 +c\207" [#1=#:temp-buffer filename boxquote-title-files boxquote-file-title-function generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents nil run-hooks boxquote-insert-file-hook boxquote-buffer boxquote-title buffer-string] 3 (#$ . 9634) "fInsert file: "])
#@214 Insert the contents of a buffer, boxes with `boxquote-region'.

If `boxquote-title-buffers' is non-nil the boxquote will be given a title that
is the result of applying `boxquote-buffer-title-function' to BUFFER.
(defalias 'boxquote-insert-buffer #[(buffer) "\303rq\210\304ed\")!\210	\205\305\n!!\207" [buffer boxquote-title-buffers boxquote-buffer-title-function boxquote-text buffer-substring-no-properties boxquote-title] 4 (#$ . 10318) "bInsert Buffer: "])
#@168 Like `kill-ring-save' but remembers a title if possible.

The title is acquired by calling `boxquote-kill-ring-save-title'. The title
will be used by `boxquote-yank'.
(defalias 'boxquote-kill-ring-save #[nil "\302\303!\210\304\305\306	 @E\"\240\207" [kill-ring-yank-pointer boxquote-kill-ring-save-title call-interactively kill-ring-save format "%S" boxquote-yank-marker] 6 (#$ . 10790) nil])
#@237 Do a `yank' and box it in with `boxquote-region'.

If the yanked entry was placed on the kill ring with
`boxquote-kill-ring-save' the resulting boxquote will be titled with
whatever `boxquote-kill-ring-save-title' returned at the time.
(defalias 'boxquote-yank #[nil "\212\303\304!\305\216rq\210\306 \210eb\210\307\310\311\217\211<\205-	@\312=\205-\313 \210\314	8c\210	A@)\315\316!\210\317 \210\n\203>\320\n!\210\321 ,c)\207" [#1=#:temp-buffer yanked title generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) yank nil (byte-code "\300p!\207" [read] 2) ((error)) boxquote-yank-marker erase-buffer 2 run-hooks boxquote-yank-hook boxquote-buffer boxquote-title buffer-string] 4 (#$ . 11192) nil])
#@44 Apply `boxquote-region' the current defun.
(defalias 'boxquote-defun #[nil "\300 \210\301\302 \303 \"\207" [mark-defun boxquote-region region-beginning region-end] 3 (#$ . 11957) nil])
#@51 Apply `boxquote-region' to the current paragraph.
(defalias 'boxquote-paragraph #[nil "\300 \210\301\302 \303 \"\207" [mark-paragraph boxquote-region region-beginning region-end] 3 (#$ . 12148) nil])
#@50 Apply `boxquote-region' to the current boxquote.
(defalias 'boxquote-boxquote #[nil "\301 \302@AT\")\207" [box boxquote-points-with-check boxquote-region] 3 (#$ . 12354) nil])
#@58 Return the name of the help buffer associated with ITEM.
(defalias 'boxquote-help-buffer-name #[(item) "\305 \2036\306J\307\310\307:\2033@\311\312\f\313Q	\"\203(	\307\211\202)\310\2033A\211\202,\207\314\207" [#1=#:--cl-var-- buffer #2=#:--cl-var-- #3=#:--cl-var-- item boxquote-xemacs-p help-buffer-list nil t string-match "^*Help:.*`" "'" "*Help*"] 5 (#$ . 12539)])
#@238 Perform a help command and boxquote the output.

HELP-CALL is a function that calls the help command.

TITLE-FORMAT is the `format' string to use to product the boxquote title.

ITEM is a function for retrieving the item to get help on.
(defalias 'boxquote-quote-help-buffer #[(help-call title-format item) "\300 \303\304\213!\210\305\306	\n \"!\210\205\307 )\207" [one-window-p title-format item boxquote-text ((byte-code " \210r\302	 !q\210\303ed\")\207" [help-call item boxquote-help-buffer-name buffer-substring-no-properties] 3)) boxquote-title format delete-other-windows] 4 (#$ . 12932)])
#@75 Call `describe-function' and boxquote the output into the current buffer.
(defalias 'boxquote-describe-function #[nil "\301\302\303#\207" [boxquote-describe-function-title-format boxquote-quote-help-buffer #[nil "\300\301!\207" [call-interactively describe-function] 2] #[nil "\301 \203\n\302J\202@\207" [minibuffer-history boxquote-xemacs-p function-history] 1]] 4 (#$ . 13539) nil])
#@75 Call `describe-variable' and boxquote the output into the current buffer.
(defalias 'boxquote-describe-variable #[nil "\301\302\303#\207" [boxquote-describe-variable-title-format boxquote-quote-help-buffer #[nil "\300\301!\207" [call-interactively describe-variable] 2] #[nil "\301 \203\n\302J\202@\207" [minibuffer-history boxquote-xemacs-p variable-history] 1]] 4 (#$ . 13935) nil])
#@233 Call `describe-key' and boxquote the output into the current buffer.

If the call to this command is prefixed with \[universal-argument] you will also be
prompted for a buffer. The key defintion used will be taken from that buffer.
(defalias 'boxquote-describe-key #[(key) "\203\f\305\306p\307#\202
pr	q\210\310\n!)\211\203 \250\203.\311\312r	q\210\313\n!)\"\2023\314\315\f\316#*\207" [current-prefix-arg from-buffer key binding boxquote-describe-key-title-format read-buffer "Buffer: " t key-binding message "%s is undefined" key-description boxquote-quote-help-buffer #[nil "rq\210\302	!)\207" [from-buffer key describe-key] 2] #[nil "rq\210\302	!)\207" [from-buffer key key-description] 2]] 5 (#$ . 14332) "kDescribe key: "])
#@60 Call `shell-command' with COMMAND and boxquote the output.
(defalias 'boxquote-shell-command #[(command) "\302\303\304!\305\216rq\210\306	\307\"\210\310 +!\210\311	!\207" [#1=#:temp-buffer command boxquote-text generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) shell-command t buffer-string boxquote-title] 4 (#$ . 15078) (list (read-from-minibuffer "Shell command: " nil nil nil 'shell-command-history))])
#@58 Call `where-is' with DEFINITION and boxquote the result.
(defalias 'boxquote-where-is #[(definition) "\304\305\306!\307\216rq\210\310	\311\"\210\312\n	\313 #+!\210\314\312	\"!\207" [#1=#:temp-buffer definition boxquote-where-is-body-format boxquote-where-is-title-format boxquote-text generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) where-is t format buffer-string boxquote-title] 5 (#$ . 15553) "CCommand: "])
#@25 Insert TEXT, boxquoted.
(defalias 'boxquote-text #[(text) "\212n\204\302c\210\303\304!\305\216rq\210	c\210\306 \210\307 +c)\207" [#1=#:temp-buffer text "\n" generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) boxquote-buffer buffer-string] 2 (#$ . 16035) "sText: "])
#@44 Narrow the buffer to the current boxquote.
(defalias 'boxquote-narrow-to-boxquote #[nil "\301 \211@A})\207" [box boxquote-points-with-check] 3 (#$ . 16370) nil])
#@59 Narrow the buffer to the content of the current boxquote.
(defalias 'boxquote-narrow-to-boxquote-content #[nil "\301 \212@b\210\302y\210`)\212Ab\210\303 )})\207" [box boxquote-points-with-check 1 line-beginning-position] 2 (#$ . 16540) nil])
#@37 Kill the boxquote and its contents.
(defalias 'boxquote-kill #[nil "\301 \302@AT\")\207" [box boxquote-points-with-check kill-region] 3 (#$ . 16791) nil])
#@47 Perform a `fill-paragraph' inside a boxquote.
(defalias 'boxquote-fill-paragraph #[(arg) "\303 \203\214\304 \210\305\n!*\207\305\n!\207" [boxquote-side fill-prefix arg boxquote-quoted-p boxquote-narrow-to-boxquote-content fill-paragraph] 2 (#$ . 16955) "P"])
#@46 Remove a box created with `boxquote-region'.
(defalias 'boxquote-unbox-region #[(start end) "\212\214	}\210eb\210\306\307\310\n!\310!Q!\203Q\311\310\n!\310\f!\312\260\307\310
!P`dW\203L\306!\203;\313\314!\210\306!\203F\315\316!\210\317y\210\202**\317\202T\320\321!*\207" [start end boxquote-top-corner boxquote-top-and-tail boxquote-bottom-corner boxquote-side looking-at "^" regexp-quote "^[" "]" kill-line t delete-char 2 nil error "I can't see a box here" lines ends] 5 (#$ . 17224) "r"])
#@44 Remove the boxquote that contains `point'.
(defalias 'boxquote-unbox #[nil "\301 \302@AT\")\207" [box boxquote-points-with-check boxquote-unbox-region] 3 (#$ . 17740) nil])
(provide 'boxquote)