Comments (9)
I am receiving this message:
dired-move-to-filename: No file on this line
Maybe I should try without customizations.
Can you please report this in a new issue? It will be easier to track
things.
Also please note what you tried to produce this error. Maybe
denote-dired-rename-file
?
from denote.
I am closing this issue now as Denote supports the idea of renaming other files.
from denote.
Thanks @Ypot!
Just in case this idea could be useful:
Yes, it is useful.
I use attached or linked local files for adding multimedia (jpg, pdf,
etc) or references (saved html, podcasts, etc) to my org notes. These
multimedia files are in a folder almost kaotically. To sort those
files in the way you've described could give to them a new dimension.
I already do this locally for my multimedia, but I don't have any Elisp
for it.
I am now trying to think how it could be done. We could have a command,
say, denote-dired-rename
which only changes the name of the file at
point. It will prompt for TITLE and KEYWORDS, just like denote
and
denote-org-capture
, but it will also ask for a file type extension:
jpd, pdf, and others can be available as completion candidates.
Unlike the other commands, denote-dired-rename
will not create a
"note" per se.
What do you think?
[ Maybe a better name is denote-dired-rename-non-note
or something to
make it clear we are not operating on notes. ]
Though we need to be careful not to go very far with this idea, as it is
not directly connected to the note-taking goal.
Thanks for elisping!
You are welcome!
from denote.
Not sure! I just thought attachments could be benefited with an analogous naming and listing. But it's more like a brainstormed idea that could fit in your project, if it suits you.
For completion candidates I would find more useful keywords than extensions (why bother with existing extensions?).
Best regards :-)
from denote.
Hello again! Here is a prototype (I made some other changes):
(defun denote-dired-rename-file (title keywords)
"Return path to new file with TITLE and KEYWORDS."
(interactive
(list
(denote--title-prompt)
(denote--keywords-prompt)))
(let* ((file (dired-get-filename))
(dir (file-name-directory file))
(old-name (file-name-nondirectory file))
(extension (file-name-extension file t))
(new-name (denote--format-file
dir
(format-time-string denote--id)
keywords
(denote--sluggify title)
extension)))
(when (y-or-n-p
(format "Rename %s to %s?"
(propertize old-name 'face 'error)
(propertize (file-name-nondirectory new-name) 'face 'success)))
(rename-file old-name new-name nil)
(revert-buffer))))
It uses the standard prompts for TITLE
and KEYWORDS
and converts
them to a familiar Denote path. The file type extension is read from
the underlying file. So if you are renaming a .pdf it stays a .pdf, if
it is an .mp3 it remains that way, and so on.
The renaming only happens relative to the current directory. It does
not move the file between directories. I think this is consistent with
the task, which basically is "Give me a Denote-style file name".
EDIT: I removed the sample diff, as I already pushed the changes.
from denote.
I made some changes early today to how renaming works. The current functionality is described here: https://protesilaos.com/emacs/denote#h:532e8e2a-9b7d-41c0-8f4b-3c5cbb7d4dca
from denote.
I am receiving this message:
dired-move-to-filename: No file on this line
Maybe I should try without customizations.
from denote.
Offtopic: I am trying to send you what seems to be a "typo". But I don't know how to, I share it here (last line):
;; Generic:
;; (add-hook 'dired-mode-hook #'denote-dired-mode)
;;
;; OR better:
(add-hook 'dired-mode-hook #'denote-dired-mode-in-directories)
;; You can bind `denote' to a global key if you prefer not to use
;; `org-capture' or want an alternative. Denote does not define any key
;; bindings though: this is for the user to decide. For example:
(let ((map global-map))
(define-key map (kbd "C-c n") #'denote)
(define-key map (kbd "C-c N") #'denote-type))
(with-eval-after-load 'org-capture
(require 'denote-org-capture)
(setq denote-org-capture-specifiers "%l\n%i\n%?")
(add-to-list 'org-capture-templates
'("n" "New note (with denote.el)" plain
(file denote-last-path)
#'denote-org-capture
:no-save t
:immediate-finish nil
:kill-buffer t
;; Should be here just 3 )))? :jump-to-captured t))))
from denote.
Offtopic: I am trying to send you what seems to be a "typo".
Fixed. Thank you!
from denote.
Related Issues (20)
- Full support for orgmode links (`denote:` type) HOT 8
- Denote links are not unique HOT 7
- Add utility for `denote-find-file` HOT 11
- org-store-link exists with error, denote-retrieve-filename-identifier should not error HOT 5
- Excluding dot directories from denote-file-prompt HOT 3
- Error loading denote-org-dblock HOT 1
- Make denote-open-or-create work better across subfolders HOT 9
- Alternative identifier formats? - Note signatures HOT 72
- conceptual similarities to date2name and filetags HOT 5
- not getting previous keywords in option list when creating note HOT 3
- proposal of a more functional file naming specification HOT 11
- Org links do not work between notes created in parent directories. HOT 6
- Include rx option for dblock links HOT 7
- dir.local.el file - Invalid Function HOT 5
- Denote multi-keyword and org tags/agenda HOT 7
- Suggestion of a denote function that uses cl keywords. HOT 5
- Cannot get silos work HOT 14
- Additional keywords delimiter after the last keywords HOT 3
- Denote insert immediately HOT 18
- Is there a way to add link title for none-denote-type files HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from denote.