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: pandoc-mode /Asciidoc
Date: Wed, 15 Mar 2023 17:37:21 +0100	[thread overview]
Message-ID: <87lejyas3i.fsf@dataswamp.org> (raw)
In-Reply-To: 5991b02c-46de-603f-e3e6-7910363c823f@posteo.de

Gottfried wrote:

> If I want a shortcut key for markdown-mode

Actually, you shouldn't need a shortcut for that since .md
files should land in that mode automatically, if you also want
it for other files that don't have that suffix/extension there
are other methods to automate that as well, see some Elisp
last in this file for an example.

> M-x local-set-key RET F5 markdown-mode

It's better to use Elisp for keys, see `define-key'.

Here is an example

(define-key gnus-server-mode-map "i" #'previous-line)

> The one F5 and the other e.g. F6 ??

Hint, avoid the function keys. Make you fingers move to much,
reduces speed/ergonomics.

> I am careful, so I am asking before doing something.

Sure, ask!

But don't be too careful, you won't screw it up, trust
a person who as done that one zillion times and is still
kicking ...

```emacs-lisp
;;; -*- lexical-binding: t -*-
;;
;; this file:
;;   https://dataswamp.org/~incal/emacs-init/mode-by-filename.el

(setq auto-mode-alist `(
    ("\\.bal\\'"     . balance-mode)
    ("\\.cl\\'"      . common-lisp-mode)
    ("\\.dat\\'"     . gnuplot-mode)
    ("\\.gpi\\'"     . gnuplot-mode)
    ("\\.grm\\'"     . sml-mode)
    ("\\.lu\\'"      . lua-mode)
    ("\\.nqp\\'"     . perl-mode)
    ("\\.php\\'"     . html-mode)
    ("\\.pic\\'"     . nroff-mode)
    ("\\.pl\\'"      . prolog-mode)
    ("\\.sed\\'"     . conf-mode)
    ("\\.service\\'" . conf-mode)
    ("\\.tap\\'"     . gcode-mode)
    ("\\.tex\\'"     . latex-mode)
    ("\\.xr\\'"      . conf-xdefaults-mode)
    ("torrc\\'"      . conf-mode)
    ("keys\\'"       . conf-mode)
    ("*"             . text-mode)
  ,@auto-mode-alist) )

(provide 'mode-by-filename)
```

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




  reply	other threads:[~2023-03-15 16:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 14:26 pandoc-mode Gottfried
2023-02-13 14:40 ` pandoc-mode Jean Louis
2023-02-22 14:26   ` pandoc-mode /Asciidoc Gottfried
2023-02-23 11:33     ` Jean Louis
2023-02-23 11:34     ` Jean Louis
2023-02-23 14:13       ` Gottfried
2023-02-23 17:48         ` Jean Louis
2023-02-23 20:17         ` Jean Louis
2023-02-25 12:24           ` Gottfried
2023-02-26  1:36             ` David Masterson
2023-02-26 10:31               ` Gottfried
2023-02-26 10:53                 ` Stephen Berman
2023-02-26 16:06                   ` Gottfried
2023-02-26 16:50                     ` Jean Louis
2023-02-27  8:41                       ` Gottfried
2023-03-01  3:24                       ` David Masterson
2023-03-02 18:06                       ` Gottfried
2023-03-02 18:51                         ` Gottfried
2023-03-13  4:17                           ` Jean Louis
2023-03-15 15:42                             ` Gottfried
2023-03-15 16:37                               ` Emanuel Berg [this message]
2023-02-14 18:35 ` pandoc-mode Bruno Barbier
2023-02-14 19:52   ` pandoc-mode Joost Kremers
2023-02-22 14:13     ` pandoc-mode Gottfried

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=87lejyas3i.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).