Groups | Search | Server Info | Login | Register
Groups > gnu.emacs.help > #61012
| Path | csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Manuel Giraud <manuel@ledu-giraud.fr> |
| Newsgroups | gnu.emacs.help |
| Subject | Re: copying enriched text with soft breaks as space |
| Date | Sun, 23 Mar 2025 17:34:12 +0100 |
| Organization | A noiseless patient Spider |
| Lines | 31 |
| Message-ID | <87wmcfln97.fsf@ledu-giraud.fr> (permalink) |
| References | <jpkh63mnzks.fsf@panix5.panix.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Date | Sun, 23 Mar 2025 17:34:13 +0100 (CET) |
| Injection-Info | dont-email.me; posting-host="0e88618fbb22316398baf6d1fc29f90c"; logging-data="2895639"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18omR13J3mkyWsoJSNKT0JX" |
| User-Agent | Gnus/5.13 (Gnus v5.13) |
| Cancel-Lock | sha1:ozO6hl6scEE011Ucl6kSqZe7jIk= sha1:fILwrByK4LGZhsBM2qdrkU1gEVA= |
| Xref | csiph.com gnu.emacs.help:61012 |
Show key headers only | View raw
Mike Small <smallm@panix.com> writes: > Hello, > > Is there any built in way in GNU emacs or an existing extension to allow > one to copy lines of text from a buffer that is in enriched text mode so > that the soft newlines get copied to the X primary selection or > clipboard as spaces? > > When editing text locally, before pasting it into a web form, I find it > convenient to use autofill in emacs. But when it comes time to paste > what I've written to the web form I usually want to remove the newlines > within paragraphs to allow the page's scripting to take over the > filling. I'd hoped that using enriched text mode and only using its soft > newline feature would provide a more automatic way to achieve what I > want than manually joining lines before copying. Maybe it would be > simple to program it, but I wanted to check if something already exists > first. Hi, It seems that the following could work for your need: --8<---------------cut here---------------start------------->8--- (defun +remove-returns (text) (mapcar (lambda (x) (subst-char-in-string ?\n ?\s x)) text)) (advice-add 'gui-select-text :filter-args #'+remove-returns) --8<---------------cut here---------------end--------------->8--- -- Manuel Giraud
Back to gnu.emacs.help | Previous | Next — Previous in thread | Next in thread | Find similar
copying enriched text with soft breaks as space Mike Small <smallm@panix.com> - 2025-03-21 12:00 -0400 Re: copying enriched text with soft breaks as space Manuel Giraud <manuel@ledu-giraud.fr> - 2025-03-23 17:34 +0100 Re: copying enriched text with soft breaks as space Charles Dagny <1800@DEV.NULL> - 2025-03-21 16:59 -0300
csiph-web