Browse Source

org-plot: Ignore gnuplot buffer read-only error

* lisp/org-plot.el (org-plot/gnuplot): When
`gnuplot-send-buffer-to-gnuplot` is called, it may emit the error
"kill-region: Text is read-only: #<buffer *gnuplot*>" when the plot
operation has been successful.  This prevents `org-plot/gnuplot` from
executing the rest of the function, which is undesirable.
It's preferable just to ignore this error.
TEC 4 năm trước cách đây
mục cha
commit
73a96c63a9
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      lisp/org-plot.el

+ 2 - 1
lisp/org-plot.el

@@ -708,7 +708,8 @@ line directly before or after the table."
 	  (insert (org-plot/gnuplot-script table data-file num-cols params)))
 	;; Graph table.
 	(gnuplot-mode)
-	(gnuplot-send-buffer-to-gnuplot))
+        (ignore-error buffer-read-only
+          (gnuplot-send-buffer-to-gnuplot)))
       ;; Cleanup.
       (bury-buffer (get-buffer "*gnuplot*"))
       ;; Refresh any displayed images