all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Aaron S. Hawley" <aaronh@garden.org>
To: bug-gnu-emacs@gnu.org
Subject: bug#1239: PATCH: Fix corner case of texinfo-insert-quote
Date: Fri, 24 Oct 2008 13:40:46 -0400	[thread overview]
Message-ID: <4902089E.9030302@garden.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1810 bytes --]

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  <aaronh@garden.org>
+
+	* textmodes/texinfo.el (texinfo-insert-quote): Handle corner
+	 case where point is at the beginning of the buffer.
+
  2008-10-24  Juanma Barranquero  <lekktu@gmail.com>

  	* 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)))))


[-- Attachment #2: texinfo.el-bobp.diff --]
[-- Type: text/plain, Size: 1637 bytes --]

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  <aaronh@garden.org>
+
+	* textmodes/texinfo.el (texinfo-insert-quote): Handle corner
+	 case where point is at the beginning of the buffer.
+
 2008-10-24  Juanma Barranquero  <lekktu@gmail.com>
 
 	* 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)))))
 

             reply	other threads:[~2008-10-24 17:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <nkk5ajw8ld.fsf@fencepost.gnu.org>
2008-10-24 17:40 ` Aaron S. Hawley [this message]
2008-12-02  3:45   ` bug#1239: marked as done (PATCH: Fix corner case of texinfo-insert-quote) Emacs bug Tracking System

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4902089E.9030302@garden.org \
    --to=aaronh@garden.org \
    --cc=1239@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.