all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Neil Baylis <neil.baylis@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Elisp: How to set multiple text properties.
Date: Fri, 14 Jan 2011 11:19:41 -0800 (PST)	[thread overview]
Message-ID: <4b20c8e7-806b-427c-b814-72523c0232eb@s9g2000vby.googlegroups.com> (raw)

I want to make a pair of elisp functions that can be called
interactively, and possibly bound to function keys.

Call them foo and bar.

When foo is called, it should cause subsequent text entered into the
buffer to be colored dark blue and bold.

When bar is called, it should cause subsequent text entered into the
buffer to be colored green, and italic.

I've only been able to find out how to set a single property of the
region. E.g., if I set it to be italic, then it stops being green. I'm
using (facemenu-set-italic) to set italic mode. I'm using (facemenu-
set-face-from-menu) to set the color.

I think I'm missing something obvious. What's the correct way to set
multiple properties on text from within an elisp function?


             reply	other threads:[~2011-01-14 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-14 19:19 Neil Baylis [this message]
2011-01-14 22:49 ` Elisp: How to set multiple text properties Stefan Monnier
2011-01-15 16:19   ` Neil Baylis
2011-01-15 18:53     ` Neil Baylis
2011-01-15 19:45       ` Mirko

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

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

  git send-email \
    --in-reply-to=4b20c8e7-806b-427c-b814-72523c0232eb@s9g2000vby.googlegroups.com \
    --to=neil.baylis@gmail.com \
    --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.
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.