emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113094: lisp/(cus-edit,custom).el: Fix typos; use s


From: Juanma Barranquero
Subject: [Emacs-diffs] trunk r113094: lisp/(cus-edit,custom).el: Fix typos; use setq-local, string-match-p, looking-at-p.
Date: Thu, 20 Jun 2013 11:29:40 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113094
revision-id: address@hidden
parent: address@hidden
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Thu 2013-06-20 13:29:30 +0200
message:
  lisp/(cus-edit,custom).el: Fix typos; use setq-local, string-match-p, 
looking-at-p.
  
  * lisp/cus-edit.el:
    (custom-commands): Fix typos.
    (custom-display): Fix tooltip text.
    (custom-magic-alist, custom-filter-face-spec, custom-group-members):
    Fix typos in docstrings.
    (custom--initialize-widget-variables, Custom-mode): Use `setq-local'.
    (custom-unlispify-menu-entry, custom-magic-value-create)
    (custom-add-see-also, custom-group-value-create): Use ?\s.
    (custom-guess-type, customize-apropos, editable-field)
    (custom-face-value-create): Use `string-match-p'.
    (custom-save-variables, custom-save-faces): Use `looking-at-p'.
  
  * lisp/custom.el (custom-load-symbol): Use `string-match-p'.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/cus-edit.el               cusedit.el-20091113204419-o5vbwnq5f7feedwu-1091
  lisp/custom.el                 custom.el-20091113204419-o5vbwnq5f7feedwu-1093
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-06-20 10:28:23 +0000
+++ b/lisp/ChangeLog    2013-06-20 11:29:30 +0000
@@ -1,5 +1,18 @@
 2013-06-20  Juanma Barranquero  <address@hidden>
 
+       * cus-edit.el (custom-commands): Fix typos.
+       (custom-display): Fix tooltip text.
+       (custom-magic-alist, custom-filter-face-spec, custom-group-members):
+       Fix typos in docstrings.
+       (custom--initialize-widget-variables, Custom-mode): Use `setq-local'.
+       (custom-unlispify-menu-entry, custom-magic-value-create)
+       (custom-add-see-also, custom-group-value-create): Use ?\s.
+       (custom-guess-type, customize-apropos, editable-field)
+       (custom-face-value-create): Use `string-match-p'.
+       (custom-save-variables, custom-save-faces): Use `looking-at-p'.
+
+       * custom.el (custom-load-symbol): Use `string-match-p'.
+
        * ansi-color.el: Convert to lexical binding.
        (ansi-colors): Fix URL.
        (ansi-color-context, ansi-color-context-region): Use defvar-local.

=== modified file 'lisp/cus-edit.el'
--- a/lisp/cus-edit.el  2013-05-08 06:59:41 +0000
+++ b/lisp/cus-edit.el  2013-06-20 11:29:30 +0000
@@ -558,7 +558,7 @@
                         (setq prefixes nil)
                         (delete-region (point-min) (point)))
                     (setq prefixes (cdr prefixes))))))
-          (subst-char-in-region (point-min) (point-max) ?- ?\  t)
+          (subst-char-in-region (point-min) (point-max) ?- ?\s t)
           (capitalize-region (point-min) (point-max))
           (unless no-suffix
             (goto-char (point-max))
@@ -629,7 +629,7 @@
     (while names
       (setq current (car names)
            names (cdr names))
-      (when (string-match (nth 0 current) name)
+      (when (string-match-p (nth 0 current) name)
        (setq found (nth 1 current)
              names nil)))
     (unless found
@@ -639,7 +639,7 @@
          (while docs
            (setq current (car docs)
                  docs (cdr docs))
-           (when (string-match (nth 0 current) doc)
+           (when (string-match-p (nth 0 current) doc)
              (setq found (nth 1 current)
                    docs nil))))))
     found))
