* Finding faces to customize @ 2005-06-26 18:05 Lennart Borgman 2005-06-26 23:36 ` Juri Linkov 0 siblings, 1 reply; 13+ messages in thread From: Lennart Borgman @ 2005-06-26 18:05 UTC (permalink / raw) I dislike the new italic style for arguments in the help. So I decided I wanted to customize it. But how do I find it? (Without reading the code of course ;-) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-06-26 18:05 Finding faces to customize Lennart Borgman @ 2005-06-26 23:36 ` Juri Linkov 2005-06-27 0:51 ` Lennart Borgman 0 siblings, 1 reply; 13+ messages in thread From: Juri Linkov @ 2005-06-26 23:36 UTC (permalink / raw) Cc: emacs-devel > I dislike the new italic style for arguments in the help. > So I decided I wanted to customize it. But how do I find it? > (Without reading the code of course ;-) On an argument name you can type `C-u C-x = TAB RET TAB RET' or `M-x customize-face RET RET' -- Juri Linkov http://www.jurta.org/emacs/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-06-26 23:36 ` Juri Linkov @ 2005-06-27 0:51 ` Lennart Borgman 2005-06-27 5:40 ` Juanma Barranquero 2005-06-28 0:00 ` Juri Linkov 0 siblings, 2 replies; 13+ messages in thread From: Lennart Borgman @ 2005-06-27 0:51 UTC (permalink / raw) Cc: emacs-devel Juri Linkov wrote: >>I dislike the new italic style for arguments in the help. >>So I decided I wanted to customize it. But how do I find it? >>(Without reading the code of course ;-) >> >> > >On an argument name you can type `C-u C-x = TAB RET TAB RET' >or `M-x customize-face RET RET' > > Thanks, that helped I could find the face without problem. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-06-27 0:51 ` Lennart Borgman @ 2005-06-27 5:40 ` Juanma Barranquero 2005-06-28 0:00 ` Juri Linkov 1 sibling, 0 replies; 13+ messages in thread From: Juanma Barranquero @ 2005-06-27 5:40 UTC (permalink / raw) Cc: Juri Linkov, emacs-devel On 6/27/05, Lennart Borgman <lennart.borgman.073@student.lu.se> wrote: > Juri Linkov wrote: > > Thanks, that helped I could find the face without problem. You could have even read etc/NEWS :) *** Help commands `describe-function' and `describe-key' now show function arguments in lowercase italics on displays that support it. To change the default, customize face `help-argument-name' or redefine the function `help-default-arg-highlight'. -- /L/e/k/t/u ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-06-27 0:51 ` Lennart Borgman 2005-06-27 5:40 ` Juanma Barranquero @ 2005-06-28 0:00 ` Juri Linkov 2005-06-28 18:47 ` Richard M. Stallman 2005-06-28 18:47 ` Richard M. Stallman 1 sibling, 2 replies; 13+ messages in thread From: Juri Linkov @ 2005-06-28 0:00 UTC (permalink / raw) Cc: emacs-devel >>>I dislike the new italic style for arguments in the help. >>>So I decided I wanted to customize it. But how do I find it? >>>(Without reading the code of course ;-) >> >>On an argument name you can type `C-u C-x = TAB RET TAB RET' >>or `M-x customize-face RET RET' >> > Thanks, that helped I could find the face without problem. BTW, the default prompt for `customize-face' has several problems. 1. The `face' property on a character under the point takes precedence over the face name extracted from the buffer. So if the point is located on the face name in the `defface' specification, then the default will be `font-lock-variable-name-face' instead of the face from `defface', because the face name is fontified in that font-lock face. The patch below joins all faces (from `face' property and face names under the point) into one list. The patch is backward-compatible for the argument `multiple' since it places faces from the `face' property in front of the face name extracted from the buffer, so the first element will be the same as now if `multiple' is nil. 2. When the `face' property has a list of faces, these faces are displayed in the default prompt as words separated by comma. It would be natural to expect that M-n in the minibuffer will allow their editing, but this doesn't work. The patch adds the default argument for completing-read, and splits the result afterwards. One drawback of such approach is that it doesn't allow completion for multiple face names (there is the file emacs-lisp/crm.el distribued with Emacs that could be used here but it is not up-to-date). Also it can accept invalid face name (to allow a comma-separated input string to be accepted), but this is not a big problem. `complete-in-turn' still works on a single face. Index: lisp/faces.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v retrieving revision 1.325 diff -c -r1.325 faces.el *** lisp/faces.el 25 Jun 2005 23:48:27 -0000 1.325 --- lisp/faces.el 28 Jun 2005 01:43:35 -0000 *************** *** 869,875 **** (aliasfaces nil) (nonaliasfaces nil) faces) ! ;; Make a list of the named faces that the `face' property uses. (if (and (listp faceprop) ;; Don't treat an attribute spec as a list of faces. (not (keywordp (car faceprop))) --- 869,878 ---- (aliasfaces nil) (nonaliasfaces nil) faces) ! ;; Try to get a face name from the buffer. ! (if (memq (intern-soft (thing-at-point 'symbol)) (face-list)) ! (setq faces (list (intern-soft (thing-at-point 'symbol))))) ! ;; Add the named faces that the `face' property uses. (if (and (listp faceprop) ;; Don't treat an attribute spec as a list of faces. (not (keywordp (car faceprop))) *************** *** 879,888 **** (push f faces))) (if (symbolp faceprop) (push faceprop faces))) - ;; If there are none, try to get a face name from the buffer. - (if (and (null faces) - (memq (intern-soft (thing-at-point 'symbol)) (face-list))) - (setq faces (list (intern-soft (thing-at-point 'symbol))))) ;; Build up the completion tables. (mapatoms (lambda (s) --- 882,887 ---- *************** *** 904,916 **** (if faces (mapconcat 'symbol-name faces ", ") string-describing-default)) (format "%s: " prompt)) ! (complete-in-turn nonaliasfaces aliasfaces) nil t)) ;; Canonicalize the output. (output (if (equal input "") faces (if (stringp input) ! (list (intern input)) input)))) ;; Return either a list of faces or just one face. (if multiple --- 903,917 ---- (if faces (mapconcat 'symbol-name faces ", ") string-describing-default)) (format "%s: " prompt)) ! (complete-in-turn nonaliasfaces aliasfaces) ! nil nil nil nil ! (if faces (mapconcat 'symbol-name faces ", ")))) ;; Canonicalize the output. (output (if (equal input "") faces (if (stringp input) ! (mapcar 'intern (split-string input ", *" t)) input)))) ;; Return either a list of faces or just one face. (if multiple -- Juri Linkov http://www.jurta.org/emacs/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-06-28 0:00 ` Juri Linkov @ 2005-06-28 18:47 ` Richard M. Stallman 2005-06-28 18:47 ` Richard M. Stallman 1 sibling, 0 replies; 13+ messages in thread From: Richard M. Stallman @ 2005-06-28 18:47 UTC (permalink / raw) Cc: lennart.borgman.073, emacs-devel 1. The `face' property on a character under the point takes precedence over the face name extracted from the buffer. So if the point is located on the face name in the `defface' specification, then the default will be `font-lock-variable-name-face' instead of the face from `defface', because the face name is fontified in that font-lock face. This is funny. Did anyone ever play the trick on you where he holds up a card that says "red", but it's in green letters, and asks you to read the word (or, to say which color you see)? Humans get confused trying to answer. It is funny that Emacs gets confused in the same way. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-06-28 0:00 ` Juri Linkov 2005-06-28 18:47 ` Richard M. Stallman @ 2005-06-28 18:47 ` Richard M. Stallman 2005-06-28 23:59 ` Juri Linkov 2005-07-02 0:08 ` Juri Linkov 1 sibling, 2 replies; 13+ messages in thread From: Richard M. Stallman @ 2005-06-28 18:47 UTC (permalink / raw) Cc: lennart.borgman.073, emacs-devel Your patch looks good to me. Please install it. One drawback of such approach is that it doesn't allow completion for multiple face names (there is the file emacs-lisp/crm.el distribued with Emacs that could be used here but it is not up-to-date). Could you tell me more about the problem? If this package no longer works, we ought to fix it. Is there an actual bug? ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-06-28 18:47 ` Richard M. Stallman @ 2005-06-28 23:59 ` Juri Linkov 2005-07-01 4:03 ` Richard M. Stallman 2005-07-02 0:08 ` Juri Linkov 1 sibling, 1 reply; 13+ messages in thread From: Juri Linkov @ 2005-06-28 23:59 UTC (permalink / raw) Cc: lennart.borgman.073, emacs-devel > One drawback of such approach is that it > doesn't allow completion for multiple face names (there is the file > emacs-lisp/crm.el distribued with Emacs that could be used here but > it is not up-to-date). > > Could you tell me more about the problem? If this package no longer > works, we ought to fix it. Is there an actual bug? I know nothing about this package, I just discovered it accidently and after trying it noticed that TAB doesn't work in places where SPC does. For example, with the test code at the end of crm.el, typing TAB after `ac' in the minibuffer: Prompt: ac,b,c,dz gives the error [No match]: Prompt: ac,b,c,dz [No match] and typing TAB in the end of the minibuffer produces the error message: Text is read-only. Typing SPC at these places completes the minibuffer correctly: Prompt: acb,b,c,dzab -- Juri Linkov http://www.jurta.org/emacs/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-06-28 23:59 ` Juri Linkov @ 2005-07-01 4:03 ` Richard M. Stallman 2005-07-02 0:05 ` Juri Linkov 0 siblings, 1 reply; 13+ messages in thread From: Richard M. Stallman @ 2005-07-01 4:03 UTC (permalink / raw) Cc: lennart.borgman.073, emacs-devel I fixed these bugs in crm.el. Thanks. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-07-01 4:03 ` Richard M. Stallman @ 2005-07-02 0:05 ` Juri Linkov 2005-07-03 15:48 ` Richard M. Stallman 0 siblings, 1 reply; 13+ messages in thread From: Juri Linkov @ 2005-07-02 0:05 UTC (permalink / raw) Cc: lennart.borgman.073, emacs-devel > I fixed these bugs in crm.el. Thanks. There are still three more bugs. Typing TAB with no more completions moves point into the read-only area. This happens, for example, after evaluating (completing-read-multiple "Prompt: " '(("hi") ("there"))) and typing `h TAB TAB'. The second bug doesn't allow RET without input string to return an empty string ("") when `require-match' arg is t, like `completing-read' does. The third bug occurs when trying to exit the minibuffer with RET. It signals an error " [An element did not match]" even for a valid completion. This patch should fix all three bugs: Index: lisp/emacs-lisp/crm.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/crm.el,v retrieving revision 1.6 diff -c -r1.6 crm.el *** lisp/emacs-lisp/crm.el 1 Jul 2005 01:10:42 -0000 1.6 --- lisp/emacs-lisp/crm.el 2 Jul 2005 00:05:27 -0000 *************** *** 214,220 **** (progn ;; (setq crm-beginning-of-element (match-beginning 1)) ! (setq crm-end-of-element end-index) ;; string to the left of the current element (setq crm-left-of-element (substring target-string 0 (match-beginning 1))) --- 214,220 ---- (progn ;; (setq crm-beginning-of-element (match-beginning 1)) ! (setq crm-end-of-element (+ end-index prompt-end)) ;; string to the left of the current element (setq crm-left-of-element (substring target-string 0 (match-beginning 1))) *************** *** 482,488 **** (setq result (catch 'crm-exit ! (if (eq (point-min) (point-max)) (throw 'crm-exit t)) ;; TODO: this test is suspect? --- 482,488 ---- (setq result (catch 'crm-exit ! (if (eq (minibuffer-prompt-end) (point-max)) (throw 'crm-exit t)) ;; TODO: this test is suspect? *************** *** 508,514 **** nil (if (equal result "check") (let ((check-strings ! (crm-strings-completed-p (buffer-string)))) ;; check all of minibuffer (if (eq check-strings t) (throw 'exit nil) --- 508,515 ---- nil (if (equal result "check") (let ((check-strings ! (crm-strings-completed-p ! (buffer-substring (minibuffer-prompt-end) (point-max))))) ;; check all of minibuffer (if (eq check-strings t) (throw 'exit nil) -- Juri Linkov http://www.jurta.org/emacs/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-07-02 0:05 ` Juri Linkov @ 2005-07-03 15:48 ` Richard M. Stallman 0 siblings, 0 replies; 13+ messages in thread From: Richard M. Stallman @ 2005-07-03 15:48 UTC (permalink / raw) Cc: lennart.borgman.073, emacs-devel > I fixed these bugs in crm.el. Thanks. There are still three more bugs. Thanks. Please install your fixes. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-06-28 18:47 ` Richard M. Stallman 2005-06-28 23:59 ` Juri Linkov @ 2005-07-02 0:08 ` Juri Linkov 2005-07-03 15:48 ` Richard M. Stallman 1 sibling, 1 reply; 13+ messages in thread From: Juri Linkov @ 2005-07-02 0:08 UTC (permalink / raw) Cc: lennart.borgman.073, emacs-devel > Your patch looks good to me. Please install it. > > One drawback of such approach is that it > doesn't allow completion for multiple face names (there is the file > emacs-lisp/crm.el distribued with Emacs that could be used here but > it is not up-to-date). > > Could you tell me more about the problem? If this package no longer > works, we ought to fix it. Is there an actual bug? With fixed crm.el, I want to submit a new patch which uses completing-read-multiple. It allows to simultaneously read multiple face names separated by comma, and even to use complete-in-turn on each of them. Index: lisp/faces.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v retrieving revision 1.327 diff -c -r1.327 faces.el *** lisp/faces.el 30 Jun 2005 15:04:57 -0000 1.327 --- lisp/faces.el 2 Jul 2005 00:08:08 -0000 *************** *** 869,875 **** (aliasfaces nil) (nonaliasfaces nil) faces) ! ;; Make a list of the named faces that the `face' property uses. (if (and (listp faceprop) ;; Don't treat an attribute spec as a list of faces. (not (keywordp (car faceprop))) --- 869,878 ---- (aliasfaces nil) (nonaliasfaces nil) faces) ! ;; Try to get a face name from the buffer. ! (if (memq (intern-soft (thing-at-point 'symbol)) (face-list)) ! (setq faces (list (intern-soft (thing-at-point 'symbol))))) ! ;; Add the named faces that the `face' property uses. (if (and (listp faceprop) ;; Don't treat an attribute spec as a list of faces. (not (keywordp (car faceprop))) *************** *** 879,888 **** (push f faces))) (if (symbolp faceprop) (push faceprop faces))) - ;; If there are none, try to get a face name from the buffer. - (if (and (null faces) - (memq (intern-soft (thing-at-point 'symbol)) (face-list))) - (setq faces (list (intern-soft (thing-at-point 'symbol))))) ;; Build up the completion tables. (mapatoms (lambda (s) --- 882,887 ---- *************** *** 896,917 **** (unless multiple (if faces (setq faces (list (car faces))))) (let* ((input ;; Read the input. ! (completing-read (if (or faces string-describing-default) (format "%s (default %s): " prompt ! (if faces (mapconcat 'symbol-name faces ", ") string-describing-default)) (format "%s: " prompt)) ! (complete-in-turn nonaliasfaces aliasfaces) nil t)) ;; Canonicalize the output. (output ! (if (equal input "") ! faces ! (if (stringp input) ! (list (intern input)) ! input)))) ;; Return either a list of faces or just one face. (if multiple output --- 895,921 ---- (unless multiple (if faces (setq faces (list (car faces))))) + (require 'crm) (let* ((input ;; Read the input. ! (completing-read-multiple (if (or faces string-describing-default) (format "%s (default %s): " prompt ! (if faces (mapconcat 'symbol-name faces ",") string-describing-default)) (format "%s: " prompt)) ! (complete-in-turn nonaliasfaces aliasfaces) ! nil nil nil nil ! (if faces (mapconcat 'symbol-name faces ",")))) ;; Canonicalize the output. (output ! (cond ((or (equal input "") (equal input '(""))) ! faces) ! ((stringp input) ! (mapcar 'intern (split-string input ", *" t))) ! ((listp input) ! (mapcar 'intern input)) ! (input)))) ;; Return either a list of faces or just one face. (if multiple output -- Juri Linkov http://www.jurta.org/emacs/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Finding faces to customize 2005-07-02 0:08 ` Juri Linkov @ 2005-07-03 15:48 ` Richard M. Stallman 0 siblings, 0 replies; 13+ messages in thread From: Richard M. Stallman @ 2005-07-03 15:48 UTC (permalink / raw) Cc: lennart.borgman.073, emacs-devel Please do it. ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2005-07-03 15:48 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-06-26 18:05 Finding faces to customize Lennart Borgman 2005-06-26 23:36 ` Juri Linkov 2005-06-27 0:51 ` Lennart Borgman 2005-06-27 5:40 ` Juanma Barranquero 2005-06-28 0:00 ` Juri Linkov 2005-06-28 18:47 ` Richard M. Stallman 2005-06-28 18:47 ` Richard M. Stallman 2005-06-28 23:59 ` Juri Linkov 2005-07-01 4:03 ` Richard M. Stallman 2005-07-02 0:05 ` Juri Linkov 2005-07-03 15:48 ` Richard M. Stallman 2005-07-02 0:08 ` Juri Linkov 2005-07-03 15:48 ` Richard M. Stallman
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.