char * string = NULL;
emacs_value v = NULL;
size_t l = -1;
- if (PL_get_string_chars(t, &string, &l)) {
+ if (PL_get_nchars(t, &l, &string, CVT_STRING|REP_UTF8)) {
v = eenv->make_string(eenv, string, l);
+ } else {
+ v = eenv->make_string(eenv, "sweep conversion error", 22);
}
return v;
}
;;; Code:
+(defgroup sweep nil
+ "SWI-Prolog Embedded in Emacs."
+ :group 'prolog)
+
(defvar sweep-install-buffer-name "*Install sweep*"
"Name of the buffer used for compiling sweep-module.")
nil))))))
(completing-read "Predicate: " col)))
+;;;###autoload
(defun sweep-find-predicate (mfn)
"Jump to the definiton of the Prolog predicate MFN.
MFN must be a string of the form \"M:F/N\" where M is a Prolog
(let* ((val (cdr (assoc-string key col)))
(pat (car val))
(des (cdr val)))
- (concat (make-string (- 32 (length key)) ? )
+ (concat (make-string (max 0 (- 32 (length key))) ? )
(if des
- (concat pat (make-string (- 64 (length pat)) ? ) des)
+ (concat pat (make-string (max 0 (- 80 (length pat))) ? ) des)
pat)))))))
(completing-read "Module: " col)))
+;;;###autoload
(defun sweep-find-module (mod)
"Jump to the source file of the Prolog module MOD."
(interactive (list (sweep-read-module-name)))