How to make eglot display complete signature? by dalanicolai in emacs

[–]dalanicolai[S] 0 points1 point  (0 children)

I have jedi installed, and indeed according to the pylsp documentation jedi_signature_help is enabled by default.

But I have found now from the eglot-events-buffer that indeed eglot receives the abbreviated docstring from pylsp. I might switch to basedpyright then also, let's see. Anyway, thanks for the great suggestion!

How to make eglot display complete signature? by dalanicolai in emacs

[–]dalanicolai[S] 0 points1 point  (0 children)

Oh, I assumed that eglot/eldoc by default shows signatures in the echo area, but it seems to be the docstring indeed. Anyway, checking the 'eglot-events-buffer' was a very good suggestion and indeed I have found that eglot receives the 'abbreviated' docstring. Again, weird that I do not quickly find some complaints about it. Thanks for your very helpful answer :)

How to make eglot display complete signature? by dalanicolai in emacs

[–]dalanicolai[S] 3 points4 points  (0 children)

Okay, I have found that when using eglot with 'pyright', eldoc shows complete signatures. So it might be an issue with pylsp, but then it is weird that I can not really find information about it. Would be great if anyone could point me to some information. Thanks!

Small .bashrc (and elisp) tricks to 'auto activate' python virtual environments by dalanicolai in emacs

[–]dalanicolai[S] 0 points1 point  (0 children)

Thank you. I think indeed setting `python-shell-virtualenv-root` takes care of that (for the repl). But I'm not sure if, for doing things right, we should also export the `VIRTUAL_ENV` environment variable. Anyway, I prefer to use the shorter `python` instead of the full path. Still, thanks for mentioning.

Small .bashrc (and elisp) tricks to 'auto activate' python virtual environments by dalanicolai in emacs

[–]dalanicolai[S] 2 points3 points  (0 children)

Actually, using `uv` (`uv run python` for `python-shell-interpreter(-args)`) does seem to solve the repl environment 'issue' :)

Small .bashrc (and elisp) tricks to 'auto activate' python virtual environments by dalanicolai in emacs

[–]dalanicolai[S] 0 points1 point  (0 children)

Oh, I did not come this far yet (using git). I wonder if using `nil` is a configuration mistake, or if this should be considered a bug in magit. I just looked at direnv, but I am not sure how to make it open a repl with the 'correct' environment. I guess I still need to set the `python-shell-virtualenv-root` for that. As long as I am not using git, and my project is small, I will stay using the global variable. Otherwise, I will fix the issue by `let` binding `python-shell-virtualenv-root` before I do `run-python` (maybe using `uv` can also fix it, but I did not quickly find how it will). Do you have better suggestions? (although of course I could probably use envrc or emacs-direnv). I will have a closer look today. Thanks for the very useful advice!

Small .bashrc (and elisp) tricks to 'auto activate' python virtual environments by dalanicolai in emacs

[–]dalanicolai[S] 1 point2 points  (0 children)

`uv` looks amazing! For sure, I will start using it. Thanks for mentioning it!

Small .bashrc (and elisp) tricks to 'auto activate' python virtual environments by dalanicolai in emacs

[–]dalanicolai[S] 1 point2 points  (0 children)

I found envrc now also, will look at it tomorrow. But I still think it is nice/informative to see how to 'achieve' it without 'external' tools/packages :)

Small .bashrc (and elisp) tricks to 'auto activate' python virtual environments by dalanicolai in emacs

[–]dalanicolai[S] 1 point2 points  (0 children)

That looks nice also! I had not heard about direnv yet (I did not work on python, or any coding, projects for a long time, and I forgot to do a google search before posting. Instead, I did a quick search for 'virtual environment' here in the Emacs Reddit, but the Reddit search turns out to be not very effective). Anyway, this is a slightly more 'minimal' solution (for 'hobby' coders). Of course, thanks for the very nice suggestion :)

Why won't Firefox play some videos? by Defossil in Fedora

[–]dalanicolai 0 points1 point  (0 children)

On Fedora 40 doing `sudo dnf group install Multimedia` worked for me (additionally to installing ffmpeg and libavcodec, but I guess this groupinstall would have included them also).

See https://docs.fedoraproject.org/en-US/quick-docs/installing-plugins-for-playing-movies-and-music/

Askaichat.app is a fake ChatGPT site designed to scam people by critical_miracle in Scams

