all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 15909@debbugs.gnu.org
Subject: bug#15909: 24.3.50; please fix `read-face-name' brain-dead PROMPT handling
Date: Fri, 15 Nov 2013 14:49:10 -0800 (PST)	[thread overview]
Message-ID: <d0b70a35-d9e4-4d29-8d4b-cf97b8dd3c9e@default> (raw)
In-Reply-To: <a4bc6974-37f7-4bb4-ab47-d9f51a2d07d6@default>

> Please add some code similar to the following to `read-face-name',
> so it DTRT.
>  (when (save-match-data (string-match ": $" prompt))
>    (setq prompt  (substring prompt 0 -2)))

To be clearer about that part.  Below is code I use to counteract
the current `read-face-name' behavior.  Incorporating a reasonable
fix into `read-face-name' would do something akin to the opposite.

(defun my-read-face-name (prompt)
  "Read a face name using completion.  Return its face symbol.
Accommodate vanilla Emacs PROMPT arg across Emacs versions."
  (save-match-data
    (when (and (> emacs-major-version 21)
               (string-match "\\(:\\s *$\\|:?\\s +$\\)" prompt))
      (setq prompt
            (substring prompt 0
                       (- (length (match-string 0 prompt)))))))
  (read-face-name prompt))





  reply	other threads:[~2013-11-15 22:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15 22:12 bug#15909: 24.3.50; please fix `read-face-name' brain-dead PROMPT handling Drew Adams
2013-11-15 22:49 ` Drew Adams [this message]
2014-02-08  3:14 ` Lars Ingebrigtsen
2014-02-08 23:08   ` Drew Adams
2016-04-29 14:42 ` Lars Ingebrigtsen

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=d0b70a35-d9e4-4d29-8d4b-cf97b8dd3c9e@default \
    --to=drew.adams@oracle.com \
    --cc=15909@debbugs.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.