profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/Fuco1/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Matus Goljer Fuco1 @ydistri Czech Republic, Bulgaria http://fuco1.github.io/sitemap.html Emacs hacker, spaces > tabs

cask/cask 1169

Project management tool for Emacs

bbatsov/emacs-lisp-style-guide 908

A community-driven Emacs Lisp style guide

emacs-elsa/Elsa 494

Emacs Lisp Static Analyzer

DamienCassou/beginend 85

Emacs package to redefine M-< and M-> for some modes

Fuco1/.emacs.d 61

My emacs config

Fuco1/achievements-mode 16

Achievements for emacs!

Fuco1/blablabla 14

A follower to litable

Fuco1/autobookmarks 13

Automatic bookmarks

Fuco1/better-jump 11

Better ace-jump-mode

Fuco1/banana.el 8

Monads for elisp

issue commenttidyverse/dplyr

dplyr::select has quite big overhead on simple selects

Yea, they have a common pattern in the name. But I thought selecting the columns will make things faster as the tibble will get smaller, but it got slower instead :D Maybe there's no action to do other than documenting that [] is much faster than select and in a tight loop can mean quite a lot of difference.

Fuco1

comment created time in 12 days

issue commenthashicorp/consul

UI: Provide a path prefix

Instead of adding rules for each path, you can use this hack and make a rule based on a referer header which all the API calls include. This is a traefik config:

[http.routers]
  [http.routers.nomad]
    rule = "PathPrefix(`/ui`) || PathPrefix(`/v1/client/fs/cat`) || HeadersRegexp(`referer`, `https://domain.com/ui/.*`)"
    priority = 1999               ## important because vault uses the same /ui prefix
    service = "nomad"
    [http.routers.nomad.tls]

  [http.routers.consul]
    rule = "PathPrefix(`/consul`) || HeadersRegexp(`referer`, `https://domain.com/consul/.*`)"
    service = "consul"
    [http.routers.consul.tls]

  [http.routers.vault]
    rule = "PathPrefix(`/ui/vault`) || HeadersRegexp(`referer`, `https://domain.com/ui/vault.*`)"
    priority = 2000
    service = "vault"
    [http.routers.vault.tls]
kvz

comment created time in 12 days

issue openedtidyverse/dplyr

dplyr::select has quite big overhead on simple selects

Related to issue https://github.com/tidyverse/dplyr/issues/5079, I think there is value in optimizing the select for the most common case of just selecting a bunch of columns by name.

This bit me in our analysis where removing the select before transmute makes the code twice as fast! Our scale is 18 million calls of this function in a pretty tight loop and this adds up to about 7 hours of overall compute, which is not insignificant when you consider the 7 hours is spent subsetting a bunch of columns.

The reprex models our data closely, the inputs are tibbles of 20 to 50 rows with about 40 columns. The operation is performed on 12 columns basically computing the difference between estimate and original (i.e. residuals).

bench_tibble <- tibble(
    a = runif(50),
    b = runif(50),
    c = runif(50),
    d = runif(50),
    e = runif(50),
    f = runif(50),
    g = runif(50),
    h = runif(50),
    i = runif(50),
    j = runif(50),
    k = runif(50),
    l = runif(50),
    a_2 = runif(50),
    b_2 = runif(50),
    c_2 = runif(50),
    d_2 = runif(50),
    e_2 = runif(50),
    f_2 = runif(50),
    g_2 = runif(50),
    h_2 = runif(50),
    i_2 = runif(50),
    j_2 = runif(50),
    k_2 = runif(50),
    l_2 = runif(50),
)

bench_summarize_select <- function(data) {
    transmute(
        select(data, a, b, c, d, e, f, g, h, i, j, k, l),
        x_1 = a - g,
        x_2 = b - h,
        x_3 = c - i,
        x_4 = d - j,
        x_5 = e - k,
        x_6 = f - l
    )
}

bench_summarize_no_select <- function(data) {
    transmute(
        data,
        x_1 = a - g,
        x_2 = b - h,
        x_3 = c - i,
        x_4 = d - j,
        x_5 = e - k,
        x_6 = f - l
    )
}

