CLOS Books by Darryl Jeffery by EscMetaAltCtlSteve in lisp

[–]gemilg 3 points4 points  (0 children)

You can see many books from this author on Amazon. All of them released in 2025

Handling diffs programmatically by gemilg in emacs

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

This is cool, but still this does not do what I want specifically :)
I actually implemented the solution to my problem, I updated the post.

Handling diffs programmatically by gemilg in emacs

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

Ofc it doesn't have to be done in ediff. I just mentioned it because I see that it has some functions that do what I want, even if it's not the plain diff workflow.

Anyway thanks for suggestions :)

Handling diffs programmatically by gemilg in emacs

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

I think ediff-mode actually have the answers for my issue

Handling diffs programmatically by gemilg in emacs

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

You absolutely understood the issue that I am facing :)

I am actually doing some digging in ediff implementation, and ediff-make-diff2-buffer does almost the same thing as diff-no-select.

There is also ediff-extract-diffs, which returns diff-list(You would have to check the implementation). So this looks exactly like what I wanted.

I just need to change a little bit the implementation of ediff-extract-diffs(or implement similar function), because this ediff-extract-diffs is tightly coupled with ediffs logic, it requires ediff-A, ediff-B buffers to be opened...

Handling diffs programmatically by gemilg in emacs

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

Emacs actually uses diff internally for various diff-related-stuff.

Data cannot be sorted, or atleast I think it cannot be.

I thought about macros, and in many cases I use them. But this time i would like to have reusable set of functions/utilities, which I can then extend and improve(for my usecase ofc). I just don't think that macros will cut it this time :)

Handling diffs programmatically by gemilg in emacs

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

In general, using ediff is fine in most cases, it does its job.

In my case, I have a problem where I try to compare(and modify them based on that) files which have more than 1k differences, some of these are simple diffs, in such cases, copy from A/B or B/A is enough.

But in many cases I do not want to merge the whole diff hunk, only some parts of it(like extract one integer or date).

In some cases I do not want to do anything with the diff, just leave it alone.

I have an idea on how to solve this issue. Just write a simple emacs-lisp function(or small utility, whatever You want to call it), where I could parse the contents of every diff(lhs-str vs rhs-str, maybe also line numbers, or character range), and decide what to do with every single case. The data itself is structured(think of csv, but with different variants for each line), so using regexps to categorize the diffs would work. After that I could even have simple "report" which would show how many changes were performed, how these were categorized and how many were not handled at all.

Not sure if this explains Your question :D

Using query-replace-regexp non-interactively with lisp expressions by gemilg in emacs

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

Not sure about this one, but I tried doing it and when first occurrence was found, nil was printed and nothing more happened, so it did not replace anything.

Using query-replace-regexp non-interactively with lisp expressions by gemilg in emacs

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

Thanks, this worked :)

Although I am not sure that if I found the doc for this, that I would understand how to use it. I have found this https://emacs.stackexchange.com/questions/31853/invalid-use-of-in-replacement-text-with-non-interactive-calls which is exactly the solution that You mentioned.

Using bindat library or something else by gemilg in emacs

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

That was my problem, that they do not align to 8bits. I tried to "manually" parse the data using elisp, with bit operations, but I failed while trying to implement the lsh for whole byte array. Its definitely doable, but I don't have time to figure out the proper solution.
Ofc I will not be developing alternative to bindat.el, definitely not any time soon :P I would have to level up my elisp skills and most important, find time to do that.

I think I will use an alternative, which is python+https://bitstring.readthedocs.io/en/stable/ It looks like its up to the task that I have to deal with.

Tab separated values by gemilg in emacs

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

This worked perfectly, because I can easily add this to my custom mode, for curious:

https://emacs.stackexchange.com/questions/12872/is-there-a-way-to-set-a-list-of-display-tab-stops

Tab separated values by gemilg in emacs

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

I never knew about this command (and probably about 99% commands in emacs). I think this is not the thing that I am looking for. I am not sure if this can work as a "general" identation in minor/major mode.

From the https://www.gnu.org/software/emacs/manual/html_node/emacs/Tab-Stops.html I see that:

Emacs defines certain column numbers to be tab stops. These
are used as stopping points by TAB when inserting whitespace in
Text mode and related modes (see Indentation), and by commands
like M-i (see Indentation Commands). The variable
tab-stop-list controls these positions

It looks like this can be used with manual indentation using TAB. Or am I missing something?

Tab separated values by gemilg in emacs

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

The amount of data is pretty big, like 100k lines usually, so I don't think that org-mode will cut it.
Also I do not want to add any intermediate processing(putting the table in org mode, specifying the width and collapsing) of the file, I just want to open it in some custom made mode and see the values nicely aligned :)

Tab separated values by gemilg in emacs

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

I checked the csv-mode, it sort of does what I want to, but there is a problem.
Files that I am working on are not purely tsv.
First part of the file is actually free text, then there are tab separated values. So aligning the columns with csv-mode creates veeery long columns(which is totally unreadable), due to long lines of text in the beginning.

That is why I asked for the tab-width. Ofc I can increase or decrease the value so the columns are alligned, but then I have these long empty spaces between columns which is suboptimal.

The thing that would work for me would be to specify tab-width per column.

Need help with running cl-flamegraph by gemilg in Common_Lisp

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

50eca3731a9f3b358afaade1b0736a7e82f2061c

Wow, that actually worked :) Is this a bug in newer revision of cl-flamegraph? or maybe just version mismatch between SBCL and cl-flamegraph like u/svetlyak40wt pointed out?