aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2016-01-28 21:01:17 -0500
committerGlenn Morris2016-01-28 21:01:17 -0500
commit59e39ccf2a26fd7251cdaf1852167eee1700b62b (patch)
tree8dcff26aee26e2b36b49c7c4be7ddc71159eb8e6
parentc51943d71d99b7196957292e2cf9a9c554ec4d21 (diff)
downloademacs-59e39ccf2a26fd7251cdaf1852167eee1700b62b.tar.gz
emacs-59e39ccf2a26fd7251cdaf1852167eee1700b62b.zip
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.
-rw-r--r--lisp/progmodes/prolog.el43
1 files changed, 31 insertions, 12 deletions
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index c62146769ec..352f3785c05 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -367,6 +367,7 @@ The version numbers are of the format (Major . Minor)."
367 :type '(repeat (list (symbol :tag "System") 367 :type '(repeat (list (symbol :tag "System")
368 (cons :tag "Version numbers" (integer :tag "Major") 368 (cons :tag "Version numbers" (integer :tag "Major")
369 (integer :tag "Minor")))) 369 (integer :tag "Minor"))))
370 :risky t
370 :group 'prolog) 371 :group 'prolog)
371 372
372;; Indentation 373;; Indentation
@@ -440,7 +441,8 @@ Legal values:
440 "Alist of Prolog keywords which is used for font locking of directives." 441 "Alist of Prolog keywords which is used for font locking of directives."
441 :version "24.1" 442 :version "24.1"
442 :group 'prolog-font-lock 443 :group 'prolog-font-lock
443 :type 'sexp) 444 :type 'sexp
445 :risky t)
444 446
445(defcustom prolog-types 447(defcustom prolog-types
446 '((mercury 448 '((mercury
@@ -449,7 +451,8 @@ Legal values:
449 "Alist of Prolog types used by font locking." 451 "Alist of Prolog types used by font locking."
450 :version "24.1" 452 :version "24.1"
451 :group 'prolog-font-lock 453 :group 'prolog-font-lock
452 :type 'sexp) 454 :type 'sexp
455 :risky t)
453 456
454(defcustom prolog-mode-specificators 457(defcustom prolog-mode-specificators
455 '((mercury 458 '((mercury
@@ -458,7 +461,8 @@ Legal values:
458 "Alist of Prolog mode specificators used by font locking." 461 "Alist of Prolog mode specificators used by font locking."
459 :version "24.1" 462 :version "24.1"
460 :group 'prolog-font-lock 463 :group 'prolog-font-lock
461 :type 'sexp) 464 :type 'sexp
465 :risky t)
462 466
463(defcustom prolog-determinism-specificators 467(defcustom prolog-determinism-specificators
464 '((mercury 468 '((mercury
@@ -468,7 +472,8 @@ Legal values:
468 "Alist of Prolog determinism specificators used by font locking." 472 "Alist of Prolog determinism specificators used by font locking."
469 :version "24.1" 473 :version "24.1"
470 :group 'prolog-font-lock 474 :group 'prolog-font-lock
471 :type 'sexp) 475 :type 'sexp
476 :risky t)
472 477
473(defcustom prolog-directives 478(defcustom prolog-directives
474 '((mercury 479 '((mercury
@@ -477,7 +482,8 @@ Legal values:
477 "Alist of Prolog source code directives used by font locking." 482 "Alist of Prolog source code directives used by font locking."
478 :version "24.1" 483 :version "24.1"
479 :group 'prolog-font-lock 484 :group 'prolog-font-lock
480 :type 'sexp) 485 :type 'sexp
486 :risky t)
481 487
482 488
483;; Keyboard 489;; Keyboard
@@ -563,7 +569,8 @@ the first column (i.e., DCG heads) inserts ` -->' and newline."
563 (or (car names) "prolog")))) 569 (or (car names) "prolog"))))
564 "Alist of program names for invoking an inferior Prolog with `run-prolog'." 570 "Alist of program names for invoking an inferior Prolog with `run-prolog'."
565 :group 'prolog-inferior 571 :group 'prolog-inferior
566 :type 'sexp) 572 :type 'sexp
573 :risky t)
567(defun prolog-program-name () 574(defun prolog-program-name ()
568 (prolog-find-value-by-system prolog-program-name)) 575 (prolog-find-value-by-system prolog-program-name))
569 576
@@ -573,7 +580,8 @@ the first column (i.e., DCG heads) inserts ` -->' and newline."
573 "Alist of switches given to inferior Prolog run with `run-prolog'." 580 "Alist of switches given to inferior Prolog run with `run-prolog'."
574 :version "24.1" 581 :version "24.1"
575 :group 'prolog-inferior 582 :group 'prolog-inferior
576 :type 'sexp) 583 :type 'sexp
584 :risky t)
577(defun prolog-program-switches () 585(defun prolog-program-switches ()
578 (prolog-find-value-by-system prolog-program-switches)) 586 (prolog-find-value-by-system prolog-program-switches))
579 587
@@ -596,7 +604,9 @@ Some parts of the string are replaced:
596 region of a buffer, in which case it is the number of lines before 604 region of a buffer, in which case it is the number of lines before
597 the region." 605 the region."
598 :group 'prolog-inferior 606 :group 'prolog-inferior
599 :type 'sexp) 607 :type 'sexp
608 :risky t)
609
600(defun prolog-consult-string () 610(defun prolog-consult-string ()
601 (prolog-find-value-by-system prolog-consult-string)) 611 (prolog-find-value-by-system prolog-consult-string))
602 612
@@ -621,7 +631,9 @@ Some parts of the string are replaced:
621If `prolog-program-name' is non-nil, it is a string sent to a Prolog process. 631If `prolog-program-name' is non-nil, it is a string sent to a Prolog process.
622If `prolog-program-name' is nil, it is an argument to the `compile' function." 632If `prolog-program-name' is nil, it is an argument to the `compile' function."
623 :group 'prolog-inferior 633 :group 'prolog-inferior
624 :type 'sexp) 634 :type 'sexp
635 :risky t)
636
625(defun prolog-compile-string () 637(defun prolog-compile-string ()
626 (prolog-find-value-by-system prolog-compile-string)) 638 (prolog-find-value-by-system prolog-compile-string))
627 639
@@ -629,7 +641,8 @@ If `prolog-program-name' is nil, it is an argument to the `compile' function."
629 "Alist of strings that represent end of file for prolog. 641 "Alist of strings that represent end of file for prolog.
630nil means send actual operating system end of file." 642nil means send actual operating system end of file."
631 :group 'prolog-inferior 643 :group 'prolog-inferior
632 :type 'sexp) 644 :type 'sexp
645 :risky t)
633 646
634(defcustom prolog-prompt-regexp 647(defcustom prolog-prompt-regexp
635 '((eclipse "^[a-zA-Z0-9()]* *\\?- \\|^\\[[a-zA-Z]* [0-9]*\\]:") 648 '((eclipse "^[a-zA-Z0-9()]* *\\?- \\|^\\[[a-zA-Z]* [0-9]*\\]:")
@@ -640,7 +653,9 @@ nil means send actual operating system end of file."
640 "Alist of prompts of the prolog system command line." 653 "Alist of prompts of the prolog system command line."
641 :version "24.1" 654 :version "24.1"
642 :group 'prolog-inferior 655 :group 'prolog-inferior
643 :type 'sexp) 656 :type 'sexp
657 :risky t)
658
644(defun prolog-prompt-regexp () 659(defun prolog-prompt-regexp ()
645 (prolog-find-value-by-system prolog-prompt-regexp)) 660 (prolog-find-value-by-system prolog-prompt-regexp))
646 661
@@ -649,7 +664,8 @@ nil means send actual operating system end of file."
649;; (t "^|: +")) 664;; (t "^|: +"))
650;; "Alist of regexps matching the prompt when consulting `user'." 665;; "Alist of regexps matching the prompt when consulting `user'."
651;; :group 'prolog-inferior 666;; :group 'prolog-inferior
652;; :type 'sexp) 667;; :type 'sexp
668;; :risky t)
653 669
654(defcustom prolog-debug-on-string "debug.\n" 670(defcustom prolog-debug-on-string "debug.\n"
655 "Predicate for enabling debug mode." 671 "Predicate for enabling debug mode."
@@ -1020,6 +1036,8 @@ VERSION is of the format (Major . Minor)"
1020 1036
1021(define-abbrev-table 'prolog-mode-abbrev-table ()) 1037(define-abbrev-table 'prolog-mode-abbrev-table ())
1022 1038
1039;; Becauses this can `eval' its arguments, any variable that gets
1040;; processed by it should be marked as :risky.
1023(defun prolog-find-value-by-system (alist) 1041(defun prolog-find-value-by-system (alist)
1024 "Get value from ALIST according to `prolog-system'." 1042 "Get value from ALIST according to `prolog-system'."
1025 (let ((system (or prolog-system 1043 (let ((system (or prolog-system
@@ -2341,6 +2359,7 @@ In effect it sets the `fill-prefix' when inside comments and then calls
2341 (swi prolog-help-online) 2359 (swi prolog-help-online)
2342 (t prolog-help-online)) 2360 (t prolog-help-online))
2343 "Alist for the name of the function for finding help on a predicate.") 2361 "Alist for the name of the function for finding help on a predicate.")
2362(put 'prolog-help-function 'risky-local-variable t)
2344 2363
2345(defun prolog-help-on-predicate () 2364(defun prolog-help-on-predicate ()
2346 "Invoke online help on the atom under cursor." 2365 "Invoke online help on the atom under cursor."