emacs/var/elfeed/db/data/0c/0c97aa3d80d95a00e674ddf119a18e543c90b889
2022-01-03 12:49:32 -06:00

1 line
2.6 KiB
Plaintext

<p><img src="https://thumbnails.lbry.com/J7d2LmivyyM" width="480" alt="thumbnail" title="Reading and Writing Buffers in Practice - Learning Emacs Lisp #5" /></p>In this video, we'll work on a practical example of writing Emacs Lisp to read and write contents of buffers! We continue the work on our dotfiles management package, now called "dotcrafter.el", to add the ability to extract all tangled configuration paths from our Org Mode files and then write out those paths to the '.gitignore' file of the dotfiles repository.<br /><br />We cover the following topics:<br /><br />- 0:00 Intro<br />- 0:38 Why learn about buffers?<br />- 2:15 What will we learn?<br />- 5:12 What is a buffer?<br />- 7:01 Getting the "current" buffer<br />- 8:02 Getting a buffer by name<br />- 9:41 Changing the current buffer<br />- 10:37 Changing the current buffer safely!<br />- 13:55 Working with file buffers<br />- 17:36 Example: Getting the buffers for our configuration Org files<br />- 20:38 Loading a file into a buffer<br />- 22:27 Example: Getting or creating the Org file buffer<br />- 24:44 What's the point?<br />- 28:21 Moving the point<br />- 32:45 Preserving the point<br />- 33:41 Examining buffer text<br />- 36:26 The Thing (thing-at-point)<br />- 39:45 Searching for text<br />- 43:24 Example: Finding Org code block output paths<br />- 50:02 Inserting text<br />- 52:00 Example: Updating the .gitignore file<br />- 57:31 Deleting text<br />- 58:31 Saving a buffer<br />- 59:09 Example: Cleaning up and saving the .gitignore file<br />- 1:00:35 What's next?<br />- 1:01:50 Sponsors and outro<br /><br />The package code from this episode can be found here:<br />https://github.com/daviwil/dotcrafter.el/blob/8d507eda31e08a789c38a5d729866eb4cda6abaf/dotcrafter.el<br /><br />The show notes can be found here: https://github.com/daviwil/emacs-from-scratch/blob/master/show-notes/Emacs-Lisp-05.org<br /><br />My Emacs configuration: https://github.com/daviwil/dotfiles/blob/master/Emacs.org<br /><br />If you enjoy this series, please consider becoming a sponsor on GitHub or Patreon:<br /><br />- https://github.com/sponsors/daviwil<br />- https://patreon.com/SystemCrafters<br /><br />You can also leave a tip via PayPal: https://paypal.me/daviwil<br /><br />Follow me on Twitter for more Emacs content!<br />https://twitter.com/SystemCrafters<br /><br />Chat with the System Crafters community on Discord: https://discord.gg/yVD8Gx6<br /><br />Intro music: Coriolis Effect by logos feat. stefsax, licensed CC-BY<br />http://ccmixter.org/files/mseq/26296<br />...<br />https://www.youtube.com/watch?v=J7d2LmivyyM