7
7
; ; Michael Ivey
8
8
; ; Phil Hagelberg
9
9
; ; Dan McKinley
10
- ; ; Version: 1.3.1
10
+ ; ; Marcelo Muñoz Araya <[email protected] >
11
+ ; ; Version: 1.3.2
11
12
; ; Package-Requires: ((emacs "24.1") (gh "0.9.2"))
12
13
; ; Keywords: tools
13
14
; ; Homepage: https://github.com/defunkt/gist.el
92
93
:type 'boolean
93
94
:group 'gist )
94
95
96
+ (defcustom gist-ask-for-filename nil
97
+ " If non-nil, prompt for change default file name before submitting gist."
98
+ :type 'boolean
99
+ :group 'gist )
100
+
95
101
(defcustom gist-created-fmt " Paste created: %s"
96
102
" Format for the message that gets shown upon successful gist
97
103
creation. Must contain a single %s for the location of the newly
@@ -182,6 +188,11 @@ appropriate modes from fetched gist files (based on filenames)."
182
188
(when gist-ask-for-description
183
189
(read-from-minibuffer " Gist description: " )))
184
190
191
+ (defun gist-ask-for-filename-maybe (fname )
192
+ (if gist-ask-for-filename
193
+ (read-string (format " File name (%s ): " fname) nil nil fname)
194
+ fname))
195
+
185
196
;;;### autoload
186
197
(defun gist-region (begin end &optional private callback )
187
198
" Post the current region as a new paste at gist.github.com
@@ -194,7 +205,8 @@ With a prefix argument, makes a private paste."
194
205
(ext (or (cdr (assoc major-mode gist-supported-modes-alist))
195
206
(file-name-extension file)
196
207
" txt" ))
197
- (fname (concat (file-name-sans-extension name) " ." ext))
208
+ (proposal-fname (concat (file-name-sans-extension name) " ." ext))
209
+ (fname (gist-ask-for-filename-maybe proposal-fname))
198
210
(files (list
199
211
(make-instance 'gh-gist-gist-file
200
212
:filename fname
0 commit comments