]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow any symbolic value for `rcirc-fill-column'.
authorSam Steingold <sds@gnu.org>
Tue, 28 Oct 2014 21:55:28 +0000 (17:55 -0400)
committerSam Steingold <sds@gnu.org>
Tue, 28 Oct 2014 21:55:28 +0000 (17:55 -0400)
* lisp/net/rcirc.el (rcirc-fill-column): Allow any symbolic value for
the sake of `window-body-width' (in addition to `frame-width').

lisp/ChangeLog
lisp/net/rcirc.el

index e139b713d644d5c7095cd2e7e8dd4cb7be56803c..1c166b164ee4b7fc053ae1ba33cc73fbf9968e4f 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-28  Sam Steingold  <sds@gnu.org>
+
+       * 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  <esr@thyrsus.com>
 
        * version.el: Fix some fallback values to conform to the actual
index f36487971c4a8419870241c76a367a2a3e199f04..44434b789c9ae8ec25d6a78c706b3a6f8a83cfd8 100644 (file)
@@ -145,10 +145,12 @@ for connections using SSL/TLS."
 
 (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 @@ If ARG is given, opens the URL in a new browser window."
     (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))))