From 083654ee81c101fb648680e1071ecb974d447874 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 2 Dec 2008 03:34:19 +0000 Subject: [PATCH] Aaron S. Hawley (texinfo-insert-quote): Handle corner case where point is at the beginning of the buffer. (Bug#1239) --- lisp/textmodes/texinfo.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 5f6724fea0e..ba61ab54008 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -682,7 +682,9 @@ With prefix argument or inside @code or @example, inserts a plain \"." (if (or arg (= (preceding-char) ?\\) (save-excursion - (backward-char (length texinfo-open-quote)) + (if (> (point) (length texinfo-open-quote)) + (backward-char (length texinfo-open-quote)) + (goto-char (point-min))) (when (or (looking-at texinfo-open-quote) (looking-at texinfo-close-quote)) (delete-char (length texinfo-open-quote)) @@ -694,7 +696,8 @@ With prefix argument or inside @code or @example, inserts a plain \"." (setq in-env t))))) (self-insert-command (prefix-numeric-value arg)) (insert - (if (memq (char-syntax (preceding-char)) '(?\( ?> ?\s)) + (if (or (bobp) + (memq (char-syntax (preceding-char)) '(?\( ?> ?\s))) texinfo-open-quote texinfo-close-quote))))) -- 2.39.2