r_emacs | Unsorted

Telegram-канал r_emacs - /r/emacs

-

This channel is a feed for r/emacs. @r_channels @reddit2telegram

Subscribe to a channel

/r/emacs

Using Logitech mouse back button in emacs on MacOs like railwaycat/emacs-mac

I am presently using emacs 29.1 from railwaycat/emacs-mac and it works great, but I want to start using emacs 30.0.50, since it seems stable enough to be a daily driver for what I use and I want to use lldb, which is supported in emacs 30.

I tried emacs 30 from both emacsformacosx, as well as from d12frosted/emacs-plus, and both worked great, but the only thing that I miss is that they don't recognize the back button on my logitech mouse.

I don't mind trying to build from source, but I want to know how railwaycat/emacs-mac recognizes the back button. I find it very helpful for using with lsp-mode to jump back to where I came from. (I know that I can use M-, for it, but it is not as convenient for me.) I use it as:

(define-key prog-mode-map [swipe-left] 'xref-go-back)

​

https://redd.it/1bqcrw3
@r_emacs

Читать полностью…

/r/emacs

Experiencing problem with eglot over TRAMP.

I have a problem that I can't seem to understand how it's caused.

I have been using eglot for R programming localy and everything works fine.

When I connect to a file at a remote server and start eglot, it reports that it connects to languageserver correctly, completions happen for a brief moment but then the server seems to hang.

A big message that looks like a .json line appears on the echo area, that seems to be some flymake diagnostics among other things. I have managed to capture this on the Warnings buffer, if anyone is interested.

I don't know if I should make a bug report on the eglot project or on corfu (that I use for in-buffer-completions)

My config can be found here if anyone is interested: https://github.com/Himsself1/My-.emacs-configuration

*** IMPORTANT NOTE ***

I start emacs with the following command: "emacs -q --load \~/my-emacs-config/init.eglot.el" so that it only uses the init.eglot.el file.

Any advise would be greatly appreciated!

Edit. Warnings buffer at: https://gist.github.com/Himsself1/b2338e54e4b9e98474aa344f84ebf668

https://redd.it/1bq8tn3
@r_emacs

Читать полностью…

/r/emacs

Release v0.9 · listen.el (audio/music player for Emacs)
https://github.com/alphapapa/listen.el/releases/tag/v0.9

https://redd.it/1bq6xsu
@r_emacs

Читать полностью…

/r/emacs

Org-babel and Python error:

I just started using source blocks in org-mode. I did the following steps

1. Using M-x customize-variables RET org-babel-load-languages I added Shell, Python and LaTeX.
2. Using M-x customise-variable RET exec-path I added the paths to python3 and my tex distribution.

a) Now when I added a sh-source block and used C-c C-c the result gets printed as expected.

b) However when I do the same for a python-source block I got an error zsh:1: command not found: python [Babel evaluation exited with code 127]

c) As for the LaTeX I am not sure if I am getting the expected result. Here is my source block

#+begin_src latex

$x^3$

#+end_src

and here is the output

#+RESULTS:

#+begin_export latex

$x^3$

#+end_export

​

How do I get the python source block to compile properly? Is my LaTeX compiling as expected?

​

​

https://redd.it/1bq04up
@r_emacs

Читать полностью…

/r/emacs

code below if name == "main" doesn't run

When I try to run C-c C-c in a buffer with python code, it only runs the code above if __name__ == "__main__", which I can understand makes some sense if __name__ is not "__main__" in this case. If that is true, how can I trick python into thinking it is? It is very normal practice to have this line in my code, and I would like to still be able to run my code in emacs without too much restructuring of my life.

​

https://redd.it/1bpdz12
@r_emacs

Читать полностью…

/r/emacs

Prebuilt #treesitter grammars for Emacs and Neovim in #openSUSE
thaodan/112170146059580948" rel="nofollow">https://mastodon.social/@thaodan/112170146059580948

https://redd.it/1bpgm2j
@r_emacs

Читать полностью…

/r/emacs

Emacs init-user-file is empty

I am not able to use my init.el file on startup, when I use load-file for my init.el file and then do a Ctrl-h v init-user-file it is empty. Only gives me blank " " so it seems that Emacs can not find my home directory or my init.el file regardless if I load it or not. I know my file is loaded as it shows up in *Messages* but the variable is still empty.

I have compiled Emacs from source using pgtk for Wayland along with native compilation as well as with json and a few others. My version is Emacs 30.0.50, at the moment I am starting Emacs via kde5 desktop, but if also had same problem running it in terminal.

