![]() (string-prefix-p "bull" "bulldozer") optional ignore case argument too => "bc" starts-with and ends-with predicates ![]() The TO argument is optional: (substring "abcdefg" -3)īuffers: ( with-temp-buffer (insert "abcdefg") (buffer-substring 2 4)) While it is quite common in other programming languages to work on strings contained in variables, in Emacs it is also common to work on text in buffers. => t nil prior to Emacs 23 Strings vs buffer text => t nil prior to Emacs 23 (eq "" (propertize "" 'face 'italic)) => t nil prior to Emacs 23 (eq "" (purecopy "")) => t ` string-empty-p' was added in 24.4.Īs a (very minor) space and performance optimization, starting with Emacs 23, Emacs keeps an interned copy of the empty string as a single object (eq "" "") The empty string (zero-length string, null string, …): (string-equal "" "") Should this page grow too large, we’ll split it up later. ![]() Just link to more elaborate pages when appropriate. ![]() There’s going to be some overlap with Categor圜ode, obviously. These recipes should be pastable into the *scratch* buffer so that users can hit ‘C-j’ and evaluate them step by step. It would be helpful to have here in one spot. For every task addressed, a worked-out solution is presented as a short, focused, directly usable piece of code.Īll this stuff can be found elsewhere, but it is scattered about in libraries, manuals, etc. This page contains snippets of code that demonstrate basic EmacsLisp programming operations in the spirit of the O’Reilly cookbook series of books. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |