Emacs

2560 readers
1 users here now

Our infinitely powerful editor.

founded 5 years ago
MODERATORS
1
2
 
 

This uses the tool support from gptel to let any LLM with tool support

  • search my bbdb for contact info
  • perform a bbdb search for all contacts with an anniversary field
  • use gnus to compose an email

plus a few helper functions to make it useful (like giving it the ability to query the current date).

The tool definition it used in the above screenshot are:

(defun gptel-tool--get-date ()
  "Return the current date"
  (format-time-string "%Y-%m-%d"))

(defun gptel-tool--compose-email (to-address subject text)
  "Open an email compose buffer '*new message*' to to-address with subject subject."
  (gnus-setup-message 'message (message-mail to-address subject))
  (insert (concat "\n" text)))

(defun gptel-tool--bbdb-search (name)
  "Search bbdb for NAME"
  (bbdb-search (bbdb-records) :name name))

(defun gptel-tool--bbdb-search-anniversary (anniversary-type)
  "Search bbdb for anniversary with ANNIVERSARY-TYPE"
  (let ((bbdb-default-xfield 'anniversary))
    (bbdb-search (bbdb-records) :xfield anniversary-type)))

And they get registered with the following code:

      (gptel-make-tool
       :function #'gptel-tool--get-date
       :name  "gptel-tool--get-date"
       :description "Use to get the current date in %Y-%m-%d format. After calling this tool, stop. Then continue fulfilling user's request."
       :category "emacs")

      (gptel-make-tool
       :function #'gptel-tool--compose-email
       :name  "gptel-tool--compose-email"
       :description "Open an email compose buffer and set subject, to-address and body. After calling this tool, stop. Then continue fulfilling user's request."
       :args (list '(:name "to-address"
                           :type string
                           :description "The address to send to")
                   '(:name "subject"
                           :type string
                           :description "The mail subject")
                   '(:name "body"
                           :type string
                           :description "The body text of the email"))
       :category "emacs")

      (gptel-make-tool
       :function #'gptel-tool--bbdb-search
       :name  "gptel-tool--bbdb-search"
       :description "Return a bbdb entry for name, or nil if not found. After calling this tool, stop. Then continue fulfilling user's request."
       :args (list '(:name "name"
                           :type string
                           :description "The name to search for"))
       :category "emacs")

      (gptel-make-tool
       :function #'gptel-tool--bbdb-search-anniversary
       :name  "gptel-tool--bbdb-search-anniversary"
       :description "Return or a specific anniversary type. After calling this tool, stop. Then continue fulfilling user's request."
       :args (list '(:name "anniversary-type"
                           :type string
                           :description "The anniversary to search for, for example 'birthday' for birthdays"))
       :category "emacs")
3
 
 

cross-posted from: https://lemmy.ml/post/28996611

v0.1.6 release - Wikimusic

https://codeberg.org/jjba23/wikimusic

