emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Craig Tanis <crt@weblar.org>
To: emacs-orgmode@gnu.org
Subject: [PATCH] List: fix creation of new items with incorrect checkbox
Date: Mon, 10 Jun 2013 13:14:49 -0400	[thread overview]
Message-ID: <9F10B0CB-E998-4762-B40F-D3C99B573210@weblar.org> (raw)

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

In 8.0.3, org-meta-return  at the end of a list wrongly adds a checkbox:

1. foo
_  <-- cursor here, org-meta-return

....

1. foo
2. [ ] 

to fix, this patches org-insert-heading to make sure that `org-list-full-item-re' actually matches before passing `(match-string 3)' to `org-insert-item'





[-- Attachment #2: 0001-List-fix-creation-of-new-items-with-incorrect-checkb.patch --]
[-- Type: application/octet-stream, Size: 1141 bytes --]

From 5dd6a07733042d6b732e1be5e15bc771ebbfc595 Mon Sep 17 00:00:00 2001
From: Craig Tanis <craig-tanis@utc.edu>
Date: Mon, 10 Jun 2013 12:50:32 -0400
Subject: [PATCH] List: fix creation of new items with incorrect checkbox

* lisp/org.el (org-insert-heading): makes sure that `org-list-full-item-re' matches before passing `(match-string 3)' to `org-insert-item'

When using org-meta-return at the end of a plain text list, checkboxes were
being wrongly inserted in the new item.

TINYCHANGE
---
 lisp/org.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 2e407a5..3ed01d7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7537,8 +7537,8 @@ This is important for non-interactive uses of the command."
 		(save-excursion
 		  (and itemp
 		       (goto-char itemp)
-		       (looking-at org-list-full-item-re)
-		       (match-string 3))))))
+		       (and (looking-at org-list-full-item-re) (match-string 3))
+		       )))))
       (let (begn endn)
 	(when (org-buffer-narrowed-p)
 	  (setq begn (point-min) endn (point-max))
-- 
1.7.12.4 (Apple Git-37)


                 reply	other threads:[~2013-06-10 17:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=9F10B0CB-E998-4762-B40F-D3C99B573210@weblar.org \
    --to=crt@weblar.org \
    --cc=emacs-orgmode@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).