2

When I try to paste a text from a web page inside Emacs I get this "-" between words. Here is one example:

enter image description here

Is there a way to get rid of this (don't know the term..) ?

Aus Sicht vie­ler Deut­scher ist Russ­land ein rät­sel­haf­tes Land. Ich habe elf Jah­re lang von dort für den SPIEGEL be­rich­tet, bis Ende 2009. Bis heu­te ver­fol­ge ich die Ent­wick­lung in dem Land, das ich je­des Jahr be­su­che.

2
  • 1
    This is most likely a soft hyphen inserted for browsers to hyphenate the text correctly. Put point on it and use M-x describe-char to verify that. – wasamasa Dec 27 '20 at 12:35
  • What @wasamasa said. Apply that info to the answer provided about replacing. (But you might also want to find out if there's a way to prevent this happening in the first place.) – Drew Dec 27 '20 at 19:13
2
(query-replace-regexp (format "\\b%c\\b" 173) "" )

or in interactive mode

C-M-% \bC-x 8 RET ad RET \b RET RET

the sequence `C-x 8 RET ad RET' is for generate the SOFT HYPHEN char (#xad =#173).

5
  • @gigair, unfortunately this doesn't seem to work – Enrico Pirani Dec 27 '20 at 23:32
  • Yes, because the dash in the answer isn't the same as the dash in your text. Copy-paste it from the text into the replacement part of either part of the answer. – wasamasa Dec 28 '20 at 1:37
  • @Enrico Pirani. Posting text as an image isn't really a good idea. You should have provided the message text as text. – gigiair Dec 28 '20 at 5:10
  • @gigiair if I post the text (copy paste from Emacs) the soft hyphen will disappear. The same happens when I paste in other program like TextEdit or Pages ... anyway this the text. – Enrico Pirani Dec 28 '20 at 7:01
  • You can post verbatim using a pastebin. ix is an Emacs extension to do so. This is an example : ix.io/2K4F – gigiair Dec 28 '20 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.