What kind of tricks do you all have for Emacs?
What sorts of less-obvious tidbits of information about Emacs do you all possess?
https://yeti.tilde.institute/brain/emacs.html#exwm
Arch <archenoth@tilde.town> writes:
What kind of tricks do you all have for Emacs?
I've bound...
(global-set-key (kbd "<f5>") 'revert-buffer)
...to have reloading (sommetimes the fastest way to activate in document settings) to the usual place known from browsers and for faster buffer switching andd long before that...
(global-set-key [f12] 'buffer-menu)
...to pop of the whole buffer list.
And since noticing the difference in these definitions, I'm scratching
my head about which one is the "better" way to do it.
No tricks harmed for this.
What sorts of less-obvious tidbits of information about Emacs do you all
possess?
I played a bit with EXWM (emacs as WM) but always managed to get it deadlocked or other hangups. I really hope this someday will be good
enough.
https://yeti.tilde.institute/brain/emacs.html#exwm
And I do increasingly more stuff in eshell (plus tramp). Having one
emacs at home which can access my stuff on remote systems definitely is easier to manage than a finetuned emacs on every system. So having a
look at tramp costs getting used to some no so cute paths/filenames, but
pays back a lot and fast. Aaaaand sudo/su-editing via tramp! Again:
One config less (no emacs config for root), just a special case for
tramp.
Hmmmm... I didn't try dired with su/sudo-paths yet... ***cough!***
| /sudo:root@cubietruck1:/:
| total 103
| drwxr-xr-x 23 root root 4096 Jul 3 2020 .
| drwxr-xr-x 23 root root 4096 Jul 3 2020 ..
| drwxr-xr-x 2 root root 4096 Feb 14 19:45 bin
| drwxr-xr-x 4 root root 3072 Apr 27 18:39 boot
| ...
...ok!
What I'm searching is a way to have 2 elpher buffers open at the same
time... comes time, comes wheel... or such...
RIP
Arch <archenoth@tilde.town> writes:
RIP
???
Ok... linear message view probably was a bad idea. I might have gotten
that association right in the zigzag view... "M-C-t"-ing back...
Ohhh! My bad!
Should I quote messages more often on usenet in general to make it
easier to see what they are in response to?
It's also nice to be able to M-x auto-revert-mode, since that works in a loooot of places that a lot of people don't expect.
(global-set-key [f12] 'buffer-menu)
...to pop of the whole buffer list.
Heck yeahh!! TRAMP is amazing.
What I'm searching is a way to have 2 elpher buffers open at the same
time... comes time, comes wheel... or such...
Gosh, I only started really using elpher recently, so I didn't even
realize it couldn't do this.
That's quite the functionality gap, huh? (I wonder how hard it would be
to implement? I know the gopher git service on elpher's homepage has a section for submitted patches, like the one to connect to gemini links
in tty emacs without erroring out)
It's also nice to be able to M-x auto-revert-mode, since that works in a loooot of places that a lot of people don't expect.
(global-set-key [f12] 'buffer-menu)
...to pop of the whole buffer list.
Heck yeahh!! TRAMP is amazing.
What I'm searching is a way to have 2 elpher buffers open at the same
time... comes time, comes wheel... or such...
Gosh, I only started really using elpher recently, so I didn't even
realize it couldn't do this.
That's quite the functionality gap, huh? (I wonder how hard it would be
to implement? I know the gopher git service on elpher's homepage has a section for submitted patches, like the one to connect to gemini links
in tty emacs without erroring out)
What I'm searching is a way to have 2 elpher buffers open at the same
time... comes time, comes wheel... or such...
Gosh, I only started really using elpher recently, so I didn't even
realize it couldn't do this.
That's quite the functionality gap, huh? (I wonder how hard it would be
to implement? I know the gopher git service on elpher's homepage has a
section for submitted patches, like the one to connect to gemini links
in tty emacs without erroring out)
I /think/ that there's a fork that allows multple elpher buffers
... hold on (I'm checking) .. yeah there's two on this page:
gopher://thelambdalab.xyz/1/scripts/browse-git.scm%7Celpher.git
I haven't tried either, but they're there.
I'm going to send another message to this thread with the stuff I use.
I originally meant this reply to just be a response to the elpher thing, woops!
Arch <archenoth@tilde.town> writes:
It's also nice to be able to M-x auto-revert-mode, since that works in a
loooot of places that a lot of people don't expect.
I have (global-auto-revert-mode +1) in my ~/.emacs, and I can confirm,
it's great. I don't even think about it.
I mean, my use-case is that I want Emacs and the filesystem to mirror
each other -- I'm on a single-user system where I know that I don't open
a file in more than one place at a time (though locks would probably fix that? Anyway...).
I copy-pasted the advice to (global-set-key (kbd "C-x C-b") #'ibuffer) a while ago; Honestly I don't use either the buffer-menu or ibuffer that
much because I have consult installed, which has its consult-buffer
command that I /love/. It does buffers and recent files (and other
stuff too, I think, but I just use those).
Heck yeahh!! TRAMP is amazing.
For some reason, TRAMP is like, weird for me. I need to do more
research to make it work.
I mean, my use-case is that I want Emacs and the filesystem to mirror
each other -- I'm on a single-user system where I know that I don't open
a file in more than one place at a time (though locks would probably fix that? Anyway...).
gopher://thelambdalab.xyz/1/scripts/browse-git.scm%7Celpher.git
Arch <archenoth@tilde.town> writes:
Oh yeah! This is nice on tildes too for watching shared folders,
especially if you set your dired-listing-switches to include "-t",
because then new files just jump to the top of the buffer as they are
edited.
I copy-pasted the advice to (global-set-key (kbd "C-x C-b") #'ibuffer) a
while ago; Honestly I don't use either the buffer-menu or ibuffer that
much because I have consult installed, which has its consult-buffer
command that I /love/. It does buffers and recent files (and other
stuff too, I think, but I just use those).
Huh. TIL consult
For ssh, I find sshx is the most reliable and fastest method, since it
holds the connection open the entire time. (You can see it in M-x list-processes)
Multi-hops are a bit more tricky, like for /sshx:box|docker:container:/
I have to type
/sshx:box:/<Tab>
then I backspace the last colon and type
/sshx:box|docker:container:/<Tab>
then I can finally type the rest of my path. And afterwards, Emacs
handles that path gracefully without needing to do that process again.
I find that tab completion really helps TRAMP, since it can be a bit
finicky sometimes.
Okay, I hope I didn't mess up posting that other reply. If I did, I apologize... I'm still gnu to gnus (heheheheh).
Anyway, here's some tricks I use with Emacs. My whole config can be
found at https://tildegit.org/acdw/emacs.
1. `when-unfocused'. This lets me garbage collect or auto-save all
files when all Emacs frames are unfocused.
(defmacro when-unfocused (name &rest forms)
"Define a function NAME, executing FORMS, that fires when Emacs
is unfocused."
(declare (indent 1))
(let ((func-name (intern (concat "when-unfocused-" (symbol-name name))))) `(progn
(defun ,func-name () "Defined by `when-unfocused'."
(when (seq-every-p #'null
(mapcar #'frame-focus-state (frame-list)))
,@forms))
(add-function :after after-focus-change-function #',func-name))))
2. `sunrise-sunset'. I change themes (modus FTW) when the sun comes up
and goes down. This is what does that. It's adapted from some other function somewhere, and made more robust.
(defun acdw/sunrise-sunset (sunrise-command sunset-command)
"Run commands at sunrise and sunset."
(let* ((times-regex (rx (* nonl)
(: (any ?s ?S) "unrise") " "
(group (repeat 1 2 digit) ":"
(repeat 1 2 digit)
(: (any ?a ?A ?p ?P) (any ?m ?M)))
(* nonl)
(: (any ?s ?S) "unset") " "
(group (repeat 1 2 digit) ":"
(repeat 1 2 digit)
(: (any ?a ?A ?p ?P) (any ?m ?M)))
(* nonl)))
(ss (sunrise-sunset))
(_m (string-match times-regex ss))
(sunrise-time (match-string 1 ss))
(sunset-time (match-string 2 ss)))
(run-at-time sunrise-time (* 60 60 24) sunrise-command)
(run-at-time sunset-time (* 60 60 24) sunset-command)
(run-at-time "12:00am" (* 60 60 24) sunset-command)))
3. I changed C-z to make kind of a custom "leader key" ... mostly I use
it for apps like GNUS (C-z m) or elpher (C-z e), or to toggle debugging
(C-z d) or kill emacs (C-z C-c).
That's it for now! Great thread idea, Arch!
Arch <archenoth@tilde.town> writes:
What kind of tricks do you all have for Emacs?
I've bound...
(global-set-key [f12] 'buffer-menu)
...to pop of the whole buffer list.
Sysop: | deepend |
---|---|
Location: | Calgary, Alberta |
Users: | 255 |
Nodes: | 10 (0 / 10) |
Uptime: | 159:50:35 |
Calls: | 1,725 |
Calls today: | 5 |
Files: | 4,107 |
D/L today: |
12 files (9,998K bytes) |
Messages: | 393,013 |