# HG changeset patch # User Eli Zaretskii # Date 982848577 0 # Node ID 6619db0066d945f7b4e92285a09e7411c8a45383 # Parent e658f85365f1aba6061ed5631e9bba054d38f203 (texinfo-format-scan): Signal an error if @ follows an accent command such as @'. Support optional braces in commands that insert accents, like makeinfo does. diff -r e658f85365f1 -r 6619db0066d9 lisp/textmodes/texinfmt.el --- a/lisp/textmodes/texinfmt.el Thu Feb 22 13:26:12 2001 +0000 +++ b/lisp/textmodes/texinfmt.el Thu Feb 22 13:29:37 2001 +0000 @@ -868,7 +868,23 @@ ;; Otherwise: the other characters are simply quoted. Delete the @. (t (delete-char -1) - (forward-char 1))) + ;; Be compatible with makeinfo: if @' and its ild are + ;; followed by a @ without a brace, barf. + (if (looking-at "[\"'^`~=]") + (progn + (if (= (char-after (1+ (point))) ?@) + (error "Use braces to give a command as an argument to @%c" + (following-char))) + (forward-char 1) + ;; @' etc. can optionally accept their argument in + ;; braces (makeinfo supports that). + (when (looking-at "{") + (let ((start (point))) + (forward-list 1) + (delete-char -1) + (goto-char start) + (delete-char 1)))) + (forward-char 1)))) ;; @ is followed by a command-word; find the end of the word. (setq texinfo-command-start (1- (point))) (if (= (char-syntax (following-char)) ?w)