emacs

Drew Verlee 2024-11-22T17:47:59.870969Z

How do you copy text between emacs and other editors such that the spacing and line breaks appear natural? What do i mean by natural? In the picture below i show what an "unnatural" copy from emacs (black area on top) and google docs (white area below) looks like. Here the second row of numbers in emacs has a column width of 80, so it goes onto the next line. Maybe that's ok, but when i copy that line into google docs, it's clearly not ok because that document has "different" rules about formatting. I'm open to ideas, the general idea is that i want to copy text around and have the formatting sync to the destination.

daveliepmann 2024-11-23T08:15:46.097309Z

Not sure if it's emacs-idiomatic but I have a couple unfill fns for this https://stackoverflow.com/questions/6707758/inverse-of-m-q-an-unfill-paragraph-function

daveliepmann 2024-11-23T08:16:52.754619Z

it works for me because I like 1. very wide buffers and 2. only some kinds of prose to wrap. the downside is that unfill is a manual step before copying to outside of emacs

onetom 2024-11-23T14:24:45.605229Z

@macroz that screen is mostly black though, so I doubt that the little green smudges made by the source code would cause the kind of calming that study was talking about :) if u want calming, have a look at the ef-spring or ef-elea-light themes https://protesilaos.com/emacs/ef-themes-pictures

Macroz 2024-11-23T14:26:14.308299Z

there is actually not a single black pixel in there

Macroz 2024-11-23T14:28:35.240909Z

but if you want to blast your eyes with extra photons all day long, even in the dark times, you can do it

πŸ˜€ 1
onetom 2024-11-23T14:36:51.247719Z

my eyes are already so blasted, i seriously thought ur background is black |-D what theme is it, btw? i like how the var names stick out!

Macroz 2024-11-23T14:56:17.816689Z

it started out as green-phosphor-theme but I've pretty much gone and changed all the colors to my liking

πŸ™ 1
Macroz 2024-11-23T14:57:51.534889Z

Big var names are a feature I've unfortunately lost for now, as I have not maintained my fork of clojure-mode which provided extra definitions. It had a similar problem as using other than monospace fonts, i.e. Emacs menus and stuff doesn't align properly. One can live with it though.

Macroz 2024-11-23T15:01:13.867249Z

here's a couple variations from this year, I've come to like using the background color

Macroz 2024-11-23T15:03:03.268169Z

describe-face and describe-text-properties are your friends if you want to customize the look

Macroz 2024-11-23T15:03:45.089629Z

(and of course M-x customize)

πŸ‘ 1
Macroz 2024-11-23T15:05:58.801449Z

I can't say Matrix the movie wasn't an inspiration, old terminals too. I grew up in the age of C-64 and Borland and both those colors tend to be rather 🀒 these days. Green is a pleasant color for myself and the anecdote about it being relaxing clinched the deal.

onetom 2024-11-23T18:05:23.948039Z

i started with B&W ZX81 and ZX Spectrum, then goldenrod color Hercules monitor, then green CGA one for personal XT machine, before we could afford B&W and colored VGA monitors. i just fired up https://github.com/Swordfish90/cool-retro-term yesterday for the sake of nostalgia :)

πŸ‘Œ 1
Macroz 2024-11-23T18:14:51.683909Z

looks nice, however I don't use terminal much at all and even then more eshell

Macroz 2024-11-23T18:15:48.307769Z

it seems to have a ton of dependencies

Drew Verlee 2025-05-14T19:46:57.591879Z

returning to this months later, copy-as-format-github from org to github just gives me this:

