unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Setting up abbrev
Date: Mon, 01 Aug 2022 05:03:24 +0200	[thread overview]
Message-ID: <87k07sfywz.fsf@dataswamp.org> (raw)
In-Reply-To: N8JCX9q--3-2@tutanota.com

wilnerthomas--- via Users list for the GNU Emacs text editor wrote:

> Have seen discussions about abbrev. How does it work
> exactly, and how could I set it up to test it?

Try for example:

;;; -*- lexical-binding: t -*-

;; (kill-all-abbrevs)
(let ((write '(
               ("lex"    ";;; -*- lexical-binding: t -*-")
               ("sld"    "sdl")
               ("wierd"  "weird")
               )))
  (define-abbrev-table 'global-abbrev-table write) )

You can do more things with abbrevs, including executing
functions - but it seems I did something wrong this time as
this doesn't work ...

(defun sh-mode-abbrev-f ()
  (goto-char (point-min))
  (insert "#! /bin/zsh\n")
  (sh-mode) )

(define-abbrev global-abbrev-table "zshbang" t #'sh-mode-abbrev-f)

-- 
underground experts united
https://dataswamp.org/~incal




  parent reply	other threads:[~2022-08-01  3:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-31 12:23 Setting up abbrev wilnerthomas--- via Users list for the GNU Emacs text editor
2022-07-31 13:08 ` Jean Louis
2022-08-01  3:06   ` Emanuel Berg
2022-08-01  6:04     ` Jean Louis
2022-08-01  7:42       ` Emanuel Berg
     [not found] ` <YuZ+ucBrwA9vOR/F@protected.localdomain-N8JMuQk----2>
2022-07-31 15:35   ` wilnerthomas--- via Users list for the GNU Emacs text editor
2022-07-31 16:40     ` [External] : " Drew Adams
2022-08-01  6:21       ` Jean Louis
2022-08-01  6:05     ` Jean Louis
2022-07-31 20:02 ` kf
2022-08-01  3:03 ` Emanuel Berg [this message]
2022-08-01 10:41   ` uzibalqa
2022-08-01 11:39     ` Emanuel Berg
2022-08-01 14:56       ` [External] : " Drew Adams
2022-08-01 15:14         ` Emanuel Berg
2022-08-01 16:36           ` Drew Adams
2022-08-01 16:57             ` wilnerthomas--- via Users list for the GNU Emacs text editor
2022-08-01 18:36             ` Emanuel Berg
2022-08-01 19:20               ` Drew Adams
2022-08-01 16:56       ` tomas
2022-08-01 18:40         ` Emanuel Berg
2022-08-01 20:37           ` tomas
2022-08-01 11:33   ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-08-01 11:42     ` Emanuel Berg
2022-08-01 12:54       ` carlmarcos--- via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k07sfywz.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).