summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-fill.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2006-11-20 06:50:29 +0000
committerMiles Bader <miles@gnu.org>2006-11-20 06:50:29 +0000
commit83dc6995148085966eddca749228a6338b7e6b0e (patch)
tree0fbf7066385873a51749737e5ac0d9c57b8a3d28 /lisp/erc/erc-fill.el
parente15a04955b0c59069aa870d7d5040bc2e795b2eb (diff)
downloademacs-83dc6995148085966eddca749228a6338b7e6b0e.tar.gz
Merge from erc--emacs--22
Merge from my ERC Emacs 22 integration branch. The version is now "5.2 stable pre-release". This will probably be the last change to the version of ERC in Emacs 22 before the release, pending any bugfixes. For details on the changes, see the lisp/erc/ChangeLog file. Note that ERC is now invoked with M-x erc, not M-x erc-select. If you were using the old `erc' function programmatically, use `erc-open' instead. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-520 Creator: Michael Olson <mwolson@gnu.org>
Diffstat (limited to 'lisp/erc/erc-fill.el')
-rw-r--r--lisp/erc/erc-fill.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index 6a5f80f7fd8..9552ce8543d 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -122,7 +122,15 @@ characters. Set to nil to disable."
You can put this on `erc-insert-modify-hook' and/or `erc-send-modify-hook'."
(unless (erc-string-invisible-p (buffer-substring (point-min) (point-max)))
(when erc-fill-function
- (funcall erc-fill-function))))
+ ;; skip initial empty lines
+ (goto-char (point-min))
+ (save-match-data
+ (while (and (looking-at "[ \t\n]*$")
+ (= (forward-line 1) 0))))
+ (unless (eobp)
+ (save-restriction
+ (narrow-to-region (point) (point-max))
+ (funcall erc-fill-function))))))
(defun erc-fill-static ()
"Fills a text such that messages start at column `erc-fill-static-center'."