emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/jgraph-mode bd32503 3/5: * packages/jgraph-mode/jgraph-


From: Stefan Monnier
Subject: [elpa] externals/jgraph-mode bd32503 3/5: * packages/jgraph-mode/jgraph-mode.el: Use lexical-binding.
Date: Sat, 28 Nov 2020 19:07:35 -0500 (EST)

branch: externals/jgraph-mode
commit bd32503eb953d863b9739f9477294e35a952e563
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * packages/jgraph-mode/jgraph-mode.el: Use lexical-binding.
    (jgraph-extract-commands): Avoid add-to-list on local var.
---
 jgraph-mode.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/jgraph-mode.el b/jgraph-mode.el
index 8f211aa..a56449e 100644
--- a/jgraph-mode.el
+++ b/jgraph-mode.el
@@ -1,9 +1,10 @@
-;;; jgraph-mode.el --- Major mode for Jgraph files
+;;; jgraph-mode.el --- Major mode for Jgraph files  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2006, 2011-2012  Free Software Foundation, Inc
+;; Copyright (C) 2006, 2011-2012, 2014  Free Software Foundation, Inc
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Version: 1.0
+;; Package-Requires: ((cl-lib "0.5"))
 ;; Keywords: tex, wp
 
 ;; This file is part of GNU Emacs.
@@ -28,6 +29,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl-lib))
+
 (defgroup jgraph-mode ()
   "Major mode for Jgraph files."
   :group 'tools)
@@ -81,8 +84,8 @@
         (setq section (intern section))
         (while (re-search-forward "^\\.TP\n\\(?:\\.B \\|\\\\fB\\)\\([^ 
:\t\n\\]+\\)\\([ {\\fI]*token\\)?" end 'move)
           (let ((cmd (match-string-no-properties 1)))
-            (if (match-end 2) (add-to-list 'tok-cmds cmd))
-            (add-to-list 'commands cmd)))
+            (if (match-end 2) (cl-pushnew cmd tok-cmds :test #'equal))
+            (cl-pushnew cmd commands :test #'equal)))
         (setq commands (nreverse commands))
         (let ((sec (assoc section sections)))
           (if sec (nconc sec commands)



reply via email to

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