GNU bug report logs - #20780
25.0.50; explain where to find skeletons in autotype info manual

Previous Next

Package: emacs;

Reported by: Nicolas Richard <youngfrog <at> members.fsf.org>

Date: Tue, 9 Jun 2015 17:33:03 UTC

Severity: wishlist

Tags: fixed

Found in version 25.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20780 in the body.
You can then email your comments to 20780 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20780; Package emacs. (Tue, 09 Jun 2015 17:33:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Richard <youngfrog <at> members.fsf.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 09 Jun 2015 17:33:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Richard <youngfrog <at> members.fsf.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; explain where to find skeletons in autotype info manual
Date: Tue, 09 Jun 2015 19:32:39 +0200
I was trying to find a template/skeleton mechanism, and that leads to
(info "(emacs) Text") :
>    The “automatic typing” features may be useful when writing text.
> *note The Autotype Manual: (autotype)Top.

Following through to the autotype info page, I'm a bit disappointed
because the manual explains how skeletons can:
- accept input in section 1,
- be modified with prefix arguments in section 2,
- be called as abbrevs in section 3,
and we have to wait section 4 to read about a (quite scary,
IMO) way to define skeletons. I'm now convinced that it is in fact not
expected that the *user* writes her own skeletons. Is that right ?

If that is the case, I suggest to mention that fact right from the
beginning, and maybe explicitly list a few places where skeletons are
actually availables (which key). C-mode is mentionned but from "emacs -Q
-f c-mode" I couldn't find anything in the menu.

Nicolas.




Severity set to 'wishlist' from 'minor' Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 29 Sep 2019 23:26:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20780; Package emacs. (Wed, 09 Oct 2019 03:47:01 GMT) Full text and rfc822 format available.

Message #10 received at 20780 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nicolas Richard <youngfrog <at> members.fsf.org>
Cc: 20780 <at> debbugs.gnu.org
Subject: Re: bug#20780: 25.0.50; explain where to find skeletons in autotype
 info manual
Date: Wed, 09 Oct 2019 05:46:29 +0200
Nicolas Richard <youngfrog <at> members.fsf.org> writes:

> I was trying to find a template/skeleton mechanism, and that leads to
> (info "(emacs) Text") :
>>    The “automatic typing” features may be useful when writing text.
>> *note The Autotype Manual: (autotype)Top.
>
> Following through to the autotype info page, I'm a bit disappointed
> because the manual explains how skeletons can:
> - accept input in section 1,
> - be modified with prefix arguments in section 2,
> - be called as abbrevs in section 3,
> and we have to wait section 4 to read about a (quite scary,
> IMO) way to define skeletons. I'm now convinced that it is in fact not
> expected that the *user* writes her own skeletons. Is that right ?

I think that's right.

> If that is the case, I suggest to mention that fact right from the
> beginning, and maybe explicitly list a few places where skeletons are
> actually availables (which key). C-mode is mentionned but from "emacs -Q
> -f c-mode" I couldn't find anything in the menu.

I wonder why the autotype manual is linked from the Emacs manual at
all.  It's a very low-level (lispref-like) manual, and doesn't really
seem to be something we should steer users towards?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20780; Package emacs. (Wed, 09 Oct 2019 17:13:01 GMT) Full text and rfc822 format available.

Message #13 received at 20780 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 20780 <at> debbugs.gnu.org, youngfrog <at> members.fsf.org
Subject: Re: bug#20780: 25.0.50;
 explain where to find skeletons in autotype info manual
Date: Wed, 09 Oct 2019 20:11:24 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Wed, 09 Oct 2019 05:46:29 +0200
> Cc: 20780 <at> debbugs.gnu.org
> 
> I wonder why the autotype manual is linked from the Emacs manual at
> all.  It's a very low-level (lispref-like) manual, and doesn't really
> seem to be something we should steer users towards?

AFAIR because some user-level feature(s) is/are described only there.
But I might be mistaken.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20780; Package emacs. (Wed, 09 Oct 2019 17:45:01 GMT) Full text and rfc822 format available.

Message #16 received at 20780 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20780 <at> debbugs.gnu.org, youngfrog <at> members.fsf.org
Subject: Re: bug#20780: 25.0.50; explain where to find skeletons in autotype
 info manual
Date: Wed, 09 Oct 2019 19:44:07 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Lars Ingebrigtsen <larsi <at> gnus.org>
>> Date: Wed, 09 Oct 2019 05:46:29 +0200
>> Cc: 20780 <at> debbugs.gnu.org
>> 
>> I wonder why the autotype manual is linked from the Emacs manual at
>> all.  It's a very low-level (lispref-like) manual, and doesn't really
>> seem to be something we should steer users towards?
>
> AFAIR because some user-level feature(s) is/are described only there.
> But I might be mistaken.

You're right; I didn't look closely enough.  Basically the least
user-friendly bit is the "Skeleton Language" node -- the rest are more
or less something users can be expected to relate to.

Would it make sense to just move that node to after the more user-facing
nodes?

@menu
* Using Skeletons::        How to insert a skeleton into your text.
* Wrapping Skeletons::     Putting existing text within a skeleton.
* Skeletons as Abbrevs::   An alternative for issuing skeleton commands.
* Skeleton Language::      Making skeleton commands insert what you want.
* Inserting Pairs::        Typing one character and getting another
                             after point.
* Autoinserting::          Filling up empty files as soon as you visit them.
* Copyrights::             Inserting and updating copyrights.
* Executables::            Turning interpreter scripts into executables.
* Timestamps::             Updating dates and times in modified files.
* QuickURL::               Inserting URLs based on text at point.
* Tempo::                  Flexible template insertion.
* Hippie Expand::          Expansion of text trying various methods.


[...]

@end menu


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20780; Package emacs. (Wed, 09 Oct 2019 18:06:01 GMT) Full text and rfc822 format available.

Message #19 received at 20780 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 20780 <at> debbugs.gnu.org, youngfrog <at> members.fsf.org
Subject: Re: bug#20780: 25.0.50; explain where to find skeletons in autotype
 info manual
Date: Wed, 09 Oct 2019 21:05:08 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: youngfrog <at> members.fsf.org,  20780 <at> debbugs.gnu.org
> Date: Wed, 09 Oct 2019 19:44:07 +0200
> 
> > AFAIR because some user-level feature(s) is/are described only there.
> > But I might be mistaken.
> 
> You're right; I didn't look closely enough.  Basically the least
> user-friendly bit is the "Skeleton Language" node -- the rest are more
> or less something users can be expected to relate to.
> 
> Would it make sense to just move that node to after the more user-facing
> nodes?

Fine with me, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20780; Package emacs. (Wed, 09 Oct 2019 18:09:01 GMT) Full text and rfc822 format available.

Message #22 received at 20780 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20780 <at> debbugs.gnu.org, youngfrog <at> members.fsf.org
Subject: Re: bug#20780: 25.0.50; explain where to find skeletons in autotype
 info manual
Date: Wed, 09 Oct 2019 20:08:20 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Fine with me, thanks.

OK; done, and I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 09 Oct 2019 18:09:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 20780 <at> debbugs.gnu.org and Nicolas Richard <youngfrog <at> members.fsf.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 09 Oct 2019 18:09:06 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20780; Package emacs. (Wed, 09 Oct 2019 22:08:01 GMT) Full text and rfc822 format available.

Message #29 received at 20780 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 20780 <at> debbugs.gnu.org, youngfrog <at> members.fsf.org
Subject: Re: bug#20780: 25.0.50; explain where to find skeletons in autotype
 info manual
Date: Thu, 10 Oct 2019 00:07:10 +0200
On 09/10/19 20:08, Lars Ingebrigtsen wrote:
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
>> Fine with me, thanks.
> 
> OK; done, and I'm closing this bug report.

Thanks for taking care of this bug report.

FWIW I had not looked any further into skeletons since I wrote the bug
report, and I still have no clue on how to use them. I thought I'd give
it another try just now:

at (info "(autotype) Skeletons as Abbrevs") I found:
>    Say you want ???ifst??? to be an abbreviation for the C language if
> statement.  You will tell Emacs that ???ifst??? expands to the empty string
> and then calls the skeleton command.  In Emacs Lisp you can say
> something like ???(define-abbrev c-mode-abbrev-table "ifst" "" 'c-if)???.

I tried to run that piece of lisp, then typed ifst in a test.c file, and
all I got was an error (void-function c-if)

I do understand that c-if is not defined as a function, but is it
expected that *I* write it ? I was hoping it would just work out of the box.

I still think we should mention some workings examples in the manual,
near the beginning of it.

Now I'm grepping for '(define-skeleton' in the git repo.
It returns results in sh-script.el, modula2.el, python.el and a few
others. Could any of those be mentionned in section 1 ? e.g. in
shell-script-mode, C-c C-c runs sh-case, which is a skeleton. I think
it's a great example of all the things mentionned in section 1.

thanks,

-- 
Nicolas.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20780; Package emacs. (Fri, 11 Oct 2019 07:45:02 GMT) Full text and rfc822 format available.

Message #32 received at 20780 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 20780 <at> debbugs.gnu.org,
 youngfrog <at> members.fsf.org
Subject: Re: bug#20780: 25.0.50; explain where to find skeletons in autotype
 info manual
Date: Fri, 11 Oct 2019 09:44:03 +0200
Nicolas Richard <theonewiththeevillook <at> yahoo.fr> writes:

> I still think we should mention some workings examples in the manual,
> near the beginning of it.
>
> Now I'm grepping for '(define-skeleton' in the git repo.
> It returns results in sh-script.el, modula2.el, python.el and a few
> others. Could any of those be mentionned in section 1 ? e.g. in
> shell-script-mode, C-c C-c runs sh-case, which is a skeleton. I think
> it's a great example of all the things mentionned in section 1.

I think adding an example to the manual would be great, but I'm not sure
which.  The one you mention seems a bit excessive for the manual...

(define-skeleton sh-case
  "Insert a case/switch statement.  See `sh-feature'."
  (csh "expression: "
       "switch( " str " )" \n
       > "case " (read-string "pattern: ") ?: \n
       > _ \n
       "breaksw" \n
       ( "other pattern, %s: "
	 < "case " str ?: \n
	 > _ \n
	 "breaksw" \n)
       < "default:" \n
       > _ \n
       resume:
       < < "endsw" \n)
  (es)
  (rc "expression: "
      > "switch( " str " ) {" \n
      > "case " (read-string "pattern: ") \n
      > _ \n
      ( "other pattern, %s: "
	"case " str > \n
	> _ \n)
      "case *" > \n
      > _ \n
      resume:
      ?\} > \n)
  (sh "expression: "
      > "case " str " in" \n
      ( "pattern, %s: "
	> str sh-non-closing-paren \n
	> _ \n
	";;" \n)
      > "*" sh-non-closing-paren \n
      > _ \n
      resume:
      "esac" > \n))

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 08 Nov 2019 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 164 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.