diff --git a/latex.el b/latex.el index 93c13dd8..b3e3d3e5 100644 --- a/latex.el +++ b/latex.el @@ -3814,20 +3814,19 @@ of the macro argument as cons." ;; expects the delimiter right behind the command. ;; However, \lstinline can also cope with whitespace as ;; well as an optional argument after the command. - ;; Besides, \lstinline or \Verb (from fancyvrb) also - ;; accept an optional argument which we have to - ;; encounter. We assume that users don't write - ;; something like this '\Verb[foo[' and again the - ;; delimiter is directly after the ] closing the - ;; optional argument: - (delimiter (if (= (char-after end) ?\[) + ;; \Verb (from fancyvrb) also accepts an optional + ;; argument which we have to encounter. We assume that + ;; users don't write something like this '\Verb[foo[' + ;; and again the delimiter is directly after the ] + ;; closing the optional argument: + (delimiter (if (string= (string (char-after end)) LaTeX-optop) ;; Update `end'. (save-excursion (goto-char end) (forward-list) (setq end (point)) (string (following-char))) (buffer-substring-no-properties - end (1+ end)))) + end (1+ end))))) ;; Heuristic: If an opening brace is encountered, search for ;; both the opening and the closing brace as an end marker. ;; Like that the function should work for \verb|...| as well @@ -3839,7 +3838,7 @@ of the macro argument as cons." (when (<= orig (point)) (if arg-only (cons (1+ end) (point)) - (cons beg (1+ (point))))))))))) + (cons beg (1+ (point)))))))))) (defun LaTeX-current-verbatim-macro () "Return name of verbatim macro containing point, nil if none is present." @@ -3876,7 +3875,7 @@ argument if any, aren't considered as component of a verbatim-like construct." (nth 3 (syntax-ppss))) ;; Fallback for users who stay away from font-latex. (or - (let (region (LaTeX-verbatim-macro-boundaries t)) + (let ((region (LaTeX-verbatim-macro-boundaries t))) (and region (<= (car region) (point) (cdr region)))) (member (LaTeX-current-environment) (LaTeX-verbatim-environments)))))