In bash syntax, one can use notify-send to make a message appear in the desktop. How can we accomplish the same with elisp?

enter image description here

2 Answers 2


On GNU/Linux systems, there is the notifications.el package in core Emacs. Example from the info manual:

      (require 'notifications)

      (defun my-on-action-function (id key)
        (message "Message %d, key \"%s\" pressed" id key))
           ⇒ my-on-action-function

      (defun my-on-close-function (id reason)
        (message "Message %d, closed due to \"%s\"" id reason))
           ⇒ my-on-close-function

       :title "Title"
       :body "This is <b>important</b>."
       :actions '("Confirm" "I agree" "Refuse" "I disagree")
       :on-action 'my-on-action-function
       :on-close 'my-on-close-function)
           ⇒ 22

      A message window opens on the desktop.  Press ``I agree''.
           ⇒ Message 22, key "Confirm" pressed
              Message 22, closed due to "dismissed"

The whole description is in the Elisp manual, see (info "(elisp) Desktop Notifications")

  • Thank you. It was really helpful.
    – BuddhiLW
    Commented Dec 18, 2021 at 18:04

you can use notifications.el as described in Michael Albinus' answer or the alert package from melpa which can be simpler in many cases and works cross-platform.

e.g. (alert "This is an alert" :title "My Alert" :category 'debug)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.