किसी कारण से ऑर्ग-मोड एक ओडीटी फ़ाइल में सही ढंग से निर्यात करता है लेकिन इसे libreoffice के बजाय डिफ़ॉल्ट पीडीएफ व्यूअर (ओकुलर) के साथ खोलता है। मैंने एक समान में बताए गए सभी समाधानों को आजमाया है। पोस्ट बिना किसी किस्मत के। संदर्भ के लिए मैं अपनी init फ़ाइल के प्रासंगिक अनुभागों की प्रतिलिपि बना रहा हूं। मेरा एमएसीएस 27.0.50 है और मेरा ऑर्ग-मोड 9.1.13 है।

;; Enable export in ODT format
(eval-after-load "org" '(require 'ox-odt nil t)) ; enable odt backend
;; Open ODT files with libre office
(defun my-org-export-to-odt-and-open ()
  (interactive)
  (org-open-file (org-odt-export-to-odt)))

और मेरे कस्टम-सेट-चर में मेरे पास है

 '(org-file-apps
   '((auto-mode . emacs)
     ("\\.mm\\'" . default)
     ("\\.x?html?\\'" . default)
     ("\\.odt\\'" . "libreoffice %s") 
     ("\\.pdf\\'" . "okular %s")))

किसी भी मदद के लिए पहले से ही शुक्रिया।

यह org-file-apps का आउटपुट मान है

Value:
((auto-mode . emacs)
 ("\\.mm\\'" . default)
 ("\\.x?html?\\'" . default)
 ("\\.odt\\'" . "libreoffice %s")
 ("\\.pdf\\'" . "okular %s"))
Original value was 
((auto-mode . emacs)
 ("\\.mm\\'" . default)
 ("\\.x?html?\\'" . default)
 ("\\.pdf\\'" . default))

और यह org-open-file पर एडबग का एक आउटपुट है जब मैंने एक NoteS.org फ़ाइल निर्यात करने का प्रयास किया।

Debugger entered--returning value: nil
  string-match("\\$\\(?:\\(?1:[[:alnum:]_]+\\)\\|{\\(?1:[^{}]+\\)}\\|\\$\\)" "/home/andre/org/NOTES.odt" 0)
