]> code.delx.au - gnu-emacs/blobdiff - lisp/subr.el
(pascal-auto-newline, pascal-mode, electric-pascal-hash):
[gnu-emacs] / lisp / subr.el
index 970ba2ee4f67ffe9bb2e917ca6fd594e0829df73..f96351e6e4d68c9c859fcd1ed0016ea12b0e2260 100644 (file)
@@ -129,7 +129,9 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP."
                (if (and (keymapp defn)
                         ;; Avoid recursively scanning
                         ;; where KEYMAP does not have a submap.
-                        (keymapp (lookup-key keymap prefix1))
+                        (let ((elt (lookup-key keymap prefix1)))
+                          (or (null elt)
+                              (keymapp elt)))
                         ;; Avoid recursively rescanning keymap being scanned.
                         (not (memq inner-def
                                    key-substitution-in-progress)))
@@ -163,7 +165,9 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP."
                        (define-key keymap prefix1
                          (nconc (nreverse skipped) newdef))
                      (if (and (keymapp defn)
-                              (keymapp (lookup-key keymap prefix1))
+                              (let ((elt (lookup-key keymap prefix1)))
+                                (or (null elt)
+                                    (keymapp elt)))
                               (not (memq inner-def
                                          key-substitution-in-progress)))
                          (substitute-key-definition olddef newdef keymap
@@ -561,6 +565,7 @@ To make a hook variable buffer-local, always use
 
 (defun add-to-list (list-var element)
   "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet.
+The test for presence of ELEMENT is done with `equal'.
 If you want to use `add-to-list' on a variable that is not defined
 until a certain package is loaded, you should put the call to `add-to-list'
 into a hook function that will be run only after loading the package.
@@ -699,7 +704,10 @@ This function accepts any number of arguments, but ignores them."
   nil)
 
 (defun error (&rest args)
-  "Signal an error, making error message by passing all args to `format'."
+  "Signal an error, making error message by passing all args to `format'.
+In Emacs, the convention is that error messages start with a capital
+letter but *do not* end with a period.  Please follow this convention
+for the sake of consistency."
   (while t
     (signal 'error (list (apply 'format args)))))
 
@@ -745,12 +753,6 @@ STRING should be given if the last search was by `string-match' on STRING."
          (substring string (match-beginning num) (match-end num))
        (buffer-substring (match-beginning num) (match-end num)))))
 
-(defun buffer-substring-no-properties (beg end)
-  "Return the text from BEG to END, without text properties, as a string."
-  (let ((string (buffer-substring beg end)))
-    (set-text-properties 0 (length string) nil string)
-    string))
-
 (defun shell-quote-argument (argument)
   "Quote an argument for passing as argument to an inferior shell."
   (if (eq system-type 'ms-dos)
@@ -778,19 +780,19 @@ syntax table; other characters are copied from the standard syntax table."
          i)
       (setq i 0)
       (while (<= i 31)
-       (aset table i 13)
+       (aset table i nil)
        (setq i (1+ i)))
       (setq i ?A)
       (while (<= i ?Z)
-       (aset table i 13)
+       (aset table i nil)
        (setq i (1+ i)))
       (setq i ?a)
       (while (<= i ?z)
-       (aset table i 13)
+       (aset table i nil)
        (setq i (1+ i)))
       (setq i 128)
       (while (<= i 255)
-       (aset table i 13)
+       (aset table i nil)
        (setq i (1+ i)))
       table)))
 \f