stability improved, add ASCII size settings for web and become more EWW friendly (eased also thanks to SSR from #lisp )

visit my instance at : https://wikimusic.jointhefreeworld.org/

4
 
 

I wanted to share Spiral, a package I wrote inspired by R's Swirl package. Spiral is used to learn elisp by interacting with it.

With Spiral, you can learn elisp by answering questions in "lessons". You can design, modify and share a lesson, to learn about a particular topic.

Take a look and share your lesson files, so we all can improve our elisp!

https://codeberg.org/pavodive/spiral

5
6
 
 

cross-posted from: https://lemmy.ml/post/28682467

SSS is a Lisp machine adventure, where the hacking culture is celebrated. Let me help you achieve GNUrvana.

Just released v2.1.29, my Emacs config is now fully modular, and I control Spotify from inside it too with smudge - waybar, rofi, mako improvements - more everforest and light themes love - org mode with proportional fonts now - SSS-atisfying

Follow SSS:

on Codeberg: https://codeberg.org/jjba23/sss

on Mastodon: https://mastodon.social/@sss_project

This custom GNU + Linux setup enhances customization to infinity, encourages the hacking spirit, and offers a superior user experience thanks in part too to REPL (Read Eval Print Loop) and Lisps.

SSS strives to have all things configured via Lisp dialects when possible and convenient, staying accessible to all kinds of users, and allowing for magical things to happen 🪄.

7
8
 
 

Got this one from ddg images but I think it was posted on reddit by someone.

Save the image to:
/.local/share/icons/

Save the modified .desktop file to:
/.local/share/applications/

This is mine, including the execution command modifier to make the window frame adwaita dark for gnome:

[Desktop Entry]
Name=DOOM Emacs
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=bash -c 'GTK_THEME=Adwaita:dark emacs'
Icon=doom-emacs.png
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupNotify=true
StartupWMClass=Emacs

and one I made for the Terminator terminal

9
 
 

I was vaguely aware of them but presumed they'd been added mostly for those who were more used to that UI convention: not something long-time users of Emacs might really need but Emacs (as usual) trying to accommodate all types of usage styles or preferences.

But, trying it out the other day briefly out of curiosity, I noticed that tabs could hold their own window configuration/layout (which, like, makes sense but hadn't dawned on me).

And I started thinking that I could use them in the same way I tend to use desktop workspaces: organizational buckets to put groups of windows in.

I've used registers to save particular window layouts but that has the added effect of, also, saving the point, as well (which, while I could keep saving to that register so I don't end up at a totally different portion of the file when I try to go to the layout, it's certainly less than ideal).

Tabs seem to keep track of your most recent buffer, per tab, – as well – so I can have each tab be their own little environment. I could open up Elfeed in one (along with all of the new buffers that might generate), a Magit buffer and various files from that repo. in another, and Wanderlust to check my E-mail in a third. And, whenever I switch to one, whatever other buffer I'd been working in before the current buffer of the tab is just a switch away because each tab keeps the correct buffer order of what was done in it.

Maybe this isn't new to anyone else but I rarely see people talk about tabs (other than brief, once-in-a-blue-moon mentions) but, while maybe not suitable for every person's workflow, this is yet another way the flexibility and power of Emacs just blows anything else out of the water, to me. It's such a useful iteration on the common UI structure.

Just wondering if anyone else uses them, found any pitfalls with them, etc. Mostly curious about people's experiences and if it's as infrequently used as my impression originally was.

10
9
Use GNU Emacs book (www2.lib.uchicago.edu)
submitted 2 months ago by [email protected] to c/[email protected]
11
12
 
 

Dunno if anyone would know but, basically, I want something similar to Ctrl-r, when you're using Bash.

eshell-isearch-backward kind of gets at it but it seems to fail at detecting commands that have definitely been used in the past, randomly (and finds them when invoked a second time…; the other issue is there doesn't seem to be an easy way to reinvoke it. Commands like eshell-isearch-repeat-backward don't seem to work like anticipated).

Figured I'd throw out a line, in case anyone knew.

13
 
 

It is not in the list of combinations. Most of the LLM packages seem to lack an easy way to run a llama.cpp server with the load split between CPU and GPU. Like Ollama appears to only load a model simply with the whole thing in the GPU. The simplification pushes users into smaller models that are far less capable. If the model is split between the CPU and GPU one can run a much larger quantized model in GGUF format that runs nearly as fast as the smaller less capable model loaded into the GPU only. Then you do not need to resort to using cloud hosted or proprietary models.

The Oobabooga front end also gives a nice interface for model loading and softmax settings.

gptel is at: https://github.com/karthink/gptel or MELPA

Oobabooga is at:
https://github.com/oobabooga/text-generation-webui

With a model loaded and the --api flag set the model will be available for gptel.

In packages.el:
(package! gptel)

In config.el:

(setq
gptel-mode 'test
gptel-backend (gptel-make-openai "llama-cpp"
                            :stream t
                            :protocol "http"
                            :host "localhost:5000"
                            :models '(test)))

This splits the load to easily run an 8×7b model. Most probably already know this or have other methods. I just thought I would mention it after getting it working just now. Share if you have a better way.

14
15
 
 

I've never messed with this layer before. I usually play with Arduino or FORTH, the first with the IDE, and the latter with a simple UART connection after using the Microchip toolchain to load the FORTH interpreter.

I was looking at putting a new (to me) version of FORTH on a MSP430F149 that I have had lying around for years. I have a homemade Goodfet 42, so I can technically use it to program through JTAG. However, it would be more fun to see how far I can get into the hardware from scratch. Perhaps I might connect another microcontroller to do the I/O through the terminal within emacs. What is the simplest path to sending byte data and manipulating a couple of I/O like the additional pins of a CH340 or RS232?

I just got Doom emacs running. I would like to get as far as developing a filesystem and tree to write assembly. I also dabble in AVRs, Espressif, and Micropython on STM32s in addition to FORTH on AVRs and PICs. If anyone has any advice please share. Call me a noob in all of them though. I'm doing good to make a cat excited by a servo and LED.

Any advice or references are welcome.

16
17
18
19
 
 

Disproject is a package for GNU Emacs that implements Transient menus for dispatching project-related commands on top of the project.el library. It aims to provide a more featureful version of the project-switch-project command, which it is inspired by. Those who are familiar with Projectile may also find similarities to projectile-commander.

Hello! I'm happy to announce version 2.0.0 of Disproject has been released. Notably, it adds support for specifying custom per-project commands (see disproject-custom-suffixes variable) with Transient's specifications syntax; the previous custom syntax has been deprecated.

Project homepage: https://github.com/aurtzy/disproject

Full release notes: https://github.com/aurtzy/disproject/releases/tag/v2.0.0

20
 
 

i'm having a little bit of a hard time expanding the unstaged changes on magit. the mode menu works fine via touch on android, so i can do most operations, but i can't expand the unstaged files in the main magit buffer without the keyboard, which is a problem since read-only buffers hide the kb by default. i could change that configuration, but i'm using a phone, so screen real state is very limited, so i want to avoid that if possible. i tried touching, double tapping, holding, but nothing seems to expand the files

i feel like i'm in uncharted territory, so this is a long shot i think, but is anyone else having similar problems?

21
22
21
What's New in Emacs 30.1? (www.masteringemacs.org)
submitted 3 months ago by [email protected] to c/[email protected]
23
29
Emacs 30.1 released (lists.gnu.org)
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/[email protected]
 
 

Featuring a significantly faster (~8x) JSON parser, native compilation enabled by default, and the official release of the Android port.

Abridged Announcement:

Version 30.1 of Emacs, the extensible text editor, should now be available from your nearest GNU mirror:

https://ftpmirror.gnu.org/emacs/emacs-30.1.tar.xz

https://ftpmirror.gnu.org/emacs/emacs-30.1.tar.gz

For a summary of changes in Emacs 30, see the etc/NEWS file in the tarball; you can view it from Emacs by typing 'C-h n', or by clicking Help->Emacs News from the menu bar.

You can also browse NEWS online using this URL:

https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-30

Windows binaries can be found at https://ftp.gnu.org/gnu/emacs/windows/emacs-30

24
 
 

The first release candidate for Emacs 30.1, the extensible text editor, is now available at:

https://alpha.gnu.org/gnu/emacs/pretest/emacs-30.1-rc1.tar.xz

Please give it as much testing as you can. If no problems are reported, this will become Emacs 30.1 this Sunday.

25
view more: next ›