(strikethrough start end): Durchstreichen in plain text mit Unicode

Ich habe letztens entdeckt, dass es einen Unicode-Modifier zum Durchstreichen gibt. Was lag also näher als eine Funktion zu schreiben, mit der ich in Plain-Text Worte durchstreichen kann?

Zum Glück macht emacs das einfach: Packt das folgende in eure .emacs, dann könnt ihr mit M-x strikethrough den aktuell markierten Text durchstreichen:

(defun strikethrough (start end)
  (interactive "r") 
  (goto-char (min start end))
  (while (< (point) (+ (max start end) (abs (- start end))))
    (forward-char)
    (insert "̶")))

Achtet darauf, die Funktion wirklich zu kopieren. Der Bindestrich ist in Wirklichkeit 0x0336, auch bekannt als COMBINING LONG STROKE OVERLAY, 822, #o1466 oder #x336. Einfach Abtippen klappt also nicht.

Wenn ihr den Strich wirklich von Hand braucht, hilft euch M-x ucs-insert 336.

Solche infos über ein Zeichen gibt euch übrigens M-x describe-key.

Nun zum Test: strike C-SPACE M-b M-x strikethrough.

Viel Spaß mit Emacs!

Use Node:

⚙ Babcom is trying to load the comments ⚙

This textbox will disappear when the comments have been loaded.

If the box below shows an error-page, you need to install Freenet with the Sone-Plugin or set the node-path to your freenet node and click the Reload Comments button (or return).

If you see something like Invalid key: java.net.MalformedURLException: There is no @ in that URI! (Sone/search.html), you need to setup Sone and the Web of Trust

If you had Javascript enabled, you would see comments for this page instead of the Sone page of the sites author.

Note: To make a comment which isn’t a reply visible to others here, include a link to this site somewhere in the text of your comment. It will then show up here. To ensure that I get notified of your comment, also include my Sone-ID.

Link to this site and my Sone ID: sone://6~ZDYdvAgMoUfG6M5Kwi7SQqyS-gTcyFeaNN1Pf3FvY

This spam-resistant comment-field is made with babcom.

Inhalt abgleichen
Willkommen im Weltenwald!
((λ()'Dr.ArneBab))



Beliebte Inhalte

Draketo neu: Beiträge

Ein Würfel System

sn.1w6.org news