emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r112374: * lisp/progmodes/opascal.el


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112374: * lisp/progmodes/opascal.el (opascal-set-token-property): Rename from
Date: Wed, 24 Apr 2013 16:44:45 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112374
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14134
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2013-04-24 16:44:45 -0400
message:
  * lisp/progmodes/opascal.el (opascal-set-token-property): Rename from
  opascal-set-text-properties and only set `token'.
  (opascal-literal-text-properties): Remove.
  (opascal-parse-next-literal, opascal-debug-unparse-buffer):
  Adjust callers.
modified:
  lisp/ChangeLog
  lisp/progmodes/opascal.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-04-24 14:35:59 +0000
+++ b/lisp/ChangeLog    2013-04-24 20:44:45 +0000
@@ -1,3 +1,12 @@
+2013-04-24  Stefan Monnier  <address@hidden>
+
+       * progmodes/opascal.el (opascal-set-token-property): Rename from
+       opascal-set-text-properties and only set `token' (bug#14134).
+       Suggested by Erik Knowles <address@hidden>.
+       (opascal-literal-text-properties): Remove.
+       (opascal-parse-next-literal, opascal-debug-unparse-buffer):
+       Adjust callers.
+
 2013-04-24  Reuben Thomas <address@hidden>
 
        * textmodes/remember.el (remember-handler-functions): Add an

=== modified file 'lisp/progmodes/opascal.el'
--- a/lisp/progmodes/opascal.el 2013-01-31 01:58:24 +0000
+++ b/lisp/progmodes/opascal.el 2013-04-24 20:44:45 +0000
@@ -406,11 +406,11 @@
 non-OPascal buffer.  Set to nil in OPascal buffers.  To override, just do:
  (let ((opascal--ignore-changes t)) ...)")
 
-(defun opascal-set-text-properties (from to properties)
+(defun opascal-set-token-property (from to value)
   ;; Like `set-text-properties', except we do not consider this to be a buffer
   ;; modification.
   (opascal-save-state
-   (set-text-properties from to properties)))
+   (put-text-property from to 'token value)))
 
 (defun opascal-literal-kind (p)
   ;; Returns the literal kind the point p is in (or nil if not in a literal).
@@ -490,13 +490,6 @@
       (re-search-forward pattern limit 'goto-limit-on-fail)
       (point))))
 
-(defun opascal-literal-text-properties (kind)
-  ;; Creates a list of text properties for the literal kind.
-  (if (and (boundp 'font-lock-mode)
-           font-lock-mode)
-      (list 'token kind 'face (opascal-face-of kind) 'lazy-lock t)
-    (list 'token kind)))
-
 (defun opascal-parse-next-literal (limit)
   ;; Searches for the next literal region (i.e. comment or string) and sets the
   ;; the point to its end (or the limit, if not found). The literal region is
@@ -507,8 +500,7 @@
            ;; We are completing an incomplete literal.
            (let ((kind (opascal-literal-kind (1- search-start))))
              (opascal-complete-literal kind limit)
-             (opascal-set-text-properties
-              search-start (point) (opascal-literal-text-properties kind))))
+             (opascal-set-token-property search-start (point) kind)))
 
           ((re-search-forward
             "\\(//\\)\\|\\({\\)\\|\\((\\*\\)\\|\\('\\)\\|\\(\"\\)"
@@ -520,13 +512,12 @@
                              ((match-beginning 4) 'string)
                              ((match-beginning 5) 'double-quoted-string)))
                  (start (match-beginning 0)))
-             (opascal-set-text-properties search-start start nil)
+             (opascal-set-token-property search-start start nil)
              (opascal-complete-literal kind limit)
-             (opascal-set-text-properties
-              start (point) (opascal-literal-text-properties kind))))
+             (opascal-set-token-property start (point) kind)))
 
           ;; Nothing found. Mark it as a non-literal.
-          ((opascal-set-text-properties search-start limit nil)))
+          ((opascal-set-token-property search-start limit nil)))
     (opascal-step-progress (point) "Parsing" opascal-parsing-progress-step)))
 
 (defun opascal-literal-token-at (p)
@@ -1570,7 +1561,7 @@
 
 (defun opascal-debug-unparse-buffer ()
   (interactive)
-  (opascal-set-text-properties (point-min) (point-max) nil))
+  (opascal-set-token-property (point-min) (point-max) nil))
 
 (defun opascal-debug-parse-region (from to)
   (interactive "r")


reply via email to

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