Gustav Wikström <> writes:

> Hi,
>> -----Original Message-----
>> From: Emacs-orgmode <> On
>> Behalf Of stardiviner
>> Sent: den 13 januari 2020 14:42
>> To:
>> Subject: Re: [O] FW: [RFC] Link-type for attachments, more attach options
>> I found when I set option ~(setq org-attach-store-link-p t)~. Then attach
>> a file, store file link with =[C-c C-l]=. The stored link. I open this
>> link got error "No such file: ....". I tested this with minimal Emacs
>> config. confirmed this problem.
> I cannot reproduce this. In my try with a minimal Emacs (emacs -q) and with 
> 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 =emacs -q= ? That is a built-in Org Mode 
which does not contains the latest version =org-attach.el=.

Here is my minimal Emacs config:

#+begin_src emacs-lisp :tangle "~/.config/emacs/minimal-init.el"

;;; 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
         (let ((load-path (copy-sequence load-path))) ; shadow
            (copy-sequence (normal-top-level-add-to-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" . "";)
;;              ("melpa" . "";)
;;              ("melpa-stable" . "";)
;;              ("marmalade" . "";)
;;              ("org"   . "";)))

(setq-default package-archives
              '(("melpa" . "";)
                ("org"   . "";)
                ("gnu"   . "";)))

(let* ((elpa-archives-dir (expand-file-name "elpa/archives/" 
       (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))


(add-to-list 'display-buffer-alist
               (display-buffer-reuse-window display-buffer-below-selected)))

;;; Load `use-package' ahead before `package-initialize' for (use-package org 
:pin manual ...).
;;; [ use-package ]

(unless (package-installed-p 'use-package)
  (package-install 'use-package))

  (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/"))
      (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)
  (use-package org
    :pin manual
    :load-path "~/Code/Emacs/org-mode/lisp/"
    :defer t
    ;; Org Mode modules -- modules that should always be loaded together with 
    ;; t: greedy load all modules.
    ;; nil: disable all extra org-mode modules to speed-up Org-mode file 
    (setq org-modules nil)
    :mode (("\\.org\\'" . org-mode))
    ;; 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/")
    ;; 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)))

;;; Here is org-attach.el customization

(require 'org-attach)

;; store link auto with `org-store-link' using `file:' link type or 
`attachment:' link type.
(setq org-attach-store-link-p 'attached)
(setq org-attach-dir-relative t)
(setq org-attach-preferred-new-method 'ask)

#+begin_src sh :eval no
emacs -q -l '~/.config/emacs/minimal-init.el'

[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

Reply via email to