* substitute-env-vars("/home/andre/org/NOTES.odt" t)
* substitute-env-in-file-name("/home/andre/org/NOTES.odt")
* substitute-in-file-name("/home/andre/org/NOTES.odt")
* #f(compiled-function (path &optional in-emacs line search) "Open the file at PATH.\nFirst, this expands any special file name abbreviations.  Then the\nconfiguration variable `org-file-apps' is checked if it contains an\nentry for this file type, and if yes, the corresponding command is launched.\n\nIf no application is found, Emacs simply visits the file.\n\nWith optional prefix argument IN-EMACS, Emacs will visit the file.\nWith a double \\[universal-argument] \\[universal-argument] prefix arg, Org tries to avoid opening in Emacs\nand to use an external application to visit the file.\n\nOptional LINE specifies a line to go to, optional SEARCH a string\nto search for.  If LINE or SEARCH is given, the file will be\nopened in Emacs, unless an entry from org-file-apps that makes\nuse of groups in a regexp matches.\n\nIf you want to change the way frames are used when following a\nlink, please customize `org-link-frame-setup'.\n\nIf the file does not exist, an error is thrown." #<bytecode 0x1524219>)("NOTES.odt" system)
* apply(#f(compiled-function (path &optional in-emacs line search) "Open the file at PATH.\nFirst, this expands any special file name abbreviations.  Then the\nconfiguration variable `org-file-apps' is checked if it contains an\nentry for this file type, and if yes, the corresponding command is launched.\n\nIf no application is found, Emacs simply visits the file.\n\nWith optional prefix argument IN-EMACS, Emacs will visit the file.\nWith a double \\[universal-argument] \\[universal-argument] prefix arg, Org tries to avoid opening in Emacs\nand to use an external application to visit the file.\n\nOptional LINE specifies a line to go to, optional SEARCH a string\nto search for.  If LINE or SEARCH is given, the file will be\nopened in Emacs, unless an entry from org-file-apps that makes\nuse of groups in a regexp matches.\n\nIf you want to change the way frames are used when following a\nlink, please customize `org-link-frame-setup'.\n\nIf the file does not exist, an error is thrown." #<bytecode 0x1524219>) ("NOTES.odt" system))
* org-open-file("NOTES.odt" system)
  (if a (org-odt-export-to-odt t s v) (org-open-file (org-odt-export-to-odt nil s v) 'system))
  (lambda (a s v b) (if a (org-odt-export-to-odt t s v) (org-open-file (org-odt-export-to-odt nil s v) 'system)))(nil t nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)

मैं नीचे दिखाए गए बिंदु तक आगे बढ़ता रहा। ऐसा लगता है कि फ़ाइल का मिलान \\.mm\\ के रूप में किया गया था?

Debugger entered--returning value: (10578 10582)
  match-data()
* regexp-opt-depth("\\.mm\\'")
* org-file-apps-entry-match-against-dlink-p(("\\.mm\\'" . default))
* cl-remove(nil ((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default) ("\\.odt\\'" . "libreoffice %s") ("\\.pdf\\'" . "okular %s") (remote . emacs) (system . mailcap) (t . mailcap)) :if org-file-apps-entry-match-against-dlink-p)
* apply(cl-remove nil ((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default) ("\\.odt\\'" . "libreoffice %s") ("\\.pdf\\'" . "okular %s") (remote . emacs) (system . mailcap) (t . mailcap)) :if org-file-apps-entry-match-against-dlink-p nil)
* cl-remove-if(org-file-apps-entry-match-against-dlink-p ((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default) ("\\.odt\\'" . "libreoffice %s") ("\\.pdf\\'" . "okular %s") (remote . emacs) (system . mailcap) (t . mailcap)))
* #f(compiled-function (path &optional in-emacs line search) "Open the file at PATH.\nFirst, this expands any special file name abbreviations.  Then the\nconfiguration variable `org-file-apps' is checked if it contains an\nentry for this file type, and if yes, the corresponding command is launched.\n\nIf no application is found, Emacs simply visits the file.\n\nWith optional prefix argument IN-EMACS, Emacs will visit the file.\nWith a double \\[universal-argument] \\[universal-argument] prefix arg, Org tries to avoid opening in Emacs\nand to use an external application to visit the file.\n\nOptional LINE specifies a line to go to, optional SEARCH a string\nto search for.  If LINE or SEARCH is given, the file will be\nopened in Emacs, unless an entry from org-file-apps that makes\nuse of groups in a regexp matches.\n\nIf you want to change the way frames are used when following a\nlink, please customize `org-link-frame-setup'.\n\nIf the file does not exist, an error is thrown." #<bytecode 0x1524219>)("NOTES.odt" system)
* apply(#f(compiled-function (path &optional in-emacs line search) "Open the file at PATH.\nFirst, this expands any special file name abbreviations.  Then the\nconfiguration variable `org-file-apps' is checked if it contains an\nentry for this file type, and if yes, the corresponding command is launched.\n\nIf no application is found, Emacs simply visits the file.\n\nWith optional prefix argument IN-EMACS, Emacs will visit the file.\nWith a double \\[universal-argument] \\[universal-argument] prefix arg, Org tries to avoid opening in Emacs\nand to use an external application to visit the file.\n\nOptional LINE specifies a line to go to, optional SEARCH a string\nto search for.  If LINE or SEARCH is given, the file will be\nopened in Emacs, unless an entry from org-file-apps that makes\nuse of groups in a regexp matches.\n\nIf you want to change the way frames are used when following a\nlink, please customize `org-link-frame-setup'.\n\nIf the file does not exist, an error is thrown." #<bytecode 0x1524219>) ("NOTES.odt" system))
* org-open-file("NOTES.odt" system)
  (if a (org-odt-export-to-odt t s v) (org-open-file (org-odt-export-to-odt nil s v) 'system))
  (lambda (a s v b) (if a (org-odt-export-to-odt t s v) (org-open-file (org-odt-export-to-odt nil s v) 'system)))(nil t nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)

दरअसल, मैं आगे बढ़ता रहा और org-file-apps में उपलब्ध किसी भी विकल्प से कोई मेल नहीं था।

0
Ajned 1 जुलाई 2018, 01:08

1 उत्तर

सबसे बढ़िया उत्तर

काफी खोजबीन के बाद मुझे ये पोस्ट मिलीं: post1 < a href="https://askubuntu.com/questions/646631/emacs-doesnot-work-with-xdg-open/824123#824123">post2 जिससे निम्नलिखित समाधान निकला:

;; Enable export in ODT format
(setcdr (assq 'system org-file-apps-defaults-gnu ) "xdg-open %s")
(setq process-connection-type nil)

Org-file-apps पर कुछ भी कॉन्फ़िगर किए बिना।

0
Ajned 11 पद 2018, 01:15