cage, to emacs
@cage@emacs.ch avatar

Hello Emacs hackers!

A new version of annotate.el (2.0.3), a mode to annotate files without
changing them, has been released; this is a bugfix release.

This version fixed a bug that could render with the same color two
adjacent annotations.

Annotate.el is available on MELPA and also on NonGNU ELPA; this means
that, if you are using an Emacs version greater or equal than 28, you
could simple run the command: 'M-x package-install RET annotate RET'
to install the package.

The development repository is available on:

https://github.com/bastibe/annotate.el

Happy hacking!
C.

tripleo, to Lisp
@tripleo@fosstodon.org avatar

What is the difference between a macro and a function?

abcdw, to guix
@abcdw@fosstodon.org avatar

Bibliography in Emacs.

  1. I found a Zotero guix package: https://github.com/guix-science/guix-science/pull/27/files

  2. @goku12 mentioned https://github.com/mpedramfar/zotra emacs package, which can use zotero translators without zotero client itself!

  3. There is org-capture-ref package. https://github.com/yantar92/org-capture-ref, which is similiar to zotra, but more ad-hoc.

  4. It's seems that a good solution will be to package zotra and translation-server and setup org-protocol handler for capturing bib entries from browser.

pglpm,
@pglpm@emacs.ch avatar

@abcdw @goku12 For the past 20+ years I've maintained a bibliography using nothing but & mode on what's basically just a text (.bib) file. A short function also allows me to immediately open the document (say, pdf or djvu) corresponding to the entry, simply by entering F9 anywhere on the entry. This system has several advantages:

  • Emacs's regexp-search together with reftex-citation allow for incredibly powerful and flexible searches through the database
  • Any other interaction niceties more or less easily implementable through elisp code. For instance, I have a custom function that abbreviate a selected piece of text according to ISO 4 standard
  • It's basically just a text file, so in particular situations one can search or modify with any text editor
  • Automatically integrated with Emacs & AUCTeX when writing TeX files (in Emacs of course :) )

Of course it's a purely subjective choice, I'm not saying it's objectively better than any other. But worth considering and trying!

summeremacs, to emacs

Next to last, we have a demonstration of table calculations in Emacs! Only, I don't have to keep track of my weight loss, but I do have to keep track of other little things sometimes and it might be handy to learn this stuff for THAT kinda thing.

DyerDwelling: Org Table to Calculate Weight Loss
https://www.emacs.dyerdwelling.family/emacs/20230910100202-emacs--weight-loss-tables/

nnungest, to emacs
@nnungest@fosstodon.org avatar

Before I go off writing , anyone know how to search multiple projects at once with projectile? Using btw.

howard, (edited )
@howard@emacs.ch avatar

