* About `char' in momentary-string-display
@ 2013-10-17 13:06 Xue Fuqiao
2013-10-17 13:17 ` Kevin Rodgers
2013-10-17 20:12 ` Kai Großjohann
0 siblings, 2 replies; 6+ messages in thread
From: Xue Fuqiao @ 2013-10-17 13:06 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
In (info "(elisp) Temporary Displays"):
-- Function: momentary-string-display string position &optional char
message
[...]
Thus, typing CHAR will simply remove the string from the display,
while typing (say) `C-f' will remove the string from the display
and later (presumably) move point forward. The argument CHAR is a
space by default.
I tried evaluating ‘(momentary-string-display "foo" 1)’ in the *scratch*
buffer and typed ‘C-f’, but the point didn't move forward. Instead, a
‘[6]’ is echoed in the *Messages* buffer. I don't know what the ‘[6]’
stands for, but the codepoint for ^F is #x6 (ACK). So I think there may
be a link between them.
But anyway, why didn't the point move forward (the point wasn't at eob)?
Can anyone point me in the right direction?
(I searched the archives, but didn't get anything that looked promising.)
--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About `char' in momentary-string-display
2013-10-17 13:06 About `char' in momentary-string-display Xue Fuqiao
@ 2013-10-17 13:17 ` Kevin Rodgers
2013-10-18 7:44 ` Xue Fuqiao
2013-10-17 20:12 ` Kai Großjohann
1 sibling, 1 reply; 6+ messages in thread
From: Kevin Rodgers @ 2013-10-17 13:17 UTC (permalink / raw)
To: help-gnu-emacs
On 10/17/13 7:06 AM, Xue Fuqiao wrote:
> Hi,
>
> In (info "(elisp) Temporary Displays"):
>
> -- Function: momentary-string-display string position&optional char
> message
> [...]
> Thus, typing CHAR will simply remove the string from the display,
> while typing (say) `C-f' will remove the string from the display
> and later (presumably) move point forward. The argument CHAR is a
> space by default.
>
> I tried evaluating ‘(momentary-string-display "foo" 1)’ in the *scratch*
> buffer and typed ‘C-f’, but the point didn't move forward. Instead, a
> ‘[6]’ is echoed in the *Messages* buffer. I don't know what the ‘[6]’
> stands for, but the codepoint for ^F is #x6 (ACK). So I think there may
> be a link between them.
>
> But anyway, why didn't the point move forward (the point wasn't at eob)?
> Can anyone point me in the right direction?
CHAR defaults to SPC, but you typed C-f. What happens if you type SPC?
What happens if you specify C-f as CHAR:
(momentary-string-display "foo" 1 ?\C-f)
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About `char' in momentary-string-display
2013-10-17 13:06 About `char' in momentary-string-display Xue Fuqiao
2013-10-17 13:17 ` Kevin Rodgers
@ 2013-10-17 20:12 ` Kai Großjohann
2013-10-18 7:51 ` Xue Fuqiao
1 sibling, 1 reply; 6+ messages in thread
From: Kai Großjohann @ 2013-10-17 20:12 UTC (permalink / raw)
To: Xue Fuqiao; +Cc: help-gnu-emacs
Xue Fuqiao wrote:
> I tried evaluating ‘(momentary-string-display "foo" 1)’ in the *scratch*
> buffer and typed ‘C-f’, but the point didn't move forward.
I think it's related to evaluation in the *scratch* buffer. Try typing
M-: and then eval the expession there -- it works as advertised.
But how exactly the *scratch* buffer makes it fail, I'm not sure. I
tried to eval (previous-line 3) in the scratch buffer, and it dutifully
went up some lines before inserting "nil" (the return value).
Kai
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About `char' in momentary-string-display
2013-10-17 13:17 ` Kevin Rodgers
@ 2013-10-18 7:44 ` Xue Fuqiao
0 siblings, 0 replies; 6+ messages in thread
From: Xue Fuqiao @ 2013-10-18 7:44 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: help-gnu-emacs
On Thu, Oct 17, 2013 at 9:17 PM, Kevin Rodgers
<kevin.d.rodgers@gmail.com> wrote:
> On 10/17/13 7:06 AM, Xue Fuqiao wrote:
>> In (info "(elisp) Temporary Displays"):
>>
>> -- Function: momentary-string-display string position&optional char
>>
>> message
>> [...]
>> Thus, typing CHAR will simply remove the string from the display,
>> while typing (say) `C-f' will remove the string from the display
>> and later (presumably) move point forward. The argument CHAR is a
>> space by default.
>>
>> I tried evaluating ‘(momentary-string-display "foo" 1)’ in the *scratch*
>> buffer and typed ‘C-f’, but the point didn't move forward. Instead, a
>> ‘[6]’ is echoed in the *Messages* buffer. I don't know what the ‘[6]’
>> stands for, but the codepoint for ^F is #x6 (ACK). So I think there may
>> be a link between them.
>>
>> But anyway, why didn't the point move forward (the point wasn't at eob)?
>> Can anyone point me in the right direction?
>
> CHAR defaults to SPC, but you typed C-f. What happens if you type SPC?
Thanks for your attention. If I type SPC, Emacs (as expected) ignores
it. But what I'm asking is about the case when CHAR ≠ the-character-i-press.
> What happens if you specify C-f as CHAR:
> (momentary-string-display "foo" 1 ?\C-f)
It doesn't make sense, I think. Emacs will simply remove "foo" from the
display, and ignore the "C-f". It is the same as pressing SPC with
‘(momentary-string-display "foo" 1)’.
--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About `char' in momentary-string-display
2013-10-17 20:12 ` Kai Großjohann
@ 2013-10-18 7:51 ` Xue Fuqiao
2013-10-18 22:19 ` Kai Großjohann
0 siblings, 1 reply; 6+ messages in thread
From: Xue Fuqiao @ 2013-10-18 7:51 UTC (permalink / raw)
To: Kai Großjohann; +Cc: help-gnu-emacs
On Fri, Oct 18, 2013 at 4:12 AM, Kai Großjohann <kai.grossjohann@gmx.net> wrote:
> Xue Fuqiao wrote:
>> I tried evaluating ‘(momentary-string-display "foo" 1)’ in the *scratch*
>> buffer and typed ‘C-f’, but point didn't move forward.
>
> I think it's related to evaluation in the *scratch* buffer. Try typing
> M-: and then eval the expession there -- it works as advertised.
>
> But how exactly the *scratch* buffer makes it fail, I'm not sure. I
> tried to eval (previous-line 3) in the scratch buffer, and it dutifully
> went up some lines before inserting "nil" (the return value).
Thanks. But in fact I didn't use eval-print-last-sexp (which is bound
to C-j in lisp-interaction-mode by default). I was using eval-last-sexp
(C-x C-e). I also tried ‘load’ and ‘eval-expression’, but neither of
them worked as I expected.
Maybe we are using different versions of Emacs? I'm using 24.3.50
(114635 eliz@gnu.org-20131012090021-bau450cmd6gk61ag) on Ubuntu 13.04.
--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About `char' in momentary-string-display
2013-10-18 7:51 ` Xue Fuqiao
@ 2013-10-18 22:19 ` Kai Großjohann
0 siblings, 0 replies; 6+ messages in thread
From: Kai Großjohann @ 2013-10-18 22:19 UTC (permalink / raw)
To: Xue Fuqiao; +Cc: help-gnu-emacs
Xue Fuqiao wrote:
>
> Thanks. But in fact I didn't use eval-print-last-sexp (which is bound
> to C-j in lisp-interaction-mode by default). I was using eval-last-sexp
> (C-x C-e). I also tried ‘load’ and ‘eval-expression’, but neither of
> them worked as I expected.
C-x C-e worked beautifully for me:
GNU Emacs 24.3.1 (x86_64-apple-darwin12.3.0, NS apple-appkit-1187.37) of
2013-04-01 on teneight-slave.macports.org
Kai
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-10-18 22:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-17 13:06 About `char' in momentary-string-display Xue Fuqiao
2013-10-17 13:17 ` Kevin Rodgers
2013-10-18 7:44 ` Xue Fuqiao
2013-10-17 20:12 ` Kai Großjohann
2013-10-18 7:51 ` Xue Fuqiao
2013-10-18 22:19 ` Kai Großjohann
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).