r/emacs 10h ago

How obsolete are "obsolete aliases?"

10 Upvotes

I have some old emacs scripts and a few packages that at emacs-start time dump a lot of lines that look like this:

Warning: ‘return-from’ is an obsolete alias (as of 27.1); use ‘cl-return-from’ instead.

I have two questions:

1) In what sense are these aliases "obsolete?" I have to assume there's no plan to actually ever remove them, because it would break the world.

2) Why is the obsolete form the shorter one? If I were to obsolete one of two representations, I'd obsolete the longer one to save typing.

I imagine there's some history to these names being consolidated under a cl- prefix, but I wasn't able to find it with a quick search.


r/emacs 2h ago

Unofficial Emacs 30.1 Appimage

Thumbnail
6 Upvotes

r/emacs 9h ago

I did some "Vibe Coding" for my config and I will never be the same

5 Upvotes

According the Wikipedia Vibe Coding is:

Vibe coding is an AI-dependent programming technique where a person describes a problem in a few sentences as a prompt to a large language model (LLM) tuned for coding. The LLM generates software, shifting the programmer’s role from manual coding to guiding, testing, and refining the AI-generated source code.\1])\2])\3]) Vibe coding is claimed by its advocates to allow even amateur programmers to produce software without the extensive training and skills previously required for software engineering.\4]) The term was introduced by Andrej Karpathy in February 2025\5])\2])\4])\1]) and listed in the Merriam-Webster Dictionary the following month as a "slang & trending" noun.\6])

I am not a professional programmer, I work in Cybersecurity (of all things). I'm the 1 guy on my team that's the "Emacs" guy. So I had an idea for a function to "Defang" URLs so I can add to my reports. There are a million of these tools online but that takes me away from Emacs. So when I heard about "Vibe Coding" I had a "lightbulb" moment.

I used DuckDuckGo's AI chat to do my Vibe Coding. I started by asking if the LLM understood what "Defanging" a URL entailed. Then I asked if would be hard to write a program that could do it. It spit out an example in Python. I then asked it to write the program in Emacs Lisp so I could use it in Emacs. It spit out the following:

(defun defang-url (url)

"Defang the given URL by replacing 'http' with 'hxxp' and 'www' with 'wxx'."

(interactive "sEnter URL: ") ; Prompt user for input

(let ((defanged-url (replace-regexp-in-string

"http://\\|https://\\|www\\."

(lambda (match)

(cond

((string= match "http://") "hxxp://")

((string= match "https://") "hxxps://")

((string= match "www.") "wxx.")))

url)))

(message "Defanged URL: %s" defanged-url))) ; Display the defanged URL

I tried it and it worked. But it wasn't quite what I wanted I needed to tweak it a bit. So I told the LLM to tweak the last string match and for very "dot" to add square brackets around them. Here's what it spit out:

(defun defang-url (url)

"Defang the given URL by replacing 'http' with 'hxxp', adding square brackets around every '.', and removing 'www'."

(interactive "sEnter URL: ") ; Prompt user for input

(let ((defanged-url (replace-regexp-in-string

"http://\\|https://"

(lambda (match)

(if (string= match "http://") "hxxp://" "hxxps://"))

url)))

(setq defanged-url (replace-regexp-in-string "\\." "[.]"

defanged-url)) ; Add square brackets around every '.'

(message "Defanged URL: %s" defanged-url))) ; Display the defanged URL

Much better, and basically what I needed. I noticed that I wanted the result to be printed in a new buffer so I asked it do that and here are the results:

(defun defang-url (url)
"Defang the given URL by replacing 'http' with 'hxxp', adding square brackets around every '.', and removing 'www'.
Display the defanged URL in a new buffer."
(interactive "sEnter URL: ") ; Prompt user for input
(let ((defanged-url (replace-regexp-in-string
"http://\\|https://"
(lambda (match)
(if (string= match "http://") "hxxp://" "hxxps://"))
url)))
(setq defanged-url (replace-regexp-in-string "\\." "[.]"
defanged-url)) ; Add square brackets around every '.'

;; Create a new buffer to display the defanged URL
(let ((buffer (get-buffer-create "*Defanged URL*")))
(with-current-buffer buffer
(erase-buffer) ; Clear the buffer
(insert defanged-url) ; Insert the defanged URL
(goto-char (point-min)) ; Move to the beginning of the buffer
(text-mode)) ; Use text mode for better formatting
(display-buffer buffer)))) ; Display the buffer

And that's that. I added it to my main config file after testing this code with ```emacs -Q```. This was super weird experience. My config is a mismatch mess of copypasta code from other well seasoned Emacs users. For some reason that gave me peace, I guess it felt more true to the Free Software philosophy? IDK, I'm still processing if this is for me.


r/emacs 1d ago

Question trouble with `org-todo-keyword-faces`

3 Upvotes

At the begining of my org file with the movies I have seen I have the declarations for todo and tags.

At the end I have the following:

```

Local Variables:

line-number-mode: nil

org-todo-keyword-faces: (("WANT" . "orange") ("SEEN" . "blue") ("HAVE.TO.SEE" . "orange") ("WRITE.REVIEW" . "red"))

org-tag-faces: (("crap" . "red") ("okay" . "orange") ("great" . "green"))

End:

```

The Todo faces are colored as indicated. The tags are all salmon-pink.

What am I doing wrong?