From e6b4e5ffdf30ef4d63614ccbe952f1efb25096a7 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 27 Oct 2017 20:04:47 -0400 Subject: Fix some doc typos * lisp/calendar/todo-mode.el (todo-next-item) (todo-previous-item, todo-toggle-item-header): * lisp/window.el (move-to-window-group-line): * src/editfns.c (Fformat): * test/lisp/calendar/todo-mode-tests.el (todo-test-move-item05): Fix doc typos. ; And in some comments. --- lisp/emacs-lisp/inline.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/inline.el b/lisp/emacs-lisp/inline.el index 00e5e6eb48d..ff27158f836 100644 --- a/lisp/emacs-lisp/inline.el +++ b/lisp/emacs-lisp/inline.el @@ -59,7 +59,7 @@ ;; and then M-: (macroexpand-all '(my-test1 y)) RET) ;; There is still one downside shared with the defmacro and cl-defsubst ;; approach: when the function is inlined, the scoping rules (dynamic or -;; lexical) will be inherited from the the call site. +;; lexical) will be inherited from the call site. ;; Of course, since define-inline defines a compiler macro, you can also do ;; call-site optimizations, just like you can with `defmacro', but not with -- cgit v1.2.3 From 3e7ebbe1bd5d33476190c789d17e4dd2d5f1bdfb Mon Sep 17 00:00:00 2001 From: Phil Sainty Date: Mon, 16 Oct 2017 23:38:42 +1300 Subject: Don't clobber docstrings of explicitly-defined mode hook variables * lisp/emacs-lisp/derived.el (define-derived-mode): * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): When defining the mode hook variable, do not clobber pre-existing docstrings. --- lisp/emacs-lisp/derived.el | 8 +++++--- lisp/emacs-lisp/easy-mmode.el | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index 3fa3818526c..751291afa88 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -203,11 +203,13 @@ See Info node `(elisp)Derived Modes' for more details." parent child docstring syntax abbrev)) `(progn - (defvar ,hook nil - ,(format "Hook run after entering %s mode. + (defvar ,hook nil) + (unless (get ',hook 'variable-documentation) + (put ',hook 'variable-documentation + ,(format "Hook run after entering %s mode. No problems result if this variable is not bound. `add-hook' automatically binds it. (This is true for all hook variables.)" - name)) + name))) (unless (boundp ',map) (put ',map 'definition-name ',child)) (with-no-warnings (defvar ,map (make-sparse-keymap))) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index bf087fc2e9a..ac8dcc69d21 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -309,11 +309,13 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. ;; up-to-here. :autoload-end - (defvar ,hook nil - ,(format "Hook run after entering or leaving `%s'. + (defvar ,hook nil) + (unless (get ',hook 'variable-documentation) + (put ',hook 'variable-documentation + ,(format "Hook run after entering or leaving `%s'. No problems result if this variable is not bound. `add-hook' automatically binds it. (This is true for all hook variables.)" - modefun)) + modefun))) ;; Define the minor-mode keymap. ,(unless (symbolp keymap) ;nil is also a symbol. -- cgit v1.2.3