emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 59e39cc 1/2: Mark some risky prolog variables.


From: Glenn Morris
Subject: [Emacs-diffs] emacs-25 59e39cc 1/2: Mark some risky prolog variables.
Date: Fri, 29 Jan 2016 02:04:28 +0000

branch: emacs-25
commit 59e39ccf2a26fd7251cdaf1852167eee1700b62b
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    Mark some risky prolog variables.
    
    * lisp/progmodes/prolog.el (prolog-system-version)
    (prolog-keywords, prolog-types, prolog-mode-specificators)
    (prolog-determinism-specificators, prolog-directives)
    (prolog-program-name, prolog-program-switches)
    (prolog-consult-string, prolog-compile-string)
    (prolog-eof-string, prolog-prompt-regexp, prolog-help-function):
    Mark anything processed by prolog-find-value-by-system as risky.
---
 lisp/progmodes/prolog.el |   43 +++++++++++++++++++++++++++++++------------
 1 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index c621467..352f378 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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]