]> git.eshelyaron.com Git - emacs.git/commitdiff
lisp/completion.el: Remove stuff unused since 2013-03-15T16:06:12Z!handa@gnu.org.
authorJuanma Barranquero <lekktu@gmail.com>
Sat, 10 Aug 2013 12:00:19 +0000 (14:00 +0200)
committerJuanma Barranquero <lekktu@gmail.com>
Sat, 10 Aug 2013 12:00:19 +0000 (14:00 +0200)
(*record-cmpl-statistics-p*): Remove (was commented out ).
(cmpl-statistics-block): Remove (body was commented out).
All callers changed.
(add-completions-from-buffer, load-completions-from-file):
Remove unused variables.

lisp/ChangeLog
lisp/completion.el

index 796ba3074e1dbba133a8c95b5f0c4e0ae9da6d33..da0ea72364b98fdd259821c3c81c04d03400b732 100644 (file)
@@ -1,3 +1,12 @@
+2013-08-10  Juanma Barranquero  <lekktu@gmail.com>
+
+       * completion.el: Remove stuff unused since revno:3176 (1993-05-27).
+       (*record-cmpl-statistics-p*): Remove (was commented out ).
+       (cmpl-statistics-block): Remove (body was commented out).
+       All callers changed.
+       (add-completions-from-buffer, load-completions-from-file):
+       Remove unused variables.
+
 2013-08-09  Juanma Barranquero  <lekktu@gmail.com>
 
        * filecache.el (file-cache-delete-file-list):
index dbddc6f5b87600af6d79795ef375fa35d77820aa..ee0234536aaf4b73f7979eaaa3f190dbf0040340 100644 (file)
@@ -343,9 +343,6 @@ are automatically added to the completion database."
   :type '(set (const lisp) (const c))
   :group 'completion)
 
-;;(defvar *record-cmpl-statistics-p* nil
-;;  "If non-nil, record completion statistics.")
-
 ;;(defvar *completion-auto-save-period* 1800
 ;;  "The period in seconds to wait for emacs to be idle before autosaving
 ;;the completions.  Default is a 1/2 hour.")
@@ -691,16 +688,6 @@ Returns nil if there isn't one longer than `completion-min-length'."
 ;; Note that the guts of this has been turned off.  The guts
 ;; are in completion-stats.el.
 
-;;-----------------------------------------------
-;; Conditionalizing code on *record-cmpl-statistics-p*
-;;-----------------------------------------------
-;; All statistics code outside this block should use this
-(defmacro cmpl-statistics-block (&rest _body))
-;;  "Only executes body if we are recording statistics."
-;;  (list 'cond
-;;     (list* '*record-cmpl-statistics-p* body)
-;;     ))
-
 ;;-----------------------------------------------
 ;; Completion Sources
 ;;-----------------------------------------------
@@ -1004,9 +991,7 @@ Each symbol is bound to a single completion entry.")
   "Initialize the completion storage.  All existing completions are lost."
   (interactive)
   (setq cmpl-prefix-obarray (make-vector cmpl-obarray-length 0))
-  (setq cmpl-obarray (make-vector cmpl-obarray-length 0))
-  (cmpl-statistics-block
-    (record-clear-all-completions)))
+  (setq cmpl-obarray (make-vector cmpl-obarray-length 0)))
 
 (defvar completions-list-return-value)
 
@@ -1154,9 +1139,6 @@ Returns the completion entry."
               (set-cmpl-prefix-entry-tail prefix-entry entry))
              (t
               (set cmpl-db-prefix-symbol (make-cmpl-prefix-entry entry))))
-       ;; statistics
-       (cmpl-statistics-block
-         (note-added-completion))
        ;; set symbol
        (set cmpl-db-symbol (car entry)))))
 
@@ -1206,9 +1188,6 @@ Returns the completion entry."
            (t
             ;; Start new prefix entry
             (set cmpl-db-prefix-symbol (make-cmpl-prefix-entry entry))))
-      ;; statistics
-      (cmpl-statistics-block
-       (note-added-completion))
       ;; Add it to the symbol
       (set cmpl-db-symbol (car entry)))))
 
@@ -1236,9 +1215,7 @@ String must be longer than `completion-prefix-min-length'."
                (or (set-cmpl-prefix-entry-head
                      prefix-entry (cdr (cmpl-prefix-entry-head prefix-entry)))
                    ;; List is now empty
-                   (set cmpl-db-prefix-symbol nil))))
-        (cmpl-statistics-block
-          (note-completion-deleted)))
+                   (set cmpl-db-prefix-symbol nil)))))
       (error "Unknown completion `%s'" completion-string)))
 
 ;; Tests --
@@ -1372,8 +1349,6 @@ Completions added this way will automatically be saved if
   (let ((string (and enable-completion (symbol-before-point)))
        (current-completion-source cmpl-source-separator)
        entry)
-    (cmpl-statistics-block
-      (note-separator-character string))
     (cond (string
           (setq entry (add-completion-to-head string))
           (if (and completion-on-separator-character
@@ -1614,9 +1589,6 @@ Prefix args ::
                       completion-prefix-min-length)))
         ;; get index
         (setq cmpl-current-index (if current-prefix-arg arg 0))
-        ;; statistics
-        (cmpl-statistics-block
-          (note-complete-entered-afresh cmpl-original-string))
         ;; reset database
         (completion-search-reset cmpl-original-string)
         ;; erase what we've got
@@ -1649,9 +1621,6 @@ Prefix args ::
                  (goto-char insert-point))
                 (t;; point at end,
                  (setq cmpl-last-insert-location insert-point)))
-          ;; statistics
-          (cmpl-statistics-block
-            (note-complete-inserted entry cmpl-current-index))
           ;; Done ! cmpl-stat-complete-successful
           ;;display the next completion
           (cond
@@ -1677,9 +1646,6 @@ Prefix args ::
           (if (and print-status-p (sit-for 0))
               (message "No %scompletions."
                        (if (eq this-command last-command) "more " "")))
-          ;; statistics
-          (cmpl-statistics-block
-            (record-complete-failed cmpl-current-index))
           ;; Pretend that we were never here
           (setq this-command 'failed-complete)))))
 \f
@@ -1709,25 +1675,14 @@ Prefix args ::
 
 (defun add-completions-from-buffer ()
   (interactive)
-  (let ((current-completion-source cmpl-source-file-parsing)
-       (start-num
-        (cmpl-statistics-block
-         (aref completion-add-count-vector cmpl-source-file-parsing)))
-       mode)
+  (let ((current-completion-source cmpl-source-file-parsing))
     (cond ((memq major-mode '(emacs-lisp-mode lisp-mode))
-          (add-completions-from-lisp-buffer)
-          (setq mode 'lisp))
+          (add-completions-from-lisp-buffer))
          ((memq major-mode '(c-mode))
-          (add-completions-from-c-buffer)
-          (setq mode 'c))
+          (add-completions-from-c-buffer))
          (t
           (error "Cannot parse completions in %s buffers"
-                 major-mode)))
-    (cmpl-statistics-block
-      (record-cmpl-parse-file
-       mode (point-max)
-       (- (aref completion-add-count-vector cmpl-source-file-parsing)
-          start-num)))))
+                 major-mode)))))
 
 ;; Find file hook
 (defun completion-find-file-hook ()
@@ -1960,8 +1915,7 @@ Prefix args ::
        ((not cmpl-completions-accepted-p)
         (message "Completions database has not changed - not writing."))
        (t
-        (save-completions-to-file))))
-  (cmpl-statistics-block (record-cmpl-kill-emacs)))
+        (save-completions-to-file)))))
 
 ;; There is no point bothering to change this again
 ;; unless the package changes so much that it matters
@@ -2066,9 +2020,7 @@ If file name is not specified, use `save-completions-file-name'."
               (set-buffer-modified-p nil)
               (message "Couldn't save completion file `%s'" filename)))
            ;; Reset accepted-p flag
-           (setq cmpl-completions-accepted-p nil) )
-         (cmpl-statistics-block
-          (record-save-completions total-in-db total-perm total-saved))))))
+           (setq cmpl-completions-accepted-p nil) )))))
 
 ;;(defun auto-save-completions ()
 ;;  (if (and save-completions-flag enable-completion cmpl-initialized-p
@@ -2103,9 +2055,6 @@ If file is not specified, then use `save-completions-file-name'."
                  string entry last-use-time
                  cmpl-entry cmpl-last-use-time
                  (current-completion-source cmpl-source-init-file)
-                 (start-num
-                  (cmpl-statistics-block
-                   (aref completion-add-count-vector cmpl-source-file-parsing)))
                  (total-in-file 0) (total-perm 0))
              ;; insert the file into a buffer
              (condition-case nil
@@ -2163,12 +2112,6 @@ If file is not specified, then use `save-completions-file-name'."
                               (message "Loading completions from file %s . . . Done."
                                        filename))
                         (message "End of file while reading completions."))))))
-
-             (cmpl-statistics-block
-              (record-load-completions
-               total-in-file total-perm
-               (- (aref completion-add-count-vector cmpl-source-init-file)
-                  start-num)))
 ))))))
 
 (defun completion-initialize ()
@@ -2201,9 +2144,7 @@ Patched to remove the most recent completion."
   (cond ((eq last-command 'complete)
         (delete-region (point) cmpl-last-insert-location)
         (insert cmpl-original-string)
-        (setq completion-to-accept nil)
-        (cmpl-statistics-block
-          (record-complete-failed)))
+        (setq completion-to-accept nil))
        (t
         (kill-region beg end))))
 
@@ -2263,15 +2204,10 @@ TYPE is the type of the wrapper to be added.  Can be :before or :under."
     (use-completion-before-separator)))
 
 (defun use-completion-backward-under ()
-  (use-completion-under-point)
-  (if (eq last-command 'complete)
-      ;; probably a failed completion if you have to back up
-      (cmpl-statistics-block (record-complete-failed))))
+  (use-completion-under-point))
 
 (defun use-completion-backward ()
-  (if (eq last-command 'complete)
-      ;; probably a failed completion if you have to back up
-      (cmpl-statistics-block (record-complete-failed))))
+  nil)
 
 (defun completion-before-command ()
   (funcall (or (and (symbolp this-command)
@@ -2428,9 +2364,6 @@ if ARG is omitted or nil."
     ;; fooquux
     ;; fooper
 
-    (cmpl-statistics-block
-     (record-completion-file-loaded))
-
     (completion-initialize)))
 
 ;;-----------------------------------------------