From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: FW: [RFC] Link-type for attachments, more attach options Date: Wed, 15 Jan 2020 14:20:32 +0800 Message-ID: <87sgkhkzpr.fsf@gmail.com> References: <87o8v7eamw.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:59356) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irc2m-0001XN-KN for emacs-orgmode@gnu.org; Wed, 15 Jan 2020 01:20:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irc2j-0004r7-4s for emacs-orgmode@gnu.org; Wed, 15 Jan 2020 01:20:44 -0500 Received: from [183.246.141.113] (port=10793 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1irc2i-0004mK-NE for emacs-orgmode@gnu.org; Wed, 15 Jan 2020 01:20:41 -0500 In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Gustav =?utf-8?Q?Wikstr=C3=B6m?= Cc: "emacs-orgmode@gnu.org" Gustav Wikstr=C3=B6m writes: > Hi, > >> -----Original Message----- >> From: Emacs-orgmode On >> Behalf Of stardiviner >> Sent: den 13 januari 2020 14:42 >> To: emacs-orgmode@gnu.org >> Subject: Re: [O] FW: [RFC] Link-type for attachments, more attach options >>=20 >>=20 >> I found when I set option ~(setq org-attach-store-link-p t)~. Then attach >> a file, store file link with =3D[C-c C-l]=3D. The stored link. I open th= is >> link got error "No such file: ....". I tested this with minimal Emacs >> config. confirmed this problem. >>=20 > > I cannot reproduce this. In my try with a minimal Emacs (emacs -q) and wi= th only that single customization it works for me. I'm testing it in linux.= A wild guess.. Could it be that you used the move operation instead of the= copy operation when attaching the file? > > Regards > Gustav Did you reproduce this issue with =3Demacs -q=3D ? That is a built-in Org M= ode version which does not contains the latest version =3Dorg-attach.el=3D. Here is my minimal Emacs config: #+begin_src emacs-lisp :tangle "~/.config/emacs/minimal-init.el" (package-initialize) ;;; add my init files directory (add-to-list 'load-path "/usr/share/emacs/site-lisp/") (add-to-list 'load-path (expand-file-name "init" user-emacs-directory)) ;; recursively load init files. (let ((default-directory (expand-file-name "init" user-emacs-directory))) (setq load-path (append (let ((load-path (copy-sequence load-path))) ; shadow (append (copy-sequence (normal-top-level-add-to-load-path '("."))) (normal-top-level-add-subdirs-to-load-path))) load-path))) (setq load-prefer-newer t) ;;; [ package.el ] -- Emacs Lisp Package Archive (ELPA) (require 'package) (setq package-enable-at-startup nil) (setq package-menu-async t) (setq package-user-dir (expand-file-name "elpa" user-emacs-directory)) ;;; ELPA Mirrors ;; (setq-default package-archives ;; '(("gnu" . "https://elpa.gnu.org/packages/") ;; ("melpa" . "http://melpa.org/packages/") ;; ("melpa-stable" . "http://stable.melpa.org/packages/") ;; ("marmalade" . "http://marmalade-repo.org/packages/") ;; ("org" . "http://orgmode.org/elpa/"))) (setq-default package-archives '(("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/= ") ("org" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/org/") ("gnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")= )) (let* ((elpa-archives-dir (expand-file-name "elpa/archives/" user-emacs-dir= ectory)) (elpa-gnu-archives-dir (concat elpa-archives-dir "gnu")) (elpa-melpa-archives-dir (concat elpa-archives-dir "melpa")) (elpa-org-archives-dir (concat elpa-archives-dir "org"))) (unless (and (file-exists-p elpa-gnu-archives-dir) (file-exists-p elpa-melpa-archives-dir) (file-exists-p elpa-org-archives-dir)) (package-refresh-contents))) (package-initialize) (add-to-list 'display-buffer-alist '("^\\*package-build-result\\*" (display-buffer-reuse-window display-buffer-below-selected))) ;;; Load `use-package' ahead before `package-initialize' for (use-package o= rg :pin manual ...). ;;; [ use-package ] (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (eval-when-compile (require 'use-package)) (require 'bind-key) ; if you use any `:bind' variant (use-package delight ; if you use `:delight' :ensure t) ;; (use-package deminish ; if you use `:diminish' ;; :ensure t) (setq use-package-verbose t ; 'debug: any evaluation errors report to `*use= -package*` buffer. use-package-always-ensure nil) ;;; use latest source code version Org Mode. (if (not (file-exists-p "~/Code/Emacs/org-mode/lisp/")) (progn (use-package org :pin org :ensure t :preface (setq org-modules nil) :mode (("\\.org\\'" . org-mode))) (use-package org-plus-contrib :pin org :ensure t)) ;; disable Emacs built-in Org Mode (delete (format "/usr/local/share/emacs/%s/lisp/org" emacs-version) load-= path) (delete "/usr/share/emacs/site-lisp/org/" load-path) =20=20 (use-package org :pin manual :load-path "~/Code/Emacs/org-mode/lisp/" :defer t :preface ;; Org Mode modules -- modules that should always be loaded together wi= th org.el. ;; t: greedy load all modules. ;; nil: disable all extra org-mode modules to speed-up Org-mode file op= ening. (setq org-modules nil) :mode (("\\.org\\'" . org-mode)) :init ;; add source code version Org-mode Info into Emacs. (with-eval-after-load 'info (add-to-list 'Info-directory-list "~/Code/Emacs/org-mode/doc/") (info-initialize)) ;; load org before using some Org settings. (require 'org) (use-package org-plus-contrib :pin manual :load-path "~/Code/Emacs/org-mode/contrib/lisp/" :defer t :no-require t))) ;;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D ;;; Here is org-attach.el customization (require 'org-attach) ;; store link auto with `org-store-link' using `file:' link type or `attach= ment:' link type. (setq org-attach-store-link-p 'attached) (setq org-attach-dir-relative t) (setq org-attach-preferred-new-method 'ask) #+end_src #+begin_src sh :eval no emacs -q -l '~/.config/emacs/minimal-init.el' #+end_src --=20 [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 =20=20=20=20=20=20