From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Puzzling behavior from echo area: truncates prompt string at 100 characters? Date: Sat, 24 Dec 2011 11:31:48 +0200 Message-ID: <83liq2xqm3.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1324719119 22635 80.91.229.12 (24 Dec 2011 09:31:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 24 Dec 2011 09:31:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tom Davey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 24 10:31:55 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ReNxL-0002vz-9L for ged-emacs-devel@m.gmane.org; Sat, 24 Dec 2011 10:31:55 +0100 Original-Received: from localhost ([::1]:34725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ReNxK-0001Xi-D6 for ged-emacs-devel@m.gmane.org; Sat, 24 Dec 2011 04:31:54 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:59756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ReNxH-0001XS-PO for emacs-devel@gnu.org; Sat, 24 Dec 2011 04:31:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ReNxG-0000NI-J3 for emacs-devel@gnu.org; Sat, 24 Dec 2011 04:31:51 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:40558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ReNxG-0000N2-85 for emacs-devel@gnu.org; Sat, 24 Dec 2011 04:31:50 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LWP00200BJEOC00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Sat, 24 Dec 2011 11:31:48 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.84.173]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LWP002XWBSYDUB0@a-mtaout23.012.net.il>; Sat, 24 Dec 2011 11:31:48 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.175 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146955 Archived-At: [Moved here from help-gnu-emacs.] > Date: Tue, 20 Dec 2011 20:29:57 -0500 > From: Tom Davey > > I'm using Emacs 24.0.50.1. The following "message" command, with an > arbitrarily chosen argument string of exactly 150 characters -- > > (message "0123456789 123456789 223456789 323456789 423456789 523456789 > 623456789 723456789 823456789 923456789 023456789 123456789 223456789 > 323456789 423456789") > > -- displays the entire length of the string (all 150 characters) in > the minibuffer's echo area, as one would expect. In fact, I find that > the echo area frame will expand in height to display even much longer > messages. (The variable "message-truncate-lines" is nil.) > > However, if the same 150-character string becomes an argument to an > "(interactive)" declaration in a defun() function, like this -- > > (interactive "c0123456789 123456789 223456789 323456789 423456789 > 523456789 623456789 723456789 823456789 923456789 023456789 123456789 > 223456789 323456789 423456789") > > -- then the display of the prompt string in the echo area is > truncated. Only the first 99 characters display; the remainder of the > echo area (to the right) is unused and empty. Nor does the echo area's > frame expand in height, as it does with the "message" function. > > Naturally, in a real-world application my prompt string would not be > composed of integers but of helpful alphanumeric text. However, no > matter what form of a prompt string I supply to the "interactive" > declaration, the echo area truncates it at the 100th character. > > Does anybody have an idea how I might get a long prompt in an > interactive declaration to fully display in the echo area? This happens because call-interactively arbitrarily truncates the prompt at the 99th character: char prompt1[100]; ... strncpy (prompt1, tem + 1, sizeof prompt1 - 1); prompt1[sizeof prompt1 - 1] = 0; tem1 = strchr (prompt1, '\n'); if (tem1) *tem1 = 0; visargs[0] = build_string (prompt1); if (strchr (prompt1, '%')) callint_message = Fformat (i, visargs); else callint_message = visargs[0]; ... case 'c': /* Character */ /* Prompt in `minibuffer-prompt' face. */ Fput_text_property (make_number (0), make_number (SCHARS (callint_message)), Qface, Qminibuffer_prompt, callint_message); args[i] = Fread_char (callint_message, Qnil, Qnil); This limitation was there since 1991, but AFAICS it is not documented anywhere. Do we want to keep this limitation? If so, it should be at least documented.