:type 'boolean
:group 'info)
-(defcustom Info-fontify-maximum-menu-size 100000
+;; 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)
(defcustom Info-use-header-line t
In interactive use, a non-numeric prefix argument directs
this command to read a file name from the minibuffer.
-A numeric prefix argument N selects an Info buffer named
-\"*info*<%s>\".
+A numeric prefix argument of N selects an Info buffer named \"*info*<N>\".
The search path for Info files is in the variable `Info-directory-list'.
The top-level Info directory is made by combining all the files named `dir'
(equal (nth 1 Info-complete-cache) Info-current-node)
(equal (nth 2 Info-complete-cache) Info-complete-next-re)
(equal (nth 5 Info-complete-cache) Info-complete-nodes)
- (let ((prev (nth 3 Info-complete-cache)))
- (eq t (compare-strings string 0 (length prev)
- prev 0 nil t))))
+ (string-prefix-p (nth 3 Info-complete-cache) string) t)
;; We can reuse the previous list.
(setq completions (nth 4 Info-complete-cache))
;; The cache can't be used.
(define-key map "," 'Info-index-next)
(define-key map "\177" 'Info-scroll-down)
(define-key map [mouse-2] 'Info-mouse-follow-nearest-node)
+ (define-key map [down-mouse-2] 'ignore) ;Override potential global binding.
(define-key map [follow-link] 'mouse-face)
(define-key map [XF86Back] 'Info-history-back)
(define-key map [XF86Forward] 'Info-history-forward)
st)
"Syntax table used in `Info-mode'.")
+(defface Info-quoted
+ '((t :family "courier"))
+ "Face used for quoted elements.")
+
+(defvar Info-mode-font-lock-keywords
+ '(("‘\\([^’]*\\)’" (1 'Info-quoted))))
+
;; Autoload cookie needed by desktop.el
;;;###autoload
-(define-derived-mode Info-mode nil "Info"
+(define-derived-mode Info-mode nil "Info" ;FIXME: Derive from special-mode?
"Info mode provides commands for browsing through the Info documentation tree.
Documentation in Info is divided into \"nodes\", each of which discusses
one topic and contains references to other nodes which discuss related
(setq-local isearch-push-state-function #'Info-isearch-push-state)
(setq-local isearch-filter-predicate #'Info-isearch-filter)
(setq-local revert-buffer-function #'Info-revert-buffer-function)
+ (setq-local font-lock-defaults '(Info-mode-font-lock-keywords t t))
(Info-set-mode-line)
(setq-local bookmark-make-record-function #'Info-bookmark-make-record))
(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
(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