From mboxrd@z Thu Jan 1 00:00:00 1970 From: Craig Tanis Subject: Bug: org-insert-heading wrongly adding checklist [8.0.7 (8.0.7-6-g13cb28-elpaplus @ /Users/ctanis/.emacs.d/elpa/org-plus-contrib-20130812/)] Date: Mon, 12 Aug 2013 09:07:45 -0400 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8rqs-0006VL-Lj for emacs-orgmode@gnu.org; Mon, 12 Aug 2013 09:08:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8rqn-000208-I7 for emacs-orgmode@gnu.org; Mon, 12 Aug 2013 09:08:02 -0400 Received: from ch1ehsobe002.messaging.microsoft.com ([216.32.181.182]:20146 helo=ch1outboundpool.messaging.microsoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8rqn-0001xv-D4 for emacs-orgmode@gnu.org; Mon, 12 Aug 2013 09:07:57 -0400 Received: from mail201-ch1 (localhost [127.0.0.1]) by mail201-ch1-R.bigfish.com (Postfix) with ESMTP id 59EB74802B4 for ; Mon, 12 Aug 2013 13:07:56 +0000 (UTC) Received: from CH1EHSMHS015.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.242]) by mail201-ch1.bigfish.com (Postfix) with ESMTP id A5655C004D for ; Mon, 12 Aug 2013 13:07:51 +0000 (UTC) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org When writing a numbered list, under certain conditions using Meta-return (triggering org-insert-heading) causes a checkbox to incorrectly appear. Specifically, a list like so: 1. foo 2. bar <----- with the cursor here, at the start of the next line Meta-return adds a checkbox. Normally this behaviour is only expected when Meta-shift-return is entered. I've traced it to the following code. (Indeed, I even submitted a patch a while ago, but I must have done something wrong.) In org-insert-heading: ((or arg (and (not (org-in-item-p)) org-insert-heading-respect-content) (not (org-insert-item (save-excursion (beginning-of-line) (looking-at org-list-full-item-re) (match-string 3))))) In the situation described above, the (looking-at org-list-full-item-re) does not match anything, but match-string is still called. The results do not correspond to the expected regexp pattern. The following code seems to remedy the problem I've described: ((or arg (and (not (org-in-item-p)) org-insert-heading-respect-content) (not (org-insert-item (save-excursion (beginning-of-line) (and (looking-at org-list-full-item-re) (match-string 3)))))) Obviously this only returns (match-string 3) when the regexp is appropriate. thanks, Craig Tanis Emacs : GNU Emacs 24.3.1 (x86_64-apple-darwin12.3.0, NS = apple-appkit-1187.37) of 2013-03-18 on nincompoop.emcs3w.utc.edu Package: Org-mode version 8.0.7 (8.0.7-6-g13cb28-elpaplus @ = /Users/ctanis/.emacs.d/elpa/org-plus-contrib-20130812/) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq org-tab-first-hook '(org-hide-block-toggle-maybe = org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe = org-babel-header-arg-expand) org-goto-interface 'outline-path-completion org-speed-command-hook '(org-speed-command-default-hook = org-babel-speed-command-hook) org-mac-grab-Chrome-app-p nil org-occur-hook '(org-first-headline-recenter) org-metaup-hook '(org-babel-load-in-session-maybe) org-log-done 'time org-confirm-shell-link-function 'yes-or-no-p org-image-actual-width nil org-mac-grab-Firefox-app-p nil org-list-allow-alphabetical t org-after-todo-state-change-hook '(org-clock-out-if-current) org-src-mode-hook '(org-src-babel-configure-edit-buffer = org-src-mode-configure-edit-buffer) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-mode-hook '((lambda nil (define-key org-mode-map (kbd "C-c g") = (quote omlg-grab-link))) #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook = org-show-block-all append local] 5] #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook = org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes (lambda nil (make-variable-buffer-local (quote = yas/trigger-key)) (setq yas/trigger-key [tab]) (add-to-list (quote org-tab-first-hook) (quote = yas/org-very-safe-expand)) (define-key yas/keymap [tab] (quote yas/next-field))) (lambda nil (local-set-key "\220" (quote = org-backward-element)) (local-set-key "\216" (quote org-forward-element)) (local-set-key "\373" (quote backward-paragraph)) (local-set-key "\375" (quote forward-paragraph)) (local-set-key "\225" (quote org-up-list-or-element)) (local-set-key "\204" (quote org-down-element)) (local-set-key "\367" (quote org-refile-fullpath)) (local-set-key "\342" (quote org-mark-ring-goto)) (local-set-key "\356" (quote org-next-block)) (local-set-key "\360" (quote org-previous-block)) = (toggle-truncate-lines 0) (auto-fill-mode 1)) ) org-refile-targets '((nil :maxlevel . 9)) org-outline-path-complete-in-steps nil org-use-speed-commands t org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point = org-babel-execute-safely-maybe) org-refile-use-outline-path t org-directory "~/Dropbox/org" org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers = org-cycle-hide-inline-tasks org-cycle-show-empty-lines = org-optimize-window-after-visibility-change) org-export-before-parsing-hook '(my-thesis-org-export-hook) org-archive-default-command 'org-toggle-archive-tag org-hide-emphasis-markers t org-catch-invisible-edits 'smart org-babel-tangle-lang-exts '(("python" . "py") ("java" . "java") ("C++" = . "cpp") ("perl" . "pl") ("emacs-lisp" . "el")) org-confirm-elisp-link-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-log-into-drawer t org-completion-use-ido t org-babel-load-languages '((emacs-lisp . t) (perl . t) (C . t) (java . = t) (python . t) (ditaa . t) (dot . t) (gnuplot . t) (octave . t) (calc . = t) (sh . t)) org-cycle-global-at-bob t org-agenda-files '("~/Dropbox/org/tasks.org" = "~/Dropbox/thesis/tex/chapters/splatter.org" "~/Dropbox/org/notes.org") org-clock-out-hook '(org-clock-remove-empty-clock-drawer) ) ---- Craig Tanis UTC Computer Science craig-tanis@utc.edu