all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* a function to enter string
@ 2007-02-19 20:27 Gary Wessle
  2007-02-19 23:28 ` Pascal Bourguignon
  2007-02-20  8:30 ` Gordon Beaton
  0 siblings, 2 replies; 5+ messages in thread
From: Gary Wessle @ 2007-02-19 20:27 UTC (permalink / raw
  To: help-gnu-emacs

Hi

I have this key macro in my emacs which puts "#include <string>" in
the first blank line in the buffer, also another key macro which puts
the string "std::string" at the point.

(fset 'str
   [?\M-<?\M-} ?# ?i ?n ?c ?l ?u ?d ?e ?  ?< ?s ?t ?r ?i ?n ?g ?>
   return])

(fset ':s
   "std::string")

I want when I type M-x :s  which is the second key macro above, it
puts the string "std::string" at point as well as checks to see if
"#include <string>" is at the top of the buffer, if not it inserts
it so that I don't have to do it.

how can this be done?

many thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-21 19:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-19 20:27 a function to enter string Gary Wessle
2007-02-19 23:28 ` Pascal Bourguignon
2007-02-20 16:06   ` Mathias Dahl
2007-02-21 19:12   ` Gary Wessle
2007-02-20  8:30 ` Gordon Beaton

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.