help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pandoc-mode /Asciidoc


From: Emanuel Berg
Subject: Re: pandoc-mode /Asciidoc
Date: Wed, 15 Mar 2023 17:37:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]