1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

Allow Info-fontify-maximum-menu-size to specify unlimited

* 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.
This commit is contained in:
Glenn Morris 2014-10-09 20:24:41 -07:00
parent dcc327d43b
commit cd0351b202
3 changed files with 17 additions and 4 deletions

View File

@ -171,6 +171,9 @@ The remainder were:
** New ERT function `ert-summarize-tests-batch-and-exit'. ** 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. ** ntlm.el has support for NTLM2.

View File

@ -1,6 +1,8 @@
2014-10-10 Glenn Morris <rgm@gnu.org> 2014-10-10 Glenn Morris <rgm@gnu.org>
* info.el (Info-fontify-maximum-menu-size): Bump to 400k. (Bug#16227) * 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> 2014-10-09 Glenn Morris <rgm@gnu.org>

View File

@ -138,10 +138,14 @@ The Lisp code is executed when the node is selected.")
:type 'boolean :type 'boolean
:group 'info) :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 (defcustom Info-fontify-maximum-menu-size 400000
"Maximum size of menu to fontify if `font-lock-mode' is non-nil. "Maximum size of menu to fontify if `font-lock-mode' is non-nil.
Set to nil to disable node fontification." Set to nil to disable node fontification; set to t for no limit."
:type 'integer :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 :version "25.1" ; 100k -> 400k
:group 'info) :group 'info)
@ -4606,7 +4610,9 @@ first line or header line, and for breadcrumb links.")
(and Info-fontify-visited-nodes (and Info-fontify-visited-nodes
;; Don't take time to refontify visited nodes in huge nodes ;; Don't take time to refontify visited nodes in huge nodes
Info-fontify-maximum-menu-size 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) rbeg rend)
;; Fontify header line ;; Fontify header line
@ -4863,7 +4869,9 @@ first line or header line, and for breadcrumb links.")
(search-forward "\n* Menu:" nil t) (search-forward "\n* Menu:" nil t)
;; Don't take time to annotate huge menus ;; Don't take time to annotate huge menus
Info-fontify-maximum-menu-size 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) (let ((n 0)
cont) cont)
(while (re-search-forward (while (re-search-forward