home.social

#emacstip — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #emacstip, aggregated by home.social.

  1. so, i managed to figure out how to include my Emacs config in the website without actually having it on the website. probably a bit hacky but in my publish.el i have:

    ;; retrieve literate emacs config from it's git repo
    (if (file-exists-p "configuration.org")
    (delete-file "configuration.org"))
    (url-copy-file "https://git.sr.ht/~peregrinator/.emacs.d/blob/main/configuration.org" "configuration.org")

    and then I include that in the empty Org file in my content sources as:

    #+title: Literate Emacs Configuration

    #+include: "../../configuration.org" :lines "8-"

    so that the last metadata line (i.e. date) is also included along with the rest of the content

    #Emacs #OrgMode #EmacsTip

  2. so, i managed to figure out how to include my Emacs config in the website without actually having it on the website. probably a bit hacky but in my publish.el i have:

    ;; retrieve literate emacs config from it's git repo
    (if (file-exists-p "configuration.org")
    (delete-file "configuration.org"))
    (url-copy-file "https://git.sr.ht/~peregrinator/.emacs.d/blob/main/configuration.org" "configuration.org")

    and then I include that in the empty Org file in my content sources as:

    #+title: Literate Emacs Configuration

    #+include: "../../configuration.org" :lines "8-"

    so that the last metadata line (i.e. date) is also included along with the rest of the content

    #Emacs #OrgMode #EmacsTip

  3. so, i managed to figure out how to include my Emacs config in the website without actually having it on the website. probably a bit hacky but in my publish.el i have:

    ;; retrieve literate emacs config from it's git repo
    (if (file-exists-p "configuration.org")
    (delete-file "configuration.org"))
    (url-copy-file "https://git.sr.ht/~peregrinator/.emacs.d/blob/main/configuration.org" "configuration.org")

    and then I include that in the empty Org file in my content sources as:

    #+title: Literate Emacs Configuration

    #+include: "../../configuration.org" :lines "8-"

    so that the last metadata line (i.e. date) is also included along with the rest of the content

    #Emacs #OrgMode #EmacsTip

  4. so, i managed to figure out how to include my Emacs config in the website without actually having it on the website. probably a bit hacky but in my publish.el i have:

    ;; retrieve literate emacs config from it's git repo
    (if (file-exists-p "configuration.org")
    (delete-file "configuration.org"))
    (url-copy-file "https://git.sr.ht/~peregrinator/.emacs.d/blob/main/configuration.org" "configuration.org")

    and then I include that in the empty Org file in my content sources as:

    #+title: Literate Emacs Configuration

    #+include: "../../configuration.org" :lines "8-"

    so that the last metadata line (i.e. date) is also included along with the rest of the content

    #Emacs #OrgMode #EmacsTip

  5. so, i managed to figure out how to include my Emacs config in the website without actually having it on the website. probably a bit hacky but in my publish.el i have:

    ;; retrieve literate emacs config from it's git repo
    (if (file-exists-p "configuration.org")
    (delete-file "configuration.org"))
    (url-copy-file "https://git.sr.ht/~peregrinator/.emacs.d/blob/main/configuration.org" "configuration.org")

    and then I include that in the empty Org file in my content sources as:

    #+title: Literate Emacs Configuration

    #+include: "../../configuration.org" :lines "8-"

    so that the last metadata line (i.e. date) is also included along with the rest of the content

    #Emacs #OrgMode #EmacsTip

  6. #EmacsTip: Want to remove the Nth element from a list? Just do (pop (nthcdr N LIST)).

    #Emacs #EmacsLisp #Lisp

  7. #emacstip Reading the builtin manuals using `M-x info`! Got some spare time? Read a couple of interesting looking manual pages.

    Navigation tips: `n` or `p` for next and previous nodes, `u` to go up one node. Press enter to follow a link. `l` to go back to where you where if followed a link or pressed a key you didn't intend. Finally, `?` to see a list of commands and general help information.

    Some starting manuals to explore: the #emacs manual, Emacs Lisp Intro and Magit manuals.

  8. #emacstip Reading the builtin manuals using `M-x info`! Got some spare time? Read a couple of interesting looking manual pages.

    Navigation tips: `n` or `p` for next and previous nodes, `u` to go up one node. Press enter to follow a link. `l` to go back to where you where if followed a link or pressed a key you didn't intend. Finally, `?` to see a list of commands and general help information.

    Some starting manuals to explore: the #emacs manual, Emacs Lisp Intro and Magit manuals.

  9. #emacstip Use the interfactive function `base64-encode-region` to encode the current region in base64!

  10. #emacstip Use the interfactive function `base64-encode-region` to encode the current region in base64!

  11. #emacstip Use the interfactive function `base64-encode-region` to encode the current region in base64!

  12. #EmacsTip: Frustrated? Feeling bored? Wanna waste some time? There's M-x doctor for you.

    #Emacs

  13. CW: add emacs, gnus version numbers in email header

    for some emails sent to our mailing list contain user-agent: emacs version x, gnus version x after to, from, subject in email headers.

    actual
    to: "recipient email id"
    from: "sender email id"
    subject: "something which is short & precise"

    desired
    to: "recipient email id"
    from: "sender email id"
    subject: "something which is short & precise"
    user-agent: emacs version x, gnus version x

    what should i add in .emacs or .gnus?

    #LinuxForEveryone #debian #emacstip #gnus #gnu #helpwanted #question #emailclients #emailgeeks #email #emacs #emacs28

  14. CW: add emacs, gnus version numbers in email header

    for some emails sent to our mailing list contain user-agent: emacs version x, gnus version x after to, from, subject in email headers.

    actual
    to: "recipient email id"
    from: "sender email id"
    subject: "something which is short & precise"

    desired
    to: "recipient email id"
    from: "sender email id"
    subject: "something which is short & precise"
    user-agent: emacs version x, gnus version x

    what should i add in .emacs or .gnus?

    #LinuxForEveryone #debian #emacstip #gnus #gnu #helpwanted #question #emailclients #emailgeeks #email #emacs #emacs28

  15. CW: add emacs, gnus version numbers in email header

    for some emails sent to our mailing list contain user-agent: emacs version x, gnus version x after to, from, subject in email headers.

    actual
    to: "recipient email id"
    from: "sender email id"
    subject: "something which is short & precise"

    desired
    to: "recipient email id"
    from: "sender email id"
    subject: "something which is short & precise"
    user-agent: emacs version x, gnus version x

    what should i add in .emacs or .gnus?

    #LinuxForEveryone #debian #emacstip #gnus #gnu #helpwanted #question #emailclients #emailgeeks #email #emacs #emacs28

  16. CW: add emacs, gnus version numbers in email header

    for some emails sent to our mailing list contain user-agent: emacs version x, gnus version x after to, from, subject in email headers.

    actual
    to: "recipient email id"
    from: "sender email id"
    subject: "something which is short & precise"

    desired
    to: "recipient email id"
    from: "sender email id"
    subject: "something which is short & precise"
    user-agent: emacs version x, gnus version x

    what should i add in .emacs or .gnus?

    #LinuxForEveryone #debian #emacstip #gnus #gnu #helpwanted #question #emailclients #emailgeeks #email #emacs #emacs28

  17. CW: add emacs, gnus version numbers in email header

    for some emails sent to our mailing list contain user-agent: emacs version x, gnus version x after to, from, subject in email headers.

    actual
    to: "recipient email id"
    from: "sender email id"
    subject: "something which is short & precise"

    desired
    to: "recipient email id"
    from: "sender email id"
    subject: "something which is short & precise"
    user-agent: emacs version x, gnus version x

    what should i add in .emacs or .gnus?

    #LinuxForEveryone #debian #emacstip #gnus #gnu #helpwanted #question #emailclients #emailgeeks #email #emacs #emacs28

  18. #EmacsTip: Recursive minibuffer is a great feature of Emacs. With minibuffer you can invoke a command on an usual buffer, and with recursive minibuffer you can invoke a command on a minibuffer (recursive or not). The built-in #MbDepth package is also very useful, it'll show the recursion depth of the current minibuffer when in a recursive minibuffer.

    gnu.org/software/emacs/manual/

    #Emacs #Minibuffer #RecursiveMinibuffer

  19. #EmacsTip: Have many windows in your Emacs and want to switch windows quickly without touching the mouse? Try #IWindow, or #AceWindow, they allow to switch to any window rapidly even when you have hundreds of windows. Have problem choosing one? Just roll a dice, both have extremely similar interface.

    codeberg.org/akib/emacs-iwindo
    github.com/abo-abo/ace-window

    #Emacs #Windows #IWindow #AceWindow

  20. #EmacsTip: Do you think your #Gnus summary buffer should be better/more like email client/fancier/cooler/<insert anything here>? Check out the "gnus-summary-line-format" user option, customize it to make #Gnus look whatever you want!

    Here is the documentation: (info "(gnus) Summary Buffer Lines")
    And if you like your browser: gnu.org/software/emacs/manual/

    #Emacs #Gnus

  21. #EmacsTip: You don't need to use the default scroll bar in #Emacs. The #mlscroll package implements a nice and fast mode line scroll bar, which you can use even in a text terminal.

    github.com/jdtsmith/mlscroll

    #Emacs #mlscroll #ScrollBar #Scrolling

  22. #EmacsTip: If you are new to #Emacs, you should use a ready-made configuration for the first time. If you want a sophisticated editor, go to starter kits like #DoomEmacs or #Spacemacs. But if you want something that you can learn from, and still pretty complete, Emacs Configuration Generator by @pkal is definitely for you.

    emacs.amodernist.com/

    #Emacs #EmacsConfiguration #InitEl #EmacsConfigurationGenerator

  23. #EmacsTip: Do want the power of Emacs in your shell? Enter #ShellMode, a specialized mode for command shell. It allows you to write shell command, run Emacs commands on your incomplete shell command and output. Before you say that it isn't a proper terminal emulator, I would like say, it is! With #Coterm, you can run any full screen terminal program in #ShellMode.

    Shell: gnu.org/software/emacs/manual/
    Coterm: elpa.gnu.org/packages/coterm.h

    #Emacs #Shell #Comint #Coterm #Terminal #TerminalEmulator

  24. #EmacsTip: The default #minibuffer #completion #UI may seem to be boring. So there is #Vertico, a vertical completion UI. Unlike many other completion UIs, it's 100% compatible with #Emacs completion API, so all #Emacs packages that properly support #Emacs also support #Vertico. #Vertico has a customizable #UI, just check out its README to get an idea.

    github.com/minad/vertico

    #Emacs #Vertico #Completion #Minibuffer

  25. #EmacsTip: Do you know what's the most flexible and powerful email client? It's #Gnus, an #Usenet newsreader! It's so much extensible that other Email clients that:

    "gnus is to emacs users what emacs is to other users" --- Topic for #gnus on @liberachat

    gnu.org/software/emacs/manual/

    #Emacs #Gnus #Email #EmailClient #Usenet #Newsreader

  26. #EmacsTip: Do really need to type something as long as "add-file-local-variable-prop-line" to invoke a command? No, #Orderless makes the completion UI much more smart and convenient. In addition to literal matches, it allows you to use #RegularExpression and other things to find something. And best thing about it is: you don't need to remember the exact name, just type some part of it in any order, and #Emacs will complete it for you.

    github.com/oantolin/orderless

    #Emacs #Orderless #RegExp #RegEx

  27. #EmacsTip: Ever tried to run a command but something unexpected happened because you pressed a wrong key, and you can't figure out what command did you just run? Press C-h l (view-lossage), all key sequences you used will be listed in a Help buffer, along with the commands you ran by those key sequences.

    #Emacs

  28. Very good explanation of Emacs completion styles:

    youtu.be/w9hHMDyF9V4

    Highly recommend it.

  29. Recently discovered a highlight feature of emacs, which makes it dead simple to change the face for a particular text. Check M-s h C-h, also take a look at hi-lock.el.

    Thanks to Bhaskar Chowdhury.

  30. When editing a file in Emacs `C-h S` allows to see the documentation for symbol at point or other item relevant to major mode (can be typed in minibuffer prompt).

    For Texinfo files it will be searching entries in Texinfo manual, for shell files it will look up Bash, gawk, sed, coreutils, diff info pages.

    This behavior is controlled by info-lookup-alist variable. Learn more with `C-h v info-lookup-alist RET`.

  31. When editing a file in Emacs `C-h S` allows to see the documentation for symbol at point or other item relevant to major mode (can be typed in minibuffer prompt).

    For Texinfo files it will be searching entries in Texinfo manual, for shell files it will look up Bash, gawk, sed, coreutils, diff info pages.

    This behavior is controlled by info-lookup-alist variable. Learn more with `C-h v info-lookup-alist RET`.

    #emacs #emacstip

  32. If I have a sudo or other interactive command in a Makefile I run compile/project-compile with universal argument to make Emacs prompt for interactive shell input.

    C-u M-x compile
    M-x recompile

  33. If I have a sudo or other interactive command in a Makefile I run compile/project-compile with universal argument to make Emacs prompt for interactive shell input.

    C-u M-x compile
    M-x recompile

    #emacs #emacstip

  34. Did you know that you can navigate magit status buffer elements with imenu?

    consult-imenu in my case.

  35. Did you know that you can navigate magit status buffer elements with imenu?

    consult-imenu in my case.

    #emacs #emacstip #git #magit

  36. The dired trick from Protesilaos' video:

    `C-u s` in dired buffer allows to set ls switches and immediately update the content.

    For example -R will show all subdirectories the same way as `dired-maybe-insert-subdir` do for one dir, changing some other switches will provide different output format.

    I use it rarely, but sometimes it's handy. Read `man ls` for more information.

  37. The dired trick from Protesilaos' video:

    `C-u s` in dired buffer allows to set ls switches and immediately update the content.

    For example -R will show all subdirectories the same way as `dired-maybe-insert-subdir` do for one dir, changing some other switches will provide different output format.

    I use it rarely, but sometimes it's handy. Read `man ls` for more information.

    #emacs #emacstip #dired

  38. To make guix search and other commands not to throw "WARNING: terminal is not fully functional", I set PAGER environment variable in my eshell to empty value.

    (add-hook 'eshell-mode-hook (lambda () (setenv "PAGER" "")))

    My other eshell settings:
    git.sr.ht/~abcdw/rde/tree/e0b4