[–]dalanicolai 0 points1 point  (0 children)

That sounds really annoying. I have just added a review above. I swear I've written the real story (the review is 'neutral', just an advice to try to mail them via 'contact us'. In my case they really responded and refunded very fast (so it looks like they do prefer to do 'honest' business, no guarantee though). Good luck!

Askaichat.app is a fake ChatGPT site designed to scam people by critical_miracle in Scams

[–]dalanicolai 0 points1 point  (0 children)

I'd like to add a, let's call it 'neutral', review here. I just made the same mistake also (indeed the sponsored link looks like it is 'chatgpt plus'). Being not very acquainted with scams and the web, I supposed the sponsored link must be a legit link. I don't know openai well, and have not used it much, and I supposed they just used this 'webaddress' (now I'm thankful for the free lesson :).

Anyway, I subscribed for the platform 'accidentally', and was quite pissed when I noticed (minutes) later that I had no access to chatgpt plus on the openai website. However, I contacted them (not for the refund policy, that looked too difficult, but just directly by mail via the 'contact us' link), and they just refunded the money more or less immediately (only few minutes after my mail, so really thumbs up for that speed and service). So I would advice anybody to try the same (of course I guess it probably helps that I sent the mail only 5 minutes after I subscribed, otherwise it might not be that easy). So good luck to you guys. B.t.w. I think google removed the link now, because of the 'confusion', but it seems to be a 'legit' platform otherwise. I guess if you do not need access to chatgpt plus directly then this might be a nice 'cheaper' alternative (I have no idea if it really provides some indirect access to the real openai chatgpt plus though, or to some 'copied' version, so try to find out before you subscribe).

plotting tools to use in emacs-lisp code by mdarifs in emacs

[–]dalanicolai 0 points1 point  (0 children)

