emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [patch] structure snippet completions


From: address@hidden
Subject: Re: [O] [patch] structure snippet completions
Date: Sat, 9 Dec 2017 21:42:46 +0800

error report when I `(require 'org-tempo)`

Debugger entered--Lisp error: (error "Format specifier doesn’t match argument type")
  format("<%c" "Q")
  (closure (t) (pair) (format "<%c" (car pair)))(("Q" "#+BEGIN_SRC sql-mode ?\n\n#+END_SRC" "#+BEGIN_SRC sql-mode ?\n\n#+END_SRC"))
  mapcar((closure (t) (pair) (format "<%c" (car pair))) (("Q" "#+BEGIN_SRC sql-mode ?\n\n#+END_SRC" "#+BEGIN_SRC sql-mode ?\n\n#+END_SRC") ("n" "#+BEGIN_NOTES\n?\n#+END_NOTES") (116 . "translate") (97 . "export ascii") (99 . "center") (67 . "comment") (101 . "example") (69 . "export") (104 . "export html") (108 . "export latex") (113 . "quote") (115 . "src") (118 . "verse") (76 . "latex") (72 . "html") (65 . "ascii") (105 . "index")))
  (let ((keys (mapcar (function (lambda (pair) (format "<%c" (car pair)))) (append org-structure-template-alist org-tempo-keywords-alist)))) (if (> (length keys) (length (delete-dups keys))) (progn (warn "Duplicated keys in `org-structure-template-alist' and `org-tempo-keywords-alist'"))) (mapc (function (lambda (key) (if (assoc-string key org-tempo-tags) (setq org-tempo-tags (delete (assoc-string key org-tempo-tags) org-tempo-tags))))) keys) (mapc (function org-tempo-add-block) org-structure-template-alist) (mapc (function org-tempo-add-keyword) org-tempo-keywords-alist))
  org-tempo-add-templates()
  org-tempo-setup()
  (progn (org-tempo-setup))
  (if (eq major-mode 'org-mode) (progn (org-tempo-setup)))
  eval-buffer(#<buffer  *load*> nil "/home/stardiviner/Code/Emacs/org-mode/lisp/org-tempo.el" nil t)  ; Reading at buffer position 5019
  load-with-code-conversion(#1="/home/stardiviner/Code/Emacs/org-mode/lisp/org-tempo.el" #1# nil t)
  require(org-tempo)


[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Sat, Dec 9, 2017 at 5:20 AM, Rasmus <address@hidden> wrote:
"Berry, Charles" <address@hidden> writes:

>> On Dec 7, 2017, at 3:37 PM, Rasmus <address@hidden> wrote:
>>
>> I have also pushed the code.  "<s"-like snippet expansion should be
>> enabled by requiring org-tempo.
>>
>
> Thanks. I was in a deep funk without "<s" and friends.  Feeling better now.

I am happy that I am able to help you for once!

>> Let me know about any issues.
>>
>
> Maybe make `tempo-match-finder' be "^ *\\(<[[:word:]]+\\)" so it will
> match things like "<la" when I want a latex align environment.  Or let
> the user customize it.

At the moment snippets with more than one character isn’t supported.  Note
that the car of org-structure-template-alist elements is now a character.
"Snippet-strings" (like "la") will be re-added soon cf. the email from
Eric earlier on in this thread.


> A minor gotcha: if you `(require 'org-tempo)' after an org buffer has
> been created you will need to (org-mode-restart) the buffer to enable
> completions.  I got stuck trying to add custom templates until I
> realized this.

It shouldn’t do that since this is near the bottom of org-tempo:

    (when (eq major-mode 'org-mode) (org-tempo-setup))

On my system it works in the first buffer where I require org-tempo, even
without reloading.

Which version of Emacs are you using?

Rasmus

--
A clever person solves a problem. A wise person avoids it




reply via email to

[Prev in Thread] Current Thread [Next in Thread]