bench_summarize_subset <- function(data) {
    transmute(
        data[c("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l")],
        x_1 = a - g,
        x_2 = b - h,
        x_3 = c - i,
        x_4 = d - j,
        x_5 = e - k,
        x_6 = f - l
    )
}

bench::mark(
    bench_summarize_select(bench_tibble), 
    bench_summarize_no_select(bench_tibble), 
    bench_summarize_subset(bench_tibble)
)

The result shows that the select makes it about twice as slow.

# A tibble: 3 x 13
  expression                                 min median `itr/sec` mem_alloc
  <bch:expr>                              <bch:> <bch:>     <dbl> <bch:byt>
1 bench_summarize_select(bench_tibble)    7.81ms 8.41ms      117.    29.6KB
2 bench_summarize_no_select(bench_tibble)  3.2ms  3.5ms      279.    23.7KB
3 bench_summarize_subset(bench_tibble)    2.94ms  3.3ms      292.    10.2KB

created time in 13 days

issue commentFuco1/smartparens

SP behavior differs in `mhtml-mode` and `html-mode`

It's because the file smartparens-html.el which is loaded when you load the package sets the configuration to all the modes in the list. So you would need to reload that file and it should work.

An example configuration that is there looks like this

(--each sp--html-modes  ;; <- do something for all the modes in the list
  (add-to-list 'sp-navigate-consider-sgml-tags it))

which obviously does not run if you update the variable later.

Glad the issue is resolved. Is mhtml-mode common? We can add it to the list by default, which would make sense if it is something more people can come across.

thomasheartman

comment created time in 13 days

push eventFuco1/smartparens

Matus Goljer

commit sha 2834c66c4f09778d0c57e99886c329188eed591a

feat(r): do not pair \( in R short-lambda syntax

view details

push time in 14 days

issue commentFuco1/smartparens

Extra trailing brace after haskell comment

I still can't repro on latest haskell-mode 333205066754348b3dd47c5ce834757dd1bbdf48

Imgur

rosekunkel

comment created time in 14 days

push eventFuco1/smartparens

Matus Goljer

commit sha 623e89ef03dac1b699eca37f480687865099b074

test: add rst tests

view details

push time in 14 days

issue commentFuco1/smartparens

Error when editing SAS or Stata source code

There was a bug in some ESS code which was only relevant to R-mode but got applied to all the "ess modes".

jia-j-chen

comment created time in 14 days

push eventFuco1/smartparens

Matus Goljer

commit sha 90c59cb7107e3ea8e78d08314a1a9fec78114995

fix(ess): only test roxy if the regexp is bound and non-nil Fixes #1090

view details

push time in 14 days

issue closedFuco1/smartparens

Error when editing SAS or Stata source code

Expected behavior

No error messages when editing SAS or Stata source code files.

Actual behavior

An error message shows up: sp--post-self-insert-hook-handler: (wrong-type-argument stringp nil)

Steps to reproduce the problem

  1. Open a SAS or Stata source code file (both are statistics programming language)
  2. Start typing
  3. The error appears

Backtraces if necessary (M-x toggle-debug-on-error)

Debugger entered--Lisp error: (wrong-type-argument stringp nil) re-search-forward(nil 2 t) sp--looking-back(nil nil nil) sp--looking-back-p(nil) sp-ess-roxy-str-p("'" insert comment) sp--do-action-p("'" insert) sp--all-pairs-to-insert(nil nil) sp--pair-to-insert() sp-insert-pair() sp--post-self-insert-hook-handler() self-insert-command(1 32) funcall-interactively(self-insert-command 1 32) call-interactively(self-insert-command nil nil) command-execute(self-insert-command)

Environment & version information

  • smartparens version: 20210529.1129
  • Active major-mode: emacs-lisp-mode
  • Smartparens strict mode: nil
  • Emacs version (M-x emacs-version): GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2021-06-03
  • Starterkit/Distribution: Spacemacs
  • OS: gnu/linux

closed time in 14 days

jia-j-chen

issue commentFuco1/smartparens

SP behavior differs in `mhtml-mode` and `html-mode`

Hi. Sorry for the delayed reaction. Let's first try to add the mode to the "html modes" list:

(add-to-list 'sp--html-modes 'mhtml-mode)

The items on the list intentionally do not respect inheritance so that might be the issue.

thomasheartman

comment created time in 14 days

issue commentFuco1/smartparens

Strict mode - cannot disable pair matching with custom predicate

You almost got it. The action you need to disable is navigate not insert because the > does not insert the opening <. With this code I kind of got it working. The skip predicate unfortunately has different API so you need two functions instead of just one.

(defun ar-emacs--point-after-equal-p (id action _context)
  "Return t if point is after \\=, nil otherwise.  This predicate
is only tested on \"insert\" action."
  (when (eq action 'navigate)
    (save-excursion
      (backward-char 1)
      (equal (preceding-char) ?=))))

(defun ar-emacs--point-after-equal-skip-p (ms mb _me)
  "Return t if point is after \\=, nil otherwise.  This predicate
is only tested on  \"insert\" action."
  (and
   (equal ms ">")
   (save-excursion
     (goto-char mb)
     (sp--looking-back-p "=" 1))))


(sp-local-pair 'web-mode "<" ">"
               :unless '(ar-emacs--point-after-equal-p)
               :skip-match 'ar-emacs--point-after-equal-skip-p)

The whole configuration API is so clunky, I don't like it very much :/

arichiardi

comment created time in 14 days

issue commenthashicorp/nomad

Interpolation support for the job priority field

Is there any pointers on to how I would go about implementing this in Nomad? If it is something which doesn't require changing half the core logic, I'd have a go at it, since this is really bothering us a lot.

Here @dadgar wrote that scheduling info must be available during job submission. But as I understand dispatched job really is its own entity so when the dispatch is being placed in nomad's queue it could have the priority set from a meta, right? Further

To clarify how the link issue would resolve this, one could set the priority of the job to be a variable supplied as metadata provided when dispatching the parameterized job.

I don't understand how this is possible to do now.

janet

comment created time in 19 days

pull request commentFuco1/dired-hacks

dired-narrow: call `dired-narrow-find-file' when entering directory

You're not binding dired-narrow-enter-directory in your repro case. However, I added the binding and can reproduce the bug. So there must be something on my system fixing it.

bastidest

comment created time in 19 days

pull request commentFuco1/dired-hacks

dired-narrow: call `dired-narrow-find-file' when entering directory

I'm actually on E26, so that might be the variable which is different here.

bastidest

comment created time in 22 days

issue commentFuco1/dired-hacks

use built in `locate-command` in dired-list-locate

Hi. Is locate-command a new setting in Emacs 27 or 28? I'm still using version 26 and it doesn't exist for me.

If this is a new built-in we can check if it exists and is bound and use it as default and if not fall back to locate.

oneness

comment created time in 24 days

pull request commentFuco1/dired-hacks

dired-narrow: call `dired-narrow-find-file' when entering directory

Hi. I tried to replicate this but can't. Are you sure you are calling dired-narrow-enter-directory (bound to right arrow key or C-j) and not the regular dired find file?

image

bastidest

comment created time in 24 days

issue commentFuco1/smartparens

Delete commands bugging out yank

Yea, I also get this from time to time but I never connected it to smartparens. It might be that some internals changed in the meantime and our code is no longer compatible with newer Emacs versions. I'll test your fix.

AkashaP

comment created time in 25 days

issue openedEdwinTh/padr

Allow no thickening if the "interval" is "too short"

I think this check makes no sense. What if randomly my sales data only happen to be one sale on each 1st day of the month and I'm thickening to a month to perform monthly aggregates. It just crashed my pipeline so it's not just theoretical example :D

https://github.com/EdwinTh/padr/blob/f960e4604346e138d819083d7754f7030d648cfa/R/thicken.R#L128-L131

created time in a month

issue commentFuco1/smartparens

Cheat sheet is empty (Emacs-28.0.50)

Well, this function kind of depends on the internals of help mode so if that changed it will break. When v28 comes out we'll have to fix it.

naoking158

comment created time in a month

push eventFuco1/smartparens

Dmitry Polienko

commit sha 9ffb373082fca531ccc8e878aeb2048b3b9abfb0

Add support for triple quoted string literals in Scala

view details

Matus Goljer

commit sha 22794b5b3773504610127c5f011629402dfec20c

Merge pull request #1099 from nigredo-tori/scala-triple-quotes

view details

push time in a month

PR merged Fuco1/smartparens

Add support for triple quoted string literals in Scala

Fixes #1098

This is not very robust: inserting double quotes inside a literal doesn't seem to count towards the closing lexeme, so there's no "typing yourself out of the literal". Still, it should be better than nothing. Any pointers would be appreciated.

+9 -0

1 comment

2 changed files

nigredo-tori

pr closed time in a month

issue closedFuco1/smartparens

Add support for triple quotes in Scala

Expected behavior

Smartparens should close multi-line string literals in Scala.

Actual behavior

Smartparens doesn't close those.

Steps to reproduce the problem

In scala-mode type in """, note that the result is not balanced

Environment & version information

  • smartparens version: 20210529.1129
  • Active major-mode: scala-mode
  • Smartparens strict mode: nil
  • Emacs version (M-x emacs-version): GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0) of 2021-01-18, modified by Debian
  • Starterkit/Distribution: Spacemacs
  • OS: gnu/linux

closed time in a month

nigredo-tori

pull request commentFuco1/smartparens

Add support for triple quoted string literals in Scala

I think the situation where you open with """ then type stuff and then type " three times to "close" is going to be somewhat problematic. I think in python we tried to do the same thing but gave up and so now it only inserts the closing tripple quote when you input three of them and that's it. Any other fixes you need to do manually (for example with C-q ").

I'll merge this as it is better than not having it. Thanks!

nigredo-tori

comment created time in a month

issue openedhashicorp/nomad

Incorrect order of tags in metrics documentation

Issue

On https://www.nomadproject.io/docs/operations/metrics#host-metrics the labels (tags) are listed alphabetically. However, this is not how labels are processed in the statsd protocol. There, the tags (values) are dot-separated and labels are only implied by order.

So the output of the metrics might be a string:

nomad.client.host.cpu.total.node_id.datacenter.node_class.cpu....

This is relevant for later parsing and assigning the labels to tags. For example, with telegraf you make a template such as

"nomad.client.host.cpu.* measurement.measurement.measurement.field.field....cpu"

This would produce series nomad_client_host with a field cpu_total (when the measurement and field are repeated they are joined by _ into a single identifier). The empty .. omit a value, any other name is the label for that position's value.

I had to find the actual order from the source: https://github.com/hashicorp/nomad/blob/dfb313a6da0954501cc79325ee227c01e7596097/client/client.go#L2797-L2801 and https://github.com/hashicorp/nomad/blob/dfb313a6da0954501cc79325ee227c01e7596097/client/client.go#L2837-L2840

It would be very helpful to list the tags in order they are produced instead of alphabetically. Also, when the order changes all the metrics collection using something like statsd and telegraf can break since it is order-based.

created time in a month

pull request commentFuco1/smartparens

README.md: fix link

Thanks, sorry for the delay!

ebzzry

comment created time in a month

push eventFuco1/smartparens

Rommel MARTINEZ

commit sha 9d2545ca45cf839018e1d66b1baa4d9b84e23998

README.md: fix link

view details

Matus Goljer

commit sha 1d7f8fbf5389f83f4c0ae72cd7fbb6fa3341beda

Merge pull request #1094 from ebzzry/master

view details

push time in a month

PR merged Fuco1/smartparens

README.md: fix link

Hey Fuco1, I moved my website from ebzzry.io to ebzzry.com!

+1 -1

0 comment

1 changed file

ebzzry

pr closed time in a month

issue commentFuco1/smartparens

Distributing spartparens in NonGNU ELPA

Any idea why the version is 4.7.1? https://elpa.nongnu.org/nongnu/smartparens.html

phikal

comment created time in a month

issue commentFuco1/dired-hacks

Feature request: suport desktop.el

I don't use desktop.el and won't add this feature since I'm quite short on time unfortunately. I'm open to a pull request and I can help out with the questions.

aidalgol

comment created time in a month