aboutsummaryrefslogtreecommitdiff
path: root/generic/proof-syntax.el
diff options
context:
space:
mode:
Diffstat (limited to 'generic/proof-syntax.el')
-rw-r--r--generic/proof-syntax.el50
1 files changed, 27 insertions, 23 deletions
diff --git a/generic/proof-syntax.el b/generic/proof-syntax.el
index 84b5940d..5871a993 100644
--- a/generic/proof-syntax.el
+++ b/generic/proof-syntax.el
@@ -1,23 +1,27 @@
-;; proof-syntax.el --- Functions for dealing with syntax
-;;
-;; Copyright (C) 1997-2001, 2010 LFCS Edinburgh.
+;;; proof-syntax.el --- Functions for dealing with syntax
+
+;; This file is part of Proof General.
+
+;; Portions © Copyright 1994-2012 David Aspinall and University of Edinburgh
+;; Portions © Copyright 2003, 2012, 2014 Free Software Foundation, Inc.
+;; Portions © Copyright 2001-2017 Pierre Courtieu
+;; Portions © Copyright 2010, 2016 Erik Martin-Dorel
+;; Portions © Copyright 2011-2013, 2016-2017 Hendrik Tews
+;; Portions © Copyright 2015-2017 Clément Pit-Claudel
+
;; Authors: David Aspinall, Healfdene Goguen,
;; Thomas Kleymann, Dilip Sequiera
-;; License: GPL (GNU GENERAL PUBLIC LICENSE)
-;;
-;; $Id$
-;;
-
-(require 'font-lock)
-(require 'proof-config) ; proof-case-fold-search
-(require 'proof-compat) ; proof-buffer-syntactic-context
-(require 'pg-pamacs) ; proof-ass-sym
+;; License: GPL (GNU GENERAL PUBLIC LICENSE)
;;; Commentary:
;;
;;; Code:
+(require 'font-lock)
+(require 'proof-config) ; proof-case-fold-search
+(require 'proof-compat) ; proof-buffer-syntactic-context
+(require 'pg-pamacs) ; proof-ass-sym
(defsubst proof-ids-to-regexp (l)
"Maps a non-empty list of tokens L to a regexp matching any element.
@@ -60,56 +64,56 @@ nil if a region cannot be found."
;; applicable.
(defsubst proof-search-forward (string &optional bound noerror count)
- "Like search-forward, but set case-fold-search to proof-case-fold-search."
+ "Like ‘search-forward’, but set ‘case-fold-search’ to ‘proof-case-fold-search’."
(let
((case-fold-search proof-case-fold-search))
(search-forward string bound noerror count)))
;;;###autoload
(defsubst proof-replace-regexp-in-string (regexp rep string)
- "Like replace-regexp-in-string, but set case-fold-search to proof-case-fold-search."
+ "Like ‘replace-regexp-in-string’, but set ‘case-fold-search’ to ‘proof-case-fold-search’."
(let ((case-fold-search proof-case-fold-search))
(replace-regexp-in-string regexp rep string)))
(defsubst proof-re-search-forward (regexp &optional bound noerror count)
- "Like re-search-forward, but set case-fold-search to proof-case-fold-search."
+ "Like ‘re-search-forward’, but set ‘case-fold-search’ to ‘proof-case-fold-search’."
(let ((case-fold-search proof-case-fold-search))
(re-search-forward regexp bound noerror count)))
(defsubst proof-re-search-backward (regexp &optional bound noerror count)
- "Like re-search-backward, but set case-fold-search to proof-case-fold-search."
+ "Like ‘re-search-backward’, but set ‘case-fold-search’ to ‘proof-case-fold-search’."
(let ((case-fold-search proof-case-fold-search))
(re-search-backward regexp bound noerror count)))
(defsubst proof-re-search-forward-safe (regexp &optional bound noerror count)
- "Like re-search-forward, but set case-fold-search to proof-case-fold-search."
+ "Like ‘re-search-forward’, but set ‘case-fold-search’ to ‘proof-case-fold-search’."
(and regexp
(let ((case-fold-search proof-case-fold-search))
(re-search-forward regexp bound noerror count))))
(defsubst proof-string-match (regexp string &optional start)
- "Like string-match, but set case-fold-search to proof-case-fold-search."
+ "Like ‘string-match’, but set ‘case-fold-search’ to ‘proof-case-fold-search’."
(let ((case-fold-search proof-case-fold-search))
(string-match regexp string start)))
(defsubst proof-string-match-safe (regexp string &optional start)
- "Like `string-match', but return nil if REGEXP or STRING is nil."
+ "Like ‘string-match’, but return nil if REGEXP or STRING is nil."
(if (and regexp string) (proof-string-match regexp string start)))
(defsubst proof-stringfn-match (regexp-or-fn string)
- "Like proof-string-match if first arg is regexp, otherwise call it."
+ "Like ‘proof-string-match’ if first arg is regexp, otherwise call it."
(cond ((stringp regexp-or-fn)
(proof-string-match regexp-or-fn string))
((functionp regexp-or-fn)
(funcall regexp-or-fn string))))
(defsubst proof-looking-at (regexp)
- "Like looking-at, but set case-fold-search to proof-case-fold-search."
+ "Like ‘looking-at’, but set ‘case-fold-search’ to ‘proof-case-fold-search’."
(let ((case-fold-search proof-case-fold-search))
(looking-at regexp)))
(defsubst proof-looking-at-safe (regexp)
- "Like `proof-looking-at', but return nil if REGEXP is nil."
+ "Like ‘proof-looking-at’, but return nil if REGEXP is nil."
(if regexp (proof-looking-at regexp)))
;;
@@ -232,7 +236,7 @@ this were even more bogus...."
(eval-after-load "font-lock"
'(progn
(defadvice font-lock-fontify-keywords-region
- (before font-lock-fontify-keywords-advice (beg end loudly))
+ (before font-lock-fontify-keywords-advice (beg end &optional loudly))
"Call proof assistant specific syntactic region fontify.
If it's bound, we call <PA>-font-lock-fontify-syntactically-region."
(when (and proof-buffer-type