Code Monkey home page Code Monkey logo

Comments (5)

lane-s avatar lane-s commented on June 5, 2024 1

That was right! I changed oi-collect-outlines to return the cdr of the list it was returning before and then it worked.

I'm not sure how that nil is getting there to begin with though.

Can't stress enough how nice this is for organizing and navigating my spacemacs config among other things.

from .spacemacs.d.

ekaschalk avatar ekaschalk commented on June 5, 2024

Try running oi-collect-outlines anywhere in the buffer and also oi--collect-outline on a line containing an outline and tell me their output. I think the marker isn't being consed, so it doesn't know where to jump.

I also don't understand why (_ . marker) is used.

Dash's -lambda is destructuring the input, namely a cons cell. The cdr is the marker we jump to. We don't need the name, namely the _, when jumping.

Glad you like the idea of outline-ivy. It is a package I've come used to having, I find it pretty practical.

I've dumped all my work in this lib. I've considered separate repos through git submodules but haven't gotten around it.

from .spacemacs.d.

lane-s avatar lane-s commented on June 5, 2024

Here's the output from oi-collect-outlines

(nil (#("1Config" 0 1 (invisible t) 1 7 (face oi-face-1)) . #<marker at 146 in outline-ivy.el>) (#("1Utils" 0 1 (invisible t) 1 6 (face oi-face-1)) . #<marker at 680 in outline-ivy.el>) (#("1Outline Jump" 0 1 (invisible t) 1 13 (face oi-face-1)) . #<marker at 2531 in outline-ivy.el>) (#("1Binding" 0 1 (invisible t) 1 8 (face oi-face-1)) . #<marker at 3624 in outline-ivy.el>))

Here's the output from oi--collect-outline on a header line

Debugger entered--Lisp error: (args-out-of-range #<buffer outline-ivy.el> 0 0)
  buffer-substring-no-properties(0 0)
  match-string-no-properties(1)
  (let* ((level (outshine-calc-outline-level)) (parents (when level (--map (plist-get oi--parents-plist it) (number-sequence 1 (- level 1))))) (str (match-string-no-properties 1)) (name (oi-format-name-pretty str parents level))) (when level (setq oi--parents-plist (plist-put oi--parents-plist level str))) (->> (point-marker) (cons name) (when level)))
  (-let* ((level (outshine-calc-outline-level)) (parents (when level (--map (plist-get oi--parents-plist it) (number-sequence 1 (- level 1))))) (str (match-string-no-properties 1)) (name (oi-format-name-pretty str parents level))) (when level (setq oi--parents-plist (plist-put oi--parents-plist level str))) (->> (point-marker) (cons name) (when level)))
  (save-excursion (beginning-of-line) (-let* ((level (outshine-calc-outline-level)) (parents (when level (--map (plist-get oi--parents-plist it) (number-sequence 1 (- level 1))))) (str (match-string-no-properties 1)) (name (oi-format-name-pretty str parents level))) (when level (setq oi--parents-plist (plist-put oi--parents-plist level str))) (->> (point-marker) (cons name) (when level))))
  oi--collect-outline()
  eval((oi--collect-outline) nil)
  elisp--eval-last-sexp(nil)
  #f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'.  With a prefix argument of zero,\nhowever, there is no such truncation.  Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d461f>)(nil)
  #f(compiled-function (&rest _it) #<bytecode 0x453f7fb9>)()
  eval-sexp-fu-flash-doit-simple(#f(compiled-function (&rest _it) #<bytecode 0x453f7fb9>) #f(compiled-function (&rest args2) #<bytecode 0x4600f639>) #f(compiled-function (&rest args2) #<bytecode 0x4600f659>))
  eval-sexp-fu-flash-doit(#f(compiled-function (&rest _it) #<bytecode 0x453f7fb9>) #f(compiled-function (&rest args2) #<bytecode 0x4600f639>) #f(compiled-function (&rest args2) #<bytecode 0x4600f659>))
  esf-flash-doit(#f(compiled-function (&rest _it) #<bytecode 0x453f7fb9>) #f(compiled-function (&rest args2) #<bytecode 0x4600f639>) #f(compiled-function (&rest args2) #<bytecode 0x4600f659>) #f(compiled-function (&rest args2) #<bytecode 0x4600f679>))
  ad-Advice-eval-last-sexp(#f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'.  With a prefix argument of zero,\nhowever, there is no such truncation.  Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d461f>) nil)
  apply(ad-Advice-eval-last-sexp #f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'.  With a prefix argument of zero,\nhowever, there is no such truncation.  Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d461f>) nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

The destructuring makes sense. I think I'm starting to understand how it's supposed to work. oi-collect-outlines should return a list of cons cells with the outline name as the first element and the outline marker as the second element. But currently only the name is being passed in to the action.

from .spacemacs.d.

ekaschalk avatar ekaschalk commented on June 5, 2024

Pretty sure it's that initial nil, try getting rid of that or doing something like lambda (name-marker) (when name-marker (let ((marker (cdr name-marker)) ....) in the oi-jump. Not at my PC today.

from .spacemacs.d.

ekaschalk avatar ekaschalk commented on June 5, 2024

Reopening this issue, the recent updates made to outshine were the cause.

I'll be fixing this shortly.

from .spacemacs.d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.