unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8345: 23.2; Suggestion: let eldoc show if something is functionp
@ 2011-03-25 21:27 Michael Heerdegen
  2013-02-17 14:51 ` Michael Heerdegen
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Heerdegen @ 2011-03-25 21:27 UTC (permalink / raw)
  To: 8345

Hello Emacs,

I want to make a suggestion:

Let the notifications of eldoc mode differentiate between functions on
the one side, and macros and special forms on the other side.  This is
an essential information for the Elisp programmer concerning the
arguments.

This could be achieved easily e.g. by using different faces. 
`eldoc-highlight-function-argument' would be the right function to change.

I myself just did replace this sexp:

  (setq doc (eldoc-docstring-format-sym-doc
		 sym doc 'font-lock-function-name-face))

by this:

  (setq doc (eldoc-docstring-format-sym-doc
                    sym doc (if (functionp sym)
                                'font-lock-function-name-face
                              'font-lock-keyword-face)))


in its function definition.


Regards,

Michael


In GNU Emacs 23.2.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2010-12-11 on raven, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
configured using `configure  '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=yes' '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' '--without-gconf' 'build_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''






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

* bug#8345: 23.2; Suggestion: let eldoc show if something is functionp
  2011-03-25 21:27 bug#8345: 23.2; Suggestion: let eldoc show if something is functionp Michael Heerdegen
@ 2013-02-17 14:51 ` Michael Heerdegen
  2013-02-18  1:30   ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Heerdegen @ 2013-02-17 14:51 UTC (permalink / raw)
  To: 8345

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hello Emacs,
>
> I want to make a suggestion:
>
> Let the notifications of eldoc mode differentiate between functions on
> the one side, and macros and special forms on the other side.  This is
> an essential information for the Elisp programmer concerning the
> arguments.

I still think this is a good idea, because macros and special forms may
handle arguments differently (evaluation), so I want to see whether the
current form is a function call or not.

Probably, using `font-lock-keyword-face' is not so good - since macros
generally are not fontified as such where used in the code.

Maybe we should just accentuate macros and special forms a bit.

Here is a patch that simply underlines macros and special forms in the
eldoc info:

--8<---------------cut here---------------start------------->8---
*** /home/micha/today/eldoc.el	2013-02-17 15:14:07.520210027 +0100
--- /home/micha/gnu-emacs/elisp/test/eldoc.el	2013-02-17 15:08:07.276219422 +0100
***************
*** 356,362 ****
  	(setq doc (copy-sequence args))
  	(add-text-properties start end (list 'face argument-face) doc))
        (setq doc (eldoc-docstring-format-sym-doc
! 		 sym doc 'font-lock-function-name-face))
        doc)))
  
  ;; Return a string containing a brief (one-line) documentation string for
--- 356,365 ----
  	(setq doc (copy-sequence args))
  	(add-text-properties start end (list 'face argument-face) doc))
        (setq doc (eldoc-docstring-format-sym-doc
! 		 sym doc (if (functionp sym)
!                              'font-lock-function-name-face
!                            '((:inherit 'font-lock-function-name-face)
!                              (:underline t)))))
        doc)))
  
  ;; Return a string containing a brief (one-line) documentation string for
--8<---------------cut here---------------end--------------->8---


Regards,

Michael.





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

* bug#8345: 23.2; Suggestion: let eldoc show if something is functionp
  2013-02-17 14:51 ` Michael Heerdegen
@ 2013-02-18  1:30   ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2013-02-18  1:30 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 8345-done

> I still think this is a good idea, because macros and special forms may
> handle arguments differently (evaluation), so I want to see whether the
> current form is a function call or not.

I think it's a good idea, and I think your original proposal is better
(because macros (and special forms) are or should be highlighted with
font-lock-keyword-face).
So I installed your change, thank you,


        Stefan





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

end of thread, other threads:[~2013-02-18  1:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25 21:27 bug#8345: 23.2; Suggestion: let eldoc show if something is functionp Michael Heerdegen
2013-02-17 14:51 ` Michael Heerdegen
2013-02-18  1:30   ` Stefan Monnier

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).