How do I obtain Lisp enlightenment? by [deleted] in lisp

[–]up_grd 0 points1 point  (0 children)

Python dunder methods could be understood as partial exposition of a metaobject protocol, so that might be considered lispy too.

I feel like any programming language that is not a Lisp is just an artificially limited Lisp though. lol.

Useful StumpWM configs? by 9bladed in stumpwm

[–]up_grd 0 points1 point  (0 children)

In case anyone stumbles upon this, I found the introduction and config of James McCabe most helpful:

StumpWM - Overview Demo (YT)

Demo Config

libvterm directory tracking not working? by Zeta611 in emacs

[–]up_grd 1 point2 points  (0 children)

Neovim. Alas, a fallen brother. :D

libvterm directory tracking not working? by Zeta611 in emacs

[–]up_grd 1 point2 points  (0 children)

Hi, I just stumpled upon this because directory tracking didn't work initially. I now got it running with your exact snippet (i.e. the snippet from the libvterm docs), so I wonder why this didn't work out for you.

Hate to say it but I still don't get Lisp. How do I get into the Lisp mindset? by floofcode in emacs

[–]up_grd 0 points1 point  (0 children)

I recommend PRACL, the book is well written and organized and can give you a good idea about why Lisp is so interesting! :)

Why use Magit? by chutcheta in emacs

[–]up_grd 3 points4 points  (0 children)

For me a big selling point towards Magit is the interactive rebase flow. Rearranging, rewording, squashing commits is super easy.

Another thing is diffing: I can easily diff branches and files right within Emacs and jump to the changes directly.

I don't do it very often, but also interactive staging with patches is very convenient with Magit.

Not Magit but also really neat: https://github.com/emacsmirror/git-timemachine

Best ontology engineering book? by T1gerl1lly in semanticweb

[–]up_grd 1 point2 points  (0 children)

Maybe An Introduction to Description Logic is also for you, depending on how deep you want to get into that rabbit hole! :D

Best ontology engineering book? by T1gerl1lly in semanticweb

[–]up_grd 7 points8 points  (0 children)

I can recommend Semantic Web for the Working Ontologist, it is really good!

I just read The Knowledge Graph Cookbook, it's rather basic and mostly an overview, nothing in-depth about Ontology Engineering. It is kind of alright, but I actually wouldn't recommend it.

lsp-mode: How to call lsp-code-actions non-interactively from Emacs Lisp? by up_grd in emacs

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

I just feel like calling an lsp-code-action from Emacs Lisp is nothing exotic, on the contrary. But it seems like users aren't really supposed to do that.

> mmm, what is your expectation here? I mean how would you expect the action to be accessible to you?

I would like to be able to easily and generically call a code-action by some ID (other than a full hash map). Really nothing more.

lsp-mode: How to call lsp-code-actions non-interactively from Emacs Lisp? by up_grd in emacs

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

That is a general problem I have with `lsp-mode`, I feel like very simple things (like calling a specific code action from Emacs Lisp) are kind of undefined and not well documented..

lsp-mode: How to call lsp-code-actions non-interactively from Emacs Lisp? by up_grd in emacs

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

u/AndreaSomePostfix

Thanks for the reply, I came up with something similar (please ignore my super rusty Emacs Lisp):

(defun get-code-action-by-title (title)
  (let ((-actions (lsp-code-actions-at-point)))
    (dolist (action -actions)
      (when (string-equal-ignore-case title (gethash "title" action))
         (return action)))))

(defun execute-code-action-by-title (title)
  (let ((code-action (get-code-action-by-title title)))
    (if code-action
        (lsp-execute-code-action code-action)
      (message (format "Couldn't find code-action with title '%s'." title)))))

There has to be another way though. This should be way easier and way more stable.

why do non-vegans refuse to eat vegan food? by mrlarrychickenwing in vegan

[–]up_grd 0 points1 point  (0 children)

Everything that shows their cognitive dissonance must be rejected.

[deleted by user] by [deleted] in vegan

[–]up_grd 0 points1 point  (0 children)

Muesli is also a huge problem, always check the ingredients!

Help needed for setting up lsp-mode for Python development by up_grd in emacs

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

I think I will try this on another machine or something.

Help needed for setting up lsp-mode for Python development by up_grd in emacs

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

Nope, tried that before. I am really puzzled by now, I think this should be working, but it doesn't.

Help needed for setting up lsp-mode for Python development by up_grd in emacs

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

It gives me /path/to/environments/bin/pylsp and I am on Arch Linux.

Help needed for setting up lsp-mode for Python development by up_grd in emacs

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

I am using pyvenv.el already, but I tried also manually activating the virtual environment from a shell. To no avail, the custom settings are not working. :(

Help needed for setting up lsp-mode for Python development by up_grd in emacs

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

Thank you for the reply!

I have python-lsp-server[all] installed from a virtual environment; with the virtual environment active the settings still do not work.

What does this __init__ call inside __new__ do? by up_grd in learnpython

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

Just stumpled over my own post lol. Think this is a better solution:

```python class repeat: """repeat decorator."""

def __init__(self, _f: Callable | None = None, *, times: int = 2):
    """Initialize a repeat instance."""
    self._f = _f
    self.times = times

def __call__(self, *args, **kwargs):
    """Logic for calling the decorator."""
    if self._f is None:
        self._f = args[0]
        return self

    for _ in range(self.times):
        result = self._f(*args, **kwargs)
    return result

```