[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

[PATCH] Added w3m-external-view-temp-directory for external viewer files



Hello,

Attached is a patch that adds a new variable,
w3m-external-view-temp-directory, that can be used to specify where
w3m-external-view puts temporary files.

By default the external view files are put in ~/.w3m and if you have
automated backups of your home directory they will be copied. I did not
want this and in my configuration I set w3m-external-view-temp-directory
to /tmp (which also gets cleaned out every reboot).

Thank you,
Vladimir
Index: ChangeLog
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/ChangeLog,v
retrieving revision 1.3585
diff -u -p -u -r1.3585 ChangeLog
--- ChangeLog	21 Jun 2017 05:19:24 -0000	1.3585
+++ ChangeLog	22 Jun 2017 23:11:49 -0000
@@ -1,3 +1,9 @@
+2017-06-22  Vladimir Sedach  <vas@xxxxxxxxxx>
+
+	* w3m.el (w3m-external-view): Added new variable
+	w3m-external-view-temp-directory to control which directory files are
+	saved to before being opened with the external viewer.
+
 2017-06-20  Vladimir Sedach  <vas@xxxxxxxxxx>

 	* w3m.el (w3m-goto-url-new-session): Handle POST data.
Index: w3m.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.1664
diff -u -p -u -r1.1664 w3m.el
--- w3m.el	21 Jun 2017 05:19:24 -0000	1.1664
+++ w3m.el	22 Jun 2017 23:11:52 -0000
@@ -737,6 +737,12 @@ w3m command, edit the file named \"~/.w3
   :group 'w3m
   :type '(directory :size 0))

+(defcustom w3m-external-view-temp-directory
+  w3m-profile-directory
+  "*Directory where files are saved for the external file viewer."
+  :group 'w3m
+  :type '(directory :size 0))
+
 (defcustom w3m-default-directory nil
   "*Directory used as the current directory in emacs-w3m buffers.
 The valid values include a string specifying an existing directory,
@@ -7299,7 +7305,8 @@ No method to view `%s' is registered. Us
 		  ((command (w3m-which-command (car method)))
 		   (arguments (cdr method))
 		   (file (make-temp-name
-			  (expand-file-name "w3mel" w3m-profile-directory)))
+			  (expand-file-name
+                           "w3mel" w3m-external-view-temp-directory)))
 		   suffix)
 		(setq suffix (file-name-nondirectory url))
 		(when (string-match "\\.[a-zA-Z0-9]+$" suffix)