changeset 68498:528aecb860cf

Revision: emacs@sv.gnu.org/emacs--devo--0--patch-30 Creator: Michael Olson <mwolson@gnu.org> Merge from erc--main--0 2006-01-30 Michael Olson <mwolson@gnu.org> * erc-stamp.el (erc-timestamp-right-align-by-pixel): New option that determines whether to use pixel values to align right timestamps. The default is not to do so, since it only works with Emacs22 on X, and even then some people have trouble. (erc-insert-aligned): Use `erc-timestamp-right-align-by-pixel'.
author Miles Bader <miles@gnu.org>
date Tue, 31 Jan 2006 00:24:36 +0000
parents a224550f3e25
children 04ad8d666956
files lisp/erc/ChangeLog lisp/erc/erc-stamp.el
diffstat 2 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/erc/ChangeLog	Mon Jan 30 23:40:49 2006 +0000
+++ b/lisp/erc/ChangeLog	Tue Jan 31 00:24:36 2006 +0000
@@ -1,3 +1,11 @@
+2006-01-30  Michael Olson  <mwolson@gnu.org>
+
+	* erc-stamp.el (erc-timestamp-right-align-by-pixel): New option
+	that determines whether to use pixel values to align right
+	timestamps.  The default is not to do so, since it only works with
+	Emacs22 on X, and even then some people have trouble.
+	(erc-insert-aligned): Use `erc-timestamp-right-align-by-pixel'.
+
 2006-01-29  Michael Olson  <mwolson@gnu.org>
 
 	* ChangeLog, ChangeLog.2005, ChangeLog.2004, ChangeLog.2003,
--- a/lisp/erc/erc-stamp.el	Mon Jan 30 23:40:49 2006 +0000
+++ b/lisp/erc/erc-stamp.el	Tue Jan 31 00:24:36 2006 +0000
@@ -180,6 +180,14 @@
 	  (integer :tag "Column number")
 	  (const :tag "Unspecified" nil)))
 
+(defcustom erc-timestamp-right-align-by-pixel nil
+  "*If non-nil, insert the right timestamp based on a pixel value.
+This is needed when variable-width text precedes a timestamp.
+Unfortunately, it only works in Emacs 22 and when using the X
+Window System."
+  :group 'erc-stamp
+  :type 'boolean)
+
 (defun erc-insert-timestamp-left (string)
   "Insert timestamps at the beginning of the line."
   (goto-char (point-min))
@@ -195,11 +203,9 @@
   "Insert STRING based on a fraction of the width of the buffer.
 Fraction is roughly (/ POS (window-width)).
 
-If the current version of Emacs doesn't support this, use
+If `erc-timestamp-right-align-by-pixel' is nil, use
 \(- POS FALLBACK) to determine how many spaces to insert."
-  (if (or (featurep 'xemacs)
-	  (< emacs-major-version 22)
-	  (not (eq window-system 'x)))
+  (if (not erc-timestamp-right-align-by-pixel)
       (insert (make-string (- pos fallback) ? ) string)
     (insert " ")
     (let ((offset (floor (* (/ (1- pos) (window-width) 1.0)