Commit c8ae6507 c8ae650738984896d1893bb570868f717410444d by Sergey Poznyakoff

Minor changes

1 parent af202127
...@@ -220,7 +220,7 @@ SCM_DEFINE_PUBLIC (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0, ...@@ -220,7 +220,7 @@ SCM_DEFINE_PUBLIC (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
220 int status; 220 int status;
221 SCM ret; 221 SCM ret;
222 222
223 SCM_ASSERT (scm_is_string (url), url, SCM_ARG1, FUNC_NAME); 223 SCM_ASSERT (scm_is_bool (url) || scm_is_string (url), url, SCM_ARG1, FUNC_NAME);
224 SCM_ASSERT (scm_is_string (mode), mode, SCM_ARG2, FUNC_NAME); 224 SCM_ASSERT (scm_is_string (mode), mode, SCM_ARG2, FUNC_NAME);
225 225
226 scm_dynwind_begin (0); 226 scm_dynwind_begin (0);
...@@ -247,8 +247,20 @@ SCM_DEFINE_PUBLIC (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0, ...@@ -247,8 +247,20 @@ SCM_DEFINE_PUBLIC (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
247 if (mode_bits & MU_STREAM_READ && mode_bits & MU_STREAM_WRITE) 247 if (mode_bits & MU_STREAM_READ && mode_bits & MU_STREAM_WRITE)
248 mode_bits = (mode_bits & ~(MU_STREAM_READ | MU_STREAM_WRITE)) | MU_STREAM_RDWR; 248 mode_bits = (mode_bits & ~(MU_STREAM_READ | MU_STREAM_WRITE)) | MU_STREAM_RDWR;
249 249
250 if (scm_is_bool (url))
251 {
252 if (url == SCM_BOOL_F)
253 mode_str = NULL;
254 else
255 mu_scm_error (FUNC_NAME, EINVAL,
256 "value #t for URL is reserved for future use",
257 scm_list_1 (url));
258 }
259 else
260 {
250 mode_str = scm_to_locale_string (url); 261 mode_str = scm_to_locale_string (url);
251 scm_dynwind_free (mode_str); 262 scm_dynwind_free (mode_str);
263 }
252 264
253 status = mu_mailbox_create_default (&mbox, mode_str); 265 status = mu_mailbox_create_default (&mbox, mode_str);
254 if (status) 266 if (status)
......
...@@ -111,6 +111,7 @@ SCM_DEFINE_PUBLIC (scm_mu_register_format, "mu-register-format", 0, 0, 1, ...@@ -111,6 +111,7 @@ SCM_DEFINE_PUBLIC (scm_mu_register_format, "mu-register-format", 0, 0, 1,
111 { 111 {
112 int status; 112 int status;
113 113
114 SCM_VALIDATE_REST_ARGUMENT (rest);
114 if (scm_is_null (rest)) 115 if (scm_is_null (rest))
115 { 116 {
116 status = register_format (NULL); 117 status = register_format (NULL);
......
...@@ -513,7 +513,7 @@ mail_send (int argc, char **argv) ...@@ -513,7 +513,7 @@ mail_send (int argc, char **argv)
513 mode = hp->mode; 513 mode = hp->mode;
514 if (mu_header_sget_value (env.header, hp->name, NULL) == 0) 514 if (mu_header_sget_value (env.header, hp->name, NULL) == 0)
515 mode = COMPOSE_REPLACE; 515 mode = COMPOSE_REPLACE;
516 compose_header_set (&env, hp->name, hp->value, hp->mode); 516 compose_header_set (&env, hp->name, hp->value, mode);
517 } 517 }
518 mu_iterator_destroy (&itr); 518 mu_iterator_destroy (&itr);
519 } 519 }
......
...@@ -27,6 +27,7 @@ exec ${GUILE-guile} -l $0 -c "(apply $main (list (command-line)))" "$@" ...@@ -27,6 +27,7 @@ exec ${GUILE-guile} -l $0 -c "(apply $main (list (command-line)))" "$@"
27 27
28 (use-modules (ice-9 getopt-long) 28 (use-modules (ice-9 getopt-long)
29 (ice-9 rdelim) 29 (ice-9 rdelim)
30 (ice-9 eval-string)
30 (srfi srfi-1) 31 (srfi srfi-1)
31 (mailutils mailutils)) 32 (mailutils mailutils))
32 33
...@@ -190,7 +191,7 @@ for any corresponding short options. ...@@ -190,7 +191,7 @@ for any corresponding short options.
190 guimb-module) 191 guimb-module)
191 192
192 (define-macro (bound? name) 193 (define-macro (bound? name)
193 `(and (module-defined? guimb-module ',name) 194 `(and (module-defined? (get-module) ',name)
194 (procedure? ,name))) 195 (procedure? ,name)))
195 196
196 (define (guimb-parse-command-line cmdline) 197 (define (guimb-parse-command-line cmdline)
...@@ -219,17 +220,12 @@ for any corresponding short options. ...@@ -219,17 +220,12 @@ for any corresponding short options.
219 (if (not output-mailbox-mode) 220 (if (not output-mailbox-mode)
220 (set! output-mailbox-mode (if (null? input-mailbox-names) "wr" "a"))) 221 (set! output-mailbox-mode (if (null? input-mailbox-names) "wr" "a")))
221 222
222 (cond 223 (if (and (not output-mailbox-name) user-name)
223 (user-name 224 (set! output-mailbox-name (if (string? user-name)
224 (set! output-mailbox
225 (mu-mailbox-open
226 (if (string? user-name)
227 (string-append "%" user-name) 225 (string-append "%" user-name)
228 "") 226 #f)))
229 output-mailbox-mode)))
230 (output-mailbox-name
231 (set! output-mailbox (mu-mailbox-open output-mailbox-name 227 (set! output-mailbox (mu-mailbox-open output-mailbox-name
232 output-mailbox-mode)))) 228 output-mailbox-mode))
233 ; (write output-mailbox)(newline) 229 ; (write output-mailbox)(newline)
234 230
235 (if source-file-name 231 (if source-file-name
......