mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Added warning about applicability to the documentation
This commit is contained in:
parent
01205f79d6
commit
4cb1ab2ba7
@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
|
||||
<title>ChangeLog</title>
|
||||
<link rel="stylesheet" href="styles.css" type="text/css" />
|
||||
</head>
|
||||
@ -47,8 +47,14 @@
|
||||
<div id="squeeze">
|
||||
<div class="right-corner">
|
||||
<div class="left-corner">
|
||||
<div class="section" id="b-2009-08-23">
|
||||
<h1>0.6.1b / 2009-08-23</h1>
|
||||
<p>
|
||||
<b>Important:</b> This documentation applies to
|
||||
the <b>SVN trunk</b> of YASnippet, which you
|
||||
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
|
||||
for other versions can be found <a title=""
|
||||
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
|
||||
</p>
|
||||
<p><strong>Upcoming</strong> release:</p>
|
||||
<ul class="simple">
|
||||
<li>Much more powerful menu. See <a class="reference external" href="snippet-menu.html">The YASnippet menu</a>.</li>
|
||||
<li>New ways to organize snippets. See <a class="reference external" href="snippet-organization.html">Organizing snippets</a>.</li>
|
||||
@ -63,7 +69,6 @@ rmartin.k...@gmail.com)</li>
|
||||
<li>Fixed <a class="reference external" href="http://code.google.com/p/yasnippet/issues/detail?id=70">Issue 70</a></li>
|
||||
<li>Fixed <a class="reference external" href="http://code.google.com/p/yasnippet/issues/detail?id=69">Issue 69</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="c-2009-07-27">
|
||||
<h1>0.6.0c / 2009-07-27</h1>
|
||||
<ul class="simple">
|
||||
|
@ -7,8 +7,7 @@ ChangeLog
|
||||
.. _Writing Snippets: snippet-development.html
|
||||
.. _The YASnippet Menu: snippet-menu.html
|
||||
|
||||
0.6.1b / 2009-08-23
|
||||
===================
|
||||
**Upcoming** release:
|
||||
|
||||
* Much more powerful menu. See `The YASnippet menu`_.
|
||||
* New ways to organize snippets. See `Organizing snippets`_.
|
||||
|
@ -49,7 +49,14 @@
|
||||
<div id="squeeze">
|
||||
<div class="right-corner">
|
||||
<div class="left-corner">
|
||||
<div class="section" id="why-there-s-an-extra-newline">
|
||||
<p>
|
||||
<b>Important:</b> This documentation applies to
|
||||
the <b>SVN trunk</b> of YASnippet, which you
|
||||
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
|
||||
for other versions can be found <a title=""
|
||||
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
|
||||
</p>
|
||||
<div class="section" id="why-there-s-an-extra-newline">
|
||||
<h1>Why there's an extra newline?</h1>
|
||||
<p>If you have a newline at the end of the snippet definition file, then
|
||||
YASnippet will add a newline when you expanding a snippet. Please
|
||||
|
@ -47,7 +47,14 @@
|
||||
<div id="squeeze">
|
||||
<div class="right-corner">
|
||||
<div class="left-corner">
|
||||
<div class="contents topic" id="contents">
|
||||
<p>
|
||||
<b>Important:</b> This documentation applies to
|
||||
the <b>SVN trunk</b> of YASnippet, which you
|
||||
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
|
||||
for other versions can be found <a title=""
|
||||
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
|
||||
</p>
|
||||
<div class="contents topic" id="contents">
|
||||
<p class="topic-title first">Contents</p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#video-demo" id="id1">Video Demo</a></li>
|
||||
|
@ -47,7 +47,14 @@
|
||||
<div id="squeeze">
|
||||
<div class="right-corner">
|
||||
<div class="left-corner">
|
||||
<div class="contents topic" id="contents">
|
||||
<p>
|
||||
<b>Important:</b> This documentation applies to
|
||||
the <b>SVN trunk</b> of YASnippet, which you
|
||||
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
|
||||
for other versions can be found <a title=""
|
||||
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
|
||||
</p>
|
||||
<div class="contents topic" id="contents">
|
||||
<p class="topic-title first">Contents</p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#snippet-development" id="id3">Snippet development</a><ul>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
|
||||
<title>Expanding snippets</title>
|
||||
<link rel="stylesheet" href="styles.css" type="text/css" />
|
||||
</head>
|
||||
@ -47,7 +47,14 @@
|
||||
<div id="squeeze">
|
||||
<div class="right-corner">
|
||||
<div class="left-corner">
|
||||
<div class="contents topic" id="contents">
|
||||
<p>
|
||||
<b>Important:</b> This documentation applies to
|
||||
the <b>SVN trunk</b> of YASnippet, which you
|
||||
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
|
||||
for other versions can be found <a title=""
|
||||
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
|
||||
</p>
|
||||
<div class="contents topic" id="contents">
|
||||
<p class="topic-title first">Contents</p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#triggering-expansion" id="id2">Triggering expansion</a><ul>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
|
||||
<title>YASnippet menu</title>
|
||||
<link rel="stylesheet" href="styles.css" type="text/css" />
|
||||
</head>
|
||||
@ -47,7 +47,14 @@
|
||||
<div id="squeeze">
|
||||
<div class="right-corner">
|
||||
<div class="left-corner">
|
||||
<div class="contents topic" id="contents">
|
||||
<p>
|
||||
<b>Important:</b> This documentation applies to
|
||||
the <b>SVN trunk</b> of YASnippet, which you
|
||||
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
|
||||
for other versions can be found <a title=""
|
||||
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
|
||||
</p>
|
||||
<div class="contents topic" id="contents">
|
||||
<p class="topic-title first">Contents</p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#loading-snippets-from-menu" id="id1">Loading snippets from menu</a></li>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
|
||||
<title>Organizing snippets</title>
|
||||
<link rel="stylesheet" href="styles.css" type="text/css" />
|
||||
</head>
|
||||
@ -47,7 +47,14 @@
|
||||
<div id="squeeze">
|
||||
<div class="right-corner">
|
||||
<div class="left-corner">
|
||||
<div class="contents topic" id="contents">
|
||||
<p>
|
||||
<b>Important:</b> This documentation applies to
|
||||
the <b>SVN trunk</b> of YASnippet, which you
|
||||
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
|
||||
for other versions can be found <a title=""
|
||||
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
|
||||
</p>
|
||||
<div class="contents topic" id="contents">
|
||||
<p class="topic-title first">Contents</p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#loading-snippets" id="id4">Loading snippets</a></li>
|
||||
|
@ -40,7 +40,14 @@
|
||||
<div id="squeeze">
|
||||
<div class="right-corner">
|
||||
<div class="left-corner">
|
||||
%(body)s
|
||||
<p>
|
||||
<b>Important:</b> This documentation applies to
|
||||
the <b>SVN trunk</b> of YASnippet, which you
|
||||
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
|
||||
for other versions can be found <a title=""
|
||||
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
|
||||
</p>
|
||||
%(body)s
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
41
yasnippet.el
41
yasnippet.el
@ -1863,34 +1863,15 @@ visited file in `snippet-mode'."
|
||||
(message "This snippet was not loaded from a file!")))))
|
||||
|
||||
(defun yas/guess-snippet-directory ()
|
||||
"Try to guess suitable directories based on `major-mode' and
|
||||
also the current active tables."
|
||||
"Try to guess suitable directories based on the current active
|
||||
tables."
|
||||
(let ((main-dir (or (and (listp yas/root-directory)
|
||||
(first yas/root-directory))
|
||||
yas/root-directory
|
||||
"~/.emacs.d/snippets"))
|
||||
(mode major-mode)
|
||||
(options))
|
||||
;; Lookup main mode and add that to the options
|
||||
;;
|
||||
(push (format "%s/%s" main-dir mode) options)
|
||||
;; Next lookup the main active table
|
||||
;;
|
||||
(let ((active-tables (first (yas/get-snippet-tables)))
|
||||
other-path-alternative)
|
||||
(when active-tables
|
||||
(setq active-tables (cons active-tables
|
||||
(yas/snippet-table-get-all-parents active-tables))))
|
||||
(dolist (table (reverse active-tables))
|
||||
(setq other-path-alternative
|
||||
(concat main-dir "/" (yas/snippet-table-name table))))
|
||||
(when other-path-alternative
|
||||
(push other-path-alternative options)))
|
||||
;; Finally add to the options the guessed parent of major-mode
|
||||
;; (this is almost never works out)
|
||||
(when (get mode 'derived-mode-parent)
|
||||
(push (format "%s/%s" main-dir (get mode 'derived-mode-parent)) options))
|
||||
(reverse options)))
|
||||
"~/.emacs.d/snippets")))
|
||||
(mapcar #'(lambda (table)
|
||||
(concat main-dir "/" (yas/snippet-table-name table)))
|
||||
(yas/get-snippet-tables))))
|
||||
|
||||
(defun yas/new-snippet (&optional same-window)
|
||||
"Create a new snippet in guessed current mode's directory."
|
||||
@ -1899,14 +1880,14 @@ also the current active tables."
|
||||
(read-from-minibuffer "Enter snippet name: ")))
|
||||
|
||||
|
||||
(defun yas/find-snippets (&optional same-window file-name)
|
||||
(defun yas/find-snippets (&optional same-window snippet-name )
|
||||
"Look for user snippets in guessed current mode's directory.
|
||||
|
||||
Calls `find-file' interactively in the guessed directory.
|
||||
|
||||
With prefix arg SAME-WINDOW opens the buffer in the same window.
|
||||
|
||||
With optional FILE-NAME, finds the file directly, i.e. `find-file' is
|
||||
With optional SNIPPET-NAME, finds the file directly, i.e. `find-file' is
|
||||
called non-interactively.
|
||||
|
||||
Because snippets can be loaded from many different locations,
|
||||
@ -1936,10 +1917,10 @@ otherwise, proposes to create the first option returned by
|
||||
|
||||
(when target-directory
|
||||
(let ((default-directory target-directory))
|
||||
(setq buffer (if file-name
|
||||
(setq buffer (if snippet-name
|
||||
(if same-window
|
||||
(find-file file-name)
|
||||
(find-file-other-window file-name))
|
||||
(find-file snippet-name)
|
||||
(find-file-other-window snippet-name))
|
||||
(call-interactively (if same-window
|
||||
'find-file
|
||||
'find-file-other-window))))
|
||||
|
Loading…
x
Reference in New Issue
Block a user