diff options
| author | Eli Zaretskii | 2019-12-05 17:43:06 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-12-05 17:43:06 +0200 |
| commit | 21790e547374ac7f8355440303fa79d74d8484df (patch) | |
| tree | acb14e7112f837492fcb2a15a209322b60297386 | |
| parent | 85f8aa1089e6fdbdf27b6f2c775e377faa79b19b (diff) | |
| download | emacs-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/NEWS | 18 | ||||
| -rw-r--r-- | lisp/jit-lock.el | 24 |
2 files changed, 23 insertions, 19 deletions
| @@ -632,13 +632,6 @@ If the region is active, the command joins all the lines in the | |||
| 632 | region. When there's no active region, the command works on the | 632 | region. When there's no active region, the command works on the |
| 633 | current and the previous or the next line, as before. | 633 | current and the previous or the next line, as before. |
| 634 | 634 | ||
| 635 | --- | ||
| 636 | ** New customizable variable 'jit-lock-antiblink-grace'. | ||
| 637 | When typing strings, this helps avoid "blinking", an oscillation | ||
| 638 | between string and non-string fontification. The variable holds a | ||
| 639 | number of seconds (default is 2) before a potentially unwanted | ||
| 640 | fontification 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 | |||
| 654 | re-fontifies the buffer. | 647 | re-fontifies the buffer. |
| 655 | 648 | ||
| 656 | --- | 649 | --- |
| 650 | ** Font Lock is smarter about fontifying unterminated strings and comments. | ||
| 651 | When you type a quote that starts a string, or a comment delimiter | ||
| 652 | that starts a comment, font-lock will not immediately refontify the | ||
| 653 | following characters in font-lock-string-face or | ||
| 654 | font-lock-comment-face. Instead, it will delay the fontification | ||
| 655 | beyond the current line to give you a chance to close the string or | ||
| 656 | comment. This is controlled by the new customizable variable | ||
| 657 | 'jit-lock-antiblink-grace', which specifies the delay in seconds. The | ||
| 658 | default 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 |
| 658 | the extracted file if the new user option 'tar-copy-preserve-time' is | 662 | the extracted file if the new user option 'tar-copy-preserve-time' is |
| 659 | non-nil. | 663 | non-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. |
| 128 | If nil, no grace period is given. Otherwise, a newly created | 128 | If nil, no grace period is given; unterminated strings and comments |
| 129 | unterminated string is fontified only to the end of the current | 129 | are refontified immediately. If a number, a newly created |
| 130 | line, after which the system waits this many seconds of idle time | 130 | unterminated string or comment is fontified only to the end of the |
| 131 | before deciding the string is multi-line and fontifying the | 131 | current line, after which fontification waits that many seconds of idle |
| 132 | remaining lines. When typing strings, this helps avoid | 132 | time before refontifying the remaining lines. When typing strings |
| 133 | \"blinking\", an unwanted oscillation between string and | 133 | and comments, the delay helps avoid unpleasant \"blinking\", between |
| 134 | non-string fontification." | 134 | string/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))) |