Giter VIP home page Giter VIP logo

Comments (7)

jkitchin avatar jkitchin commented on August 19, 2024

I think using visual-line-mode solves this issue, by visually wrapping the long lines.

from jmax.

eigengrau avatar eigengrau commented on August 19, 2024

Sadly, visual-line-mode fails to wrap these lines, due to the fact that there is no whitespace in between bibkeys. Making visual-line work would require the same solution as initially described, i.e., allowing whitespace between bibkeys and scanning until the closing parens of an org-mode link.

from jmax.

eigengrau avatar eigengrau commented on August 19, 2024

Hm, so it seems I can already insert whitespace between cite-keys if the cite command is wrapped in a link. This will work with visual-line-mode then. So if spaces already work, maybe you could just have the relevant regex match in multi-line mode to make hard-wrapped link lines work?

from jmax.

eigengrau avatar eigengrau commented on August 19, 2024

I’ve initially had good results with these changes:
https://gist.github.com/eigengrau/696251cb79338ce81ec7

However, for some reason this only seems to work if there are just two lines. With three, only the first two links will work; with more, only the first link works. For the non-working links, org-ref-get-bibtex-key-under-cursor seems not to be called, and some function in org-mode reports no link found. Could this be an org-mode bug? The syntax spec says all characters except [ and ] are allowed inside the link.

from jmax.

eigengrau avatar eigengrau commented on August 19, 2024

Seems to be an org-mode-bug: http://comments.gmane.org/gmane.emacs.orgmode/19919 :(

from jmax.

jkitchin avatar jkitchin commented on August 19, 2024

I use (global-visual-line-mode 1) in my init file, and it wraps the lines just fine.
2014-07-02_9-16-09

from jmax.

eigengrau avatar eigengrau commented on August 19, 2024

I don’t usually use visual-line-mode. I tought it wouldn’t wrap because I expected the virtual line-break to occur at column 80, same as when filling a paragraph, but actually it only breaks on the edge of the window. That way it works, but I prefer hard breaks, especially when sharing content. This will also nicely break between full words, then.

The method in my gist should work for multi-line links once the org-mode bug is resolved. I’ve submitted this issue to the mailing list.

One thing that might need to be added to what I posted is dealing with multi-line links during export. I was looking into this, but I discovered that org-mode only calls the export handlers with the link :path, which is currently broken for multi-line links. I hope they can get that fixed though.

from jmax.

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.