@@ -731,7 +731,7 @@
 
 (defvar custom-commands
   '((" Apply " Custom-set t
-     "Apply settings (for the current session only)"
+     "Apply settings (for the current session only)."
      "index"
      "Apply")
     (" Apply and Save " Custom-save
@@ -1421,8 +1421,8 @@
   "Customize loaded options, faces and groups matching PATTERN.
 PATTERN can be a word, a list of words (separated by spaces),
 or a regexp (using some regexp special characters).  If it is a word,
-search for matches for that word as a substring.  If it is a list of words,
-search for matches for any two (or more) of those words.
+search for matches for that word as a substring.  If it is a list of
+words, search for matches for any two (or more) of those words.
 
 If TYPE is `options', include only options.
 If TYPE is `faces', include only faces.
@@ -1435,7 +1435,7 @@
   (let (found)
     (mapatoms
      `(lambda (symbol)
-       (when (string-match apropos-regexp (symbol-name symbol))
+       (when (string-match-p apropos-regexp (symbol-name symbol))
          ,(if (memq type '(nil groups))
               '(if (get symbol 'custom-group)
                    (push (list symbol 'custom-group) found)))
@@ -1832,7 +1832,7 @@
 (widget-put (get 'editable-field 'widget-type)
            :custom-show (lambda (_widget value)
                           (let ((pp (pp-to-string value)))
-                            (cond ((string-match "\n" pp)
+                            (cond ((string-match-p "\n" pp)
                                    nil)
                                   ((> (length pp) 40)
                                    nil)
@@ -1973,7 +1973,7 @@
 left out, ITEM-DESC will be used.
 
 The string %c in either description will be replaced with the
-category of the item.  These are `group'. `option', and `face'.
+category of the item.  These are `group', `option', and `face'.
 
 The list should be sorted most significant first.")
 
@@ -2039,7 +2039,7 @@
        (when (and (eq category 'group)
                   (not (and (eq custom-buffer-style 'links)
                             (> (widget-get parent :custom-level) 1))))
-         (insert-char ?\  (* custom-buffer-indent
+         (insert-char ?\s (* custom-buffer-indent
                              (widget-get parent :custom-level))))
        (push (widget-create-child-and-convert
               widget 'choice-item
@@ -2064,7 +2064,7 @@
       (when (and (eq category 'group)
                 (not (and (eq custom-buffer-style 'links)
                           (> (widget-get parent :custom-level) 1))))
-       (insert-char ?\  (* custom-buffer-indent
+       (insert-char ?\s (* custom-buffer-indent
                            (widget-get parent :custom-level))))
       (when custom-magic-show-button
        (when custom-magic-show
@@ -2293,7 +2293,7 @@
         (indent (widget-get widget :indent)))
     (when links
       (when indent
-       (insert-char ?\  indent))
+       (insert-char ?\s indent))
       (when prefix
        (insert prefix))
       (insert "See also ")
@@ -3227,7 +3227,7 @@
                                           pm)
                                    (const :format "W32 "
                                           :sibling-args (:help-echo "\
-Windows NT/9X.")
+MS Windows.")
                                           w32)
                                    (const :format "NS "
                                           :sibling-args (:help-echo "\
@@ -3348,7 +3348,7 @@
   "Converted version of the `custom-face-all' widget.")
 
 (defun custom-filter-face-spec (spec filter-index &optional default-filter)
-  "Return a canonicalized version of SPEC using.
+  "Return a canonicalized version of SPEC.
 FILTER-INDEX is the index in the entry for each attribute in
 `custom-face-attributes' at which the appropriate filter function can be
 found, and DEFAULT-FILTER is the filter to apply for attributes that
@@ -3473,7 +3473,7 @@
        (widget-specify-sample widget opoint (point)))
       (insert
        (cond ((eq custom-buffer-style 'face) " ")
-            ((string-match "face\\'" tag)   ":")
+            ((string-match-p "face\\'" tag)   ":")
             (t " face: ")))
 
       ;; Face sample.
@@ -3947,7 +3947,7 @@
 
 (defun custom-group-members (symbol groups-only)
   "Return SYMBOL's custom group members.
-If GROUPS-ONLY non-nil, return only those members that are groups."
+If GROUPS-ONLY is non-nil, return only those members that are groups."
   (if (not groups-only)
       (get symbol 'custom-group)
     (let (members)
@@ -4058,7 +4058,7 @@
                      :tag tag
                      symbol)
                     buttons)
-            (insert-char ?\  (* custom-buffer-indent (1- level)))
+            (insert-char ?\s (* custom-buffer-indent (1- level)))
             (insert "-- ")
             (push (widget-create-child-and-convert
                    widget 'custom-group-visibility
@@ -4098,7 +4098,7 @@
           (when (eq level 1)
             (if (custom-add-parent-links widget "Parent groups:")
                 (insert "\n")))
-          (insert-char ?\  (* custom-buffer-indent (1- level)))
+          (insert-char ?\s (* custom-buffer-indent (1- level)))
           ;; Create tag.
           (let ((start (point)))
             (insert tag " group: ")
@@ -4137,11 +4137,11 @@
           (if nil  ;;; This should test that the buffer
                    ;;; was not made to display a group.
               (when (eq level 1)
-                (insert-char ?\  custom-buffer-indent)
+                (insert-char ?\s custom-buffer-indent)
                 (custom-add-parent-links widget)))
           (custom-add-see-also widget
                                (make-string (* custom-buffer-indent level)
-                                            ?\ ))
+                                            ?\s))
           ;; Members.
           (message "Creating group...")
           (let* ((members (custom-sort-items
@@ -4326,7 +4326,7 @@
 save all customizations in this file, but does not load it.
 
 When you change this variable outside Custom, look in the
-previous custom file \(usually your init file) for the
+previous custom file (usually your init file) for the
 forms `(custom-set-variables ...)'  and `(custom-set-faces ...)',
 and copy them (whichever ones you find) to the new custom file.
 This will preserve your existing customizations.
@@ -4337,7 +4337,7 @@
 `custom-set-variables' and `custom-set-faces' forms already
 present in that file.  It will not delete any customizations from
 the old custom file.  You should do that manually if that is what you
-want.  You also have to put something like `\(load \"CUSTOM-FILE\")
+want.  You also have to put something like `(load \"CUSTOM-FILE\")
 in your init file, where CUSTOM-FILE is the actual name of the
 file.  Otherwise, Emacs will not load the file when it starts up,
 and hence will not set `custom-file' to that file either."
@@ -4346,7 +4346,7 @@
                       :doc
                       "Please read entire docstring below before setting \
 this through Custom.
-Click on \"More\" \(or position point there and press RETURN)
+Click on \"More\" (or position point there and press RETURN)
 if only the first line of the docstring is shown."))
   :group 'customize)
 
@@ -4553,7 +4553,7 @@
       (if (bolp)
          (princ " "))
       (princ ")")
-      (unless (looking-at "\n")
+      (unless (looking-at-p "\n")
        (princ "\n")))))
 
 (defun custom-save-faces ()
@@ -4608,7 +4608,7 @@
       (if (bolp)
          (princ " "))
       (princ ")")
-      (unless (looking-at "\n")
+      (unless (looking-at-p "\n")
        (princ "\n")))))
 
 ;;; The Customize Menu.
@@ -4759,22 +4759,22 @@
       (message "To install your edits, invoke [State] and choose the Set 
operation")))
 
 (defun custom--initialize-widget-variables ()
-  (set (make-local-variable 'widget-documentation-face) 'custom-documentation)
-  (set (make-local-variable 'widget-button-face) custom-button)
-  (set (make-local-variable 'widget-button-pressed-face) custom-button-pressed)
-  (set (make-local-variable 'widget-mouse-face) custom-button-mouse)
+  (setq-local widget-documentation-face 'custom-documentation)
+  (setq-local widget-button-face custom-button)
+  (setq-local widget-button-pressed-face custom-button-pressed)
+  (setq-local widget-mouse-face custom-button-mouse)
   ;; We need this because of the "More" button on docstrings.
   ;; Otherwise clicking on "More" can push point offscreen, which
   ;; causes the window to recenter on point, which pushes the
   ;; newly-revealed docstring offscreen; which is annoying.  -- cyd.
-  (set (make-local-variable 'widget-button-click-moves-point) t)
+  (setq-local widget-button-click-moves-point t)
   ;; When possible, use relief for buttons, not bracketing.  This test
   ;; may not be optimal.
   (when custom-raised-buttons
-    (set (make-local-variable 'widget-push-button-prefix) "")
-    (set (make-local-variable 'widget-push-button-suffix) "")
-    (set (make-local-variable 'widget-link-prefix) "")
-    (set (make-local-variable 'widget-link-suffix) ""))
+    (setq-local widget-push-button-prefix "")
+    (setq-local widget-push-button-suffix "")
+    (setq-local widget-link-prefix "")
+    (setq-local widget-link-suffix ""))
   (setq show-trailing-whitespace nil))
 
 (define-obsolete-variable-alias 'custom-mode-hook 'Custom-mode-hook "23.1")
@@ -4802,17 +4802,17 @@
 if that value is non-nil."
   (use-local-map custom-mode-map)
   (easy-menu-add Custom-mode-menu)
-  (set (make-local-variable 'tool-bar-map)
-       (or custom-tool-bar-map
-          ;; Set up `custom-tool-bar-map'.
-          (let ((map (make-sparse-keymap)))
-            (mapc
-             (lambda (arg)
-               (tool-bar-local-item-from-menu
-                (nth 1 arg) (nth 4 arg) map custom-mode-map
-                :label (nth 5 arg)))
-             custom-commands)
-            (setq custom-tool-bar-map map))))
+  (setq-local tool-bar-map
+             (or custom-tool-bar-map
+                 ;; Set up `custom-tool-bar-map'.
+                 (let ((map (make-sparse-keymap)))
+                   (mapc
+                    (lambda (arg)
+                      (tool-bar-local-item-from-menu
+                       (nth 1 arg) (nth 4 arg) map custom-mode-map
+                       :label (nth 5 arg)))
+                    custom-commands)
+                   (setq custom-tool-bar-map map))))
   (make-local-variable 'custom-options)
   (make-local-variable 'custom-local-buffer)
   (custom--initialize-widget-variables)

=== modified file 'lisp/custom.el'
--- a/lisp/custom.el    2013-01-02 16:13:04 +0000
+++ b/lisp/custom.el    2013-06-20 11:29:30 +0000
@@ -77,7 +77,7 @@
   "Initialize SYMBOL based on VALUE.
 Set the symbol, using its `:set' function (or `set-default' if it has none).
 The value is either the symbol's current value
- \(as obtained using the `:get' function), if any,
+ (as obtained using the `:get' function), if any,
 or the value in the symbol's `saved-value' property if any,
 or (last of all) VALUE."
   (funcall (or (get symbol 'custom-set) 'set-default)
@@ -319,7 +319,7 @@
 binding.  This is normally not what you want.  Thus, if you need
 to load a file defining variables with this form, or with
 `defvar' or `defconst', you should always load that file
-_outside_ any bindings for these variables.  \(`defvar' and
+_outside_ any bindings for these variables.  (`defvar' and
 `defconst' behave similarly in this respect.)
 
 See Info node `(elisp) Customization' in the Emacs Lisp manual
@@ -541,8 +541,8 @@
 (defun custom-add-dependencies (symbol value)
   "To the custom option SYMBOL, add dependencies specified by VALUE.
 VALUE should be a list of symbols.  For each symbol in that list,
-this specifies that SYMBOL should be set after the specified symbol, if
-both appear in constructs like `custom-set-variables'."
+this specifies that SYMBOL should be set after the specified symbol,
+if both appear in constructs like `custom-set-variables'."
   (unless (listp value)
     (error "Invalid custom dependency `%s'" value))
   (let* ((deps (get symbol 'custom-dependencies))
@@ -647,7 +647,7 @@
                     (found nil))
                 (dolist (loaded load-history)
                   (and (stringp (car loaded))
-                       (string-match regexp (car loaded))
+                       (string-match-p regexp (car loaded))
                        (setq found t)))
                 found))
              ;; Without this, we would load cus-edit recursively.
@@ -937,7 +937,7 @@
 evaluates to the customized value.  EXP will also be stored,
 without evaluating it, in SYMBOL's `saved-value' property, so
 that it can be restored via the Customize interface.  It is also
-added to the alist in SYMBOL's `theme-value' property \(by
+added to the alist in SYMBOL's `theme-value' property (by
 calling `custom-push-theme').
 
 NOW, if present and non-nil, means to install the variable's


reply via email to

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