Giter Club home page Giter Club logo

Comments (7)

EFLS avatar EFLS commented on July 30, 2024 2

There seems to be a typo in your config: nameing should be naming. But otherwise it looks fine to me.

To replace other characters, you could write your own function. Based on this example, you might do something like this:

(defun my-filter (str)
  (replace-regexp-in-string ":" "_" str))

(setq deft-file-naming-rules '((noslash . "-")
			       (nospace . "-")
			       (case-fn . my-filter)))

You'd have to expand the my-filter function to filter more than just :'s, but this is the basic idea.

from zetteldeft.

EFLS avatar EFLS commented on July 30, 2024

Hi buhtz, this issue was previously discussed here: #63

The good news is: you can configure Deft to take care of this And Zetteldeft separates filenames and file titles, so this is easily achieved. See the discussion in PR #42, where it is explained how you could use deft-file-naming-rules to achieve what you want.

Perhaps, after you've configured your setup, you can share it here? I could add a note on this to the zd-tutorial knowledge base, which would explain how to configure this for Windows systems' filenaming rules.

EDIT: Replaced zetteldeft-file-naming-rule with deft-file-naming-rules

from zetteldeft.

buhtz avatar buhtz commented on July 30, 2024

Sorry, the Issues and PR your linked to are far above my knowledge. I do not understand them.

Without knowing what it does I tried

(setq deft-file-naming-rules
  '((noslash . "-")
    (nospace . "-")
    (case-fn . downcase)))

No effect. There is no difference between title and resulting filename except the datestring.

$ ls
'2021-10-08-1537 äöü ß ? "test" : &.org'
'2021-10-08-1540 % $ ? ".org'

And zetteldeft-file-naming-rules is not mentioned anywhere in the PR.

from zetteldeft.

EFLS avatar EFLS commented on July 30, 2024

To learn how to use this, try C-h v deft-file-naming-rules to check out the Deft documentation and read up on the different possibilities.

You can also write your own function to replace specific characters in the file name strings, as explained here: #31 (comment)

I don't use these features myself, but I hope this helps you out.

And zetteldeft-file-naming-rules is not mentioned anywhere in the PR.

My mistake! I meant to type deft-file-naming-rules.

from zetteldeft.

buhtz avatar buhtz commented on July 30, 2024

My mistake! I meant to type deft-file-naming-rules.

IMHO it would improve the docu if you would have a special section about features and functionalities that does not come from zetteldeft but from deft or other emacs parts. Me as a user I do not think like a machine or in separated emacs modules/modes.
I use zetteldeft not more. I want to change zetteldeft filenaming and of course I want to do that with zetteldeft. I does not come to my mind that another emacs module could be involved in such a basic feature.

I am aware that this is part of emacs concept and if someone use emacs she/he also decides to "make some steps into the machine". But "some" not all. As a "user of zetteldeft" I do not want to think about other modes. It would help me, but I assume it is unusual, to create surrogate functions for zetteldeft (e.g. zetteldeft-file-nameing-rules) simply calling the "real" function (e.g. deft-file-nameing-rule).

from zetteldeft.

buhtz avatar buhtz commented on July 30, 2024

So I looked into the docu of the variable/function(?). The docu uses setq but I assume this is not needed when I use usepackage right?

This is part of my init file.

99  (use-package deft
100   :ensure t
101   :custom
102     (deft-extensions '("org" "md" "txt"))
103     (deft-directory "~/tab-cloud/zettel")
104     (deft-use-filename-as-title t)
105     (deft-file-nameing-rules
106       ’((nospace . "_"))
107     )
108 )
109
110 (use-package zetteldeft
111   :ensure t
112   :after deft
113   :config (zetteldeft-set-classic-keybindings))

To make it simple I used foo bar as title of a new zettel. But it is not transformed into *foo_bar.org but *foo bar.org. The space is still there but I set nospace. So what did I missunerstood? Or is someting wrong with my syntax?

When I understood the docu correct this variable does not do a lot. It just replaces slashes and spaces and take care of upper- or lowercase letters - not more. What is about my :, or " or etc...
How can I treat them?

from zetteldeft.

EFLS avatar EFLS commented on July 30, 2024

IMHO it would improve the docu if you would have a special section about features and functionalities that does not come from zetteldeft but from deft or other emacs parts. Me as a user I do not think like a machine or in separated emacs modules/modes. I use zetteldeft not more. I want to change zetteldeft filenaming and of course I want to do that with zetteldeft. I does not come to my mind that another emacs module could be involved in such a basic feature.

Zetteldeft is specifically intended as expansion of Deft. In other words: Deft is the core of Zetteldeft (at least it is for now), so it doesn't make sense to me to duplicate configuration options.

from zetteldeft.

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.