3 ms·
>>Simple, regular syntax. When I found myself desiring to add the name of the enclosing function to the start of every log string, an Emacs regexp find-replace
by fit2rule 12y ago
>>Simple, regular syntax. When I found myself desiring to add the name of the enclosing function to the start of every log string, an Emacs regexp find-replace was sufficient, whereas more complex languages would require use of a parser to achieve this.
It would be really wonderful to have a series of tutorials on this subject. It might be a good reason for me to learn to use Emacs, anyway ..
- logicchains 12y agoA good place to start is http://www.emacswiki.org/emacs/RegularExpression http://www.emacswiki.org/emacs/RegularExpression, followed by https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Re... and https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Re.... They're more references than tutorials though; unfortunately I'm not aware of any comprehensive tutorials on the subject.
- jqgatsby 12y agoIf you are already using emacs, I recommend setting regular expression find/replace as your default search mode. Ctrl-s, etc, so it becomes second nature.
- Dewie 12y agoAnother way to use search in Emacs is to go to a place that you need to edit/insert text. Instead of using the movement commands or the mouse, use forward or backwards search to search for the point you need to be at: like "(str" in "(String s) ...". I don't know if it is faster for me. But it can feel more ergonomic, since you don't have to make so much effort into going to a specific point. I'm getting better at it, though: maybe soon it will become second-nature.
- lclarkmichalek 12y agoThat way also makes writing kbd macros a lot easier