[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/adoc-mode 109bdc5d13 180/199: Fix a typo and some whitespa
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/adoc-mode 109bdc5d13 180/199: Fix a typo and some whitespace issues |
Date: |
Sun, 3 Sep 2023 06:59:44 -0400 (EDT) |
branch: elpa/adoc-mode
commit 109bdc5d132b8c6cc7a1e5054e95775932cc267f
Author: Bozhidar Batsov <bozhidar@batsov.dev>
Commit: Bozhidar Batsov <bozhidar@batsov.dev>
Fix a typo and some whitespace issues
---
adoc-mode.el | 75 ++++++++++++++++++++++++++++++------------------------------
1 file changed, 38 insertions(+), 37 deletions(-)
diff --git a/adoc-mode.el b/adoc-mode.el
index 90badd145e..dfcbb97312 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -251,8 +251,8 @@ If the value is another non-nil value then code blocks
are fontified natively regardless of their size."
:group 'adoc
:type '(choice :tag "Fontify code blocks " :format "\n%{%t%}: %[Size%] %v"
- (integer :tag "limited to")
- (boolean :tag "unlimited"))
+ (integer :tag "limited to")
+ (boolean :tag "unlimited"))
:safe '(lambda (x) (or (booleanp x) (numberp x)))
:package-version '(adoc-mode . "0.8.0"))
@@ -1971,7 +1971,8 @@ meta characters."
nil)
-;;; Natively highlite source code blocks.
+;;; Natively highlight source code blocks.
+;;
;; The code is an adaption of the code in markdown-mode.el.
(defun adoc-get-lang-mode (lang)
@@ -2019,22 +2020,22 @@ START-SRC and END-SRC delimit the actual source code."
(put-text-property
(+ start-src (1- pos)) (1- (+ start-src next)) 'face
val adoc-buffer)))
- (add-text-properties start-block start-src '(face adoc-meta-face))
- (add-text-properties end-src end-block '(face adoc-meta-face))
+ (add-text-properties start-block start-src '(face adoc-meta-face))
+ (add-text-properties end-src end-block '(face adoc-meta-face))
(add-text-properties
start-block end-block
'(font-lock-fontified t fontified t font-lock-multiline t
- adoc-code-block t adoc-reserved t))
+ adoc-code-block t adoc-reserved t))
(set-buffer-modified-p modified)))))
(defconst adoc-code-block-begin-regexp
(cl-flet ((rx-or (first second) (format "\\(?:%s\\|%s\\)" first second))
- (rx-optional (stuff) (format "\\(?:%s\\)?" stuff))
- (outer-brackets-and-delimiter (&rest stuff)
- (format "^\\[%s\\]\n\\(?2:----+\\)\n"
- (apply #'concat stuff)))
- (lang () ",\\(?1:[^],]+\\)")
- (optional-other-args () "\\(?:,[^]]+\\)?"))
+ (rx-optional (stuff) (format "\\(?:%s\\)?" stuff))
+ (outer-brackets-and-delimiter (&rest stuff)
+ (format "^\\[%s\\]\n\\(?2:----+\\)\n"
+ (apply #'concat stuff)))
+ (lang () ",\\(?1:[^],]+\\)")
+ (optional-other-args () "\\(?:,[^]]+\\)?"))
(outer-brackets-and-delimiter
(rx-or
(concat
@@ -2065,10 +2066,10 @@ actual source code."
(let (start-header start-src end-src end-block lang)
(save-match-data
(and (setq start-src (re-search-forward adoc-code-block-begin-regexp
last noerror))
- (setq lang (or (match-string 1) t)
- start-header (match-beginning 0))
- (setq end-block (re-search-forward (format "\n%s$" (match-string
2))))
- (setq end-src (match-beginning 0)))
+ (setq lang (or (match-string 1) t)
+ start-header (match-beginning 0))
+ (setq end-block (re-search-forward (format "\n%s$" (match-string
2))))
+ (setq end-src (match-beginning 0)))
)
(when end-block
(set-match-data (list start-header end-block start-src end-src
(current-buffer)))
@@ -2084,16 +2085,16 @@ Returns a cons (BEG . END) with the updated limits of
the region."
(goto-char beg)
;; Maybe edits in header line: Skip to body
(cl-case (char-after (line-beginning-position))
- (?\[ (forward-line 2))
- (?- (forward-line 1)))
+ (?\[ (forward-line 2))
+ (?- (forward-line 1)))
;; Search backward for header:
(let ((beg-block (re-search-backward adoc-code-block-begin-regexp (max 0
(- (point) adoc-font-lock-extend-after-change-max)) t))
- end-block)
- (when beg-block
- (goto-char (match-end 0))
- (setq end-block (or (re-search-forward (format "\n%s$" (match-string
2)) (+ (point) adoc-font-lock-extend-after-change-max) t) end))
- (when (and end-block (> end-block beg)) ;; block reaches really into
edited area
- (cons (min beg beg-block) (max end end-block))))))))
+ end-block)
+ (when beg-block
+ (goto-char (match-end 0))
+ (setq end-block (or (re-search-forward (format "\n%s$" (match-string
2)) (+ (point) adoc-font-lock-extend-after-change-max) t) end))
+ (when (and end-block (> end-block beg)) ;; block reaches really into
edited area
+ (cons (min beg beg-block) (max end end-block))))))))
(defun adoc-fontify-code-blocks (last)
"Add text properties to next code block from point to LAST.
@@ -2101,17 +2102,17 @@ Use this function as matching function MATCHER in
`font-lock-keywords'."
(let ((lang (adoc-search-forward-code-block last 'noError)))
(when lang
(save-excursion
- (save-match-data
+ (save-match-data
(let* ((start-block (match-beginning 0))
- (end-block (match-end 0))
- (start-src (match-beginning 1))
- (end-src (match-end 1))
+ (end-block (match-end 0))
+ (start-src (match-beginning 1))
+ (end-src (match-end 1))
(end-src+nl (if (eq (char-after end-src) ?\n) (1+ end-src)
end-src))
- (size (1+ (- end-src start-src))))
+ (size (1+ (- end-src start-src))))
(if (if (numberp adoc-fontify-code-blocks-natively)
- (<= size adoc-fontify-code-blocks-natively)
- adoc-fontify-code-blocks-natively)
- (adoc-fontify-code-block-natively lang start-block end-block
start-src end-src)
+ (<= size adoc-fontify-code-blocks-natively)
+ adoc-fontify-code-blocks-natively)
+ (adoc-fontify-code-block-natively lang start-block end-block
start-src end-src)
(add-text-properties
start-src
end-src
@@ -2119,7 +2120,7 @@ Use this function as matching function MATCHER in
`font-lock-keywords'."
;; Set background for block as well as opening and closing lines.
(font-lock-append-text-property
start-src end-src+nl 'face 'adoc-native-code-face)
- )))
+ )))
t)))
@@ -3433,10 +3434,10 @@ Turning on Adoc mode runs the normal hook
`adoc-mode-hook'."
;; font lock
(setq-local font-lock-defaults
- '(adoc-font-lock-keywords
- nil nil nil nil
- (font-lock-multiline . t)
- (font-lock-mark-block-function . adoc-font-lock-mark-block-function)))
+ '(adoc-font-lock-keywords
+ nil nil nil nil
+ (font-lock-multiline . t)
+ (font-lock-mark-block-function .
adoc-font-lock-mark-block-function)))
(setq-local font-lock-extra-managed-props '(adoc-reserved
adoc-attribute-list adoc-code-block))
(setq-local font-lock-unfontify-region-function
'adoc-unfontify-region-function)
(setq-local font-lock-extend-after-change-region-function
#'adoc-font-lock-extend-after-change-region)
- [nongnu] elpa/adoc-mode 576d724330 114/199: 'caption' of http/... inline macros can now contain commas, (continued)
- [nongnu] elpa/adoc-mode 576d724330 114/199: 'caption' of http/... inline macros can now contain commas, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2682662c96 118/199: Use mode-* to set var require-final-newline, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode db6c51c8e7 128/199: Restructure the README, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 46e8ea4126 129/199: Add Eldev and a GHA workflow based on it, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 7fdddd54f7 132/199: Require Emacs 26, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode bded623e3d 139/199: [Fix #8] Add a changelog, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 00c59c8d95 145/199: [Fix #7] Convert readme to AsciiDoc (#10), ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 893daa395c 152/199: Move the syntax-table out of the mode definition, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2c4847d843 160/199: Tweak a couple of docstrings, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode c3d738dd7d 169/199: Fix a typo, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 109bdc5d13 180/199: Fix a typo and some whitespace issues,
ELPA Syncer <=
- [nongnu] elpa/adoc-mode 9e7af55e7e 183/199: Fix a typo, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode b0702bdeb8 187/199: [Fix #33] Address noticeable lag when typing in larger code blocks (#35), ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 526e058665 029/199: added another list item test, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a0ddf0f02d 034/199: added tests for images, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 1a4e93ec7c 035/199: enhanded general block macro incl. tests, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode fcabdc3a7e 037/199: added general inline macro, began reworking anchors, touched image, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 656e7670c5 099/199: fixed type: denote -> demote, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 2cfd433622 030/199: extended quotes tests, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode a61e7cd749 063/199: added AsciiDoc menu & key map, ELPA Syncer, 2023/09/03
- [nongnu] elpa/adoc-mode 22bd99a194 075/199: test: Use with-temp-buffer instead home-brewed solution, ELPA Syncer, 2023/09/03