;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:20:57 2007 ;;; from file /home/cyd/emacs/lisp/longlines.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 "`longlines.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-group 'longlines nil "Automatic wrapping of long lines when loading files." :group 'fill) #@231 Non-nil means long lines are automatically wrapped after each command. Otherwise, you can perform filling using `fill-paragraph' or `auto-fill-mode'. In any case, the soft newlines will be removed when the file is saved to disk. (custom-declare-variable 'longlines-auto-wrap 't '(#$ . 672) :group 'longlines :type 'boolean) #@232 Non-nil means wrapping and filling happen at the edge of the window. Otherwise, `fill-column' is used, regardless of the window size. This does not work well when the buffer is displayed in multiple windows with differing widths. (custom-declare-variable 'longlines-wrap-follows-window-size 'nil '(#$ . 1004) :group 'longlines :type 'boolean) #@222 Non-nil means each hard newline is marked on the screen. (The variable `longlines-show-effect' controls what they look like.) You can also enable the display temporarily, using the command `longlines-show-hard-newlines'. (custom-declare-variable 'longlines-show-hard-newlines 'nil '(#$ . 1355) :group 'longlines :type 'boolean) #@105 A string to display when showing hard newlines. This is used when `longlines-show-hard-newlines' is on. (custom-declare-variable 'longlines-show-effect '(propertize "|\n" 'face 'escape-glyph) '(#$ . 1690) :group 'longlines :type 'string) (byte-code "\301B\302\301!\204\303\301\304\"\210\305B\302\305!\204\303\305\304\"\210\306B\302\306!\204-\303\306\304\"\210\307B\302\307!\204<\303\307\304\"\210\310\301!\210\310\305!\210\310\306!\210\310\307!\207" [current-load-list longlines-wrap-beg default-boundp set-default nil longlines-wrap-end longlines-wrap-point longlines-showing make-variable-buffer-local] 3) #@97 Non-nil if Longlines mode is enabled. Use the command `longlines-mode' to change this variable. (defvar longlines-mode nil (#$ . 2318)) (make-variable-buffer-local 'longlines-mode) #@493 Toggle Long Lines mode. In Long Lines mode, long lines are wrapped if they extend beyond `fill-column'. The soft newlines used for line wrapping will not show up when the text is yanked or saved to disk. If the variable `longlines-auto-wrap' is non-nil, lines are automatically wrapped whenever the buffer is changed. You can always call `fill-paragraph' to fill individual paragraphs. If the variable `longlines-show-hard-newlines' is non-nil, hard newlines are indicated with a symbol. (defalias 'longlines-mode #[(&optional arg) "\306=\203 ?\202%\203\307!\310V\202% \204\311\202%\312\313\301\"\210\314\211\203\371\315\316\317\"\210\320\302!\210\314\321\322\323\"\210\324\325\326\314\311$\210\324\327\330\314\311$\210\320\331!\210\320\303!\210\332\321\331\333\"\210\f\203l\320\334!\210\335 Z\324\336\337\314\311$\210\311\211\314\340 @.AB\214~\210\341 \210\342ed\"\210)\343@!\210,$\203\230C\204\230\344 \210D\345=\203\274\324\346\341\314\311$\210'\204\262\324\347\350\314\311$\210\324\347\351\314\311$\210\202\337D\352=\203\337\324\353\341\314\311$\210\320\354!\210,<\204\331,C,\321\354\351\311#\210E\203P\355\310!\210\324\356\357\314\311$\210\324\360\361\314\311$\210\202P\362\323\"C\203\363 \210\311\314\311A.B\214~\210\364ed\"\210,\365\325\326\311#\210\365\356\357\311#\210\365\360\361\311#\210\365\327\330\311#\210\365\336\337\311#\210\f\203@\366\334!\210\366\303!\210\366\302!\210\366\331!\210\366\315!\210\367\370 \203Z\371\202[\372\"\210\373 \203o\312\374 \203l\375\202m\376\"\210\377 \210 \207" [arg longlines-mode require-final-newline isearch-search-fun-function longlines-wrap-follows-window-size window-min-width toggle prefix-numeric-value 0 t message "Toggling %s off; better pass an explicit argument." nil use-hard-newlines 1 never make-local-variable add-to-list buffer-file-format longlines add-hook change-major-mode-hook longlines-mode-off before-revert-hook longlines-before-revert-hook buffer-substring-filters longlines-search-function longlines-encode-string fill-column window-width window-configuration-change-hook longlines-window-change-function buffer-modified-p longlines-decode-buffer longlines-wrap-region set-buffer-modified-p longlines-show-hard-newlines mail-mode mail-setup-hook mail-citation-hook mail-indent-citation longlines-decode-region message-mode message-setup-hook message-indent-citation-function auto-fill-mode after-change-functions longlines-after-change-function post-command-hook longlines-post-command-function delete longlines-unshow-hard-newlines longlines-encode-region remove-hook kill-local-variable run-hooks longlines-mode-hook longlines-mode-on-hook longlines-mode-off-hook called-interactively-p "Longlines mode %sabled" "en" "dis" force-mode-line-update mod inhibit-read-only buffer-undo-list longlines-showing major-mode longlines-auto-wrap] 6 (#$ . 2506) (list (or current-prefix-arg 'toggle))]) (byte-code "\300\301\302\303\304!\205 \304J#\207" [add-minor-mode longlines-mode " ll" boundp longlines-mode-map] 5) #@117 Turn off longlines mode. This function exists to be called by `change-major-mode-hook' when the major mode changes. (defalias 'longlines-mode-off #[nil "\300\301!\207" [longlines-mode 0] 2 (#$ . 5556)]) #@114 Make hard newlines visible by adding a face. With optional argument ARG, make the hard newlines invisible again. (defalias 'longlines-show-hard-newlines #[(&optional arg) "\304\305 \n\203\306 \210\202\304\307ed\"\210\310!*\207" [mod buffer-undo-list arg longlines-showing t buffer-modified-p longlines-unshow-hard-newlines longlines-show-region set-buffer-modified-p] 3 (#$ . 5766) "P"]) #@49 Make hard newlines between BEG and END visible. (defalias 'longlines-show-region #[(beg end) " ^ ]\306\n \307\310$\311\f\205-\312\f\211T\313\314 !$\210\306\fT \307\310$\211\204\310,\207" [beg end pmin pmax pos inhibit-read-only text-property-not-all hard nil t put-text-property display copy-sequence longlines-show-effect] 7 (#$ . 6168)]) #@37 Make hard newlines invisible again. (defalias 'longlines-unshow-hard-newlines #[nil "\302\303ed\304\302$\211\205!\305 \211T\306#\210\303 Td\304\302$\211\204 \302)\207" [longlines-showing pos nil text-property-not-all hard remove-text-properties (display)] 6 (#$ . 6525) nil]) #@150 Wrap each successive line, starting with the line before BEG. Stop when we reach lines after END that don't need wrapping, or the end of the buffer. (defalias 'longlines-wrap-region #[(beg end) "` b\210\303y\210\304 \203m\204`\nY\203\304 \203b\207" [longlines-wrap-point beg end -1 longlines-wrap-line] 2 (#$ . 6813)]) #@203 If the current line needs to be wrapped, wrap it and return nil. If wrapping is performed, point remains on the line. If the line does not need to be wrapped, move point to the next line and return t. (defalias 'longlines-wrap-line #[nil "\301 \203\302\303!\210\304u\210\305\304!\210\306u\210\307\207\310 \203H\307\210n\306u\210\204(l\2038\305\304!\210`V\203FS\202F\311\312!\210\304u\210\305\304!\210\306u\210\307\207\306y\210\313\207" [longlines-wrap-point longlines-set-breakpoint insert-before-markers 10 -1 delete-char 1 nil longlines-merge-lines-p insert-before-markers-and-inherit 32 t] 2 (#$ . 7149)]) #@140 Place point where we should break the current line, and return t. If the line should not be broken, return nil; point remains on the line. (defalias 'longlines-set-breakpoint #[nil "\301!\210\302\303\304 \305#\205iV\205\306 \206\301!\210\307 \207" [fill-column move-to-column re-search-forward "[^ ]" line-end-position 1 longlines-find-break-backward longlines-find-break-forward] 4 (#$ . 7777)]) #@108 Move point backward to the first available breakpoint and return t. If no breakpoint is found, return nil. (defalias 'longlines-find-break-backward #[nil "\301\302\303 \304#\205+\212\302\303 x\210n)?\205+\304u\210\203*\305\300!\203*\302\303 x\210\306 \207\307\207" [fill-nobreak-predicate search-backward " " line-beginning-position 1 run-hook-with-args-until-success longlines-find-break-backward t] 4 (#$ . 8190)]) #@108 Move point forward to the first available breakpoint and return t. If no break point is found, return nil. (defalias 'longlines-find-break-forward #[nil "\301\302\303 \304#\205!\302\303 w\210l?\205!\203 \305\300!\203 \306 \207\307\207" [fill-nobreak-predicate search-forward " " line-end-position 1 run-hook-with-args-until-success longlines-find-break-forward t] 4 (#$ . 8619)]) #@133 Return t if part of the next line can fit onto the current line. Otherwise, return nil. Text cannot be moved across hard newlines. (defalias 'longlines-merge-lines-p #[nil "\212\302\210m?\2055\303`\304\"?\2055iZ\305y\210\302f\306=\203#\307\2024\310\311\312 \305#\2030i\2022iT X))\207" [fill-column space nil get-text-property hard 1 32 t search-forward " " line-end-position] 4 (#$ . 9011)]) #@112 Turn all newlines between BEG and END into hard newlines. If BEG and END are nil, the point and mark are used. (defalias 'longlines-decode-region #[(&optional beg end) "\204` \204\303\304!\212 ] ^b\210\305\306\n\304#\205*\307\310\224\310\225\"\210\202*\207" [beg end reg-max mark t search-forward "\n" set-hard-newline-properties 0] 4 (#$ . 9420)]) #@53 Turn all newlines in the buffer into hard newlines. (defalias 'longlines-decode-buffer #[nil "\300ed\"\207" [longlines-decode-region] 3 (#$ . 9788)]) #@194 Replace each soft newline between BEG and END with exactly one space. Hard newlines are left intact. The optional argument BUFFER exists for compatibility with `format-alist', and is ignored. (defalias 'longlines-encode-region #[(beg end &optional buffer) "\212 ]\304  ^b\210\305\306 \307#\203$\310\311\224\312\"\204 \313\314!\210\202 \315\n!\210 +\207" [beg end mod reg-max buffer-modified-p search-forward "\n" t get-text-property 0 hard replace-match " " set-buffer-modified-p] 4 (#$ . 9945)]) #@100 Return a copy of STRING with each soft newline replaced by a space. Hard newlines are left intact. (defalias 'longlines-encode-string #[(string) "\303!\304\305 \"\211\203%\306\n\307 #\204 \n\310I\210\304\305 \nT#\211\204 *\207" [string str pos copy-sequence string-match "\n" get-text-property hard 32] 5 (#$ . 10457)]) #@114 Turn on automatic line wrapping, and wrap the entire buffer. With optional argument ARG, turn off line wrapping. (defalias 'longlines-auto-wrap #[(&optional arg) "\303\304\305\306#\210\303\307\310\306#\210\203\311\312\313!\207\306\314\304\305\311\306$\210\314\307\310\311\306$\210\315 \316ed\"\210\317\n!\210)\312\320!\207" [arg longlines-auto-wrap mod remove-hook after-change-functions longlines-after-change-function t post-command-hook longlines-post-command-function nil message "Auto wrap disabled." add-hook buffer-modified-p longlines-wrap-region set-buffer-modified-p "Auto wrap enabled."] 5 (#$ . 10793) "P"]) #@144 Update `longlines-wrap-beg' and `longlines-wrap-end'. This is called by `after-change-functions' to keep track of the region that has changed. (defalias 'longlines-after-change-function #[(beg end len) "?\205 \203 \n^\202\n \203 \f]\202\f\211\207" [undo-in-progress longlines-wrap-beg beg longlines-wrap-end end] 2 (#$ . 11426)]) #@127 Perform line wrapping on the parts of the buffer that have changed. This is called by `post-command-hook' after each command. (defalias 'longlines-post-command-function #[nil "\2056 \304=\204 \305=\203\306`\307\310!\"\210\n\203 \311 \"\210 \312=\2041 \313=\2041\314 \"\210\315\211\211\207" [longlines-wrap-beg this-command longlines-showing longlines-wrap-end yank yank-pop longlines-decode-region mark t longlines-show-region fill-paragraph fill-region longlines-wrap-region nil] 5 (#$ . 11776)]) #@107 Re-wrap the buffer if the window width has changed. This is called by `window-configuration-change-hook'. (defalias 'longlines-window-change-function #[nil "\303 ZU?\205\303 Z\304 \305ed\"\210\306\n!)\207" [fill-column window-min-width mod window-width buffer-modified-p longlines-wrap-region set-buffer-modified-p] 3 (#$ . 12294)]) (defalias 'longlines-search-function #[nil "\203\f \203\n\303\207\304\207\n\203 \203\305\207\306\207 \203\307\207\310\207" [isearch-word isearch-forward isearch-regexp word-search-forward word-search-backward re-search-forward re-search-backward longlines-search-forward longlines-search-backward] 1]) (defalias 'longlines-search-forward #[(string &optional bound noerror count) "\305\306\307 !\n \f$)\207" [search-spaces-regexp string bound noerror count "[ \n]+" re-search-forward regexp-quote] 5]) (defalias 'longlines-search-backward #[(string &optional bound noerror count) "\305\306\307 !\n \f$)\207" [search-spaces-regexp string bound noerror count "[ \n]+" re-search-backward regexp-quote] 5]) (defalias 'longlines-before-revert-hook #[nil "\300\301\302\303\304$\210\305\306!\207" [add-hook after-revert-hook longlines-after-revert-hook nil t longlines-mode 0] 5]) (defalias 'longlines-after-revert-hook #[nil "\300\301\302\303#\210\304\305!\207" [remove-hook after-revert-hook longlines-after-revert-hook t longlines-mode 1] 4]) (byte-code "\300\301\302\303\304\211\305\306\304\257\"\210\307\302!\207" [add-to-list format-alist longlines "Automatically wrap long lines." nil longlines-encode-region t provide] 9)