简体   繁体   English

org-mode:打开链接文件的父目录

[英]org-mode: Open parent directory of linked file

Is there a function in org-mode to open the parent directory of a linked file instead of the file itself? 在组织模式下是否有一个功能可以打开链接文件的父目录而不是文件本身?

Background: Having links to files under version control (subversion), I want to update the file before opening it. 背景:在版本控制(Subversion)下具有指向文件的链接,我想在打开文件之前先对其进行更新。

The main question I have is: when you click on the link, do you always expect to go to the containing directory? 我的主要问题是:当您单击链接时,是否总是希望转到包含目录? If so, why not change the link to point to the directory, instead of pointing to the file? 如果是这样,为什么不更改链接以指向目录而不是指向文件?

If you sometimes want to go to the directory and sometimes to the file, then you might (no guarantees) be able to do it by defining your own link type (but note that org-add-link-type was declared obsolete in v9.0 and you are supposed to use org-link-set-parameters instead - the manual needs updating). 如果您有时要转到目录,有时甚至要转到文件,则可以 (不保证)通过定义自己的链接类型来做到这一点(但请注意,在v9中org-add-link-type被声明为过时的)。 0,您应该改用org-link-set-parameters手册需要更新)。 You'll need to program the criteria (or perhaps supply an argument somehow) for when you want to visit the directory and when you want to visit the file. 您需要为何时访问目录和何时访问文件编程标准(或以某种方式提供参数)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM