aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-12-05 17:43:06 +0200
committerEli Zaretskii2019-12-05 17:43:06 +0200
commit21790e547374ac7f8355440303fa79d74d8484df (patch)
treeacb14e7112f837492fcb2a15a209322b60297386
parent85f8aa1089e6fdbdf27b6f2c775e377faa79b19b (diff)
downloademacs-21790e547374ac7f8355440303fa79d74d8484df.tar.gz
emacs-21790e547374ac7f8355440303fa79d74d8484df.zip
Minor copyedits of 'jit-lock-antiblink-grace's docs
* lisp/jit-lock.el (jit-lock-antiblink-grace): * etc/NEWS (value): Reword the NEWS entry and the doc string.
-rw-r--r--etc/NEWS18
-rw-r--r--lisp/jit-lock.el24
2 files changed, 23 insertions, 19 deletions
diff --git a/etc/NEWS b/etc/NEWS
index d4f31aeb85d..28bcb720cde 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -632,13 +632,6 @@ If the region is active, the command joins all the lines in the
632region. When there's no active region, the command works on the 632region. When there's no active region, the command works on the
633current and the previous or the next line, as before. 633current and the previous or the next line, as before.
634 634
635---
636** New customizable variable 'jit-lock-antiblink-grace'.
637When typing strings, this helps avoid "blinking", an oscillation
638between string and non-string fontification. The variable holds a
639number of seconds (default is 2) before a potentially unwanted
640fontification starts. Set to nil to get back the old behavior.
641
642 635
643* Changes in Specialized Modes and Packages in Emacs 27.1 636* Changes in Specialized Modes and Packages in Emacs 27.1
644 637
@@ -654,6 +647,17 @@ font locking for a mode. It recomputes the font locking data and then
654re-fontifies the buffer. 647re-fontifies the buffer.
655 648
656--- 649---
650** Font Lock is smarter about fontifying unterminated strings and comments.
651When you type a quote that starts a string, or a comment delimiter
652that starts a comment, font-lock will not immediately refontify the
653following characters in font-lock-string-face or
654font-lock-comment-face. Instead, it will delay the fontification
655beyond the current line to give you a chance to close the string or
656comment. This is controlled by the new customizable variable
657'jit-lock-antiblink-grace', which specifies the delay in seconds. The
658default is 2 seconds; set to nil to get back the old behavior.
659
660---
657** The 'C' command in 'tar-mode' will now preserve the timestamp of 661** The 'C' command in 'tar-mode' will now preserve the timestamp of
658the extracted file if the new user option 'tar-copy-preserve-time' is 662the extracted file if the new user option 'tar-copy-preserve-time' is
659non-nil. 663non-nil.
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index a17224e4bd0..0586eb7bf08 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -124,14 +124,14 @@ The value of this variable is used when JIT Lock mode is turned on."
124 :group 'jit-lock) 124 :group 'jit-lock)
125 125
126(defcustom jit-lock-antiblink-grace 2 126(defcustom jit-lock-antiblink-grace 2
127 "Grace period after which to refontify due to unterminated strings. 127 "Delay after which to refontify unterminated strings and comments.
128If nil, no grace period is given. Otherwise, a newly created 128If nil, no grace period is given; unterminated strings and comments
129unterminated string is fontified only to the end of the current 129are refontified immediately. If a number, a newly created
130line, after which the system waits this many seconds of idle time 130unterminated string or comment is fontified only to the end of the
131before deciding the string is multi-line and fontifying the 131current line, after which fontification waits that many seconds of idle
132remaining lines. When typing strings, this helps avoid 132time before refontifying the remaining lines. When typing strings
133\"blinking\", an unwanted oscillation between string and 133and comments, the delay helps avoid unpleasant \"blinking\", between
134non-string fontification." 134string/comment and non-string/non-comment fontification."
135 :type '(choice (const :tag "never" nil) 135 :type '(choice (const :tag "never" nil)
136 (number :tag "seconds")) 136 (number :tag "seconds"))
137 :group 'jit-lock 137 :group 'jit-lock
@@ -725,19 +725,19 @@ will take place when text is fontified stealthily."
725 (cancel-timer jit-lock--antiblink-grace-timer) 725 (cancel-timer jit-lock--antiblink-grace-timer)
726 (setq jit-lock--antiblink-grace-timer nil))) 726 (setq jit-lock--antiblink-grace-timer nil)))
727 (same-line 727 (same-line
728 ;; In same line, but no state change, leave everything as it was 728 ;; In same line, but no state change, leave everything as it was.
729 ) 729 )
730 (t 730 (t
731 ;; Left the line somehow or customized feature away, etc 731 ;; Left the line somehow or customized feature away, etc.;
732 ;; kill timer if running, resume normal operation. 732 ;; kill timer if running, resume normal operation.
733 (when jit-lock--antiblink-grace-timer 733 (when jit-lock--antiblink-grace-timer
734 ;; Do refontify immediately, adding a small delay. This 734 ;; Do refontify immediately, adding a small delay. This
735 ;; makes sense because it remark somehow that we are 735 ;; makes sense because it signals somehow that we are
736 ;; leaving the unstable state. 736 ;; leaving the unstable state.
737 (jit-lock-context-fontify) 737 (jit-lock-context-fontify)
738 (cancel-timer jit-lock--antiblink-grace-timer) 738 (cancel-timer jit-lock--antiblink-grace-timer)
739 (setq jit-lock--antiblink-grace-timer nil)))) 739 (setq jit-lock--antiblink-grace-timer nil))))
740 ;; Update variables (and release the marker) 740 ;; Update variables (and release the marker).
741 (set-marker jit-lock--antiblink-line-beginning-position nil) 741 (set-marker jit-lock--antiblink-line-beginning-position nil)
742 (setq jit-lock--antiblink-line-beginning-position new-l-b-p 742 (setq jit-lock--antiblink-line-beginning-position new-l-b-p
743 jit-lock--antiblink-string-or-comment new-s-o-c))) 743 jit-lock--antiblink-string-or-comment new-s-o-c)))