1

Description

I've got some c-functions with long argument lists. Even if that is bad style I would like semantic-idle-summary-mode to help me with those bad style functions.

Pityingly it keeps the height of the echo area at one line even if the function signature does not fit into that area.

I would like the height of the echo area being adapted to the function signature.

As far as I understood the source code of semantics-idle-summary-mode it uses (parts of) eldoc-mode. Therefore I already tried to set eldoc-echo-area-use-multiline-p to t without any effect on semantic-idle-summary-mode.

Version information

Emacs: GNU Emacs 25.1.50.2 (i686-pc-linux-gnu, GTK+ Version 3.10.8) of 2016-04-25

semantic: version 2.2 shipping with emacs

Reproduction

  • start emacs -Q
  • Call M-x semantic-mode and switch on menu item Development->Show Tag Summaries
  • customize eldoc-echo-area-use-multiline-p to t
  • create new buffer with C-x C-f test.c (there is no need for saving this buffer as file)
  • paste the following c-code into that buffer:

    #include <stdio.h>
    
    void fun(int a, int function, int with, int many, int arguments, int that, int dont, int fit, int on, int one, int line) {
        printf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",a,function,with,many,arguments,that,dont,fit,on,one,line);
    }
    
    int main() {
        int a=1,function=2,with=3,many=4,arguments=5,that=6,dont=7,fit=8,on=9,one=10,line=11;
        fun(a,function,with,many,arguments,that,dont,fit,on,one,line);
        return 0;
    }
    
  • adjust frame size such that the signature of fun is wrapped at the window edge
  • place point at the open parenthesis of the call of fun in main
  • the function signature in the echo area is truncated as shown in following Figure

echo area with truncated function signature

2

Short answer: The full semantic tags are shown in the minibuffer if semantic-idle-truncate-long-summaries is customized to nil and eldoc-echo-area-use-multiline-p is customized to non-nil.

The not so short answer:

The eldoc message is generated by semantic-idle-summary-idle-function. This function really considers eldoc-echo-area-use-multiline-p. If eldoc-echo-area-use-multiline-p is nil it truncates the message. But this function additionally considers a separate option semantic-idle-truncate-long-summaries with very much the same functionality. The only difference is that semantic-idle-summary-idle-function truncates the message if semantic-idle-truncate-long-summaries is non-nil.

I am a bit puzzled by the existence of semantic-idle-truncate-long-summaries. I've got the impression that this option should be depreciated in favor of eldoc-echo-area-use-multiline-p and its default value should be changed to nil.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.