From: Glenn Morris Date: Tue, 2 Dec 2008 03:34:19 +0000 (+0000) Subject: Aaron S. Hawley X-Git-Tag: emacs-pretest-23.0.90~1372 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=083654ee81c101fb648680e1071ecb974d447874;p=emacs.git Aaron S. Hawley (texinfo-insert-quote): Handle corner case where point is at the beginning of the buffer. (Bug#1239) --- 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)))))