Subject: bug#39624: closed (Re: bug#39624: 26.3; Inserting text in a specified face)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 20 Feb 2020 17:53:03 +0000

Your bug report

#39624: 26.3; Inserting text in a specified face

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
39624: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=39624
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#39624: 26.3; Inserting text in a specified face
From: Stephen Berman <[email-masked]>
To: Greg Hill <[email-masked]>
Cc: [email-masked]
Date: Thu, 20 Feb 2020 18:52:07 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

The OP confirmed to me off-list that this bug can be closed, so I'm
doing so.

On Sun, 16 Feb 2020 00:24:49 +0100 Stephen Berman <[email-masked]> wrote:

> On Sat, 15 Feb 2020 13:20:01 -0800 Greg Hill <[email-masked]> wrote:
>
>> I'm just trying to figure out how to use the 'insert' function to insert
>> one string in the currently active buffer in a specific face like
>> 'custom-comment'). I'm sure it's easy to do, but I have spent
>> several hours searching through all the Info documentation and haven't
>> found a single clue.
>
> Here's one way:
>
> (insert (propertize "Test" 'face 'custom-comment))
>
> And here's how you might have found that in the documentation: If you
> look in the Elisp manual at the node Faces, it says: "One way to
> represent a face is as a property list of attributes", and if you look
> at the node Insertion, it says that most of the insertion functions
> "copy text characters from strings and buffers along with their
> properties".  So properties are a point of intersection between faces
> and insertion.  In the Elisp node Text Properties there is a menu that
> contains the entry Changing Properties with the description "Setting the
> properties of a range of text", which seems to be what you're looking
> for.  And indeed, the node Changing Properties describes the function
> propertize, saying it is "the easiest way to make a string with text
> properties".
>
> Steve Berman

Subject: 26.3; Inserting text in a specified face
From: Greg Hill <[email-masked]>
To: [email-masked]
Date: Sat, 15 Feb 2020 13:20:01 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

I'm just trying to figure out how to use the 'insert' function to insert
one string in the currently active buffer in a specific face like
'custom-comment'). I'm sure it's easy to do, but I have spent
several hours searching through all the Info documentation and haven't
found a single clue. If I could figure out how to do it, I would write
my own function like '(insert-using-face STRING FACE)' if no existing
function does that.

In GNU Emacs 26.3 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511))
of 2019-09-02 built on builder10-10.porkrind.org
Windowing system distributor 'Apple', version 10.3.1561
Recent messages:
Starting new Ispell process ispell with default dictionary...
apply: Searching for program: No such file or directory, ispell
Quit [2 times]
Starting new Ispell process ispell with default dictionary...
apply: Searching for program: No such file or directory, ispell
Quit
"Blue1"
Auto-saving...done
Mark saved where search started
Mark set
mwheel-scroll: Beginning of buffer [46 times]
Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Info

Minor modes in effect:
  save-place-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(ispell ibuf-ext ibuffer ibuffer-loaddefs pp shadow sort mail-extr
emacsbug message rmc puny seq format-spec rfc822 mml mml-sec
password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils view tildify table rst rng-valid rng-loc rng-uri rng-parse
nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-util
nxml-enc xmltok refer refer-to-bibtex refbib printing picture noutline
outline easy-mmode nroff-mode disp-table enriched ebnf2ps ps-print
ps-print-loaddefs ps-def lpr delim-col bib-mode cus-edit wid-edit color
two-column iso-transl rect delsel kmacro cl-print byte-opt gv bytecomp
byte-compile cconv debug completion dos-w32 find-cmd grep compile comint
ansi-color ring find-dired dired dired-loaddefs misearch multi-isearch
mode-local find-func thingatpt help-fns radix-tree apropos warnings
saveplace cus-start cus-load cl-seq cl-extra help-mode elec-pair
jka-compr info easymenu desktop frameset cl-loaddefs cl-lib time-date
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue cocoa ns
multi-tty make-network-process emacs)

Memory information:
((conses 16 449106 71432)
(symbols 48 29014 3)
(miscs 40 944 1252)
(strings 32 67655 2467)
(string-bytes 1 5282950)
(vectors 16 45812)
(vector-slots 8 840469 39428)
(floats 8 559 529)
(intervals 56 38870 11)
(buffers 992 35))