Function: sieve-refresh-scriptlist
sieve-refresh-scriptlist is an interactive and byte-compiled function
defined in sieve.el.gz.
Signature
(sieve-refresh-scriptlist)
Documentation
Refresh list of scripts found on the currently opened server.
Update contents of the current sieve buffer.
Probably introduced at or before Emacs version 31.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/net/sieve.el.gz
(defun sieve-refresh-scriptlist ()
"Refresh list of scripts found on the currently opened server.
Update contents of the current sieve buffer."
(interactive)
(with-current-buffer sieve-buffer
(setq buffer-read-only nil)
(delete-region (or sieve-buffer-header-end (point-max)) (point-max))
(goto-char (point-max))
;; get list of script names and print them
(let* ((scripts (sieve-manage-listscripts sieve-manage-buffer))
(count (length scripts))
(keys (substitute-command-keys "\\[sieve-edit-script]")))
(insert
(if (null scripts)
(format
"No scripts on server, press %s on %s to create a new script.\n"
keys sieve-new-script)
(format (concat (ngettext "%d script on server"
"%d scripts on server"
count)
", press %s on a script name to edit it, or"
"\npress %s on %s to create a new script.\n")
count keys keys sieve-new-script)))
(save-excursion
(sieve-insert-scripts (list sieve-new-script))
(sieve-insert-scripts scripts)))
(sieve-highlight t)
(setq buffer-read-only t)))