emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/emacs-lisp derived.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp/emacs-lisp derived.el
Date: Thu, 10 Sep 2009 06:21:23 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/09/10 06:21:23

Modified files:
        lisp/emacs-lisp: derived.el 

Log message:
        (define-derived-mode): Give the mode's map, and syntax and abbrev
        tables basic docs, if they don't have any.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/emacs-lisp/derived.el?cvsroot=emacs&r1=1.23&r2=1.24

Patches:
Index: derived.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/derived.el,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- derived.el  5 Jan 2009 03:20:57 -0000       1.23
+++ derived.el  10 Sep 2009 06:21:23 -0000      1.24
@@ -1,8 +1,8 @@
 ;;; derived.el --- allow inheritance of major modes
 ;; (formerly mode-clone.el)
 
-;; Copyright (C) 1993, 1994, 1999, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1994, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
+;;   2007, 2008, 2009  Free Software Foundation, Inc.
 
 ;; Author: David Megginson (address@hidden)
 ;; Maintainer: FSF
@@ -202,16 +202,25 @@
        (unless (boundp ',map)
         (put ',map 'definition-name ',child))
        (defvar ,map (make-sparse-keymap))
+       (unless (get ',map 'variable-documentation)
+        (put ',map 'variable-documentation
+             ,(format "Keymap for `%s'." child)))
        ,(if declare-syntax
            `(progn
               (unless (boundp ',syntax)
                 (put ',syntax 'definition-name ',child))
-              (defvar ,syntax (make-syntax-table))))
+              (defvar ,syntax (make-syntax-table))
+              (unless (get ',syntax 'variable-documentation)
+                (put ',syntax 'variable-documentation
+                     ,(format "Syntax table for `%s'." child)))))
        ,(if declare-abbrev
            `(progn
               (put ',abbrev 'definition-name ',child)
               (defvar ,abbrev
-                (progn (define-abbrev-table ',abbrev nil) ,abbrev))))
+                (progn (define-abbrev-table ',abbrev nil) ,abbrev)
+                (unless (get ',abbrev 'variable-documentation)
+                  (put ',abbrev 'variable-documentation
+                       ,(format "Abbrev table for `%s'." child))))))
        (put ',child 'derived-mode-parent ',parent)
        ,(if group `(put ',child 'custom-mode-group ,group))
 




reply via email to

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