Skip to content

Commit 9a7bd6d

Browse files
committed
Fix lint warnings and byte compilation warnings
1 parent 847e7de commit 9a7bd6d

File tree

1 file changed

+114
-114
lines changed

1 file changed

+114
-114
lines changed

Diff for: markdown-mode.el

+114-114
Original file line numberDiff line numberDiff line change
@@ -3381,79 +3381,6 @@ the buffer)."
33813381
(defun markdown-match-yaml-metadata-key (last)
33823382
(markdown-match-propertized-text 'markdown-metadata-key last))
33833383

3384-
(defun markdown-fontify-wiki-links (last)
3385-
"Add text properties to next wiki link from point to LAST."
3386-
(when (and markdown-enable-wiki-links
3387-
(markdown-match-inline-generic markdown-regex-wiki-link last))
3388-
(let* ((begin (match-beginning 1))
3389-
(end (match-end 1))
3390-
(beg2 (match-beginning 2))
3391-
(end2 (match-end 2))
3392-
(beg3 (match-beginning 3))
3393-
(end3 (match-end 3))
3394-
(beg4 (match-beginning 4))
3395-
(end4 (match-end 4))
3396-
(beg5 (match-beginning 5))
3397-
(end5 (match-end 5))
3398-
(beg6 (match-beginning 6))
3399-
(end6 (match-end 6))
3400-
(part1 (match-string-no-properties 3))
3401-
(part2 (match-string-no-properties 5))
3402-
(aliasp (string-equal (match-string-no-properties 4) "|"))
3403-
(file-name (markdown-convert-wiki-link-to-filename (markdown-wiki-link-link)))
3404-
(file-missing-p (not (file-exists-p file-name))))
3405-
(if (or (markdown-in-comment-p begin)
3406-
(markdown-in-comment-p end)
3407-
(markdown-inline-code-at-pos-p begin)
3408-
(markdown-inline-code-at-pos-p end)
3409-
(markdown-code-block-at-pos begin))
3410-
(progn (goto-char (min (1+ begin) last))
3411-
(when (< (point) last)
3412-
(markdown-fontify-wiki-links last)))
3413-
;; Add text properties for hiding markup
3414-
(progn
3415-
(if aliasp
3416-
(progn
3417-
;; Propertize pipe separating URL from link text
3418-
(add-text-properties beg4 end4 markup-props)
3419-
(add-face-text-property beg4 end4 'markdown-markup-face)
3420-
(if markdown-wiki-link-alias-first
3421-
(progn
3422-
(if (and file-missing-p markdown-wiki-link-fontify-missing)
3423-
(progn
3424-
(add-text-properties beg3 end3 (missing-link-props part2))
3425-
(put-text-property beg3 end3 'font-lock-face 'markdown-missing-link-face))
3426-
(progn
3427-
(add-text-properties beg3 end3 (link-props part2))
3428-
(put-text-property beg3 end3 'font-lock-face 'markdown-link-face)))
3429-
(progn
3430-
(add-text-properties beg5 end5 url-props)
3431-
(add-face-text-property beg5 end5 'markdown-url-face)))
3432-
(progn
3433-
(add-text-properties beg3 end3 url-props)
3434-
(add-face-text-property beg3 end3 'markdown-url-face)
3435-
(if (and file-missing-p markdown-wiki-link-fontify-missing)
3436-
(progn
3437-
(add-text-properties beg5 end5 (missing-link-props part1))
3438-
(put-text-property beg5 end5 'font-lock-face 'markdown-missing-link-face))
3439-
(progn
3440-
(add-text-properties beg5 end5 (link-props part1))
3441-
(put-text-property beg5 end5 'font-lock-face 'markdown-link-face))))))
3442-
(if (and file-missing-p markdown-wiki-link-fontify-missing)
3443-
(progn
3444-
(add-text-properties beg3 end3 (missing-link-props part1))
3445-
(put-text-property beg3 end3 'font-lock-face 'markdown-missing-link-face))
3446-
(progn
3447-
(add-text-properties beg3 end3 (link-props part1))
3448-
(put-text-property beg3 end3 'font-lock-face 'markdown-link-face))))
3449-
;; Propertize opening and closing brackets
3450-
(add-text-properties beg2 end2 markup-props)
3451-
(add-text-properties beg6 end6 markup-props)
3452-
(add-face-text-property beg2 end2 'markdown-markup-face)
3453-
(add-face-text-property beg6 end6 'markdown-markup-face))
3454-
(set-match-data (list begin end))
3455-
t))))
3456-
34573384
(defun markdown-match-inline-attributes (last)
34583385
"Match inline attributes from point to LAST."
34593386
;; #428 re-search-forward markdown-regex-inline-attributes is very slow.
@@ -3591,15 +3518,15 @@ SEQ may be an atom or a sequence."
35913518
(heading-face
35923519
(intern (format "markdown-header-face-%d" level)))
35933520
(heading-props `(face ,heading-face))
3594-
(left-markup-props
3521+
(left-markdown--markup-props
35953522
`(face markdown-header-delimiter-face
35963523
,@(cond
35973524
(markdown-hide-markup
35983525
`(display ""))
35993526
(markdown-marginalize-headers
36003527
`(display ((margin left-margin)
36013528
,(markdown--marginalize-string level)))))))
3602-
(right-markup-props
3529+
(right-markdown--markup-props
36033530
`(face markdown-header-delimiter-face
36043531
,@(when markdown-hide-markup `(display ""))))
36053532
(rule-props `(face markdown-header-rule-face
@@ -3619,7 +3546,7 @@ SEQ may be an atom or a sequence."
36193546
(min (point-max) (1+ (match-end 0)))
36203547
(match-end 0))))
36213548
(add-text-properties
3622-
(match-beginning 4) (match-end 4) left-markup-props)
3549+
(match-beginning 4) (match-end 4) left-markdown--markup-props)
36233550

36243551
;; If closing tag is present
36253552
(if (match-end 6)
@@ -3629,15 +3556,13 @@ SEQ may be an atom or a sequence."
36293556
(add-text-properties
36303557
(match-beginning 5) header-end heading-props)
36313558
(add-text-properties
3632-
(match-beginning 6) (match-end 6) right-markup-props))
3559+
(match-beginning 6) (match-end 6) right-markdown--markup-props))
36333560
(add-text-properties
36343561
(match-beginning 5) (match-end 5) heading-props)
36353562
(add-text-properties
3636-
(match-beginning 6) header-end right-markup-props)))
3563+
(match-beginning 6) header-end right-markdown--markup-props)))
36373564
;; If closing tag is not present
3638-
(add-text-properties
3639-
(match-beginning 5) header-end heading-props))
3640-
)))
3565+
(add-text-properties (match-beginning 5) header-end heading-props)))))
36413566
t))
36423567

36433568
(defun markdown-fontify-tables (last)
@@ -5286,8 +5211,7 @@ Otherwise, do normal delete by repeating
52865211
(back-to-indentation)
52875212
(unless (looking-at-p "[ \t]*$")
52885213
(setq mincol (min mincol (current-column))))
5289-
(forward-line 1)
5290-
))
5214+
(forward-line 1)))
52915215
mincol))
52925216

52935217
(defun markdown-indent-region (beg end arg)
@@ -5762,6 +5686,36 @@ Assumes match data is available for `markdown-regex-italic'."
57625686
"Keymap for `gfm-mode'.
57635687
See also `markdown-mode-map'.")
57645688

5689+
5690+
;;; Text Properties ===========================================================
5691+
5692+
(defconst markdown--markup-props (list 'invisible 'markdown-markup
5693+
'rear-nonsticky t
5694+
'font-lock-multiline t))
5695+
5696+
(defconst markdown--url-props (list 'invisible 'markdown-markup
5697+
'keymap markdown-mode-mouse-map
5698+
'mouse-face 'markdown-highlight-face
5699+
'font-lock-multiline t))
5700+
5701+
(defconst markdown--title-props (list 'invisible 'markdown-markup
5702+
'font-lock-multiline t))
5703+
5704+
(defun markdown--link-props (url &optional title)
5705+
"Return a property list for URL with optional TITLE."
5706+
(let ((echo-text (if title (concat title "\n" url) url)))
5707+
(list 'keymap markdown-mode-mouse-map
5708+
'mouse-face 'markdown-highlight-face
5709+
'font-lock-multiline t
5710+
'help-echo echo-text)))
5711+
5712+
(defun markdown--missing-link-props (url)
5713+
"Return a property list for URL for file that doesn't exist."
5714+
(list 'keymap markdown-mode-mouse-map
5715+
'mouse-face 'markdown-highlight-face
5716+
'font-lock-multiline t
5717+
'help-echo url))
5718+
57655719

57665720
;;; Menu ======================================================================
57675721

@@ -8229,33 +8183,6 @@ Translate filenames using `markdown-filename-translate-function'."
82298183
(markdown--browse-url (markdown-link-url)))
82308184
(user-error "Point is not at a Markdown link or URL")))
82318185

8232-
(defconst markup-props (list 'invisible 'markdown-markup
8233-
'rear-nonsticky t
8234-
'font-lock-multiline t))
8235-
8236-
(defconst url-props (list 'invisible 'markdown-markup
8237-
'keymap markdown-mode-mouse-map
8238-
'mouse-face 'markdown-highlight-face
8239-
'font-lock-multiline t))
8240-
8241-
(defconst title-props (list 'invisible 'markdown-markup
8242-
'font-lock-multiline t))
8243-
8244-
(defun link-props (url &optional title)
8245-
"Return a property list for URL with optional TITLE."
8246-
(let ((echo-text (if title (concat title "\n" url) url)))
8247-
(list 'keymap markdown-mode-mouse-map
8248-
'mouse-face 'markdown-highlight-face
8249-
'font-lock-multiline t
8250-
'help-echo echo-text)))
8251-
8252-
(defun missing-link-props (url)
8253-
"Return a property list for URL for file that doesn't exist."
8254-
(list 'keymap markdown-mode-mouse-map
8255-
'mouse-face 'markdown-highlight-face
8256-
'font-lock-multiline t
8257-
'help-echo url))
8258-
82598186
(defun markdown-fontify-inline-links (last)
82608187
"Add text properties to next inline link from point to LAST."
82618188
(when (markdown-match-generic-links last nil)
@@ -8270,17 +8197,17 @@ Translate filenames using `markdown-filename-translate-function'."
82708197
(url-char (markdown--first-displayable markdown-url-compose-char)))
82718198
(dolist (g '(1 2 4 5 8))
82728199
(when (match-end g)
8273-
(add-text-properties (match-beginning g) (match-end g) markup-props)
8200+
(add-text-properties (match-beginning g) (match-end g) markdown--markup-props)
82748201
(add-face-text-property (match-beginning g) (match-end g) 'markdown-markup-face)))
82758202
;; Preserve existing faces applied to link part (e.g., inline code)
82768203
(when link-start
8277-
(add-text-properties link-start link-end (link-props url title))
8204+
(add-text-properties link-start link-end (markdown--link-props url title))
82788205
(add-face-text-property link-start link-end 'markdown-link-face))
82798206
(when url-start
8280-
(add-text-properties url-start url-end url-props)
8207+
(add-text-properties url-start url-end markdown--url-props)
82818208
(add-face-text-property url-start url-end 'markdown-url-face))
82828209
(when title-start
8283-
(add-text-properties url-end title-end title-props)
8210+
(add-text-properties url-end title-end markdown--title-props)
82848211
(add-face-text-property url-end title-end 'markdown-link-title-face))
82858212
(when (and markdown-hide-urls url-start)
82868213
(compose-region url-start (or title-end url-end) url-char))
@@ -8326,6 +8253,79 @@ Translate filenames using `markdown-filename-translate-function'."
83268253
(compose-region ref-start ref-end url-char)))
83278254
t)))
83288255

8256+
(defun markdown-fontify-wiki-links (last)
8257+
"Add text properties to next wiki link from point to LAST."
8258+
(when (and markdown-enable-wiki-links
8259+
(markdown-match-inline-generic markdown-regex-wiki-link last))
8260+
(let* ((begin (match-beginning 1))
8261+
(end (match-end 1))
8262+
(beg2 (match-beginning 2))
8263+
(end2 (match-end 2))
8264+
(beg3 (match-beginning 3))
8265+
(end3 (match-end 3))
8266+
(beg4 (match-beginning 4))
8267+
(end4 (match-end 4))
8268+
(beg5 (match-beginning 5))
8269+
(end5 (match-end 5))
8270+
(beg6 (match-beginning 6))
8271+
(end6 (match-end 6))
8272+
(part1 (match-string-no-properties 3))
8273+
(part2 (match-string-no-properties 5))
8274+
(aliasp (string-equal (match-string-no-properties 4) "|"))
8275+
(file-name (markdown-convert-wiki-link-to-filename (markdown-wiki-link-link)))
8276+
(file-missing-p (not (file-exists-p file-name))))
8277+
(if (or (markdown-in-comment-p begin)
8278+
(markdown-in-comment-p end)
8279+
(markdown-inline-code-at-pos-p begin)
8280+
(markdown-inline-code-at-pos-p end)
8281+
(markdown-code-block-at-pos begin))
8282+
(progn (goto-char (min (1+ begin) last))
8283+
(when (< (point) last)
8284+
(markdown-fontify-wiki-links last)))
8285+
;; Add text properties for hiding markup
8286+
(progn
8287+
(if aliasp
8288+
(progn
8289+
;; Propertize pipe separating URL from link text
8290+
(add-text-properties beg4 end4 markdown--markup-props)
8291+
(add-face-text-property beg4 end4 'markdown-markup-face)
8292+
(if markdown-wiki-link-alias-first
8293+
(progn
8294+
(if (and file-missing-p markdown-wiki-link-fontify-missing)
8295+
(progn
8296+
(add-text-properties beg3 end3 (markdown--missing-link-props part2))
8297+
(put-text-property beg3 end3 'font-lock-face 'markdown-missing-link-face))
8298+
(progn
8299+
(add-text-properties beg3 end3 (markdown--link-props part2))
8300+
(put-text-property beg3 end3 'font-lock-face 'markdown-link-face)))
8301+
(progn
8302+
(add-text-properties beg5 end5 markdown--url-props)
8303+
(add-face-text-property beg5 end5 'markdown-url-face)))
8304+
(progn
8305+
(add-text-properties beg3 end3 markdown--url-props)
8306+
(add-face-text-property beg3 end3 'markdown-url-face)
8307+
(if (and file-missing-p markdown-wiki-link-fontify-missing)
8308+
(progn
8309+
(add-text-properties beg5 end5 (markdown--missing-link-props part1))
8310+
(put-text-property beg5 end5 'font-lock-face 'markdown-missing-link-face))
8311+
(progn
8312+
(add-text-properties beg5 end5 (markdown--link-props part1))
8313+
(put-text-property beg5 end5 'font-lock-face 'markdown-link-face))))))
8314+
(if (and file-missing-p markdown-wiki-link-fontify-missing)
8315+
(progn
8316+
(add-text-properties beg3 end3 (markdown--missing-link-props part1))
8317+
(put-text-property beg3 end3 'font-lock-face 'markdown-missing-link-face))
8318+
(progn
8319+
(add-text-properties beg3 end3 (markdown--link-props part1))
8320+
(put-text-property beg3 end3 'font-lock-face 'markdown-link-face))))
8321+
;; Propertize opening and closing brackets
8322+
(add-text-properties beg2 end2 markdown--markup-props)
8323+
(add-text-properties beg6 end6 markdown--markup-props)
8324+
(add-face-text-property beg2 end2 'markdown-markup-face)
8325+
(add-face-text-property beg6 end6 'markdown-markup-face))
8326+
(set-match-data (list begin end))
8327+
t))))
8328+
83298329
(defun markdown-fontify-angle-uris (last)
83308330
"Add text properties to angle URIs from point to LAST."
83318331
(when (markdown-match-angle-uris last)

0 commit comments

Comments
 (0)