Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] IndexDefect: index 3 not in 0 .. 2 #20

Open
madorian opened this issue Feb 4, 2023 · 6 comments
Open

[ERROR] IndexDefect: index 3 not in 0 .. 2 #20

madorian opened this issue Feb 4, 2023 · 6 comments

Comments

@madorian
Copy link

madorian commented Feb 4, 2023

Any way to have a better way of understanding why it can't parse the file?

This error is not very helpful

 [ERROR] IndexDefect: index 3 not in 0 .. 2
@kaushalmodi
Copy link
Member

Can you please post a reproducible example?

@madorian
Copy link
Author

madorian commented Feb 5, 2023

Well, that's a problem, cause it's my 500 line org-mode file and it contains some secrets, but can't the program say anything about where it has problems, like what line number, etc?

@madorian
Copy link
Author

madorian commented Feb 7, 2023

I have to bisect the file?

@kaushalmodi
Copy link
Member

I should be able to output the line number of the Org file when that unhandled exception happens, but I don't have that mechanism in place. When I fix this, I'll look into adding that feature.

I have to bisect the file?

That's the easiest way. Keep on commenting out your file in half until you stop getting that exception. Then uncomment in halves again until you reproduce this exception.

@madorian
Copy link
Author

madorian commented Feb 8, 2023

ok, here's a reproducible;)

* emacs
#+property: header-args :tangle yes
#+INCLUDE: early-init.el src emacs-lisp
#+INCLUDE: init.el src emacs-lisp

***** word
https://www.emacswiki.org/emacs/CopyWithoutSelection
#+begin_src elisp
    (defun get-point (symbol &optional arg)
      "get the point"
      (funcall symbol arg)
      (point)
      )

    (defun copy-thing (begin-of-thing end-of-thing &optional arg)
      "copy thing between beg & end into kill ring"
      (save-excursion
	(let ((beg (get-point begin-of-thing 1))
	      (end (get-point end-of-thing arg)))
	  (copy-region-as-kill beg end)))
      )

    (defun paste-to-mark(&optional arg)
      "Paste things to mark, or to the prompt in shell-mode"
      (let ((pasteMe
	     (lambda()
	       (if (string= "shell-mode" major-mode)
		   (progn (comint-next-prompt 25535) (yank))
		 (progn (goto-char (mark)) (yank) )))))
	(if arg
	    (if (= arg 1)
		nil
	      (funcall pasteMe))
	  (funcall pasteMe))
	))

    ;; now copy the god damn word
    (defun copy-word (&optional arg)
      "Copy words at point into kill-ring"
      (interactive "P")
      (copy-thing 'backward-word 'forward-word arg)
      ;;(paste-to-mark arg)
      )

  (define-key my-mode-map (kbd "C-M-w c") 'copy-word)
#+end_src






@madorian
Copy link
Author

Any idea what this could be?;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants