emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r112159: * lisp/case-table.el (case-t


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112159: * lisp/case-table.el (case-table-get-table): New function.
Date: Wed, 27 Mar 2013 10:33:03 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112159
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2013-03-27 10:33:03 -0400
message:
  * lisp/case-table.el (case-table-get-table): New function.
  * lisp/case-table.el: Use lexical-binding.
  (case-table-get-table): New function.
  (get-upcase-table): Use it.  Mark as obsolete.  Adjust callers.
  * src/casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
  the upcase table.
modified:
  etc/NEWS
  lisp/ChangeLog
  lisp/case-table.el
  src/ChangeLog
  src/casetab.c
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2013-03-27 14:04:34 +0000
+++ b/etc/NEWS  2013-03-27 14:33:03 +0000
@@ -302,6 +302,8 @@
 
 ** `dont-compile' is declared obsolete.
 
+** `get-upcase-table' is obsoleted by the new `case-table-get-table'.
+
 ** Support for filesystem notifications.
 Emacs now supports notifications of filesystem changes, such as
 creation, modification, and deletion of files.  This requires the

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-03-27 14:04:34 +0000
+++ b/lisp/ChangeLog    2013-03-27 14:33:03 +0000
@@ -1,3 +1,12 @@
+2013-03-27  Stefan Monnier  <address@hidden>
+
+       * case-table.el: Use lexical-binding.
+       (case-table-get-table): New function.
+       (get-upcase-table): Use it.  Mark as obsolete.  Adjust callers.
+
+       * minibuffer.el (completion-pcm--merge-completions): Make sure prefixes
+       and suffixes don't overlap
+
 2013-03-27  Teodor Zlatanov  <address@hidden>
 
        * progmodes/subword.el: Add `superword-mode' to do word motion

=== modified file 'lisp/case-table.el'
--- a/lisp/case-table.el        2013-01-01 09:11:05 +0000
+++ b/lisp/case-table.el        2013-03-27 14:33:03 +0000
@@ -1,4 +1,4 @@
-;;; case-table.el --- code to extend the character set and support case tables
+;;; case-table.el --- code to extend the character set and support case tables 
 -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1988, 1994, 2001-2013 Free Software Foundation, Inc.
 
@@ -65,18 +65,26 @@
        (describe-vector description)
        (help-mode)))))
 
+(defun case-table-get-table (case-table table)
+  "Return the TABLE of CASE-TABLE.
+TABLE can be `down', `up', `eqv' or `canon'."
+  (let ((slot-nb (cdr (assq table '((up . 0) (canon . 1) (eqv . 2))))))
+    (or (if (eq table 'down) case-table)
+        (char-table-extra-slot case-table slot-nb)
+        ;; Setup all extra slots of CASE-TABLE by temporarily selecting
+        ;; it as the standard case table.
+        (let ((old (standard-case-table)))
+          (unwind-protect
+              (progn
+                (set-standard-case-table case-table)
+                (char-table-extra-slot case-table slot-nb))
+            (or (eq case-table old)
+                (set-standard-case-table old)))))))
+
 (defun get-upcase-table (case-table)
   "Return the upcase table of CASE-TABLE."
-  (or (char-table-extra-slot case-table 0)
-      ;; Setup all extra slots of CASE-TABLE by temporarily selecting
-      ;; it as the standard case table.
-      (let ((old (standard-case-table)))
-       (unwind-protect
-           (progn
-             (set-standard-case-table case-table)
-             (char-table-extra-slot case-table 0))
-         (or (eq case-table old)
-             (set-standard-case-table old))))))
+  (case-table-get-table case-table 'up))
+(make-obsolete 'get-upcase-table 'case-table-get-table "24.4")
 
 (defun copy-case-table (case-table)
   (let ((copy (copy-sequence case-table))
@@ -97,7 +105,7 @@
 indicate left and right delimiters."
   (aset table l l)
   (aset table r r)
-  (let ((up (get-upcase-table table)))
+  (let ((up (case-table-get-table table 'up)))
     (aset up l l)
     (aset up r r))
   ;; Clear out the extra slots so that they will be
@@ -117,7 +125,7 @@
 word constituents."
   (aset table uc lc)
   (aset table lc lc)
-  (let ((up (get-upcase-table table)))
+  (let ((up (case-table-get-table table 'up)))
     (aset up uc uc)
     (aset up lc uc))
   ;; Clear out the extra slots so that they will be
@@ -132,7 +140,7 @@
 It also modifies `standard-syntax-table' to give them the syntax of
 word constituents."
   (aset table lc lc)
-  (let ((up (get-upcase-table table)))
+  (let ((up (case-table-get-table table 'up)))
     (aset up uc uc)
     (aset up lc uc))
   ;; Clear out the extra slots so that they will be
@@ -148,7 +156,7 @@
 word constituents."
   (aset table uc lc)
   (aset table lc lc)
-  (let ((up (get-upcase-table table)))
+  (let ((up (case-table-get-table table 'up)))
     (aset up uc uc))
   ;; Clear out the extra slots so that they will be
   ;; recomputed from the main (downcase) table and upcase table.
@@ -164,7 +172,7 @@
 It also modifies `standard-syntax-table'.
 SYNTAX should be \" \", \"w\", \".\" or \"_\"."
   (aset table c c)
-  (let ((up (get-upcase-table table)))
+  (let ((up (case-table-get-table table 'up)))
     (aset up c c))
   ;; Clear out the extra slots so that they will be
   ;; recomputed from the main (downcase) table and upcase table.

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-03-27 13:26:34 +0000
+++ b/src/ChangeLog     2013-03-27 14:33:03 +0000
@@ -1,3 +1,8 @@
+2013-03-27  Stefan Monnier  <address@hidden>
+
+       * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
+       the upcase table.
+
 2013-03-27  rzl24ozi  <address@hidden>  (tiny changes)
 
        * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.

=== modified file 'src/casetab.c'
--- a/src/casetab.c     2013-01-01 09:11:05 +0000
+++ b/src/casetab.c     2013-03-27 14:33:03 +0000
@@ -246,7 +246,7 @@
 init_casetab_once (void)
 {
   register int i;
-  Lisp_Object down, up;
+  Lisp_Object down, up, eqv;
   DEFSYM (Qcase_table, "case-table");
 
   /* Intern this now in case it isn't already done.
@@ -275,13 +275,21 @@
 
   for (i = 0; i < 128; i++)
     {
+      int c = (i >= 'a' && i <= 'z') ? i + ('A' - 'a') : i;
+      CHAR_TABLE_SET (up, i, make_number (c));
+    }
+
+  eqv = Fmake_char_table (Qcase_table, Qnil);
+
+   for (i = 0; i < 128; i++)
+     {
       int c = ((i >= 'A' && i <= 'Z') ? i + ('a' - 'A')
               : ((i >= 'a' && i <= 'z') ? i + ('A' - 'a')
                  : i));
       CHAR_TABLE_SET (up, i, make_number (c));
     }
 
-  set_char_table_extras (down, 2, Fcopy_sequence (up));
+  set_char_table_extras (down, 2, eqv);
 
   /* Fill in what isn't filled in.  */
   set_case_table (down, 1);


reply via email to

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