biviosoftware / home-env

MIT License
2 stars 2 forks source link

copy and paste with indentation #79

Closed e-carlin closed 1 year ago

e-carlin commented 1 year ago

Indentation gets messed up when I copy and paste (through OS clipboard) into an emacs buffer. For example, copy the following and paste into *scratch*.

      devbox:
        docker_image: radiasoft/sirepo-devbox:alpha
        guest_d: /some/dir
        ssh_service_port_difference: 1
        users:
          userA: 8888

I get

devbox:
docker_image: radiasoft/sirepo-devbox:alpha
guest_d: /some/dir
ssh_service_port_difference: 1
users:
          userA: 8888

Does this happen to anyone else? Does anyone have a workaround?

robnagler commented 1 year ago

I think It depends on where you copy from. I've seen it screw up from GitHub on the web or other websites where the indentation is done by CSS not actual spaces.

Also *scratch* is probably not the best place for this, because it uses lisp indentation. I do this in a shell buffer:

$ cat > /dev/null
<paste here>
C-c C-c

Fundamental mode has some auto-indentation, too.

e-carlin commented 1 year ago

Ok thanks.

cat > /dev/null seems to do what I want. I'll use that.