]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/mode-local.el
Auto-commit of generated files.
[gnu-emacs] / lisp / cedet / mode-local.el
index 453109f599e91c35539a69a0e50fd3d6c7f03732..7c75e3f9f3960008a9af7db5d00196d16330bcbd 100644 (file)
@@ -1,6 +1,6 @@
 ;;; mode-local.el --- Support for mode local facilities
 ;;
-;; Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2005, 2007-2013 Free Software Foundation, Inc.
 ;;
 ;; Author: David Ponce <david@dponce.com>
 ;; Maintainer: David Ponce <david@dponce.com>
@@ -36,7 +36,7 @@
 ;;
 ;; You should use a mode-local variable or override to allow extension
 ;; only if you expect a mode author to provide that extension.  If a
-;; user might wish to customize a give variable or function then
+;; user might wish to customize a given variable or function then
 ;; the existing customization mechanism should be used.
 
 ;; To Do:
@@ -55,7 +55,7 @@
 FUNCTION does not have arguments; when it is entered `current-buffer'
 is the currently selected file buffer.
 If optional argument PREDICATE is non nil, only select file buffers
-for which the function PREDICATE return non-nil.
+for which the function PREDICATE returns non-nil.
 If optional argument BUFFERS is non-nil, it is a list of buffers to
 walk through.  It defaults to `buffer-list'."
   (dolist (b (or buffers (buffer-list)))
@@ -146,7 +146,7 @@ local variables have been defined."
   (mode-local-map-mode-buffers #'activate-mode-local-bindings mode))
 
 (defmacro define-child-mode (mode parent &optional docstring)
-  "Make major mode MODE inherits behavior from PARENT mode.
+  "Make major mode MODE inherit behavior from PARENT mode.
 DOCSTRING is optional and not used.
 To work properly, this should be put after PARENT mode local variables
 definition."
@@ -522,12 +522,15 @@ See also the function `define-overload'."
         (list (mode-local--override name args body))
       result)))
 
+;;;###autoload
+(put 'define-overloadable-function 'doc-string-elt 3)
+
 (defmacro define-overloadable-function (name args docstring &rest body)
-  "Define a new function, as with `defun' which can be overloaded.
+  "Define a new function, as with `defun', which can be overloaded.
 NAME is the name of the function to create.
 ARGS are the arguments to the function.
 DOCSTRING is a documentation string to describe the function.  The
-docstring will automatically had details about its overload symbol
+docstring will automatically have details about its overload symbol
 appended to the end.
 BODY is code that would be run when there is no override defined.  The
 default is to call the function `NAME-default' with the appropriate
@@ -546,6 +549,7 @@ defined.  The default is to call the function `NAME-default' with the
 appropriate arguments deduced from ARGS.
 OVERARGS is a list of arguments passed to the override and
 `NAME-default' function, in place of those deduced from ARGS."
+  (declare (doc-string 3))
   `(eval-and-compile
      (defun ,name ,args
        ,docstring
@@ -610,19 +614,16 @@ PROMPT, INITIAL, HIST, and DEFAULT are the same as for `completing-read'."
 SYMBOL is a function that can be overridden."
   (with-current-buffer "*Help*"
     (pop-to-buffer (current-buffer))
-    (unwind-protect
-       (progn
-         (toggle-read-only -1)
-          (goto-char (point-min))
-          (unless (re-search-forward "^$" nil t)
-            (goto-char (point-max))
-            (beginning-of-line)
-            (forward-line -1))
-          (insert (overload-docstring-extension symbol) "\n")
-         ;; NOTE TO SELF:
-         ;; LIST ALL LOADED OVERRIDES FOR SYMBOL HERE
-         )
-      (toggle-read-only 1))))
+    (goto-char (point-min))
+    (unless (re-search-forward "^$" nil t)
+      (goto-char (point-max))
+      (beginning-of-line)
+      (forward-line -1))
+    (let ((inhibit-read-only t))
+      (insert (overload-docstring-extension symbol) "\n")
+      ;; NOTE TO SELF:
+      ;; LIST ALL LOADED OVERRIDES FOR SYMBOL HERE
+      )))
 
 ;; Help for mode-local bindings.
 (defun mode-local-print-binding (symbol)
@@ -640,7 +641,7 @@ SYMBOL is a function that can be overridden."
 
 (defun mode-local-print-bindings (table)
   "Print bindings in TABLE."
-  (let (us ;; List of unpecified symbols
+  (let (us ;; List of unspecified symbols
         mc ;; List of mode local constants
         mv ;; List of mode local variables
         ov ;; List of overloaded functions
@@ -659,7 +660,7 @@ SYMBOL is a function that can be overridden."
      table)
     ;; Print symbols by type
     (when us
-      (princ "\n  !! Unpecified symbols\n")
+      (princ "\n  !! Unspecified symbols\n")
       (mapc 'mode-local-print-binding us))
     (when mc
       (princ "\n  ** Mode local constants\n")
@@ -782,5 +783,4 @@ invoked interactively."
 
 (provide 'mode-local)
 
-;; arch-tag: 14b77823-f93c-4b3d-9116-495f69a6ec07
 ;;; mode-local.el ends here