mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
elisp--highlight-function-argument: Handle special syntax correctly
* lisp/progmodes/elisp-mode.el (elisp--highlight-function-argument): Handle special usage syntax correctly when scanning usage arguments using 'forward-sexp' (bug#8432). Before binding 'origin', skip over blanks, so as not to highlight them, and to move immediately before any possible opening square brackets. After binding 'origin' and before calling 'forward-sexp', skip over opening square brackets, so as to highlight them. After calling 'forward-sexp' and before setting 'start' and 'end', skip over closing square brackets and periods, so as to highlight them.
This commit is contained in:
parent
8c39a17eef
commit
9a5eafa8c3
1 changed files with 3 additions and 0 deletions
|
|
@ -2447,12 +2447,15 @@ ARGS is the argument list of function SYM."
|
||||||
(insert args)
|
(insert args)
|
||||||
(goto-char (1+ (point-min)))
|
(goto-char (1+ (point-min)))
|
||||||
(while (and index (>= index 1))
|
(while (and index (>= index 1))
|
||||||
|
(skip-chars-forward "[:blank:]")
|
||||||
(let ((origin (point)))
|
(let ((origin (point)))
|
||||||
|
(skip-chars-forward "[")
|
||||||
(if (condition-case nil
|
(if (condition-case nil
|
||||||
(forward-sexp)
|
(forward-sexp)
|
||||||
(:success t)
|
(:success t)
|
||||||
(scan-error nil))
|
(scan-error nil))
|
||||||
(progn
|
(progn
|
||||||
|
(skip-chars-forward "].")
|
||||||
(setq start (- origin (point-min))
|
(setq start (- origin (point-min))
|
||||||
end (- (point) (point-min)))
|
end (- (point) (point-min)))
|
||||||
(let ((argument (substring args start end)))
|
(let ((argument (substring args start end)))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue