unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13206: 24.3.50; FR: insert-char must(?) show characters visually in completion buffer
@ 2012-12-17 13:40 Jambunathan K
  2012-12-17 14:34 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jambunathan K @ 2012-12-17 13:40 UTC (permalink / raw)
  To: 13206

[-- Attachment #1: Type: text/plain, Size: 996 bytes --]


(My NIC card went down during earlier sent.  Apologies if it results in
duplicate bug)

It will be wonderful if ucs-insert shows the characters visually in the
completion buffer.

Here is a proof-of-concept.  Install an annotation function. 

    (setq completion-extra-properties
          (list :annotation-function 'annotate-ucs-names))

    (defun annotate-ucs-names (name)
      (format "(%s)" (char-to-string (cdr (assoc-string name (ucs-names) t)))))

M-x insert-char RET will give screenshot 1.  Note the presence of
characters visually next to char names.  I would have wised to place the
the glyphs come before the description.

Now let us install a small /hack/ to minibuffer as shown below. The
result is as shown in screenshot 2, which I would much prefer.
(Ofcourse, the insertion itself wouldn't work)

Following two things emerge from this experiment.

    1. Annotation may go infront of the candidate.
    2. Annotation may provide a substitution for visual feedback etc etc.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: minibuffer-hack.diff --]
[-- Type: text/x-diff, Size: 536 bytes --]

=== modified file 'lisp/minibuffer.el'
--- lisp/minibuffer.el	2012-11-29 21:32:24 +0000
+++ lisp/minibuffer.el	2012-12-17 13:20:32 +0000
@@ -1690,7 +1690,9 @@ variables.")
             (setq completions
                   (mapcar (lambda (s)
                             (let ((ann (funcall afun s)))
-                              (if ann (list s ann) s)))
+                              ;; (if ann (list s ann) s)
+			      ann
+			      ))
                           completions)))
 
           (with-current-buffer standard-output


[-- Attachment #3: 1-insert-char-with-annotations.png --]
[-- Type: image/png, Size: 25765 bytes --]

[-- Attachment #4: 2-insert-char-with-substitution.png --]
[-- Type: image/png, Size: 20000 bytes --]

[-- Attachment #5: Type: text/plain, Size: 372 bytes --]



In GNU Emacs 24.3.50.5 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2012-12-15 on debian-6.05
Bzr revision: 111244 eliz@gnu.org-20121215133821-ie5ujd9ogv3tw34f
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Important settings:
  value of $LANG: en_IN
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

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

* bug#13206: 24.3.50; FR: insert-char must(?) show characters visually in completion buffer
  2012-12-17 13:40 bug#13206: 24.3.50; FR: insert-char must(?) show characters visually in completion buffer Jambunathan K
@ 2012-12-17 14:34 ` Stefan Monnier
  2012-12-17 14:45 ` Drew Adams
  2013-11-15  4:44 ` Jambunathan K
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2012-12-17 14:34 UTC (permalink / raw)
  To: Jambunathan K; +Cc: 13206

> It will be wonderful if ucs-insert shows the characters visually in the
> completion buffer.

> Here is a proof-of-concept.  Install an annotation function. 

>     (setq completion-extra-properties
>           (list :annotation-function 'annotate-ucs-names))

>     (defun annotate-ucs-names (name)
>       (format "(%s)" (char-to-string (cdr (assoc-string name (ucs-names) t)))))

I'd be happy to install such a patch, yes.  Please send it along.

> M-x insert-char RET will give screenshot 1.  Note the presence of
> characters visually next to char names.  I would have wised to place the
> the glyphs come before the description.

Indeed, placing them before would make sense.

> Now let us install a small /hack/ to minibuffer as shown below. The
> result is as shown in screenshot 2, which I would much prefer.
> (Ofcourse, the insertion itself wouldn't work)

Indeed, this version has various problems.  E.g. as a user, I'd often
have trouble figuring out which chars goes with which name.

I agree that the annotation mechanism would deserve improvement.


        Stefan





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

* bug#13206: 24.3.50; FR: insert-char must(?) show characters visually in completion buffer
  2012-12-17 13:40 bug#13206: 24.3.50; FR: insert-char must(?) show characters visually in completion buffer Jambunathan K
  2012-12-17 14:34 ` Stefan Monnier
@ 2012-12-17 14:45 ` Drew Adams
  2013-11-15  4:44 ` Jambunathan K
  2 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2012-12-17 14:45 UTC (permalink / raw)
  To: 'Jambunathan K', 13206

[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]

> It will be wonderful if ucs-insert shows the characters 
> visually in the completion buffer.

FWIW, Icicles has had that feature for quite a while.

The attached screenshot shows also what happens when cycling:
*Completions* mode line shows the char with its code point.

,----
| icicle-read-char-by-name is a compiled Lisp function.
| 
| (icicle-read-char-by-name PROMPT &optional NAMES)
| 
| Read a character by its Unicode name or hex number string.
| Display PROMPT and read a string that represents a character by its
| Unicode property `name' or `old-name'.  Return the char as a number.
| 
| You can use completion against the Unicode name of the character.
| 
| In Icicle mode:
| 
| * The character itself is displayed next to its name, even though it
|   is not part of the completion candidate.  WYSIWYG.
| 
| * When you cycle among candidates, the current character and its
|   Unicode code point are shown in the mode line (provided user option
|   `icicle-help-in-mode-line-delay' is greater than zero.)
| 
| If you use a dedicated `*Completions*' frame, then the font used in
| `*Completions*' is the same as the frame from which you invoked
| completion.
| 
| If you use library `doremi-frm.el' then you can increase the font size
| for `*Completions*' dynamically using `C-x -'.
| 
| As an alternative to completing the Unicode name, you can input a
| number for the Unicode code point: a hexidecimal number or a number in
| hash notation: #o21430 for octal, #x2318 for hex, or #10r8984 for
| decimal.
| 
| Non-nil optional arg NAMES is an alist of names to use in place of the
| value returned by `icicle-ucs-names'.  It must have the same form as
| such a return value: (CHAR-NAME . CHAR-CODE).
`----

[-- Attachment #2: throw-icy-unicode-comp.png --]
[-- Type: image/png, Size: 14777 bytes --]

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

* bug#13206: 24.3.50; FR: insert-char must(?) show characters visually in completion buffer
  2012-12-17 13:40 bug#13206: 24.3.50; FR: insert-char must(?) show characters visually in completion buffer Jambunathan K
  2012-12-17 14:34 ` Stefan Monnier
  2012-12-17 14:45 ` Drew Adams
@ 2013-11-15  4:44 ` Jambunathan K
  2 siblings, 0 replies; 4+ messages in thread
From: Jambunathan K @ 2013-11-15  4:44 UTC (permalink / raw)
  To: 13206-done


OP here.  Closed.





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

end of thread, other threads:[~2013-11-15  4:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-17 13:40 bug#13206: 24.3.50; FR: insert-char must(?) show characters visually in completion buffer Jambunathan K
2012-12-17 14:34 ` Stefan Monnier
2012-12-17 14:45 ` Drew Adams
2013-11-15  4:44 ` Jambunathan K

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).