Subject: bug#1239 closed by Glenn Morris <[email-masked]> (Re: bug#1239: PATCH: Fix corner case of texinfo-insert-quote)

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#1239: PATCH: Fix corner case of texinfo-insert-quote

It has been closed by Glenn Morris <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Glenn Morris <[email-masked]> by
replying to this email.

-- 
1239: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1239
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Mon Dec  1 19:38:03 2008
From: Glenn Morris <[email-masked]>
To: [email-masked]
Subject: Re: bug#1239: PATCH: Fix corner case of texinfo-insert-quote
Date: Mon, 01 Dec 2008 22:37:34 -0500

OK; installed.

2008-12-02  Aaron S. Hawley  <[email-masked]>

  * textmodes/texinfo.el (texinfo-insert-quote): Handle
  corner case where point is at the beginning of the buffer.  (Bug#1239)

>From [email-masked] Fri Oct 24 10:41:14 2008
Date: Fri, 24 Oct 2008 13:40:46 -0400
From: "Aaron S. Hawley" <[email-masked]>
To: [email-masked]
Subject: PATCH: Fix corner case of texinfo-insert-quote

This is a multi-part message in MIME format.
--------------080408080708000509060700
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Patch is attached and in-line.  It would be nice to have this, in case 
one tries to do quotation mark manipulation with with-temp-buffer.

Thanks for Emacs,
/a

Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.14668
diff -u -r1.14668 ChangeLog
--- ChangeLog	24 Oct 2008 09:39:28 -0000	1.14668
+++ ChangeLog	24 Oct 2008 17:29:37 -0000
@@ -1,3 +1,8 @@
+2008-10-24  Aaron S. Hawley  <[email-masked]>
+
+	* textmodes/texinfo.el (texinfo-insert-quote): Handle corner
+	 case where point is at the beginning of the buffer.
+
  2008-10-24  Juanma Barranquero  <[email-masked]>

  	* subr.el (locate-user-emacs-file): New function.
Index: textmodes/texinfo.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/texinfo.el,v
retrieving revision 1.122
diff -u -r1.122 texinfo.el
--- textmodes/texinfo.el	6 May 2008 04:33:13 -0000	1.122
+++ textmodes/texinfo.el	24 Oct 2008 17:29:37 -0000
@@ -682,7 +682,9 @@
      (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 @@
  		    (setq in-env t)))))
  	(self-insert-command (prefix-numeric-value arg))
        (insert
-       (if (memq (char-syntax (preceding-char)) '(?\( ?> ?\s))
+       (if (or (bobp) ;; (eq (preceding-char) 0)
+	       (memq (char-syntax (preceding-char)) '(?\( ?> ?\s)))
  	   texinfo-open-quote
  	 texinfo-close-quote)))))

--------------080408080708000509060700
Content-Type: text/plain;
 name="texinfo.el-bobp.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="texinfo.el-bobp.diff"

Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.14668
diff -u -r1.14668 ChangeLog
--- ChangeLog	24 Oct 2008 09:39:28 -0000	1.14668
+++ ChangeLog	24 Oct 2008 17:29:37 -0000
@@ -1,3 +1,8 @@
+2008-10-24  Aaron S. Hawley  <[email-masked]>
+
+	* textmodes/texinfo.el (texinfo-insert-quote): Handle corner
+	 case where point is at the beginning of the buffer.
+
 2008-10-24  Juanma Barranquero  <[email-masked]>
 
 	* subr.el (locate-user-emacs-file): New function.
Index: textmodes/texinfo.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/texinfo.el,v
retrieving revision 1.122
diff -u -r1.122 texinfo.el
--- textmodes/texinfo.el	6 May 2008 04:33:13 -0000	1.122
+++ textmodes/texinfo.el	24 Oct 2008 17:29:37 -0000
@@ -682,7 +682,9 @@
     (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 @@
 		    (setq in-env t)))))
 	(self-insert-command (prefix-numeric-value arg))
       (insert
-       (if (memq (char-syntax (preceding-char)) '(?\( ?> ?\s))
+       (if (or (bobp) ;; (eq (preceding-char) 0)
+	       (memq (char-syntax (preceding-char)) '(?\( ?> ?\s)))
 	   texinfo-open-quote
 	 texinfo-close-quote)))))

--------------080408080708000509060700--