diff options
| author | Stephen Leake | 2018-12-13 14:39:02 -0800 |
|---|---|---|
| committer | Stephen Leake | 2018-12-13 14:39:02 -0800 |
| commit | 87bef630bf0f45e8da74e43ba614aa2292b296ef (patch) | |
| tree | efdead3c0d7dd227bacbd4dfc5c1ff9b4d5c13c3 /lisp/progmodes | |
| parent | 4d3f7b77cc7dea072d2ecb9f137c2e497bc52da1 (diff) | |
| parent | d08b75abe0f0cf9ade812b189c374809a2c7836e (diff) | |
| download | emacs-87bef630bf0f45e8da74e43ba614aa2292b296ef.tar.gz emacs-87bef630bf0f45e8da74e43ba614aa2292b296ef.zip | |
Merge commit 'd08b75abe0f0cf9ade812b189c374809a2c7836e'
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/flymake.el | 21 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 4 |
2 files changed, 19 insertions, 6 deletions
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index ad8f50cd7a5..7b100da42b8 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Pavel Kobyakov <pk_at_work@yahoo.com> | 5 | ;; Author: Pavel Kobyakov <pk_at_work@yahoo.com> |
| 6 | ;; Maintainer: João Távora <joaotavora@gmail.com> | 6 | ;; Maintainer: João Távora <joaotavora@gmail.com> |
| 7 | ;; Version: 1.0.2 | 7 | ;; Version: 1.0.3 |
| 8 | ;; Package-Requires: ((emacs "26.1")) | 8 | ;; Package-Requires: ((emacs "26.1")) |
| 9 | ;; Keywords: c languages tools | 9 | ;; Keywords: c languages tools |
| 10 | 10 | ||
| @@ -293,7 +293,7 @@ generated it." | |||
| 293 | 293 | ||
| 294 | (cl-defstruct (flymake--diag | 294 | (cl-defstruct (flymake--diag |
| 295 | (:constructor flymake--diag-make)) | 295 | (:constructor flymake--diag-make)) |
| 296 | buffer beg end type text backend data overlay) | 296 | buffer beg end type text backend data overlay-properties overlay) |
| 297 | 297 | ||
| 298 | ;;;###autoload | 298 | ;;;###autoload |
| 299 | (defun flymake-make-diagnostic (buffer | 299 | (defun flymake-make-diagnostic (buffer |
| @@ -301,13 +301,20 @@ generated it." | |||
| 301 | end | 301 | end |
| 302 | type | 302 | type |
| 303 | text | 303 | text |
| 304 | &optional data) | 304 | &optional data |
| 305 | overlay-properties) | ||
| 305 | "Make a Flymake diagnostic for BUFFER's region from BEG to END. | 306 | "Make a Flymake diagnostic for BUFFER's region from BEG to END. |
| 306 | TYPE is a key to symbol and TEXT is a description of the problem | 307 | TYPE is a key to symbol and TEXT is a description of the problem |
| 307 | detected in this region. DATA is any object that the caller | 308 | detected in this region. DATA is any object that the caller |
| 308 | wishes to attach to the created diagnostic for later retrieval." | 309 | wishes to attach to the created diagnostic for later retrieval. |
| 310 | |||
| 311 | OVERLAY-PROPERTIES is an an alist of properties attached to the | ||
| 312 | created diagnostic, overriding the default properties and any | ||
| 313 | properties of `flymake-overlay-control' of the diagnostic's | ||
| 314 | type." | ||
| 309 | (flymake--diag-make :buffer buffer :beg beg :end end | 315 | (flymake--diag-make :buffer buffer :beg beg :end end |
| 310 | :type type :text text :data data)) | 316 | :type type :text text :data data |
| 317 | :overlay-properties overlay-properties)) | ||
| 311 | 318 | ||
| 312 | ;;;###autoload | 319 | ;;;###autoload |
| 313 | (defun flymake-diagnostics (&optional beg end) | 320 | (defun flymake-diagnostics (&optional beg end) |
| @@ -600,7 +607,9 @@ associated `flymake-category' return DEFAULT." | |||
| 600 | ;; properties. | 607 | ;; properties. |
| 601 | (cl-loop | 608 | (cl-loop |
| 602 | for (ov-prop . value) in | 609 | for (ov-prop . value) in |
| 603 | (append (reverse ; ensure ealier props override later ones | 610 | (append (reverse |
| 611 | (flymake--diag-overlay-properties diagnostic)) | ||
| 612 | (reverse ; ensure ealier props override later ones | ||
| 604 | (flymake--lookup-type-property type 'flymake-overlay-control)) | 613 | (flymake--lookup-type-property type 'flymake-overlay-control)) |
| 605 | (alist-get type flymake-diagnostic-types-alist)) | 614 | (alist-get type flymake-diagnostic-types-alist)) |
| 606 | do (overlay-put ov ov-prop value)) | 615 | do (overlay-put ov ov-prop value)) |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 2f68f004e7b..d60899cf182 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -517,6 +517,9 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'." | |||
| 517 | ((ruby-smie--opening-pipe-p) "opening-|") | 517 | ((ruby-smie--opening-pipe-p) "opening-|") |
| 518 | ((ruby-smie--closing-pipe-p) "closing-|") | 518 | ((ruby-smie--closing-pipe-p) "closing-|") |
| 519 | (t tok))) | 519 | (t tok))) |
| 520 | ((string-match "\\`[^|]+|\\'" tok) | ||
| 521 | (forward-char -1) | ||
| 522 | (substring tok 0 -1)) | ||
| 520 | ((and (equal tok "") (looking-at "\\\\\n")) | 523 | ((and (equal tok "") (looking-at "\\\\\n")) |
| 521 | (goto-char (match-end 0)) (ruby-smie--forward-token)) | 524 | (goto-char (match-end 0)) (ruby-smie--forward-token)) |
| 522 | ((equal tok "do") | 525 | ((equal tok "do") |
| @@ -559,6 +562,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'." | |||
| 559 | ((ruby-smie--opening-pipe-p) "opening-|") | 562 | ((ruby-smie--opening-pipe-p) "opening-|") |
| 560 | ((ruby-smie--closing-pipe-p) "closing-|") | 563 | ((ruby-smie--closing-pipe-p) "closing-|") |
| 561 | (t tok))) | 564 | (t tok))) |
| 565 | ((string-match-p "\\`[^|]+|\\'" tok) "closing-|") | ||
| 562 | ((string-match-p "\\`|[*&]\\'" tok) | 566 | ((string-match-p "\\`|[*&]\\'" tok) |
| 563 | (forward-char 1) | 567 | (forward-char 1) |
| 564 | (substring tok 1)) | 568 | (substring tok 1)) |