Package: emacs22-common
Version: 22.3+1-1.1
Severity: wishlist
Tags: patch

Reminded by <20090709005937.ga10...@dario.dodds.net> I realized that it
would be pretty useful to map run-mailcap action compose to what emacs
already offers with auto-insert-mode.

Quoting run-mailcap(1):

   EXAMPLES
         ...
         compose text/html:index.htm

This is a perfect example of what emacs is capable of.
However, since auto-insert-mode is not enabled by default, many users
probably do not know.  But the compose action explicitly tells
us the user wants to compose a new document, so template insertion
should be forced in this case.

Without the attached mailcap entries, vim is fired up with a blank new
file when doing "compose text/html:index.htm".
With the attached mailcap entries installed under
/usr/lib/mime/packages,
emacs fires up and asks for the document title.  It then automatically
inserts a simple HTML template.  The same also works for:

$ compose file.h
$ compose file.hh
$ compose document.ltx

Additionally, as a side benefit, emacs is now also fired up when
doing

$ edit index.html
or
$ edit file.ltx

and the appropriate mode is initialized according to auto-mode-alist.

Attachment: pgpuBrDl6ViuL.pgp
Description: PGP signature

text/html; view %s; edit=emacs22 %s; compose=emacs22 --eval '(progn (setq 
auto-insert-query nil) (auto-insert-mode 1))' %s; needsterminal;
text/x-chdr; view %s; edit=emacs22 %s; compose=emacs22 --eval '(progn (setq 
auto-insert-query nil) (auto-insert-mode 1))' %s; needsterminal;
text/x-csrc; view %s; edit=emacs22 %s; compose=emacs22 --eval '(progn (setq 
auto-insert-query nil) (auto-insert-mode 1))' %s; needsterminal;
text/x-c++hdr; view %s; edit=emacs22 %s; compose=emacs22 --eval '(progn (setq 
auto-insert-query nil) (auto-insert-mode 1))' %s; needsterminal;
text/x-c++src; view %s; edit=emacs22 %s; compose=emacs22 --eval '(progn (setq 
auto-insert-query nil) (auto-insert-mode 1))' %s; needsterminal;
text/x-tex; view %s; edit=emacs22 %s; compose=emacs22 --eval '(progn (setq 
auto-insert-query nil) (auto-insert-mode 1))' %s; needsterminal;
-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages emacs22-common depends on:
ii  dpkg                          1.15.3     Debian package management system
ii  emacsen-common                1.4.19     Common facilities for all emacsen

emacs22-common recommends no packages.

Versions of packages emacs22-common suggests:
ii  emacs22-common-non-dfsg       22.3+1-1   GNU Emacs shared, architecture ind
ii  emacs22-el                    22.3+1-1.1 GNU Emacs LISP (.el) files

-- no debconf information

-- 
CYa,
  ⡍⠁⠗⠊⠕ | Debian Developer <URL:http://debian.org/>
  .''`. | Get my public key via finger mlang/k...@db.debian.org
 : :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
 `. `'
   `-      <URL:http://delysid.org/>  <URL:http://www.staff.tugraz.at/mlang/>

Reply via email to