Coder Social home page Coder Social logo

org-mode links become invisible about polymode HOT 3 OPEN

borwick avatar borwick commented on June 24, 2024 1
org-mode links become invisible

from polymode.

Comments (3)

yoshinari-nomura avatar yoshinari-nomura commented on June 24, 2024 1

I have the same problem with Polymode 20230317.1218 and Emacs 29.2.50.

Invoke emacs with -q option, and eval below:

(add-to-list 'load-path "~/.emacs.d/versions/29.2/elpa/polymode-20230317.1218")

(require 'polymode)

(define-innermode poly-org-innermode
  :mode 'org-mode
  :head-matcher "^[*]+ .*"
  :tail-matcher "^[^ \n\t*#]\\|\\'"
  :head-mode 'body
  :tail-mode 'host)

(define-hostmode poly-fundamental-hostmode
  :mode 'fundamental-mode)

(define-polymode poly-fundamental-mode
  :hostmode 'poly-fundamental-hostmode
  :innermodes '(poly-org-innermode))

Then creat a buffer with fundamental-mode.
Yank this text:

* 2024-01-29
  [[https://github.com/polymode/polymode][polymode]] is awesome!

M-x poly-fundamental-mode becomes:

* 2024-01-29
   is awesome!

link looks invisible. If you cut and paste the invisible text to another buffer,
polymode becomes awesome again πŸ˜„

from polymode.

borwickatuw avatar borwickatuw commented on June 24, 2024 1

FYI that works for me!

  (advice-add 'poly-org-mode
	      :before
	      (lambda () (setq buffer-invisibility-spec
		    (with-temp-buffer
		      (org-mode)
		      buffer-invisibility-spec))))

I'm sure there is a better way to do this, e.g. to figure out what's going on with buffer-invisibility-spec, but this works! Thank you @yoshinari-nomura !

from polymode.

yoshinari-nomura avatar yoshinari-nomura commented on June 24, 2024

I found that org-mode uses buffer-invisibility-spec to control the appearance of invisible text. Polymode introduces buffer-invisibility-spec from host into inner.

I think host needs to setup buffer-invisibility-spec as that of org-mode.

Eval below before M-x poly-fundamental-mode in host buffer works for me.

(setq buffer-invisibility-spec
      (with-temp-buffer
        (org-mode)
        buffer-invisibility-spec))

from polymode.

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.