My environment variables are set even moved to the XDG standard, set XDG_CONFIG_HOME to proper location. But still getting an empty init-user-file, wonder exactly how to figure this out.

R81Z3N1

https://redd.it/1bpbhz8
@r_emacs

Читать полностью…

/r/emacs

python window management

Hi all, I'm running into the following issue with python windows in emacs 29.1 on OSX. Buffers end up being duplicated in certain conditions. I've started emacs using "emacs -Q" so this is all using the default settings.

1. I like to have my \*Python\* shell buffer under my python code buffer. (see below)

[1. Initial setup with Python source code buffer above \*Python\* shell buffer.](https://preview.redd.it/ni9gkgpwawqc1.png?width=3086&format=png&auto=webp&s=55da956b9da94a4532e128e1b83b71f6d77dc5d0)

2. When executing the code buffer with C-c C-c the code buffer ends up being duplicated on the bottom right (see below)

[2. Code buffer duplicated on bottom right after running C-c C-c](https://preview.redd.it/dlk9bh9bbwqc1.png?width=3086&format=png&auto=webp&s=b18f747af8c212e5975451ca7c6dafd4b1052c67)

3. Even worse if I then move to the Python shell buffer and press <enter>, the Python shell buffer ends up being duplicated on the top right (see below)

&#x200B;

[3. \*Python\* shell buffer is duplicated on top right when pressing \<enter\> in bottom left window](https://preview.redd.it/3jzgcmzjbwqc1.png?width=3086&amp;format=png&amp;auto=webp&amp;s=aab04777b05da495f70392c2365d7c5289c1d724)

Obviously this isn't what I'd expect, I'd like to keep the initial layout and end up with

&#x200B;

[4. expected layout instead of 2 and 3. ](https://preview.redd.it/p6jah0nubwqc1.png?width=3086&amp;format=png&amp;auto=webp&amp;s=e5c0b5c1728bd32edb04be823d36ae3a6d0f9f0a)

I came across this fantastic guide on managing windows [https://www.masteringemacs.org/article/demystifying-emacs-window-manager#templates-examples](https://www.masteringemacs.org/article/demystifying-emacs-window-manager#templates-examples)

so I tried customising the `display-buffer-alist` variable using

`(add-to-list 'display-buffer-alist`

`\`((or (derived-mode . python-mode) (derived-mode . inferior-python-mode))`

`(display-buffer-reuse-window display-buffer-reuse-mode-window)`

`(inhibit-same-window . nil)))`

but that's making no difference here, I get the same behaviour as before.

&#x200B;

Couple of questions

1. Are others able to reproduce this issue?
2. Is there a way to configure `display-buffer-alist` to avoid seeing my python source and shell buffers duplicated and get screenshot 4 instead of 2 or 3?

Grateful for any tips!

&#x200B;

&#x200B;

&#x200B;

https://redd.it/1bp4zyc
@r_emacs

Читать полностью…

/r/emacs

Weekly Tips, Tricks, &c. Thread

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.

Don't feel constrained in regards to what you post, just keep your post vaguely, generally on the topic of emacs.

https://redd.it/1bowp8e
@r_emacs

Читать полностью…

/r/emacs

how to hunt for emacs replacing two spaces with period space?

I have been unable to identify the source of this behavior. Heck, I'm not sure what I do that triggers it to start. It doesn't happen after a restart of emacs.

In a programming mode, (fortran or lisp), I'll start spacing at the end of a line to add a trailing comment and I see that a period is placed after the last word on the line.

I've gone through the list of major and minor modes active and I can't see any that would do this. I checked lossage and it shows a self-insert of a period, but I absolutely did not type one.

I'm still trying to pin down what I do that makes this start happening. Once it starts, it's on everywhere.

Any advice or does anyone know of this behavior?

Packages installed: '(delight reformatter cobol-mode sml-basis sml-mode undo-tree geiser-guile flycheck flycheck-guile lsp-mode lsp-scheme lsp-treemacs lsp-ui corfu orderless vertico eglot editorconfig ef-themes eshell marginalia vegetative-theme which-key ws-butler))

Confused here.

https://redd.it/1bfce3d
@r_emacs

Читать полностью…

/r/emacs

Why are my packages one huge file?

I want to contribute to a package. I haven't really used elisp other than setting variables in a configuration and decided that forking a package and contributing was a good way to learn.

I was surprised to see that the entire package was just one huge file. 2000+ lines of code. Basically unreadable.

If I wanted to contribute to basically anything else I can assume everything else works fine and add features to whatever class I need. Here I guess I would have to sift through the code searching relevant variables and functions.

What is the reason for this? It seems like the standard for elisp packages. This doesn't even look slightly acceptable for me. It's like a group of college kids decided to do a group project in one file like it's a Google doc.

https://redd.it/1bf7ozj
@r_emacs

Читать полностью…

/r/emacs

Is the hostility towards emacs and vim users just a one-way thing or does it go both ways?

I'm in a lot of tech communities online and there are a few people I interact with on a regular basis. I talk about both neovim and emacs with a few people while we're having a productive conversation, there's always some wise-ass butting in with a snarky comment about how we are wasting time or that we're deluded, or that some other unproductive comment. These are primarily all VS Code users (they make it known at every chance they get when they behave this way). I don't understand what they feel so threatened about.

I get that some people are ignorant about some of the tools out there but I've never seen anyone taking such an active interest in not knowing them, but even more interest in shitting on those who actually enjoy these tools.

I can't remember the last time I joined a conversation I don't belong to and then be a dick to everyone for no reason. So I'm curious if this hostility I get from these people just a one-way thing.

https://redd.it/1bf64wi
@r_emacs

Читать полностью…

/r/emacs

Legit: Magit-like package for Lem
https://lisp-journey.gitlab.io/blog/oh-no-i-started-a-magit-like-plugin-for-the-lem-editor/

https://redd.it/1besvxn
@r_emacs

Читать полностью…

/r/emacs

Floating windows

I'm a neovim/zellij user who is very accustomed to using floating windows. And my inability to use them on emacs causes me a cognitive pain. It would be nice to call a scratch buffer or eshell such way. Is there any way to achieve that?

https://redd.it/1bepi2n
@r_emacs

Читать полностью…

/r/emacs

Things you do in Emacs that will make non-Emacs users go WOW?

Even with packages, I thought it would be fun to see what some of the Emacs-meisters here actually do in Emacs that the rest of the people are unaware.

Seeing the use of yasnippets blew my mind at times. I'm really curious about other amazing things that I and many other people may have overlooked.

Please share some examples of Emacs-wizardry.

https://redd.it/1benj4g
@r_emacs

Читать полностью…

/r/emacs

Progress update modifying tab-line

https://www.youtube.com/watch?v=es5AmF807Oo

https://github.com/benleis1/emacs-init/blob/main/tab-config.md

I've reached another milestone in my tinkering with tab-line. I now have integrated custom grouping with some extensions for project, basic integration with the desktop functionality to save tab info, some modeline integration and most excitingly views that mimic tab-bar and allow lightweight spaces that preserve window-configuration and tab lists.

Note: in the demo I am focused mostly on mouse based interactions but there are commands/initial keybindings too.

I'm still trying out the total ui experience on a day to day basis and tinkering with the code. But I think I've slipped part of the way over the line between configuration and becoming a full blown package.

That's also made me go back and look at other tab packages to see if I ended up reinventing the wheel. So far I think this is something a bit new.

Besides show and tell - I'm interested in feedback / UI thoughts.

&#x200B;

https://redd.it/1bq9aci
@r_emacs

Читать полностью…

/r/emacs

I'm having some problems with an emacs theme

sorry if this isn't the right place but I can't figure out what's wrong

i'm using doom emacs and I have installed the catppuccin theme as I really enjoy that but whenever i reloaded, quit, then tried to go back into emacs using the client it crashed immediately and open emacs normally gives me a white screen until I do M-x but can't go into any menus and the theme is definitely not right please help

&#x200B;

this is whats in my doom config.el

(setq doom-theme 'catpuccin)

(setq catppuccin-flavor 'macchiato) ;; or 'latte, 'macchiato, or 'mocha

(catppuccin-reload)

and here is a picture

&#x200B;

https://preview.redd.it/70fycvd1j5rc1.png?width=669&amp;format=png&amp;auto=webp&amp;s=99fbae9da46748cb0860add3d4ae02b45a9bbc84

https://redd.it/1bq8rso
@r_emacs

Читать полностью…

/r/emacs

Newish issues using Org-roam in Termux on Android?

So I've been synchronising my org-roam files between computers and mobile phone. For a while I've been mostly successfully being able to use Emacs in Termux for org-roam on my mobile phone.

However, in the past few months any org-roam 'look-up' operations, like org-roam-node-insert, org-roam-node-find, &c. have become slower and slower. Worse, in the past couple of months, after doing one or two such operations it seems to get stuck indefinitely, and trying to cancel out with C-g does nothing the first time, and kills Emacs the second time.

I'm not sure whether the issue is that my org-roam file library has continued to grow or whether it's to do with changes to Android (there have been a few Android OS updates in that time period). Or whether the issue is with accessing a larger sqlite database or whether it's to do with the actual file-lookup operations (more org-roam files over time).

Is anyone in a similar situation? Any ideas of how to resolve this? Maybe at the Termux level? (I saw, for instance, a Termux 'no-root-ram-booster' https://github.com/White9shadow/no-root-ram-booster but haven't tried it or know whether it would be at all relevant. But have wondered about things like this - some way of affecting things at the Termux-level.)

https://redd.it/1bpzc14
@r_emacs

Читать полностью…

/r/emacs

Emacs Badges inspired by Common Lisp logos

Hello, i was learning common lisp and i noticed the wonderful logos they had, then i searched for some similar logos or badges for emacs and elisp, but sadly i couldn't find anything, so the best i could do would be to create them by myself if they didn't exist(yet).

So here are some badges i made:

https://preview.redd.it/e9jtwzy6w3rc1.png?width=97&amp;format=png&amp;auto=webp&amp;s=a3259bfa30da0f5d3766b449ce114bbdf69f62bf

https://preview.redd.it/hvqq34l7w3rc1.png?width=97&amp;format=png&amp;auto=webp&amp;s=6dc30b0bd04c86f29ec4bfcc84ecfe40ee87fcff

https://preview.redd.it/mtjopq28w3rc1.png?width=97&amp;format=png&amp;auto=webp&amp;s=48475176c864e764ea0f48f5afe3d91edc696638

\(This one was inspired by \\"Powered by: Neovim\\" badge\)

https://redd.it/1bq0nif
@r_emacs

Читать полностью…

/r/emacs

How to use a file handler?

I am having troubles understanding how the file handlers work from the documentation. Particularly in the make-process :file-handler.

I understand that I should provide an alist with the form (regexp . handler) however, I cannot figure out how can I ask my handler to call the process in a given path.

I have the following:

(make-process
:name "my-R-async"
:buffer "my-R-async"
:command (list "Rscript" "app.R")
:connection-type 'pty)

However, this only works if I call make-process from the same dir where my app.R is. Therefore, I am trying to find a handler that can call make-process from a particular dir.

I have tried a few things, including :file-handler (unhandled-file-name-directory "~/Projects/myApp/") and :file-handler ("~/Projects/myApp/" . unhandled-file-name-directory), I have tried with other functions replacing unhandled-file-name-directory and sometimes writing the full path of the file rather than only the directory, but nothing seems to work.

I have currently a solution by providing the path to R directly, sending the command setwd() but a workaround and I really would like to learn and understand how Emacs can handle this.

https://redd.it/1bprft1
@r_emacs

Читать полностью…

/r/emacs

Switch focus to minibuffer for an interactive command

solved

I have a keymap that binds a mouse press to an interactive command:

;; keymap to wire the new desktop button to tab2-new-dektop
(defvar-keymap tab2-new-desktop-map
"<tab-line> <down-mouse-1>" #'tab2-new-desktop
"RET" #'tab2-new-desktop)

Where the command is really vanilla:

;; Create a new desktop and switch to it.
(defun tab2-new-desktop (name)
(interactive "sNew Desktop name: ")
.....

This all works as expected, except the focus doesn't switch to the minibuffer automatically when the mouse is pressed. You have to do so manually. Does anyone know how to make that happen?

https://redd.it/1bpe2bu
@r_emacs

Читать полностью…

/r/emacs

C-h keybinding help shows something interesting for ( and )

I notice that if I bind ( and ) to the same command

(global-set-key (kbd "C-c y (") 'kill-region)
(global-set-key (kbd "C-c y )") 'kill-region)

After hitting C-c y C-h, the C-h page displays something like this

C-c y ( .. C-c y ) kill-region

It seems this only happens to ( and ) bound to the same command. E.g. If I bind both < and > to the same command, C-h displays correctly.

(global-set-key (kbd "C-c y <") 'kill-region)
(global-set-key (kbd "C-c y >") 'kill-region)

C-h shows:

C-c y < kill-region
C-c y > kill-region

Does anybody know this is by design or a bug ? btw, I'm running v29.2.

https://redd.it/1bp5tjl
@r_emacs

Читать полностью…

/r/emacs

xcscope plugin with big c code data base

I can make `cscope.out` with

find -L . -name ".c" -o -name ".h" > cscope.files
cscope -b -k -R cscope.files

But xcscope take a long time to search symbol `C-c,s,s` (60s) as if `cscope.out` was not used.
If I use `cscope -d` or another editor to use cscope it is quick (1s) and it use only `cscope.out`.

I tried also that with no effect :

(setq cscope-do-not-update-database t)

Is there a way to use xcscope plugin or other to use only `cscope.out` and have a quick search?

https://redd.it/1bp27mw
@r_emacs

Читать полностью…

/r/emacs

What is the name of the setting to turn off this appearence of parentheses
https://redd.it/1bozu6k
@r_emacs

Читать полностью…

/r/emacs

Something similar to notmuch and mu4e, but for regular files?

I would usually use rg or something to search through some text files.
But I wonder if I can do this notmuch/mu4e style, maildir files are essentially text files, aren't they? And I really like the notmuch/mu4e interface and interaction.
Just throwing this idea out here...

https://redd.it/1bf951l
@r_emacs

Читать полностью…

/r/emacs

Horizontal scrolling that doesn't jump around?

Hey guys, I have jumped back to Emacs after using regular editors (for quite a while). I've been using avy and the likes to accelerate my navigations. And they are awesome! The one big problem I have with emacs is the scrolling. When it scrolls the whole screen changes, including the point, which loses all points of reference. I have tried using ways like scrolling only half a screen, smooth scrolling, or resorting to using my mouse (which sucks btw). In the end, I've settled down with good-scroll for full-screen scrolls, and repeated C-u C-n/C-u C-ps. And there's that.

Except it isn't. Because now the problem becomes horizontal scrolling. For example, the code in the header image. If I were to, say, scroll down while reading the code, I don't really have a friendly way to scroll horizontally and back. Like, there's always this violent skip which makes me think "oh where was I again?" If I was using regular code editors like Kate, I can scroll horizontally using the mouse, and the scrolling will be smooth so I can conveniently track and read the code. But for hscroll, there's only C-e and M-m in emacs (at least to my knowledge). I guess there's M-f etc as well, but they move too slowly so it's not as efficient.

So what I am looking for? Well something like C-l that places the point in the center, except this time it's horizontally centered as well. The other thing is during these horizontal scrolls and I move the point down, and the next line is not as long as the previous one, it skips back to the left and when the next line length is long enough, it skips back again. If there's something that can preserve horizontal point offset during these scrolls it'll be awesome. But not something like scroll-left because I have to manually scroll-right to get back.

https://redd.it/1bf7zp5
@r_emacs

Читать полностью…

/r/emacs

Learning emacs with default keybindings?

Hi all,

I assume this is a rather common question on this subreddit about whether one should adopt evil mode right away when learning emacs or lean into the default keybindings, for someone coming from vim. Unsurprisingly, I belong in the same boat: using (neo)vim for the past 5 years and have setup a window-manager setup with bindings all very akin to vim (heck I even have a firefox addon to emulate vim inside my browser for moving around).

Now, I don't wish to learn emacs the vim-way and would like to learn it with default keybindings (makes it easier to follow docs, works well with other packages, etc.) but I'm afraid that'll make me "unlearn" the bindings I have in place that are more vim like. Heck, I'm scared I might unlearn vim itself.

What I want to know is if it's possible to use emacs bindings inside emacs and my custom (vim) bindings outside it? Has anyone encountered this and made it work? Thanks in advance!

https://redd.it/1beye1n
@r_emacs

Читать полностью…

/r/emacs

An alternate pattern-matching conditional for Elisp
https://lwn.net/Articles/961682/

https://redd.it/1betdl6
@r_emacs

Читать полностью…

/r/emacs

jupyter-emacs users how do handl errors and ansi escapes in output

https://imgur.com/a/vNDvNXs

my config in doom emacs is as follows if you know any workaround please share

(after! jupyter
(setq org-babel-default-header-args:jupyter-julia '((:async . "yes")
(:session . "julia")))
(with-eval-after-load 'ob-jupyter
(org-babel-jupyter-aliases-from-kernelspecs))
(setq ob-async-no-async-languages-alist '("jupyter-python" "jupyter-julia"))
)


https://redd.it/1bero5t
@r_emacs

Читать полностью…

/r/emacs

Is there a way to watch for changes in a font attribute?

I want to set a font attribute as follows:

(set-face-attribute 'outline-1 nil :height 120)

Unfortunately, something occasionally resets it to "unspecified" (according to describe-face). I haven't been able to pin down what's doing that - so I thought maybe I could add a debug watchpoint with debug-watch to trip when it's changed - the debug stack might give me a clue.

Trouble is - debug-watch wants a variable to watch and I can't figure out how to point it at a font attribute.

Anyone have any ideas?

https://redd.it/1bejzgp
@r_emacs

Читать полностью…
Subscribe to a channel