]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/num3-mode/num3-mode.el
Merge commit 'e93367512080e540dc5dd126dfcb38b4a5e9415b' from diff-hl
[gnu-emacs-elpa] / packages / num3-mode / num3-mode.el
index 4e4f625e495c0c9a1206369056e84f6e9b5fbb93..d4f12e0f0387406115e0ec17235bf6c4195f222e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; num3-mode.el --- highlight groups of digits in long numbers  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2014 Free Software Foundation, Inc.
 
 ;; Author: Felix Lee <felix8a@gmail.com>, Michal Nazarewicz <mina86@mina86.com>
 ;; Maintainer: Michal Nazarewicz <mina86@mina86.com>
@@ -45,10 +45,12 @@ font-lock is on."
   :group 'text)
 
 (defcustom num3-group-size 3
-  "Number of digits to group in decimal numbers.")
+  "Number of digits to group in decimal numbers."
+  :type 'integer)
 
 (defcustom num3-threshold 5
-  "Number must be at least that long to start highlighting.")
+  "Number must be at least that long to start highlighting."
+  :type 'integer)
 
 (defface num3-face-odd
   '((t))
@@ -91,8 +93,8 @@ where) decimal point (would be) is."
       (unless (assoc 'num3--matcher font-lock-keywords)
         (font-lock-add-keywords nil '(num3--matcher) 'append))
     (font-lock-remove-keywords nil '(num3--matcher)))
-  (when font-lock-mode
-    (font-lock-fontify-buffer)))
+  (if (fboundp 'font-lock-flush) (font-lock-flush)
+    (when font-lock-mode (with-no-warnings (font-lock-fontify-buffer)))))
 
 ;;;###autoload
 (define-globalized-minor-mode global-num3-mode num3-mode num3-mode)