reddit / emacs

Weekly Tips, Tricks, &c. Thread

AutoModerator · 2022-08-17 08:15
This is a thread for smaller, miscellaneous items that might not warrant a full post on their own. [See this search for previous "Weekly Tips, Tricks, &c." Threads.](https://www.reddit.com/r/emacs/search?q=Weekly+tips&restrict_sr=on&sort=new&t=all) Don't feel constrained in regards to what you post, just keep your post vaguely, generally on the topic of emacs.
desquared · 2022-08-17 16:28
I'm interested in learning some eshell. How do you use it? Any good resources? It seems interesting but the documentation seems largely nonexistent. I use emacs on Windows and in part am interested in eshell because I get a platform-independent shell experience.
dj_goku · 2022-08-17 16:55
Maybe check this out from a few days back: https://www.reddit.com/r/emacs/comments/wp1jit/mastering_eshell_emacss_elisp_shell/?utm_source=share&utm_medium=ios_app&utm_name=iossmf
MitchellMarquez42 · 2022-08-17 16:55
There's a recent article from Mastering Emacs, here: https://www.reddit.com/r/emacs/comments/wp1jit/mastering_eshell_emacss_elisp_shell/?utm_medium=android_app&utm_source=share
desquared · 2022-08-17 18:06
I saw that, and it got me interested. But I'm looking for more.
trae · 2022-08-17 21:37
Is there a way to query org, to get `CLOCK`ed items?
[deleted] · 2022-08-18 00:39
[deleted]
thr33body · 2022-08-18 03:02
I don’t have any specific tip but I just want to throw it out there that if you are tired of using spacemacs or doom it was much easier to set up my own install than I thought. It only took me a couple of days of active work and now diagnosing problems is so much simpler. Not to say that you should not use either one but I wanted to learn more about emacs and I’ve been really happy with the results.
PriorOutcome · 2022-08-18 09:47
I've parsed and prettified some of the comments (I think I'm missing some, but hopefully should be fixed soonish) from past weekly tips and tricks thread here: [https://github.com/LaurenceWarne/reddit-emacs-tips-n-tricks/blob/master/out.md](https://github.com/LaurenceWarne/reddit-emacs-tips-n-tricks/blob/master/out.md) If you fancy procrastinating for a bit today...
attento_redaz · 2022-08-18 19:55
Using [zotra](https://github.com/mpedramfar/zotra), [citar](https://github.com/emacs-citar/citar) and some parts of the Org-cite ecosystem I hacked together a highly experimental but pretty comfortable environment for working with "org-biblatex bibliographies" which are basically like [org-bibtex](http://gewhere.github.io/org-bibtex) but with biblatex entries represented as headings with suitable properties instead of bibtex. I have a function which retrieves a biblatex entry corresponding to an url using zotra and adds a corresponding Org heading with the biblatex fields as properties, and the entry becomes available in Citar as soon as I save the document. Citing these entries then works anywhere, even in the same document with a suitable `#+bibliography: my-org-biblatex-file.org` declaration. Exporting the citations also works with the CSL exporter, no conversion is necessary to a proper biblatex bibliography file (but can be easily done if one needs biblatex-based export). Since the bibliography is an Org document, tagging, agenda commands, column view etc. can all be used with the bibliography entries. In a way it's frightening how much can be achieved building on already existing stuff and with a few lines of Emacs Lisp.
JDRiverRun · 2022-08-19 03:26
Would love to see a gist with this!
hairlesscaveman · 2022-08-19 06:37
Question: I generally work with 3 vertical panes, with my preferred layout as left for code, middle for related test file, and right for test output or magit. However, keeping this layout is tricky; sometimes magit will open in the first pane, or the current pane when I'm focused in the middle, and deadgrep will open just anywhere… well, it's quite hectic and feels random. Is there any way I can get files to open in panes 1 or 2, and always have things like magit/test-output/deadgrep/etc on pane 3? I've tried "shackle" but I've had no success with it; everything seems to open in a horizontal pane at the bottom of my screen regardless of config. Any suggestions would be appreciated!
attento_redaz · 2022-08-19 14:53
>Would love to see a gist with this! will try to put together one during the week-end
WallyMetropolis · 2022-08-19 15:21
Anyone using Poetry for Python dependency and environment management? How can I get flycheck-checkers to recognize dependencies that are installed in a poetry environment?
aisamu · 2022-08-19 17:27
Thanks, that's super helpful! Already found something really useful - from 3 years ago!
PriorOutcome · 2022-08-19 19:09
I'm glad you've it useful (:
attento_redaz · 2022-08-21 06:03
here it is, I hope it's not totally useless: [org-bibtex-misc.el gist](https://gist.github.com/andras-simonyi/eda0daa0b677838022fd7c438b6eadfa) especially the Zotra part is just a POC with a lot of rough edges, as you'll see
agumonkey · 2022-08-21 14:11
who here uses emacs daily at work and how much do you enjoy it ?
MitchellMarquez42 · 2022-08-21 15:39
I use it at work for writing powershell and whatever else comes up. The work pc is Windows, so it's not great, but it's still emacs. I pull my dotfiles onto the work computer so I have all the customizations I've done at home. I don't really enjoy it, so much. It's a tool to me, that does most of the things I want it to.
agumonkey · 2022-08-21 16:12
Thanks what do you dislike ? you mean you're not fanatic about it ? or do you miss another setup / editor ? your comment about it being just a tool is interesting, emacs can be "everything" but it's interesting that it can be a useful tool to get the job done
MitchellMarquez42 · 2022-08-21 21:44
I love emacs at home on the Linux laptop I use it for everything. But on a windows desktop, there are lots of quality-of-life issues. - font size is way too big. This probably happens because I have the display resolution lowered to make other apps behave. But the way emacs computes font size is cartoonishly large for whatever reason. - startup is slow. The same config takes 0.8 seconds to load on Linux, and 12ish on windows. Again, there's probably other factors but I'm not ready to chase them down yet. - noticeable garbage collection freezing. Every now and then, emacs' ui locks up for a few seconds. Any input still goes through and gets executed, but it feels dodgy to be working blind. This is a simple fix, I just need to lower the gc threshold. I recently raised it on Linux and got the same effect, so that's a simple one. - emacs 29 ui "features" do not seem to be present when enabled. Namely, smooth scrolling and background transparency. This is probably just a window-system thing, and comes with using a pre-release build. I honestly want emacs to be more of a tool for my job. But I'm only using it to edit text because most of the really good plugins are crippled on windows: - magit freezes everything when it actually does something, which is often especially with a (accidentally) big repo. Thus, I use `git` manually in the console. - vterm won't build due to missing libraries. Ansi-term chokes on the kind of output I deal with, and comint/shell-mode isn't enough of a terminal for what powershell does. Thus, stock powershell console it is. - pdf-tools won't build, and even when it does it can't show the bottom of one page and the beginning of the next one. I desperately need to scroll smoothly through PDFs so this is unfortunate. - because of the above, there's not much point in using dirvish (Dired with previews, basically). I really like dirvish and it's awesome, but the default Windows file manager and Adobe reader actually work so I'm stuck with them. - `Your Emacs was compiled without XWidgets support`. No embedded graphical browser. Guess I'll just keep using Chrome, then. Om the plus side, org-mode does work and I use it to track my time as well as remember how to do things. Opening Org files does take a few extra seconds, though.
agumonkey · 2022-08-21 21:48
Interesting. Under linux I never had any issue on a medium sized project. But git and windows are known not to be friend. It's sad to not have lag free magit :)
immortal192 · 2022-08-22 04:26
(Not a programmer): `org-copy-visible` copies visible parts of the highlighted region to the kill-ring. I use Evil and copy lots of org-emphasis'ed text but rarely want to include the org-emphasis markers. Can someone me with a way to enhance `evil-yank` by yanking the visible parts of the highlighted region to the clipboard when Font-lock mode is enabled (and when it's not, just do the normal `evil-yank`)? I like the constraint with Font-lock mode because disabling it still lets me `evil-yank` the text along with the org-emphasized text markers in the rare case I do need it. This is intuitive because disabling Font-lock mode shows text as it is, so it would make sense to disable the enhanced version of `evil-yank`.
LorenzoFero · 2022-08-22 11:51
Question: how to complete a suggestion only with TAB with Corfu?
yapfff · 2022-08-22 15:07
See the discussion in Corfu issue 170 (https://github.com/minad/corfu/issues/170). By default you can have tab completion, but then need to use return to accept even a single completion. To be able to use tab only (shell like) is not possible out of the box. But the issue #170 discussion provide some function to bind to <tab> in the Corfu map to achieve this. This is what I use.
Sudo_Brew · 2022-08-22 18:04
I've used it daily at work writing software for around 6 or 7 years now and I enjoy it quite a bit. I use an M1 Mac at work and Linux at home, so none of the Windows problems mentioned by the first commenter here. I do not envy them, I was on Windows when I started using Emacs and I never want to go back to that. I build Emacs from master (through emacs-plus on Mac), and things occasionally break after an update, but no more than I would expect from a bleeding-edge branch, though that can be annoying when it happens. Rather than debug at all, I just roll back to Emacs 28 for a couple weeks before trying master again and it all works out. I don't use Emacs for everything the way some others do, I prefer Thunderbird for email, and I've never really gotten into Org. And I generally still use a terminal for running makefiles and the like to avoid long line issues (though improvements are being worked on). But otherwise I write Typescript and Python on a daily basis with LSP, Clojure occasionally. I rarely use Git in a terminal anymore, Magit is too good.
BayesMind · 2022-08-23 00:51
As an indirect answer, I faced a similar problem and solved it with XMonad. Emacs is amazing. But I never liked it's handling of frames, and I didn't like handling screen realestate both within emacs, and separately outside it. Windows tiling managers are the creme de la crop for solving your problem, in my prideful opinion.
BayesMind · 2022-08-23 00:52
I've used it daily for probably near a decade. I love emacs, and wouldn't be whole without it.
meain · 2022-08-23 17:34
I am not sure if this will actually work, but maybe use popper and make the right most one the location where all popup buffers open? https://github.com/karthink/popper
meain · 2022-08-23 17:37
You might wanna take a look at https://github.com/wyuenho/emacs-pet
WallyMetropolis · 2022-08-24 15:34
Will do. I was able to get this working with pyvenv-mode. Setting the WOKON\_HOME as the root dir for Poetry environments, along with a custom function that loads up the correct executable. So ... I think I reinvented a poor man's version of PET. This looks great, thanks.
poiu- · 2022-09-14 19:36
Shackles maybe?