本週末我顯然有一個強大的癢癢,爲我的Emacs環境增加了很多功能。我可以自己做一些基礎知識,並搜索其他內容,但是我一直無法找到解決方案(而且我自己也不夠好)。在emacs中自動轉義抽取的字符串
我經常使用HTML字符串,有時如果我將它們從一個塊移到另一個塊(或一種語言到另一個語言),字符串會被打破,而不會被轉義。所以,我想要一個這樣的功能:
(defun smart-yank-in-string()
(if (stringp) ; Check if the point is in a string
; Check if the region created from the point to the end of the yank ends the string
; (and there is more yank left that isn't ";")
; Escape quotes for those locations recursively by prepending \
; Insert result into buffer @ mark
))
任何聰明的想法?我想認爲它涉及到使用kill-new
來隱藏一個變量,並通過它,但我不熟悉elisp解決它。
你混淆刻度點看來。你能添加一個最簡單的例子嗎?或者檢查一下http://abo-abo.github.io/lispy/#sec-3-25是否是你想要的。 –
哎呀,對不起,修正了上面的問題。我的意思是說。 –