@holgerschurig @nnungest Yeah that use of rgrep might be a good excuse for a small wrapper around shell-command (see the dwim project, https://github.com/xenodium/dwim-shell-command).

You might also take advantage of ripgrep or the silver searcher to make the results a little nicer.

stalecu, to emacs

Until now I seriously underestimated in . Wow, the integration it has is amazing, I get nice autocompletion and, of course, integration with Elisp. The only problem is that I have to adapt to the Eshell way of doing things (i.e. stuff like eval "$(ssh-agent -s)" don't quite work) and it's a dumb terminal (quite literally, so I have vterm as a backup), but FWIW it is underrated, don't scoff at it.

starbreaker,

@stalecu I recently got into myself and have been doing as much as I can with it while using as a fallback. It's pretty sweet, and I no longer need the as a calculator. I can use REPL instead when I want to see how badly I got screwed by working unpaid overtime.

laejoh, to emacs

My first function for that I wrote myself, -view-notifications!

galdor, to random
@galdor@emacs.ch avatar

Go 1.21 introducing min and max is good. Go devs finally realizez that "c := max(a,b)" is better than:

c := a
if b > a {
c = b
}

If we're luck in a couple years they'll finally understand why so many have been asking for the conditional ternary operator. One can dream.

sqrtminusone,
@sqrtminusone@emacs.ch avatar

@louis @galdor @a13cui To be honest, I'm skeptical about defining "superiority" on the set of isomorphic representations of reasonable code.

Of course, there's the space of bad code, e.g. long hard-to-understand poorly-documented (take any) functions, spaghetti code, WET, unreadable constructs such as nested ternaries, etc., etc... And better programmers sample that space less, but it's substantial, even in more minimal languages.

I.e. I doubt you can write "better" code, you can write the code that is less bad perhaps.

Conversely, I'm in love with , so I know I can write the same iteration construct with mapcar & co, cl-loop, threading macros, seq-, dash functions, dolist, cl-do, cl-reduce & the rest of cl-, hmm, what else... And I don't feel like I've grown much because of that 🙂

By the way, it's kinda the same with the aforementioned darkness.js, with its countless _.chain(libraries) besides the built-in loop expressions, .map / .reduce / whatever, .forEach... A Scheme with C syntax indeed.

And next to the above, there's the space of memory/compute inefficient code... From my work with students, I often find it harder to explain that this code is O(n!) while it should be O(n^2).

Besides, there are principles of single responsibility, separation of concerns, which are mostly language-independent. And architectural decisions.

...maybe I'll change something in this stream of consciousness if I manage to work in the field for the next 20 years 🤷

Mehrad, to emacs
@Mehrad@fosstodon.org avatar

What package do you use for case conversion (snake_case, kebab-kase, dotted.case, etc.)?

pedro76,

@Mehrad Here's the function that does the trick (an function is simplier than installing a package)
Thanks to the videos of @zamansky, it was easy

(defun lower-case-hyphen ()
"Convert a region by putting lowercase and replacing spaces by hyphen"
(interactive)
(if mark-active
(let* ((s (buffer-substring-no-properties (point) (mark)) ))
(kill-region (point) (mark))
(insert (string-replace " " "-" (downcase s)))
)

)
)

pedro76, to emacs French

Remember I am a newbie : I wanted to open a link from into
I am sure there's already a way, but I didn't find it

So it was the opportunity to make my first code (obviously some bits are copied from internet).
I begin to realize what "empowerment" means when you become a
Sure not academic but it works !

Attachments: None
|=================================================================|

lambdageek, to vscode
@lambdageek@mastodon.social avatar

I've been doing some VS Code extension hacking recently (something cool coming soon, possibly!) and I have to say...

It is really a testament to LISP and to the Emacs contributors that docstrings are:

  1. a core part of the language
  2. are available on nearly every function and command

The best way to even find out if a command exists in VS Code is to open the "keyboard shortcuts" window. And then just guess the args…

luis_felipe, to emacs
@luis_felipe@mastodon.online avatar

How do you make paredit work when editing elisp in Org mode's code blocks?

MenacingMecha, to orgmode
@MenacingMecha@mastodon.gamedev.place avatar

What options do I have for parsing child headlines in ?

Can find a million and one options for walking up the tree, but struggling to find how to walk down

:emacs:

olav, to emacs
@olav@emacs.ch avatar

I just discovered this novel feature:

As part of their definitions, functions can be declared as being pure and side-effect free. This shows up in Help buffers and is also used by the compiler for optimisation. These types of declarations are associated with the symbol as opposed to the function value(https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Properties.html), just like metadata(https://clojure.org/reference/metadata).

I know has a similar feature where functions can be marked as being pure (https://tour.dlang.org/tour/en/gems/functional-programming), but I haven't seen it anywhere else. I suppose immutable references are kind of similar too, although that's stretching it.

Are there any there any other cool or novel features in elisp?

bram85, to emacs
@bram85@emacs.ch avatar

This piece of makes execute certain code when opening a file with a particular name. This is useful for files that have no clear extension or mode setting.

I use it to enter yaml-mode whenever I open a .clang-format file (which I don't want to pollute with -*- magic).

https://apps.bram85.nl/git/bram/gists/src/commit/ad450efe2064441477a9f5e8bd97cf83efd00e5a/gists/find-file-hook-for-certain-filenames.el

The original code was inspired by this StackExchange post, but I found the implementation quite cumbersome so I rewrote it to make it more condense.

https://emacs.stackexchange.com/a/77480/34645

Anoncheg, to emacs
  1. fixed emacs: message of found auto save # was hidden by another messages
  2. I learned code extension mechanism called "advice", it can add code before/after/around any Elisp defined function.
  3. I enhance my scripts with image posting to , I use Org mode and call saved bash scripts,
    here is how it looks now:
ms, to random
@ms@emacs.ch avatar

I'm starting to learn . Can someone tell me why

(message "start")  
(message (shell-command-to-string "kubectl config get-contexts -o name"))  
(message "end")  

doesn't message anyting from line 2? Line 1 and 3 work fine.

Torchwood, (edited ) to emacs
Torchwood avatar
rml, to random

When @spritelyinst closes in on their work on 's wasm compiler (maybe later this year?!), it'll certainly become the easiest way to target optimized . Tree-IL has gotta be the simplest intermediate language to compile to, and you get all the optimizations Guile offers for free.

Considering Robin Templeton, the author of Guile's compiler, is one of the engineers behind it, I can't help but speculate that this will put in the browser within reach. If I can handle my org-agenda online by 2025, I will cry.

It's called because it allows just a few friends to plot a CONSpiracy to build amazing things.

screwtape, to internet
@screwtape@mastodon.sdf.org avatar


@amszmidt is right to balkanize and .

Whatever lisp was, it died out in the 80s, survived by rnrs and a portability ansi standard to the 32bit x86 era.

Now that the MIT CADR https://tumbleweed.nu/lm-3/ and (medley) dmachine https://interlisp.org/ have reincarnated, should be deported back to and and used as a portability standard.

In contrast rnrs scheme https://scheme.org -> (incf n) rnrs scheme https://scheme.org

screwtape,
@screwtape@mastodon.sdf.org avatar

I figure the counterargument is : however elisp is not portable out of emacs, and emacs is only host to common lisp development in the sense that it's a host to C development, if that.

len, to fediverse Slovenian

Hello from . I must admit I was a bit displeased with seeing all the posts on so I went to check how mastodon looks from inside the emacs. So far I like it. I have a constant urge to C-x C-s while writing this toot.

Since I'm in Emacs I'm also quite pleased how last Emacs user group Slovenia meetup unfolded. It was not very crowded (if I'm being modest) and so I took the liberty to read the article on making elisp repl more comfortable. I've added the config to my as well.

Hopefully I'll find some time to get better in in the upcomming months.

wasamasa, to random

Using xcb.el I managed to recreate a X11 drawing demo with . This may or may not pave the way forward to faster graphics rendering programs in ...

https://www.x.org/releases/current/doc/libxcb/tutorial/index.html#drawingprim

wasamasa,

One tip for profiling non-interactively when using --batch:

(require 'profiler)
(profiler-start 'cpu)
;; ...
(profiler-stop)
(let ((filename (format "%d.profile" (truncate (float-time)))))
(profiler-write-profile (profiler-cpu-profile) filename))

You can then use M-x profiler-find-profile on the file.

I've moved some of the request objects outside the drawing loop and resorted to reusing one object per type of request, then mutating the fields as necessary before sending the request. Now the performance hotspots left seem to be inside the data marshalling code. I can't do much about it unless I were to rewrite it to avoid creating/walking objects in the first place.

mitchmarq42xyz, to emacs

I'm working on re-implementing a certain Zsh prompt in and wanted better access to the current-directory portion. I split it with (split-string default-directory "/" t) and spent about 20 minutes trying to put it back together.

Then realized string-join exists.

Dammit !

mitchmarq42xyz,

Scraping the shell command output was the way to go - perhaps a little slower, but far more reliable.

So thankful for dash.el's --> macro. Makes me feel like I'm programming in bash again (in a good way). Must use it more.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • InstantRegret
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • tacticalgear
  • ethstaker
  • provamag3
  • cisconetworking
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • modclub
  • megavids
  • normalnudes
  • Leos
  • lostlight
  • All magazines