Defining Functions and Commands - Learning Emacs Lisp #3

preview_player
Показать описание
In this stream, we'll continue learning the fundamentals of Emacs Lisp by showing how to define functions and commands:

- Basic function definitions
- Function argument types (optional, rest)
- Unnamed (lambda) functions
- Invoking functions stored in variables and parameters
- Adding documentation strings
- Defining interactive functions (commands)

We'll also start working on the basic steps of the Emacs package that we'll be creating for the rest of this series!

If you enjoy this series, please consider becoming a sponsor on GitHub or Patreon:

Follow me on Twitter for more Emacs content!

Intro music: Coriolis Effect by logos feat. stefsax, licensed CC-BY
Рекомендации по теме
Комментарии
Автор

I am liking this package idea a lot. My current setup is pretty good (Stow + Emacs + Git) but its very manual, so this will probably be awesome. I am very excited for this!!

auroradraco
Автор

Amazing content. Well planned and executed. Thanks for your teachings.

diegonayalazo
Автор

0:35 - Intro
1:08 - What will we cover?
2:10 - What is a function?
4:48 - Defining a function
8:03 - Function arguments
17:48 - Documenting functions
24:12 - Functions without names
27:25 - Invoking functions
36:10 - Defining Commands
49:19 - Chat Questions (defalias)
49:58 - A real example!
1:00:04 - Chat Questions
1:01:19 - About next video
1:01:46 - Outro

wakamenod
Автор

What variable do you use for having the #+begin_src and that good stuff, the same color as the background (or i think that's how it's invisible.)

mastergamer
Автор

Apart from "eros-mode" I commented for inline evaluation, *scratch* buffer, in the previous video and in github, you can evaluate a piece of code inside your org file, say, your first example, just calling "M-x org-babel-execute-maybe" inside the begin_src end_src content. And Emacs will yield the result like so:

#+begin_src emacs-lisp

(defun do-some-math (x y)
(* (+ x 20)
(- y 10)))

(do-some-math 100 50)

#+end_src

#+RESULTS:
: 4800

Which is more elegant, IMHO

Achyles
Автор

ps: 'x is shorthand for (quote x)

FelipeBalbi
Автор

Hi! I really enjoy your channel :)
This request has nothing to do with the video
I have a problem and I don't know if you can dedicate a video to solve it
I installed company and yasnippet, but the problem is that company does not show snippets in it's popup window
I spent the entire day trying to solve this issue but no luck :-(
tried to groupe copmany backends but that did not work.

anassirizi
Автор

22:54 - Definitely Don't inDent Documentation.

mendelovitch
join shbcf.ru