emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r118225: Allow any symbolic value for `rcirc-fill-co


From: Sam Steingold
Subject: [Emacs-diffs] trunk r118225: Allow any symbolic value for `rcirc-fill-column'.
Date: Tue, 28 Oct 2014 21:55:31 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118225
revision-id: address@hidden
parent: address@hidden
committer: Sam Steingold <address@hidden>
branch nick: trunk
timestamp: Tue 2014-10-28 17:55:28 -0400
message:
  Allow any symbolic value for `rcirc-fill-column'.
  
  * lisp/net/rcirc.el (rcirc-fill-column): Allow any symbolic value for
  the sake of `window-body-width' (in addition to `frame-width').
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/rcirc.el              rcirc.el-20091113204419-o5vbwnq5f7feedwu-4032
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-10-26 17:57:10 +0000
+++ b/lisp/ChangeLog    2014-10-28 21:55:28 +0000
@@ -1,3 +1,8 @@
+2014-10-28  Sam Steingold  <address@hidden>
+
+       * net/rcirc.el (rcirc-fill-column): Allow any symbolic value for
+       the sake of `window-body-width' (in addition to `frame-width').
+
 2014-10-26  Eric S. Raymond  <address@hidden>
 
        * version.el: Fix some fallback values to conform to the actual

=== modified file 'lisp/net/rcirc.el'
--- a/lisp/net/rcirc.el 2014-09-29 18:14:08 +0000
+++ b/lisp/net/rcirc.el 2014-10-28 21:55:28 +0000
@@ -145,10 +145,12 @@
 
 (defcustom rcirc-fill-column nil
   "Column beyond which automatic line-wrapping should happen.
-If nil, use value of `fill-column'.  If 'frame-width, use the
-maximum frame width."
-  :type '(choice (const :tag "Value of `fill-column'")
-                (const :tag "Full frame width" frame-width)
+If nil, use value of `fill-column'.
+If a symbol (e.g., `frame-width' or `window-body-width'), call it
+to compute the number of columns."
+  :version "25.1"
+  :type '(choice (const :tag "Value of `fill-column'" nil)
+                (symbol :tag "Function returning the number of columns")
                 (integer :tag "Number of columns"))
   :group 'rcirc)
 
@@ -2533,11 +2535,10 @@
     (let ((fill-prefix
           (or rcirc-fill-prefix
               (make-string (- (point) (line-beginning-position)) ?\s)))
-         (fill-column (- (cond ((eq rcirc-fill-column 'frame-width)
-                                (1- (frame-width)))
-                               (rcirc-fill-column
-                                rcirc-fill-column)
-                               (t fill-column))
+         (fill-column (- (cond ((null rcirc-fill-column) fill-column)
+                                ((symbolp rcirc-fill-column)
+                                 (1- (funcall rcirc-fill-column)))
+                               (t rcirc-fill-column))
                          ;; make sure ... doesn't cause line wrapping
                          3)))
       (fill-region (point) (point-max) nil t))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]