emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug in org-paste-subtree
@ 2014-06-19 12:02 Anders Johansson
  2014-07-27 23:03 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Anders Johansson @ 2014-06-19 12:02 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

The force-level check in org-paste-subtree seems to contain a small bug.

If I try to paste a subtree at the end of a line only containing some 
stars, I get an error "Wrong type argument: number-or-marker-p, nil".

The problem is (- (match-end 1) (match-end 1)) (see below)

We have no subexpression to match, it should be zero.

(force-level (cond (level (prefix-numeric-value level))
			     ((and (looking-at "[ \t]*$")
				   (string-match
				    "^\\*+$" (buffer-substring
					      (point-at-bol) (point))))
			      (- (match-end 1) (match-beginning 1)))
			     ((and (bolp)
				   (looking-at org-outline-regexp))
			      (- (match-end 0) (point) 1))))


Cheers,
Anders Johansson

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug in org-paste-subtree
  2014-06-19 12:02 Bug in org-paste-subtree Anders Johansson
@ 2014-07-27 23:03 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2014-07-27 23:03 UTC (permalink / raw)
  To: Anders Johansson; +Cc: emacs-orgmode

Hi Anders,

Anders Johansson <mejlaandersj@gmail.com> writes:

> We have no subexpression to match, it should be zero.

Indeed, thanks for reporting this and for the fix, applied.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-28 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-19 12:02 Bug in org-paste-subtree Anders Johansson
2014-07-27 23:03 ` Bastien

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