Coder Social home page Coder Social logo

Comments (5)

protesilaos avatar protesilaos commented on July 28, 2024

Strange... It seems to work on my end. Just invoked your command:

+++
title      = "Testing this with denote-md command"
date       = 2022-06-12T17:52:12+03:00
tags       = ["testing"]
identifier = "20220612T175212"
+++

Note that the (file-name-directory (buffer-file-name)) in denote-md does not work when called form the *scratch* buffer (my initial test). But that is not related to the denote-file-type.

from denote.

kaushalmodi avatar kaushalmodi commented on July 28, 2024

Oops, sorry for this noise. I had denote-file-type set to nil in a project .dir-locals.el. I think that denote internally creates a temp buffer and so the .dir-locals.el settings kick in there.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

I got a backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-name-directory(nil)
  (let ((denote-directory (file-name-directory (buffer-file-name))) (denote-file-type 'markdown-toml)) (call-interactively #'denote))
  denote-md()
  funcall-interactively(denote-md)
  call-interactively(denote-md record nil)
  command-execute(denote-md record)
  execute-extended-command(nil "denote-md" nil)
  funcall-interactively(execute-extended-command nil "denote-md" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

from denote.

kaushalmodi avatar kaushalmodi commented on July 28, 2024

Note that the (file-name-directory (buffer-file-name)) in denote-md does not work when called form the scratch buffer (my initial test).

Correct. I make sure I always call it from a file buffer (it was a quick way for me to change the denote directory.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Oops, sorry for this noise.

No worries!

.dir-locals.el settings

We should elaborate on this in the section about creating those user-level commands. It will be useful, especially for the denote-directory.

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.