]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow Info-fontify-maximum-menu-size to specify unlimited
authorGlenn Morris <rgm@gnu.org>
Fri, 10 Oct 2014 03:24:41 +0000 (20:24 -0700)
committerGlenn Morris <rgm@gnu.org>
Fri, 10 Oct 2014 03:24:41 +0000 (20:24 -0700)
* lisp/info.el (Info-fontify-maximum-menu-size): Fix :type.
Allow t to mean no limit.
(Info-fontify-node): Handle Info-fontify-maximum-menu-size = t.

etc/NEWS
lisp/ChangeLog
lisp/info.el

index 67b0d681401a28ab70f63872e9336387b1520952..04de67e9365251d073df69e1ba7727568f7e81c6 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -171,6 +171,9 @@ The remainder were:
 
 ** New ERT function `ert-summarize-tests-batch-and-exit'.
 
+---
+** `Info-fontify-maximum-menu-size' can be t for no limit.
+
 ---
 ** ntlm.el has support for NTLM2.
 
index 33ddd79a52134a38b8b660f289fcb8beb33a854e..44aa27f7d8258b6c6a2d47fa956e323bff38b111 100644 (file)
@@ -1,6 +1,8 @@
 2014-10-10  Glenn Morris  <rgm@gnu.org>
 
        * info.el (Info-fontify-maximum-menu-size): Bump to 400k.  (Bug#16227)
+       Fix :type.  Allow t to mean no limit.
+       (Info-fontify-node): Handle Info-fontify-maximum-menu-size = t.
 
 2014-10-09  Glenn Morris  <rgm@gnu.org>
 
index 68679b1643e48b2f1dfaa938e84ac15bf9ec58f4..2a8ba9064b2295e742bfb16c90d72189e43005c7 100644 (file)
@@ -138,10 +138,14 @@ The Lisp code is executed when the node is selected.")
   :type 'boolean
   :group 'info)
 
+;; It's unfortunate that nil means no fontification, as opposed to no limit,
+;; since that differs from font-lock-maximum-size.
 (defcustom Info-fontify-maximum-menu-size 400000
   "Maximum size of menu to fontify if `font-lock-mode' is non-nil.
-Set to nil to disable node fontification."
-  :type 'integer
+Set to nil to disable node fontification; set to t for no limit."
+  :type '(choice (const :tag "No fontification" nil)
+                (const :tag "No size limit" t)
+                (integer :tag "Up to this many characters"))
   :version "25.1"                      ; 100k -> 400k
   :group 'info)
 
@@ -4606,7 +4610,9 @@ first line or header line, and for breadcrumb links.")
             (and Info-fontify-visited-nodes
                  ;; Don't take time to refontify visited nodes in huge nodes
                 Info-fontify-maximum-menu-size
-                 (< (- (point-max) (point-min)) Info-fontify-maximum-menu-size)))
+                 (or (eq Info-fontify-maximum-menu-size t)
+                    (< (- (point-max) (point-min))
+                       Info-fontify-maximum-menu-size))))
            rbeg rend)
 
       ;; Fontify header line
@@ -4863,7 +4869,9 @@ first line or header line, and for breadcrumb links.")
                  (search-forward "\n* Menu:" nil t)
                  ;; Don't take time to annotate huge menus
                 Info-fontify-maximum-menu-size
-                 (< (- (point-max) (point)) Info-fontify-maximum-menu-size))
+                (or (eq Info-fontify-maximum-menu-size t)
+                    (< (- (point-max) (point))
+                       Info-fontify-maximum-menu-size)))
         (let ((n 0)
               cont)
           (while (re-search-forward