Browse Source

Export: Protect pushing to x-selection, for non-x environments

Carsten Dominik 16 years ago
parent
commit
ab643f15d9
2 changed files with 5 additions and 2 deletions
  1. 3 0
      lisp/ChangeLog
  2. 2 2
      lisp/org-exp.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-05-22  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-exp.el (org-export-push-to-kill-ring): Protect using
+	x-set-selection, because that does not always work.
+
 	* org-agenda.el (org-agenda-list): Apply the new face
 	`org-agenda-date-today'.
 

+ 2 - 2
lisp/org-exp.el

@@ -2725,8 +2725,8 @@ The depends on the variable `org-export-copy-to-kill'."
   (when org-export-copy-to-kill-ring
     (kill-new (buffer-string))
     (when (fboundp 'x-set-selection)
-      (x-set-selection 'PRIMARY (buffer-string))
-      (x-set-selection 'CLIPBOARD (buffer-string)))
+      (ignore-errors (x-set-selection 'PRIMARY (buffer-string)))
+      (ignore-errors (x-set-selection 'CLIPBOARD (buffer-string))))
     (message "%s export done, pushed to kill ring and clipboard" format)))
 
 (provide 'org-exp)