GithubHelp home page GithubHelp logo

Comments (7)

jeanphilippegg avatar jeanphilippegg commented on September 14, 2024 2

By the way, you may want to consider replacing

(lambda () (denote-org-capture-with-prompts :title :keywords :subdirectory nil :template)))

with

(lambda () (let ((denote-prompts '(title keywords subdirectory template))) (denote-org-capture)))

because it is more flexible (supports signature and reordering) and denote-org-capture-with-prompts may be removed eventually (maybe).

from denote.

protesilaos avatar protesilaos commented on September 14, 2024 1

I merged @jeanphilippegg changes. Thank you!

from denote.

jeanphilippegg avatar jeanphilippegg commented on September 14, 2024

(denote-template-prompt) prompts for a symbol which is used to select the correct string template in denote-templates.

I am wondering how you are able to input something in (denote-template-prompt). The way it is coded it is required that there is a match with some symbols in denote-templates. Even with the standard denote command, it requires a symbol.

from denote.

psmith1303 avatar psmith1303 commented on September 14, 2024

Yes, I get prompted for the choice of template in both cases (denote-template and denote-org-capture-with-prompts). The correct template is selected and used when I try denote-template.

from denote.

jeanphilippegg avatar jeanphilippegg commented on September 14, 2024

I could reproduce this issue. Should be fixed in #303 !

from denote.

x61 avatar x61 commented on September 14, 2024

@jeanphilippegg and @protesilaos, is it possible to use the templates defined in denote-template in 'org-capture-template`? For example, can I use resonance in the template defined above in @psmith1303's example? That is

(setq org-capture-templates
        '(
          ("g" "General" resonance
           (file denote-last-path)
           (function
            (lambda ()
              (let ((denote-directory (file-name-as-directory (concat (denote-directory) "general"))
                (denote-prompts '(template))
                (denote-org-capture))))
 …..

I tried this and it is still prompting for the template.

from denote.

jeanphilippegg avatar jeanphilippegg commented on September 14, 2024

If I understand correctly, what you want is to "not prompt for a template and use a specific one automatically". Though this was not the object of this issue, we have added some code to allow that in the latest code (or the upcoming version 3.0.0).

You will have to use the new denote-use-template variable. (There are other variants for other file name components.)

Here is an example you can adapt to your needs:

(setq denote-templates '((resonance . "the resonance template")))

(setq org-capture-templates
      '(("g" "General" plain
         (file denote-last-path)
         (function
          (lambda ()
            (let ((denote-directory (file-name-as-directory (concat (denote-directory) "general")))
                  (denote-prompts '(title keywords))
                  (denote-use-template 'resonance))
              (denote-org-capture)))))))

This org-capture-template will prompt for a title and keywords and will use the resonance template automatically (without prompting).

from denote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.