org
#+begin_src clojure
(when update-underlay?
  (when (filter-set "isochrones")
    (mb/set-multiple-layers-visibility! #"isochrones" false))
  (toggle-underlay! ...))
#+end_src
Which isn't the github markdown i expected.

Drew Verlee 2024-11-22T17:48:46.124489Z

picture:

Macroz 2024-11-22T17:55:32.630429Z

Generally it just doesn't work but I've sometimes had success with htmlize

phronmophobic 2024-11-22T17:55:33.455359Z

On Mac-OSX, you can do: 1. highlight text in emacs 2. M-| for shell-command-on-region 3. pbcopy to copy to clipboard There's probably a similar command to pbcopy for other OS's

2024-11-22T17:55:50.834269Z

https://doc.endlessparentheses.com/Fun/c-toggle-syntactic-indentation.html not sure if this is what you're looking for

phronmophobic 2024-11-22T17:58:48.216459Z

I'm assuming the problem is from actually copying extra whitespace and newlines, but maybe it's a different problem.

Drew Verlee 2024-11-22T18:00:54.792759Z

Thanks, I'll take a look at this. Is the 80 column idea ideal or does it make more sense to let the editor just wrap the text? I feel like the later is better but people prefer former because it means it kinda works everywhere with no effort.

Drew Verlee 2024-11-22T18:02:08.061189Z

Like i don't even know how to tell each of my frames to "visually" always wrap at 80. I just include the line break at 80.

Macroz 2024-11-22T18:02:15.555209Z

I let emacs wrap my text but in pretty much all other uses, it depends (could be short tweet, certain paragraph in paper etc.)

Macroz 2024-11-22T18:02:35.196129Z

The ideal column width is in the eye of the coder

Drew Verlee 2024-11-22T18:02:50.848199Z

When you say you let it wrap text, do you mean you set a column width?

Macroz 2024-11-22T18:03:19.414389Z

no, I mean Emacs wraps depending on the size of the window

Macroz 2024-11-22T18:03:21.545199Z

dynamically

Macroz 2024-11-22T18:03:32.079809Z

I adjust font-size and window width all the time

Macroz 2024-11-22T18:04:05.385889Z

is it called visual-line-mode or what

Macroz 2024-11-22T18:04:13.629589Z

it wraps the text dynamically

Macroz 2024-11-22T18:04:58.338309Z

but let's say I want to put some code in a presentation slide ... the situation is completely different and I probably must massage it manually, even shorten some variable names etc.

Macroz 2024-11-22T18:12:53.170889Z

here's a random screenshot of what my Emacs tends to look like

🍏 2
Macroz 2024-11-22T18:13:16.190719Z

not the best example of this πŸ™‚

Drew Verlee 2024-11-22T18:39:07.093669Z

Did you know the human eye can detect more shades of green than any other?

Macroz 2024-11-22T18:39:38.037629Z

according to some study, green is the most relaxing color

πŸ‘ 1
Drew Verlee 2024-11-22T18:41:41.315799Z

I practice hdd: Hate driven development. So i go with all red.

πŸ˜„ 2
ag 2024-11-22T18:52:35.364429Z

green is the most relaxing colorNot the bright green like yours though. Muted shades of green and blue considered the most relaxing. Bright colors are rather more stimulating and less calming.

Drew Verlee 2024-11-22T19:12:31.537129Z

i turned off color except on the form my cursor is in. I find too much color distracting.

Macroz 2024-11-22T19:46:13.699739Z

I keep my colors as pleasant as I can, summer colors, I also find too much color distracting

Macroz 2024-11-22T19:46:38.773879Z

desaturating the colors a bit would be nice but I haven't bothered

Akiz 2024-11-22T20:44:47.680199Z

This might be usefull as well https://github.com/sshaw/copy-as-format

peterh 2024-11-24T17:52:35.819349Z

For me it is also a two-step process: remove the linebreaks and then copy. For the first step, I found this command really helpful: https://www.emacswiki.org/emacs/UnwrapLine I removed the last 3 forms so it doesn’t insert a newline and keeps the cursor from jumping to the original position. Helps me to repeat the command quickly for the next paragraphs. When I write a lot of prose text, I’d rather use visual-line-mode , which wraps by word boundary and preserves hard line-breaks (similar to normal word processors).