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. #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.

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

  4. 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

  5. #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

  6. #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

  7. Very good explanation of Emacs completion styles:

    youtu.be/w9hHMDyF9V4

    Highly recommend it.

  8. 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.

  9. 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`.

  10. 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

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

    consult-imenu in my case.

  12. 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.

  13. 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

  14. Just an . When I review patches sometimes I want to ignore indentation updates.

    With magit I do `d -b c` on the commit to hide whitespace changes.