Questions tagged [skeleton]
The skeleton tag has no usage guidance.
15
questions
0
votes
0answers
30 views
I don't understand skeleton.el indenting rules
As a fun (?) exercise, I am testing skeleton.el templates for some repeated, boring boilerplate coding tasks.
I want to generate something like this:
int main () {
if () {
if() {
...
0
votes
0answers
16 views
Skeletons: Run-time conditional skeleton elements?
I want to use Emacs skeletons to conditionally insert dynamic context-dependent text. As an example, if inserted after a Ruby class or module declaration, the skeleton would insert appropriate ...
0
votes
0answers
18 views
Skeletons: non-interactive subskeletons?
§12 Skeleton Language lists, as an element of a skeleton input list,
skeleton
Subskeletons are inserted recursively, not once, but as often as
the user enters something at the subskeletons ...
0
votes
1answer
63 views
Relationship between Skeleton and Tempo
Emacs ships with two packages for creating and inserting templates: Tempo and Skeleton. As far as I can tell, they fulfill the same purpose. Am I missing something?
0
votes
1answer
71 views
Is it possible to have expand abbreviations when calling a skeleton-read?
I have a large set of abbreviations I defined inside an abbrev-table. Take one of them:
(define-abbrev-table 'latex-mode-abbrev-table
'(("ff" "my abbreviation!" 0 nil)))
If I run a predefined ...
0
votes
2answers
90 views
How to insert boilerplate code in a file based on the directory in which it is created?
Suppose I have a file dir1/this_file.txt and dir2/this_file.txt, and I want to insert different boilerplate code not based on the file name or extension, but based on the directory in which the file ...
0
votes
1answer
46 views
How to control cursor position when using a function for inserting a skeleton
I am using the following function to make a new text file containing premade rows. The text file is named with a date and time tag, and stored in a /notes/ folder.
(defun myfun-create-file-with-rows(...
1
vote
1answer
108 views
Limit emacs skeleton pairs
I have the following skeleton pair setup to quickly insert LaTeX fragents into org-mode documents:
(setq skeleton-pair t)
(global-set-key (kbd "$") 'skeleton-pair-insert-maybe)
This works. But the ...
0
votes
1answer
102 views
How to disable skeleton-pair-insert-maybe?
I recently got a new Chromebook and installed Ubuntu via crouton. I then installed Emacs 23 and transferred my .emacs file to the new machine. However, a few of my key rebindings have been ...
5
votes
2answers
488 views
What templates are available for generating an elisp library?
At some point I remember encountering a command that generated a skeleton of a properly formatted emacs-lisp library as below:
;;; library.el --- summary
;; Copyright ...
;; Author:
;; Keywords:
;;...
1
vote
1answer
161 views
Insert quote characters in define-skeleton
In the following skeleton definition, I like to have quote characters ", ` and '
in the generated skeleton code.
For example,
I like to have the effect of
#+NAME:a-function-test
#+BEGIN_SRC ...
2
votes
1answer
560 views
Redefine verilog-mode header skeleton
The verilog-mode package contains this code:
(define-skeleton verilog-sk-header-tmpl
"Insert a comment block containing the module title, author, etc."
"[Description]: "
"// ...
6
votes
2answers
528 views
Automatically closing #ifdef block when editing C code
When editing LaTeX code, the command latex-close-block inserts an \end{..} that matches the last unclosed \begin{..}. Very handy!
Is there a similar command in c-mode that would close a pending #...
5
votes
1answer
122 views
Context sensitive skeleton triggered by abbrev stuck in loop
I want to create a skeleton, triggered by the abbrev keyword 'func' which checks its context and runs one of two possible sub-skeletons.
Here's what I have:
(define-skeleton my-func-skeleton "func ...
3
votes
1answer
979 views
auto-insert a skeleton and run a function when creating a new file
auto-insert-alist by default matches files created in .../bin/ directories and enables sh-mode.
There are examples on the wiki showing how to use a skeleton to insert some text, but I want to both ...