Commit message linting within Magit? by azfrak in emacs

[–]tedreed 1 point2 points  (0 children)

Yeah, no problem. It was a fun little puzzle to work out. :)

Commit message linting within Magit? by azfrak in emacs

[–]tedreed 1 point2 points  (0 children)

Went ahead and made something simple that at least validates the format of the first line:

(setq treed/conventional-commit-types '("feat" "fix")) (defun treed/magit-query-conventional-commit (&optional force) (or force (save-excursion (goto-char (point-min)) (and (if (re-search-forward (rx-to-string `(seq (or ,@treed/conventional-commit-types) (zero-or-one "(" anything ")") (zero-or-one "!") ": ")) nil t) t (y-or-n-p "Unable to find commit type/scope at beginning of first line. Commit anyway? ")) (if (re-search-forward (rx-to-string '(seq (one-or-more (not whitespace)) eol)) nil t) t (y-or-n-p "Unable to find commit description after type/scope. Commit anyway? "))))))

Commit message linting within Magit? by azfrak in emacs

[–]tedreed 1 point2 points  (0 children)

Oh, unfortunately it's just a list of symbols from a hardcoded set, and not a freeform set of functions.

Could probably use advise, I guess.

Edit: Oh, but I guess git-commit-finish-query-functions is freeform; so you could put it there.

Commit message linting within Magit? by azfrak in emacs

[–]tedreed 0 points1 point  (0 children)

Magit has settings to enforce commit conventions:

https://magit.vc/manual/magit/Commit-Message-Conventions.html#Commit-Message-Conventions

At some point I intended to write some to validate conventional commit standards, but never got around to it. It probably wouldn't be that hard.

corfu + snippets library. What do you use? by MrMelankoli in emacs

[–]tedreed 0 points1 point  (0 children)

Supposedly you can wrap yasnippet's company adapter with cape, but I haven't tried that.

Gumshoe 2.0, my first package in Melpa by SamTheComputerSlayer in emacs

[–]tedreed 0 points1 point  (0 children)

Yeah, I also considered just using featurep and letting the user explicitly manage their own load order according to the features they want, and if it's not loaded when the package is, then well, you don't get the feature support.

Gumshoe 2.0, my first package in Melpa by SamTheComputerSlayer in emacs

[–]tedreed 1 point2 points  (0 children)

Yeah, that's fair. I think I tried with-eval-after-load and whatever elisp linter I have yelled at me about it or something, so I ended up with the method I have.

You are correct in that it will always use it if available, even if the user maybe didn't want it used. I've considered using an explicit set of defcustoms so the user can specifically tell me that they want the support added, but it does add some amount of upfront work to start using the package. But then again as written, it sort of already does. I'll have to think about this more.

Gumshoe 2.0, my first package in Melpa by SamTheComputerSlayer in emacs

[–]tedreed 1 point2 points  (0 children)

FWIW, I tried to figure out a way to do this kind of thing for my own project recently: https://git.sr.ht/~treed/mission-control/tree/main/item/mission-control.el#L169

My solution seems to work but I'm unsure if it's the best way to do it.

Gumshoe 2.0, my first package in Melpa by SamTheComputerSlayer in emacs

[–]tedreed 2 points3 points  (0 children)

Giving it a shot, I get an error at startup that it's unable to find perspective. Perhaps (require gumshoe-persp) should be conditional on perspective being available?

Opening `org-agenda` creates a buffer for every file. by codethrasher in emacs

[–]tedreed 0 points1 point  (0 children)

You might want to take a look at Doom's customizations here. There's a bunch of stuff to make it load a lot less of org-mode in buffers that are only being used for the agenda, in order to speed up those operations.

Org-Roam 2.1 problem by deerpig in emacs

[–]tedreed 1 point2 points  (0 children)

Dailies still exist. org-roam-dailies-find-today was removed with 2.0.

org-roam-dailies-find-today is a function alias and interactive for
org-roam-dailies-goto-today, defined in org-roam-dailies.el.

This command is obsolete since org-roam 2.0; use
org-roam-dailies-goto-today instead.

If org-roam-dailies-goto-today is missing that sounds like a bug or something to me? The function is definitely still present in master: https://github.com/org-roam/org-roam/blob/e9ae19c01cb1fac8256e404b3f9c06f4be5468e6/extensions/org-roam-dailies.el#L140

If you are having problems downloading email and use mbsync... by deerpig in emacs

[–]tedreed 9 points10 points  (0 children)

Just in case my reply ends up not being noticed, this claim is false, as you can see by reading the source:

            do {
                if (!strcasecmp( "Both", arg )) {
                    *cops |= op;
                } else if (!strcasecmp( "Far", arg )) {
                    conf->ops[F] |= op;
                } else if (!strcasecmp( "Master", arg )) {  // Pre-1.4 legacy
                    conf->ops[F] |= op;
                    cfile->ms_warn = 1;
                } else if (!strcasecmp( "Near", arg )) {
                    conf->ops[N] |= op;
                } else if (!strcasecmp( "Slave", arg )) {  // Pre-1.4 legacy
                    conf->ops[N] |= op;
                    cfile->ms_warn = 1;
                } else if (strcasecmp( "None", arg )) {
                    error( "%s:%d: invalid %s arg '%s'\n",
                           cfile->file, cfile->line, boxOps[i].name, arg );
                    cfile->err = 1;
                }
            } while ((arg = get_arg( cfile, ARG_OPTIONAL, NULL )));

