Write Everything In Emacs Org Mode? You NEED This Plugin!

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 73

  • @Danielddiniz
    @Danielddiniz 2 роки тому +16

    DT is being so much productive with videos recently! So much great content! Thanks DT

  • @nabarunr3
    @nabarunr3 2 роки тому +3

    This is such a perfectly timed video for me I can't even....
    It was just YESTERDAY I started using org-babel-tangle for programming. I needed to think for a second to press the default bindings for tangle. Seems like I do not need that anymore!
    Thanks DT!

  • @flip4119
    @flip4119 2 роки тому +7

    I love the Emacs content DT. Is the best on your channel imo.

  • @Zakaros1000
    @Zakaros1000 2 роки тому +7

    I was persuaded to learn a bit of Org Mode by you when I see how you organized your config files, and I wanted to do the same with my html,css, javascript files, now that I-m learning web development. Now everything is easier to organize and keep track of what I was learning the day before o several days before. I don-t have the large chunk of code, instead I have one html, css and javascript files with foldable bullets for whatever they are mean to, and links among several related sections of those files. Everything is easier to track. Several months ago I was learning too, but because I let id for a while when I returned everything looked like a mess and a whole chunk of code hard to follow that require me to make a hella debug to see what everything was about, and the comments where hard to read and because of not being foldable the different sections it was well, I just give up on that xD. note: Btw don-t try to do just one large org file of front end divided in different things, it-s just a horrible Idea and the benefits of the foldable bullets are vanished in that situation. Another bad idea is to use org/mode to automate the creation of the html files, those hella names.... lol are okay for a blog but for large projects emmm nope. instead use it to organize your file and create a nice documentation.

  • @auroradraco9974
    @auroradraco9974 2 роки тому +26

    I have added org-babel-tangle to the after-save-hook so didn't know of this. I assume this is what that package does as well. Its definitely a necessary add if you tangle stuff often.

    • @Syncratci
      @Syncratci 2 роки тому +8

      To be honest, I don't really understand the point of this package. That after-save-hook is literally 1 line of code and you can have it set for all org files or for only specific ones with local variables.

    • @jotix2570
      @jotix2570 2 роки тому +4

      yes, is literaly shorter to use after-save-hook... totally pointless this plugin

    • @nabarunr3
      @nabarunr3 2 роки тому +3

      Just tried adding the after-save-hook. It's just: (add-hook 'after-save-hook 'org-babel-tangle) and it works just perfect.

    • @Syncratci
      @Syncratci 2 роки тому +9

      Looking through the actual code, I guess the actual value proposition is that the tangling is asynchronous. I guess that could appeal to someone with an insanely large org file where tangling takes a while.

    • @predragmiletic3078
      @predragmiletic3078 2 роки тому +3

      of course.. but these youtubers have no idea how emacs works so they need "packages" for everything. this was an awful video.

  • @haidermirza192
    @haidermirza192 2 роки тому +2

    I had packaged this a few months ago for the Guix operating system/ package manager.

  • @SouProds
    @SouProds 2 роки тому

    I was so impressed by your config files, I was inspired to go make my own using Org mode in Emacs, but didn't know how to make it write to my actual config file, this helped a ton!

  • @hermannpaschulke1583
    @hermannpaschulke1583 2 роки тому +5

    This is known as literate programming, invented by Donald Knuth iirc. The original TeX source code was written this way.

  • @AeriaVelocity
    @AeriaVelocity 2 роки тому +11

    I usually just use Org mode to write up college work and convert to PDF through LaTeX, but this looks pretty useful, maybe I'll end up using it at some point. Side note: I need to start experimenting with Elisp.

    • @erikgiorgis2335
      @erikgiorgis2335 2 роки тому +2

      I mostly use it for my doom emacs config, so I can have a single file that outputs code snippets to init.el config.el and package.el

    • @drishalballaney
      @drishalballaney 2 роки тому +1

      you can also directly export from org to pdf using C-c C-e and then select to which format you want to export to
      edit nvm it does not support directly exporting to pdf lol

    • @AeriaVelocity
      @AeriaVelocity 2 роки тому +1

      @@drishalballaney Yeah, but I typically just convert to LaTeX and then convert to PDF using MiKTeX, because my college's computers all have Windows, unfortunately, which for some reason the direct export doesn't work on :/

    • @drishalballaney
      @drishalballaney 2 роки тому

      @@AeriaVelocity rather you can export to html instead, that is a lot more portable :P

    • @AeriaVelocity
      @AeriaVelocity 2 роки тому

      @@drishalballaney Sure, but my college doesn't accept HTML documents XD

  • @aritraranjanchowdhury1412
    @aritraranjanchowdhury1412 2 роки тому +2

    Can I write Mathematical expression in Org mode ?

  • @MichaelWilliams-lr4mb
    @MichaelWilliams-lr4mb 2 роки тому +2

    Can Emacs do time travel? I need to go back in time and make a few different decisions.

  • @gflorin7761
    @gflorin7761 Рік тому

    Hey, DT! What do you think of org-roam? Would love to see a video on this!

  • @QQ-gn7tc
    @QQ-gn7tc 2 роки тому +1

    Is it possible to get linting to work within Code blocks inside Org document ? Linting for Haskell as example ?. Thanks a lot DT.

  • @valizeth4073
    @valizeth4073 2 роки тому +2

    Is there a possibility to enable lsp-like features in org? Cause when I'm modifying my emacs config through a regular elisp file I get not only syntax highlights but also proper suggestions and linting, but I'm not in org mode.

    • @danieldoherty5034
      @danieldoherty5034 9 місяців тому

      Use indirect buffers. In a source block, type C-c '. It puts the block in an elisp-mode buffer. When done, type C-c ' again.

  • @TrueWordsOfEternity
    @TrueWordsOfEternity 2 роки тому +2

    if you did not know you can use this line inside of the init.el and it will read that org file without ever needing to tangle it this is what i use :)
    `(org-babel-load-file (expand-file-name "README.org" user-emacs-directory))`

  • @johannesjoseph823
    @johannesjoseph823 2 роки тому

    I started to watch more of your org mode videos. I write a lot of technical documentation and reference materials in French and German. How can I add spellcheck capabilities for org mode in those languages? Currently I only see autosuggestions for English

  • @drishalballaney
    @drishalballaney 2 роки тому

    pro tip: you just need a 4 line function in your config to automatically tangle currently open file :P

  • @noferblatz
    @noferblatz 2 роки тому +19

    Here's the problem with an ORG mode README. If I'm looking at the README for a project, I don't want to page through endless pages of code. I just want to see what the package does and other documentation details. Interspersing code with the documentation is a bad idea. Works for you, but not for other people.

    • @alt2458
      @alt2458 2 роки тому +10

      But having the documentation and the code example in the same place helps a lot not only to follow along, but also to use as a template for our own purpose.

    • @overclucker
      @overclucker 2 роки тому +1

      I hate complicated readmes. Sometimes I'll make it 3/4ths of the way through before realizing the project doesn't do what I need.

    • @undefinednull5749
      @undefinednull5749 Рік тому +3

      ​@@overclucker This doesn't negate the superiority of the org format. It's just a shortcoming of people who don't include such a summary at top of file.

    • @minamur
      @minamur Рік тому

      the real problem is that actually, no one asked your opinion.

    • @amadocabrera5007
      @amadocabrera5007 Рік тому +4

      I understand what you say, you don't always want to have both source code and documentation in the same file. But in my opinion you can keep having a sepparate file to make simpler documentation and the org file with a better detailed one. 😋

  • @mustafaakillll
    @mustafaakillll 2 роки тому

    Hey DT, which wm are you using??

  • @DangerSepp
    @DangerSepp 2 роки тому +4

    Now I want bi-directional auto-tangle. Can Emacs do that? 😁

    • @DistroTube
      @DistroTube  2 роки тому +2

      Since "tangle" is an org-specific program, I would assume that it wouldn't work going the other way (from a non-Org file to the Org file) since you would not be in Org Mode.

    • @theodorealenas3171
      @theodorealenas3171 2 роки тому

      Can I link a file?
      Similar to how I can link an image in markdown.
      So only it's path is in the org file, but the org viewer actually displays me the contents. And perhaps Emacs would let me modify them as well.
      Because markdown shows images but if you look at what's in the markdown file, there's no image data.

    • @flip4119
      @flip4119 2 роки тому

      @@theodorealenas3171 yes you can. by default inline images aren't shown in doom emacs i think though, and need to change that or open each image in an org file, but they are inline.

    • @theodorealenas3171
      @theodorealenas3171 2 роки тому

      @@flip4119 Ok that's interesting. Although I meant if I can link a text file in org, similar to linking images in markdown. If I can do what DT did here, but without putting the text data in the org document itself. If an org document can display contents of text files, with inlining as you called it.

  • @eriklundstedt9469
    @eriklundstedt9469 2 роки тому +1

    Alacritty/wezterm, automatic config reload and the fact that I sometimes work on multiple functions simultaneously and often introduce crashes while wanting to save for security or gitsync, this is a fairly bad idea
    Plus, I just wrote all my configuration in lisp nowadays (a dialect called fennel if anyone is interested) and prefer removing a step, I also prefer working with modules which makes everything a lot more readable and manageable

    • @brickviking667
      @brickviking667 2 роки тому

      One thing I learned a while ago: don't axe "production code", check that your new code works first, then you can simply copy over. Yes, it's an extra step to make sure that you diff the two, but it pays off. Generally, you can :tangle filename-new.ext and diff filename.ext with filename-new.ext to make sure the changes make sense to you.

  • @hexisXz
    @hexisXz 2 роки тому +1

    I just had an idea what if you make a video about you building the os that is the opposite of your os like for example i like xmonad with the alacritty terminal running the bash shell and doom emacs as my text editor so my opposite would be i3 running kitty as the terminal and fish as the shell then atom as the text editor so you should do something like that it would be all the things you dislike or all of the programs that are the opposite to the ones you use it would be cool

    • @wumi2419
      @wumi2419 2 роки тому

      It probably would be Windows )

  • @muddyexport5639
    @muddyexport5639 2 роки тому +1

    Yet another just like the others!
    #just-a-thought; #Idea_for_follow-up:
    Add the line to the "Org" scripts using a BASH file with standard GNU tools -- like one of the previous vids. Real world imiplementation.

  • @theodorealenas3171
    @theodorealenas3171 2 роки тому +1

    Nice! I want to mention that there's a program,
    inotifywait I think, which can execute commands whenever a file is changed.
    So you could have used that to execute some tangling script I suppose.
    And if you know how to use it you can automate anything that should happen upon file/directory modification.
    Actually I'm sure you knew about it so how come?

    • @user-he4ef9br7z
      @user-he4ef9br7z 2 роки тому

      How is it any different from entr?

    • @theodorealenas3171
      @theodorealenas3171 2 роки тому

      @@user-he4ef9br7z I don't know. I've barely seen how inotifywait works.

  • @armandfavrot3210
    @armandfavrot3210 Рік тому

    Inspiring

  • @yuvanmichael
    @yuvanmichael 2 роки тому

    WOW! 381 UPDATES!!!

  • @itsfish8672
    @itsfish8672 2 роки тому +1

    Not a Emacs user but GVDT.

  • @samwdp
    @samwdp 2 роки тому

    org-babel-tangle writes the org file as well as tangling it

  • @zeocamo
    @zeocamo 2 роки тому

    DT if you like Emacs Org-mode then you will love Norg-mode in Neovim, it is org-mode done the right way, fair wraning if you try it, you will stop using Emacs org-mode.. it is so much better

    • @matsmcmats
      @matsmcmats 2 роки тому +1

      yeah, the me-too copy is probably surperior :P

  • @rashie
    @rashie 2 роки тому

    👍👍

  • @emvdl
    @emvdl 2 роки тому +2

    elisp -> after-save-hook

  • @END90210
    @END90210 2 роки тому +2

    First

  • @m4rt_
    @m4rt_ 2 роки тому

    he he, I saw myself 1:35

  •  2 роки тому +2

    05:44 Can Emacs get me a girlfriend?

    • @yuliusseraph4973
      @yuliusseraph4973 2 роки тому +1

      It can help! Org is amazing for productivity and self-improvement, which always translates into someone being attracted to you.

    •  2 роки тому

      @@yuliusseraph4973 I wasn't expecting an answer, but it actually makes sense hahahah.

  • @aehjr1
    @aehjr1 2 роки тому +1

    You don't have to add a package to auto tangle your org file. A simple local variable can do the same thing. I have the following in my Emacs config org document, which every time I save it asks me if I want to tangle the file. I like to have choices, hehe.
    Local Variables:
    eval: (add-hook 'after-save-hook (lambda ()(if (y-or-n-p "Tangle?")(org-babel-tangle))) nil t)
    End:

    • @aehjr1
      @aehjr1 2 роки тому

      I should have added, nothing else is needed in the org doc, and that the Local Variables block is placed at the END OF THE FILE.

    • @theodorealenas3171
      @theodorealenas3171 2 роки тому

      Replacing packages with simple scripts is my favourite mindset. I use a simple vim macro for bracket completion. It's expandable