From 4770ff0da323eaf522df333177f4a3c7cac2ce9d Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Tue, 26 May 2009 09:38:44 +0000 Subject: unicode-tokens-symbs-to-props: Allow multiple properties to work. Note: font prop must be given first --- lib/unicode-tokens.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/unicode-tokens.el') diff --git a/lib/unicode-tokens.el b/lib/unicode-tokens.el index b200223a..09634d0f 100644 --- a/lib/unicode-tokens.el +++ b/lib/unicode-tokens.el @@ -1,6 +1,6 @@ ;;; unicode-tokens.el --- Support for control and symbol tokens ;; -;; Copyright(C) 2008 David Aspinall / LFCS Edinburgh +;; Copyright(C) 2008-2009 David Aspinall / LFCS Edinburgh ;; Author: David Aspinall ;; License: GPL (GNU GENERAL PUBLIC LICENSE) ;; @@ -278,13 +278,11 @@ Token symbol is searched for in `unicode-tokens-hash-table'." (font-lock-fontify-buffer)) (defun unicode-tokens-symbs-to-props (symbs &optional facenil) - (let (props p) + (let (props ps) (dolist (s symbs) - (setq p (car-safe - (cdr-safe (assoc s unicode-tokens-fontsymb-properties)))) - (if (consp p) - (setq props (cons (car p) (cons (cadr p) props))) - (setq props (cons p props)))) + (setq ps (cdr-safe (assoc s unicode-tokens-fontsymb-properties))) + (dolist (p ps) + (setq props (append p props)))) (if (and facenil (not (memq 'face props))) (setq props (append '(face nil) props))) @@ -391,7 +389,8 @@ Calculated from `unicode-tokens-token-name-alist' and (message "Inserted %s" ins))) (defun unicode-tokens-annotate-region (name) - "Annotate region with region markup tokens for scheme NAME." + "Annotate region with region markup tokens for scheme NAME. +Available annotations chosen from `unicode-tokens-control-regions'." (interactive (let ((completion-ignore-case t)) (list (completing-read "Annotate region with: " -- cgit v1.2.3