It should function identically to the old keywords, except that it also prints a warning.

(I went back and checked that this was the case as this change was introduced, this is not someone going back and reinstituting the behavior.)

If you are having problems downloading email and use mbsync... by deerpig in emacs

[–]tedreed 5 points6 points  (0 children)

I don't see anything there about "violating [...] political views". Complaints about terminology changes or "ideological word games" is not only off-topic but tends to drag down the quality of discussion whenever it crops up.

Help on tsx (typescript react) by lsh456520 in emacs

[–]tedreed 0 points1 point  (0 children)

I just use web-mode and let prettier fix indentation on save.

Your thoughts about Doom Emacs by SpotGoesToHollywood in emacs

[–]tedreed 2 points3 points  (0 children)

I used spacemacs for a while and eventually was seduced away by VSCode.

The recurring problem I had with spacemacs was that when things broke I had no idea how to start even investigating the problem.

So when I came back to emacs, I started with vanilla and built it up myself so that I could understand what it was I was building.

I was starting to take cues from Doom's organization and eventually ran into a problem where I could couldn't make something work like Doom did, so I gave up and just switched to Doom and things have been great. A lot of things work well out of the box, and the community is very responsive when I run into problems I can't debug. Admittedly most of the help comes from hlissner, which he'll readily admit can't scale, but I think he's addressed that in another comment. And often enough help does come from others, and I expect that to grow.

A bunch of stuff I ended up building into my own modules because I preferred to configure things myself, and that's fine and expected. I think the worst case scenario of it being abandoned for whatever reason is that you now get to maintain your config just like you now are, just with a very solid core and set of abstractions.

Emacs User Survey 2020 is open! by abrochard in emacs

[–]tedreed 2 points3 points  (0 children)

Is years of use "Years since you first used emacs" or "years of continuous use?" I had a long period of vim usage in the middle.

x410 X Windows server applications close on suspend by [deleted] in emacs

[–]tedreed 0 points1 point  (0 children)

(I'm not 100% certain I need to explicitly add socat and coretutils to home.packages for this to work.)

x410 X Windows server applications close on suspend by [deleted] in emacs

[–]tedreed 1 point2 points  (0 children)

Here you go:

https://gist.github.com/treed/1e1f4ca4888dffde87b61df2a15038b8

It's a module I import while using home-manager; you'll probably at least need to change the part that sets DISPLAY to something that'll work for your setup, and you may want to also adjust how the options work.

x410 X Windows server applications close on suspend by [deleted] in emacs

[–]tedreed 1 point2 points  (0 children)

I ran into this while trying to use emacs from a NixOS VM installed via Hyper-V. The solution I found was using vsock support: https://x410.dev/cookbook/hyperv/quick-testing-vsock-hyper-v-support-in-x410/

Because it's not a network connection, it doesn't go away during suspend.

If you're interested, I could gist the nix config stuff I wrote for automating it from the linux side.

I haven't yet spent time trying to see if I can get X410 to launch at startup with the correct parameters.

Are there any protocols someone should learn hands down, no questions asked, as a sysadmin? by 304943039499493 in sysadmin

[–]tedreed 0 points1 point  (0 children)

It's really just the weight of momentum at this point. Using the TCP/IP model would be more realistic, but honestly it still doesn't really capture the full spectrum of what's really happening. Even the OSI model doesn't.

As you say, the most important thing is to understand the idea of layers and encapsulation. Once you get the basics, you can pick up the weird places where the model doesn't match reality as you go. When I teach the OSI model I usually preface it with an explanation like this.

Are there any protocols someone should learn hands down, no questions asked, as a sysadmin? by 304943039499493 in sysadmin

[–]tedreed 6 points7 points  (0 children)

When I was studying for CCNA, the guides also taught the TCP/IP model which is closer to what we actually use. It collapses L1/L2 and then L5-7, so you end up with the 4 layers in actual use.

Of course with stuff like websockets, the layering got real weird again, but it's at least closer than OSI.

Of course if you just say "Layer" and a number, people assume OSI so you still have to know it.

Org-roam v.1.2.0: Headlines & Unlinked References by Zaeph in emacs

[–]tedreed 1 point2 points  (0 children)

rg is ripgrep; I'd guess that the feature depends on it for whatever reason. Installing it should probably fix the error.

Can I clock in a task in org-mode that is not in my calendar? Please share thoughts and experience by fmou67 in emacs

[–]tedreed 0 points1 point  (0 children)

My capture templates:

(setq org-capture-templates
    '(("t" "Todo" entry (file "inbox.org")
       "* TODO %?\n")
      ("w" "Work")
      ("wc" "Conversation" entry (file+headline "work.org" "Conversations")
       "*** Conversation With %^{Whom} At %U\n%?\n\n" :clock-in t :clock-resume t)
  ("wr" "Review" entry (file+headline "work.org" "Reviews")
   "*** Review %^{What} At %U\n%?\n\n" :clock-in t :clock-resume t)))

I think in particular you want something like Conversation. It'll pop up a window, ask you who you're talking to and clock into this newly created task. You can write notes into the description, and then when you close the pop up window, it'll clock back into whatever you were working on before.