emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: kadal <kadalcalypse@gmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: org-return does not work in magit's git-commit-setup-hook
Date: Thu, 15 Mar 2018 09:24:18 -0700	[thread overview]
Message-ID: <5c5b2696-22ab-9330-eaa7-ad3e94b31dca@gmail.com> (raw)

I have the line (add-hook 'git-commit-setup-hook 'orgstruct++-mode) but 
(org-return) does not work when edting the commit message.

This is the backtrace:

"Debugger entered--Lisp error: (wrong-type-argument stringp nil)
   looking-at(nil)
   org-return()
   (cond ((eq 'line-break (car (org-element-context))) 
(org-return-indent)) ((or (and (eq 'link (car (org-element-context))) 
(not (eolp))) (bolp)) (org-return)) ((org-inlinetask-in-task-p) 
(org-return)) ((org-at-item-checkbox-p) (cond ((and (eolp) (not (eq 
'item (car (org-element-context))))) (org-insert-todo-heading nil)) 
((and (eolp) (eq 'item (car (org-element-context)))) (let* ((v 
(line-beginning-position)) (v (point))) (cl--set-buffer-substring v v 
""))) ((eq 'paragraph (car (org-element-context))) (goto-char 
(org-element-property :end (org-element-context))) 
(org-insert-todo-heading nil)) (t (org-return)))) ((org-in-item-p) (cond 
((and (looking-at " ::") (looking-back "- " 3)) (beginning-of-line) 
(delete-region (line-beginning-position) (line-end-position))) ((and 
(looking-at "$") (looking-back "- " 3)) (beginning-of-line) 
(delete-region (line-beginning-position) (line-end-position))) ((and 
(looking-at "$") (looking-back "[0-9]*. " (line-beginning-position))) 
(beginning-of-line) (delete-region (line-beginning-position) 
(line-end-position))) (t (end-of-line) (org-insert-item)))) 
((org-at-heading-p) (if (not (string= "" (org-element-property :title 
(org-element-context)))) (progn (org-end-of-subtree) 
(org-insert-heading-respect-content) (outline-show-entry)) 
(beginning-of-line) (let* ((v (line-beginning-position)) (v 
(line-end-position))) (cl--set-buffer-substring v v "")))) 
((org-at-table-p) (if (-any\? (function (lambda (x) (not (string= "" 
x)))) (nth (- (org-table-current-dline) 1) (remove 'hline 
(org-table-to-lisp)))) (org-return) (beginning-of-line) (let* ((v 
(line-beginning-position)) (v (line-end-position))) 
(cl--set-buffer-substring v v "")) (org-return))) (t (org-return)))
   (if ignore (org-return) (cond ((eq 'line-break (car 
(org-element-context))) (org-return-indent)) ((or (and (eq 'link (car 
(org-element-context))) (not (eolp))) (bolp)) (org-return)) 
((org-inlinetask-in-task-p) (org-return)) ((org-at-item-checkbox-p) 
(cond ((and (eolp) (not (eq 'item (car (org-element-context))))) 
(org-insert-todo-heading nil)) ((and (eolp) (eq 'item (car 
(org-element-context)))) (let* ((v (line-beginning-position)) (v 
(point))) (cl--set-buffer-substring v v ""))) ((eq 'paragraph (car 
(org-element-context))) (goto-char (org-element-property :end 
(org-element-context))) (org-insert-todo-heading nil)) (t 
(org-return)))) ((org-in-item-p) (cond ((and (looking-at " ::") 
(looking-back "- " 3)) (beginning-of-line) (delete-region 
(line-beginning-position) (line-end-position))) ((and (looking-at "$") 
(looking-back "- " 3)) (beginning-of-line) (delete-region 
(line-beginning-position) (line-end-position))) ((and (looking-at "$") 
(looking-back "[0-9]*. " (line-beginning-position))) (beginning-of-line) 
(delete-region (line-beginning-position) (line-end-position))) (t 
(end-of-line) (org-insert-item)))) ((org-at-heading-p) (if (not (string= 
"" (org-element-property :title (org-element-context)))) (progn 
(org-end-of-subtree) (org-insert-heading-respect-content) 
(outline-show-entry)) (beginning-of-line) (let* ((v 
(line-beginning-position)) (v (line-end-position))) 
(cl--set-buffer-substring v v "")))) ((org-at-table-p) (if (-any\? 
(function (lambda (x) (not (string= "" x)))) (nth (- 
(org-table-current-dline) 1) (remove 'hline (org-table-to-lisp)))) 
(org-return) (beginning-of-line) (let* ((v (line-beginning-position)) (v 
(line-end-position))) (cl--set-buffer-substring v v "")) (org-return))) 
(t (org-return))))"

             reply	other threads:[~2018-03-15 16:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 16:24 kadal [this message]
2018-03-17  9:21 ` org-return does not work in magit's git-commit-setup-hook Nicolas Goaziou
2018-03-18 18:30   ` kadal

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=5c5b2696-22ab-9330-eaa7-ad3e94b31dca@gmail.com \
    --to=kadalcalypse@gmail.com \
    --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).