/r/emacs


Channel's geo and language: not specified, not specified
Category: not specified


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

Related channels

Channel's geo and language
not specified, not specified
Statistics
Posts filter


DOOM emacs with ReasonMode, problem with merlin

Im trying to use reason-mode with doom emacs, but im having some troubles with merlin, autocomplete is not working, i have just followed the guide from the repo but when coding the following message appear :

[error message](https://preview.redd.it/qdoqcvamthf51.png?width=817&format=png&auto=webp&s=942aadf864e3f94d8a7bc514ba6adc77840dd190)

not sure what to do, just a emacs newbie, any help is welcome :)

https://redd.it/i55rmm
@r_emacs




Is there anyway to use lap-mode with dictionary

I have been switched to Emacs from Vim for 2 weeks. I
am seeking a way to use dictionary with lsp-mode, since that coc.nvim plugin for vim can connect the google dictionary. THANKS 🙏

https://redd.it/i5hyn2
@r_emacs


(quote
(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "http://stable.melpa.org/packages/"))))
'(package-selected-packages (quote (flymake elpy dracula-theme)))
'(ring-bell-function (quote ignore))
'(visible-bell nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
'(setq visible-bell 1)
(elpy-enable)
(define-key yas-minor-mode-map (kbd "C-c k") 'yas-expand)
(define-key global-map (kbd "C-c o") 'iedit-mode)

The contents of the virtualenv directory are as follows:

> c:\users\username\python-virtual-environments
> -- \env\
> ---- \include\
> -------- #blank#
> ---- \lib\
> -------- \site-packages\
> ------------- #blank#
> ---- \scripts\
> -------- python.exe
> -------- pythonw.exe
> ---- pyvenv.cfg

https://redd.it/i5idtc
@r_emacs


Flymake stopped working with elpy…no idea what I did or didn't do [Windows]

I installed elpy, along with jedi, rope and got it to work briefly yesterday after uninstalling python and reinstalling it with anaconda and setting the environment variable to path. I tinkered around yesterday both with the emacs config files and trying to setup virtualenvs. I did manage to create one virtual environment but I haven't installed anything to that directory so it's sitting empty.



I get two errors when I try to do a syntax check on my [test.py](https://test.py) sieve algorithm (below):

1. MAX_PRIME = 100
2. sieve = [True] * MAX_PRIME
3. for i as range(2, MAX_PRIME):
4. if sieve[i]:
5. print(i)
6. for j in range(i * i, MAX_PRIME, i):
7. sieve[j] = False

The third line should be highlighted under as
seeing as it's incorrect syntax. It picked up yesterday but not anymore. The two errors are as follows:

Warning [flymake test.py]: Disabling backend python-flymake because (file-error Spawning child process Exec format error)

Warning [flymake test.py]: Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)

Below is my `elpy-config`:

Elpy Configuration

Emacs.............: 26.3
Elpy..............: 1.34.0
Virtualenv........: env (c:/Users/Robby Parliament/python-virtual-environments/env/)
Interactive Python: python 38 (c:/Users/Robby Parliament/python-virtual-environments/env/Scripts/python.exe)
RPC virtualenv....: rpc-venv (c:/Users/Robby Parliament/.emacs.d/elpy/rpc-venv)
Python...........: c:/ProgramData/Anaconda3/pythonw.exe 3.8.3 (c:/ProgramData/Anaconda3/pythonw.exe)
Jedi.............: 0.17.1
Rope.............: 0.17.0
Autopep8.........: 1.5.3
Yapf.............: 0.30.0
Black............: Not found
Syntax checker....: flake8.exe (c:/ProgramData/Anaconda3/Scripts/flake8.exe)

Warnings

Elpy could not connect to Pypi (or at least not quickly enough) and
check if the python packages were up-to-date. You can still try to
update all of them:

[Update python packages]

Pip doesn't seem to be installed in the dedicated virtualenv created
by Elpy (c:/Users/Robby Parliament/.emacs.d/elpy/rpc-venv). This may
prevent some features from working properly (completion,
documentation, reformatting, ...). You can try reinstalling the
virtualenv. If the problem persists, please report on Elpy's github
page.

[Reinstall RPC virtualenv]

The black package is not available. Commands using this will not work.

[Install black]

Options

`Raised' text indicates buttons; type RET or click mouse-1 on a button
to invoke its action. Invoke [+] to expand a group, and [-] to
collapse an expanded group. Invoke the [Group], [Face], and [Option]
buttons below to edit that item in another window.

And below is what's inside the init.el file:

;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ansi-color-faces-vector
[default default default italic underline success warning error])
'(ansi-color-names-vector
["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"])
'(custom-enabled-themes (quote (dracula)))
'(custom-safe-themes
(quote
("b46ee2c193e350d07529fcd50948ca54ad3b38446dcbd9b28d0378792db5c088" default)))
'(display-line-numbers t)
'(package-archives


Unix sockets?

As far as I can see, the Emacs network stream feature doesn't support local (a.k.a. Unix) sockets. This seems wrong and even a bit absurd, given that they are in fact easier to set up (no port numbers and TCP options to worry about). So why? And has it ever been floated for addition?

https://redd.it/i5iqbw
@r_emacs


How to read documentation in Help buffers

I have made a habit of using `describe-function` in situations when I want to know more about a function, or create my own little wrapper function around one to extend said function.

What I often struggle with in the Help buffer which then appears is to make sense of the argument list. Right now I have the documentation for `evil-yank` pulled up (I want to map the functionality of `yy` to `tt`, just gain understanding of how mappings, evil etc. work).

The documentation contains this line:

```(evil-yank BEG END &optional TYPE REGISTER YANK-HANDLER)```

The arguments `BEG` and `END` I understand, but the remaining three make little sense to me. In such situations, how should I go about figuring out the meaning of the arguments which are not clear, and which are also not described at all in the Help buffer?

https://redd.it/i5hf6s
@r_emacs


Small hack for concealing the content of private buffers

Since I don't use workspaces a lot, I end up in awkward situations while screen sharing while working from home where my personal notes end up on display while showing something in Emacs.

I am not sure if there are other solutions but I ended up making a quick package based on per line overlays called [conceal.el](https://github.com/lepisma/conceal). Not a lot of features as of now. Feedback welcome.

https://redd.it/i5fidd
@r_emacs


Help me create an emacs function to use a command line tool

Hi everyone, I'm trying to create emacs functions to work with [cmdstan](https://mc-stan.org/docs/2_24/cmdstan-guide/index.html), a command line interface to "Stan", a probabilistic programming language.

First I needed a function to compile stan within emacs, that worked and I'm good to go.

Now, there is where I'm having issues, the [command line has several arguments](https://mc-stan.org/docs/2_24/cmdstan-guide/command-line-interface-overview.html#command-line-help) and subarguments.

I would like the user to be able to interactively pick the arguments and sub arguments they want and then send them to the CLI.

I was thinking about something à la [Hydra](https://github.com/abo-abo/hydra), with the options appearing in the minibuffer so people can choose from them.

The arguments also require a file path, I'd need the ability to navigate to a file.

What I tried initially is to have the current buffer file name be sent to the shell with hardcoded arguments but that's not modular enough.

I'd be glad to hear what you think,

Thanks

https://redd.it/i5cc6j
@r_emacs


Is there a way to detect if a org file is open and then change the font?

I use emacs to write code and some notes, the problem is that I would like to use diferent fonts for certain purposes.

https://redd.it/i57tzm
@r_emacs


Which are your favorite hot keys (key-strokes) in Emacs?

Most of the time I use, `C-x f, C-x s, M-x, C-c C-v.` Though, there are plenty of key-strokes I am not getting comfortable with them. So just out of curiosity, I am asking this question.

https://redd.it/i57jig
@r_emacs


Help with command `insert` and evil mode

So I have what is probably a really dumb question but something that I can't seem to find a clear answer for.

I am trying to insert the file path of one buffer into another buffer. Should be pretty straightforward. I start with running `(setq variable buffer-file-name)` then jump over to the other buffer and run `(insert variable)` which inserts the text.

Here's where I am confused, I am running Doom Emacs, and loving it, but I can't seem to edit or modify with the standard VI keys. When I select a large chunk of the text and hit `x` it only kills the last character.

I am assuming there is some simple error I am running into if someone could point me to the proper documentation or a quick explanation of what I am not understanding that would be appreciated. Some DDGing on the subject did not seem to be illuminating.

Thanks in advance.

https://redd.it/i52zwy
@r_emacs


Moving rows/columns in table.el tables

Is there a way to move rows or columns in a table.el table? In a regular table this can be done with `M-up` or `M-down`, but this doesn't work in a table.el table.

https://redd.it/i50hir
@r_emacs


emacs hanging on OSX

I just started using emacs on OSX (Catalina) last night and it has hung 3 times already. It opens fine but hangs randomly. So far I have seen it hang in the scratch buffer and the dired buffer. I cannot quit emacs either, and I have to go on the terminal and kill the process.

Have anybody encountered this and know of a fix, or why it's hanging? I installed it using brew.

https://redd.it/i4uh6w
@r_emacs


Emacs install folder vs .emacs.d vs .emacs/.emacs~ confusion [Windows 10]

I've recently run into complications regarding elpy and setting up virtual environments (see other questions) which have brought me back to a more fundamental issue that I must resolve before I continue integrating python functionality into emacs.

**Details:**

1. My HOME environment variable is located in c:\\users\\robby parliament
2. My root emacs install folder is located in c:\\users\\robby parliament\\documents
3. The .emacsand .emacs\~*files* are also located in c:\\users\\robby parliament
4. The .emacs.d *folder* is also located in c:\\users\\robby parliamentand contains the following items:



> - c:\users\robby parliament
> --- .emacs.d
> ----- auto-save-list
> ----- elpa
> ----- elpy
> ----- snippets
> ----- url

**Questions:**

1. When I move the .emacs and .emacs\~ files into the .emacs.d folder I lose my theme (dracula), why is this so?
2. In response to the above question I figured I must change the HOME environment variable to `c:\users\robby parliament.emacs.d`, so when I do that I get the following warning/error:



Warning (initialization): An error occurred while loading ‘c:/Users/Robby Parliament/.emacs.d/.emacs’:

Symbol's function definition is void: elpy-enable To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the ‘--debug-init’ option to view a complete error backtrace.



3. Then when I move the .emacs and .emacs\~ files *into* the .emacs.d subfolder within c:\\users\\robby parliament\\.emacs.d the warning is now gone yet the theme is still gone. I've watched LigerLearn's tutorial on setting up emacs and the customization of the file paths several times but I feel like I'm still not understanding a fundamental concept which is bringing me all these warnings and errors. What am I doing wrong?

Also, this is within my .emacs file:

;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ansi-color-faces-vector
[default default default italic underline success warning error])
'(ansi-color-names-vector
["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"])
'(custom-enabled-themes (quote (dracula)))
'(custom-safe-themes
(quote
("b46ee2c193e350d07529fcd50948ca54ad3b38446dcbd9b28d0378792db5c088" default))) '(display-line-numbers t)
'(package-archives
(quote
(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "http://stable.melpa.org/packages/"))))
'(package-selected-packages (quote (flymake elpy dracula-theme)))
'(ring-bell-function (quote ignore))
'(visible-bell nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
'(setq visible-bell 1)
(elpy-enable)
(define-key yas-minor-mode-map (kbd "C-c k") 'yas-expand)
(define-key global-map (kbd "C-c o") 'iedit-mode)

https://redd.it/i4y6p8
@r_emacs


Persisting command history in term mode

How can I persist command history in the term mode? From reading online, some places say to enable savehist mode, which is already enabled but doesn't appear to do anything.

To be clear, when I kill the term mode buffer and start another one, the previous command history isn't there and I'd like it to be.

https://redd.it/i4yxnz
@r_emacs


Better integration between treemacs and projectile

Hello.
I noticed that when i add a project to treemacs workspace, it doenst also add the project to the list of projectile's known projects.
Same thing for deleting a project from the workspace.

This is inconvenient because, if i want to use for instance counsel-projectile-switch-project, it will use the list from projectile known projects, so i have to first add a project to known projects, then also add the project to treemacs workspace.

I was wondering if there is a way make all of this in one action
Say, C-c C-p a would add the project to treemacs workspace but also to projectile known projects so i can use its bindings to switch, add and delete projects.

Thanks in advance.

https://redd.it/i4xd6z
@r_emacs


Is there a better way? s-replace

Hay, everyone I have the following code that needs refactoring, I know there's a better way and I believe someone here is generous enough to show me. Thanks

(defun speak-content (start end)
"Speak selected region."
(interactive "r")
(save-excursion
(let* ((start (or start (region-beginning)))
(end (or end (region-end)))
(region (s-replace-regexp "/" ""
(s-replace-regexp "\\]" ""
(s-replace-regexp "\\[" ""
(s-replace-regexp "#" ""
(s-replace-regexp "~" "" (buffer-substring start end)))))))
(line (s-replace-regexp "/" ""
(s-replace-regexp "\\]" ""
(s-replace-regexp "\\[" ""
(s-replace-regexp "#" ""
(s-replace-regexp "~" "" (thing-at-point 'line)))))))
)
(if (region-active-p)
(play-audio (fetch-audio region))
(play-audio (fetch-audio line))))))

https://redd.it/i4uk4y
@r_emacs


meld-like diff in emacs

I like using meld for diffing files. However, I prefer to stay in emacs if possible. Are they any modes out there that have similar functionality to meld. So far I tried ediff and vdiff and found them lacking. In particular I would like the following features:

\- Automatic scrolling of windows and highlighting of current line in both buffers. (at least switching windows should jump to the same line). This seems missing from ediff and not fully implemented in vdiff.

\- Ability to send changes from one side to the other. This is available in vdiff but seems to be easy to trip up when I want to send part of a chunk.

\- Character level differences. This seems to be available in vdiff but not working for me in ediff.

\- Handling of missing lines. This is handled in vdiff but not in ediff.

Are there any other solutions or is vdiff my best shot?

https://redd.it/i4txt3
@r_emacs


EAF Browser now supports Caret Browsing - select text on a webpage without leaving your keyboard!
https://redd.it/i4th1l
@r_emacs

20 last posts shown.

26

subscribers
Channel statistics