diff options
Diffstat (limited to 'lisp/progmodes/prolog.el')
-rw-r--r-- | lisp/progmodes/prolog.el | 54 |
1 files changed, 38 insertions, 16 deletions
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index c62146769ec..3767dbaa1e8 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -367,6 +367,7 @@ The version numbers are of the format (Major . Minor)." :type '(repeat (list (symbol :tag "System") (cons :tag "Version numbers" (integer :tag "Major") (integer :tag "Minor")))) + :risky t :group 'prolog) ;; Indentation @@ -440,7 +441,8 @@ Legal values: "Alist of Prolog keywords which is used for font locking of directives." :version "24.1" :group 'prolog-font-lock - :type 'sexp) + :type 'sexp + :risky t) (defcustom prolog-types '((mercury @@ -449,7 +451,8 @@ Legal values: "Alist of Prolog types used by font locking." :version "24.1" :group 'prolog-font-lock - :type 'sexp) + :type 'sexp + :risky t) (defcustom prolog-mode-specificators '((mercury @@ -458,7 +461,8 @@ Legal values: "Alist of Prolog mode specificators used by font locking." :version "24.1" :group 'prolog-font-lock - :type 'sexp) + :type 'sexp + :risky t) (defcustom prolog-determinism-specificators '((mercury @@ -468,7 +472,8 @@ Legal values: "Alist of Prolog determinism specificators used by font locking." :version "24.1" :group 'prolog-font-lock - :type 'sexp) + :type 'sexp + :risky t) (defcustom prolog-directives '((mercury @@ -477,7 +482,8 @@ Legal values: "Alist of Prolog source code directives used by font locking." :version "24.1" :group 'prolog-font-lock - :type 'sexp) + :type 'sexp + :risky t) ;; Keyboard @@ -563,7 +569,8 @@ the first column (i.e., DCG heads) inserts ` -->' and newline." (or (car names) "prolog")))) "Alist of program names for invoking an inferior Prolog with `run-prolog'." :group 'prolog-inferior - :type 'sexp) + :type 'sexp + :risky t) (defun prolog-program-name () (prolog-find-value-by-system prolog-program-name)) @@ -573,7 +580,8 @@ the first column (i.e., DCG heads) inserts ` -->' and newline." "Alist of switches given to inferior Prolog run with `run-prolog'." :version "24.1" :group 'prolog-inferior - :type 'sexp) + :type 'sexp + :risky t) (defun prolog-program-switches () (prolog-find-value-by-system prolog-program-switches)) @@ -596,7 +604,9 @@ Some parts of the string are replaced: region of a buffer, in which case it is the number of lines before the region." :group 'prolog-inferior - :type 'sexp) + :type 'sexp + :risky t) + (defun prolog-consult-string () (prolog-find-value-by-system prolog-consult-string)) @@ -621,7 +631,9 @@ Some parts of the string are replaced: If `prolog-program-name' is non-nil, it is a string sent to a Prolog process. If `prolog-program-name' is nil, it is an argument to the `compile' function." :group 'prolog-inferior - :type 'sexp) + :type 'sexp + :risky t) + (defun prolog-compile-string () (prolog-find-value-by-system prolog-compile-string)) @@ -629,7 +641,8 @@ If `prolog-program-name' is nil, it is an argument to the `compile' function." "Alist of strings that represent end of file for prolog. nil means send actual operating system end of file." :group 'prolog-inferior - :type 'sexp) + :type 'sexp + :risky t) (defcustom prolog-prompt-regexp '((eclipse "^[a-zA-Z0-9()]* *\\?- \\|^\\[[a-zA-Z]* [0-9]*\\]:") @@ -640,7 +653,9 @@ nil means send actual operating system end of file." "Alist of prompts of the prolog system command line." :version "24.1" :group 'prolog-inferior - :type 'sexp) + :type 'sexp + :risky t) + (defun prolog-prompt-regexp () (prolog-find-value-by-system prolog-prompt-regexp)) @@ -649,7 +664,8 @@ nil means send actual operating system end of file." ;; (t "^|: +")) ;; "Alist of regexps matching the prompt when consulting `user'." ;; :group 'prolog-inferior -;; :type 'sexp) +;; :type 'sexp +;; :risky t) (defcustom prolog-debug-on-string "debug.\n" "Predicate for enabling debug mode." @@ -1020,6 +1036,8 @@ VERSION is of the format (Major . Minor)" (define-abbrev-table 'prolog-mode-abbrev-table ()) +;; Becauses this can `eval' its arguments, any variable that gets +;; processed by it should be marked as :risky. (defun prolog-find-value-by-system (alist) "Get value from ALIST according to `prolog-system'." (let ((system (or prolog-system @@ -2341,6 +2359,7 @@ In effect it sets the `fill-prefix' when inside comments and then calls (swi prolog-help-online) (t prolog-help-online)) "Alist for the name of the function for finding help on a predicate.") +(put 'prolog-help-function 'risky-local-variable t) (defun prolog-help-on-predicate () "Invoke online help on the atom under cursor." @@ -2598,6 +2617,8 @@ and end of list building." (goto-char (point-max)) ) +(declare-function pltrace-on "ext:pltrace" ()) + (defun prolog-enable-sicstus-sd () "Enable the source level debugging facilities of SICStus 3.7 and later." (interactive) @@ -2608,21 +2629,22 @@ and end of list building." (progn ;; If there is a *prolog* buffer, then call pltrace-on (if (get-buffer "*prolog*") - ;; Avoid compilation warnings by using eval - (eval '(pltrace-on))) + (pltrace-on)) (setq prolog-use-sicstus-sd t) ))) +(declare-function pltrace-off "ext:pltrace" (&optional remove-process-filter)) + (defun prolog-disable-sicstus-sd () "Disable the source level debugging facilities of SICStus 3.7 and later." (interactive) + (require 'pltrace) (setq prolog-use-sicstus-sd nil) ;; Remove the hook (remove-hook 'prolog-inferior-mode-hook 'pltrace-on) ;; If there is a *prolog* buffer, then call pltrace-off (if (get-buffer "*prolog*") - ;; Avoid compile warnings by using eval - (eval '(pltrace-off)))) + (pltrace-off))) (defun prolog-toggle-sicstus-sd () ;; FIXME: Use define-minor-mode. |