emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Edit source: fix 'end' initialisation
@ 2012-12-06 21:52 Michael Gauland
  2012-12-13 22:48 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Gauland @ 2012-12-06 21:52 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 368 bytes --]

I've been able to run org-edit-src-code just fine under NTEmacs
24.2.50.1 on Windows 7, but under GNU Emacs 23.2.1 on Debian, I got an
error:

    Wrong type argument: integer-or-marker-p, nil

With the attached patch, I've been able to run it on both systems. The
change passes (make-marker) to (copy-marker), instead of nil.

Kind Regards,
Mike Gauland


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Edit-source-fix-end-initialisation.patch --]
[-- Type: text/x-diff; name="0001-Edit-source-fix-end-initialisation.patch", Size: 1227 bytes --]

From 9aca6bb03fe92adc7198c85699b2539bc811b414 Mon Sep 17 00:00:00 2001
From: Michael Gauland <mike_gauland@stanfordalumni.org>
Date: Fri, 7 Dec 2012 10:44:09 +1300
Subject: [PATCH] Edit source: fix 'end' initialisation

* lisp/org-src.el: Create a marker to pass to copy-marker. This fixes a 'wrong
type argument' error when running org-edit-src-code (observed on Emacs 23.2.1).

The problem was that copy-marker expects a marker, and it was given nil. This
change gives it a marker that doesn't point anywhere, but still lets us set the
insertion type of the end marker.

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

diff --git a/lisp/org-src.el b/lisp/org-src.el
index 97ee8c5..ab937b8 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -230,7 +230,7 @@ buffer."
 	 (beg (make-marker))
 	 ;; Move marker with inserted text for case when src block is
 	 ;; just one empty line, i.e. beg == end.
-	 (end (copy-marker nil t))
+	 (end (copy-marker (make-marker) t))
 	 (allow-write-back-p (null code))
 	 block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
 	 begline markline markcol line col transmitted-variables)
-- 
1.7.2.5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

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

* Re: [PATCH] Edit source: fix 'end' initialisation
  2012-12-06 21:52 [PATCH] Edit source: fix 'end' initialisation Michael Gauland
@ 2012-12-13 22:48 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-12-13 22:48 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode

Hi Michael,

sorry I overlooked this patch.  It's cleaner than the solution
I committed, so I reverted my commit and applied your patch.

Thanks!

Michael Gauland <mikelygee@no8wireless.co.nz> writes:

> I've been able to run org-edit-src-code just fine under NTEmacs
> 24.2.50.1 on Windows 7, but under GNU Emacs 23.2.1 on Debian, I got an
> error:
>
>     Wrong type argument: integer-or-marker-p, nil
>
> With the attached patch, I've been able to run it on both systems. The
> change passes (make-marker) to (copy-marker), instead of nil.

-- 
 Bastien

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

end of thread, other threads:[~2012-12-13 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-06 21:52 [PATCH] Edit source: fix 'end' initialisation Michael Gauland
2012-12-13 22:48 ` 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).