From: Magnus H. <leg...@us...> - 2007-05-07 01:40:37
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv27500 Modified Files: jabber.el NEWS Added Files: jabber-truncate.el Removed Files: jabber-clean.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-354 Creator: Magnus Henoch <ma...@fr...> Rename clean to truncate; add option for chat buffers --- jabber-clean.el DELETED --- Index: NEWS =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/NEWS,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- NEWS 6 May 2007 14:53:11 -0000 1.57 +++ NEWS 7 May 2007 01:40:29 -0000 1.58 @@ -10,7 +10,7 @@ (not documented yet) ** Clean history from chat buffers -See jabber-clean-top and new option for jabber-alert-muc-hooks. +See jabber-truncate-top and new option for jabber-alert-muc-hooks. (not documented yet) ** MUC bookmarks --- NEW FILE: jabber-truncate.el --- ;; jabber-clean.el - cleanup top lines in chatbuffers ;; Copyright (C) 2007 - Kirill A. Korinskiy - ca...@ca... ;; This file is a part of jabber.el. ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (require 'jabber-chat) (eval-when-compile (require 'cl)) (defvar jabber-log-lines-to-keep 1000 "Maximum number of lines in chat buffer") (defun jabber-truncate-top () "Clean old history from a chat buffer. `jabber-log-lines-to-keep' specifies the number of lines to keep." (interactive) (let ((inhibit-read-only t) (delete-before ;; go back one node, to make this function "idempotent" (ewoc-prev jabber-chat-ewoc (ewoc-locate jabber-chat-ewoc (save-excursion (goto-char (point-max)) (forward-line (- jabber-log-lines-to-keep)) (point)))))) (while delete-before (setq delete-before (prog1 (ewoc-prev jabber-chat-ewoc delete-before) (ewoc-delete jabber-chat-ewoc delete-before)))))) (defun jabber-truncate-muc (nick group buffer text proposed-alert) "Clean old history from MUC buffers. `jabber-log-lines-to-keep' specifies the number of lines to keep." (jabber-truncate-top)) (defun jabber-truncate-chat (from buffer text proposed-alert) "Clean old history from chat buffers. `jabber-log-lines-to-keep' specifies the number of lines to keep. Note that this might interfer with `jabber-chat-display-more-backlog': you ask for more history, you get it, and then it just gets deleted." (jabber-truncate-top)) (pushnew 'jabber-truncate-muc (get 'jabber-alert-muc-hooks 'custom-options)) (pushnew 'jabber-truncate-chat (get 'jabber-alert-message-hooks 'custom-options)) (provide 'jabber-truncate) ;; arch-tag: 3d1e3428-f598-11db-a314-000a95c2fcd0 Index: jabber.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber.el,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- jabber.el 28 Apr 2007 15:00:36 -0000 1.73 +++ jabber.el 7 May 2007 01:40:29 -0000 1.74 @@ -104,7 +104,7 @@ (require 'jabber-vcard-avatars) (require 'jabber-autoaway) (require 'jabber-time) -(require 'jabber-clean) +(require 'jabber-truncate) (require 'jabber-ft-client) (require 'jabber-ft-server) |