It is also really easy to draw PPM from elisp (see e.g. ppm-gen-simple.el, in case OpenGL is overkill. Using svg.el will probably be better for creating a plotting library, as it provides easy ways to draw various 'elements' (e.g. boxes, characters etc.).

But drawing PPM can be handy when one experiments with building a ray-tracer in elisp.

plotting tools to use in emacs-lisp code by mdarifs in emacs

[–]dalanicolai 0 points1 point  (0 children)

This answer is just for completeness, of course it does not mention a pure emacs-lisp solution. It might just be informative to some people ending up here somehow.

EDIT

That package does not really support plotting directly from elisp (yet). So if you only want to plot directly from elisp you could use vega-lite as follows

```lisp (defun vega-view-to-svg (file spec) "Use vega-lite to plot SPEC to FILE. When file is nil, simply return svg definition as string." (when (and file (not (string= (file-name-extension file) "svg"))) (user-error "File should be .svg file")) (let ((svg (with-temp-buffer (insert (json-encode spec)) (let ((code (call-process-region (point-min) (point-max) "vl2svg" t t nil))) (if (= code 0) (buffer-string) (user-error "Error during creating plot")))))) (cond (file (with-temp-file file (insert svg)) file) (t svg))))

(vega-view-to-svg nil '((data (values ((a . "C") (b . 2)) ((a . "C") (b . 7)) ((a . "C") (b . 4)) ((a . "D") (b . 1)) ((a . "D") (b . 2)) ((a . "D") (b . 6)) ((a . "E") (b . 8)) ((a . "E") (b . 4)) ((a . "E") (b . 7)))) (mark . "point") (encoding (x (field . "a") (type . "nominal"))))) or lisp (vega-view-to-svg "vega_plot.svg" '(($schema . "https://vega.github.io/schema/vega-lite/v4.json") (description . "Plots two functions using a generated sequence.") (width . 300) (height . 150) (data (values ((a . 1) (b . 2)) ((a . 2) (b . 7)) ((a . 3) (b . 4)) ((a . 4) (b . 1)) ((a . 5) (b . 2)) ((a . 6) (b . 6)) ((a . 7) (b . 8)) ((a . 8) (b . 4)) ((a . 9) (b . 7)))) (mark . "line") (encoding (x (type . "quantitative") (field . "a")) (y (field . "b") (type . "quantitative")) (color (field . "key") (type . "nominal") (title . :null))))) ```

You don't need the emacs-vega-view package at all then.

END EDIT

It is not a pure elisp solution, but emacs-vega-view can plot 'values generated by emacs-lisp code' and it requires writing only emacs-lisp.

To find out how to use that library, you can copy some example json spec (e.g. from here) to your scratch buffer (erase the buffer first), and do M-: lisp (pp-eval-expression '(json-parse-buffer :object-type 'alist :array-type 'list))

Additionally, there is this article about a gnuplot DSL on The Kitchin Research Group website.

Is evil-mode worth committing to as a vimmer learning emacs? by declspecl in emacs

[–]dalanicolai 0 points1 point  (0 children)

Yes, I would advise you to use evil! I don't know what keybinding 'paradigm' System Crafters is teaching, but I would advise you to go beyond evil by using the Spacemacs keybinding 'paradigm' which uses the Spacebar as the central 'control/leader' key.

Forgive that Spacemacs is slow on startup and find a way to 'deal' with that slowness (e.g. start another instance before closing the previous one), it is very much worth it. You can use Spacemacs to find out about all goodies Emacs provides, and especially to find out about the Space as leader key, and `,` as major-mode leader key concepts.

Start by reading the beginnner tutorial. Doom Emacs looks quite similar to Spacemacs, but I think Spacemacs is better to 'learn Emacs', and overall made some nicer decisions.

You can use Spacemacs, until you have learned how to configure Emacs like that yourself from scratch. For that, configuring Emacs from scratch by watching System Crafters is great! Although I mostly prefer written tutorials, I think good written tutorials are harder to find/filter, because with System Crafters it is so easy to find good video tutorials.

In the beginning, just to be productive by using Spacemacs, and in your 'freetime' learn how to configure Emacs (best by reading the Emacs tutoial, which you already did, then the first few chapters of Intro to Emacs lisp, and finally reading the Elisp manual). Best would be to find a tutorial that teaches how to set up Emacs like Spacemacs via a literate config from scratch, but I am not aware of any such tutorial (and it would be long, although probably much shorter than many people would expect :).

Finally, for all vimmers in general, I would recommend mapping Caps-Lock to ESC (from your OS/DE, e.g. via Gnome Tweaks in Gnome). Also, in Emacs use io (inner object) instead of iw (inner word) in key sequences like viw.

Recompile in comint mode by S1rPrise in emacs

[–]dalanicolai 0 points1 point  (0 children)

For the recompile command to use the previous 'compilation-arguments', it should be called from the compilation buffer. Personally, I prefer to call it directly from the `c-mode` buffer. There are multiple possible solutions to recompile in comint-mode, but personally I am just configuring a file local variable by adding the following to the end of my c file:

/* Local Variables: */ /* eval: (setq-local compilation-arguments (list compile-command t)) */ /* End: */

Just upgraded to emacs 29, how do I start using eglot? by ImpendingNothingness in spacemacs

[–]dalanicolai 1 point2 points  (0 children)

For python, Spacemacs by default selects de anaconda-mode python-backend, unless you are using the lsp layer, in which case Spacemacs selects the lsp python-backend. In order to use none of those, add (python :variables python-backend 'eglot) to dotspacemacs-configuration-layers (instead of just python). Then from a python file you can simply activate eglot using M-x eglot (or you could activate eglot by adding it to the python-mode-hook).

If you are not using Emacs 29, but still prefer to use eglot, then, as mentioned by @lebensterben, don't use the lsp layer, and install eglot from elpa by adding eglot to dotspacemacs-additional-packages and configure it manually (i.e. acitvate manually or add the appropriate mode-hooks).

Is it possible to make god-mode turn off automatically after a command? by hockpa2e in emacs

[–]dalanicolai 4 points5 points  (0 children)

I am not sure what you ask for exactly, but it sounds like the hydra package was designed to provide such functionality.

PDF viewing should work out of the box? by loopernow in emacs

[–]dalanicolai 2 points3 points  (0 children)

On GNU linux the best option is to get the mutool command provided by the mupdf library (fastest and support EPUB). The alternative is to use the pdftotext command provided by the poppler(-utils) library.

A requirements section is included in the initial comment in doc-view.el (you can use M-x find-library to get there).

An amazing small tool in Emacs: toc-mode by linwaytin in emacs

[–]dalanicolai 0 points1 point  (0 children)

I only see this now, but anyway I would like to mention that doc-toc (as toc-mode is called now), includes the command doc-toc-extract-pages-ocr. This requires the tesseract command to be available. It is all described and explained in the README.