From 0448b476012ef55ac026fcb7fcc0a75cff9f73bc Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Tue, 26 Apr 2005 09:03:56 +0000 Subject: (define-obsolete-function-alias): New macro. --- lisp/emacs-lisp/byte-run.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index ab7259b667f..5c92f247a05 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -114,6 +114,18 @@ was first made obsolete, for example a date or a release number." (put function 'byte-obsolete-info (list new handler when))) function) +(defmacro define-obsolete-function-alias (function new + &optional when docstring) + "Set FUNCTION's function definition to NEW and warn that FUNCTION is obsolete. +If provided, WHEN should be a string indicating when FUNCTION was +first made obsolete, for example a date or a release number. The +optional argument DOCSTRING specifies the documentation string +for FUNCTION; if DOCSTRING is omitted or nil, FUNCTION uses the +documentation string of NEW unluess it already has one." + `(progn + (defalias ,function ,new ,docstring) + (make-obsolete ,function ,new ,when))) + (defun make-obsolete-variable (variable new &optional when) "Make the byte-compiler warn that VARIABLE is obsolete. The warning will say that NEW should be used instead. -- cgit v1.2.3 From 0a3e46de17584a2bd6045895615d83f9127681f0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 26 Apr 2005 10:59:44 +0000 Subject: (eldoc-mode): Doc fix. (eldoc-documentation-function): Renamed from eldoc-print-current-symbol-info-function. Calls changed. --- lisp/emacs-lisp/eldoc.el | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index f31dafb7b11..29167c70812 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -139,16 +139,11 @@ truncated to make more of the arglist or documentation string visible." ;;;###autoload (define-minor-mode eldoc-mode "Toggle ElDoc mode on or off. -Show the defined parameters for the elisp function near point. - -For the emacs lisp function at the beginning of the sexp which point is -within, show the defined parameters for the function in the echo area. -This information is extracted directly from the function or macro if it is -in pure lisp. If the emacs function is a subr, the parameters are obtained -from the documentation string if possible. - -If point is over a documented variable, print that variable's docstring -instead. +In ElDoc mode, the echo area displays information about a +function or variable in the text where point is. If point is +on a documented variable, it displays that variable's doc string. +Otherwise it displays the argument list of the function called +in the expression point is on. With prefix ARG, turn ElDoc mode on if and only if ARG is positive." :group 'eldoc :lighter eldoc-minor-mode-string @@ -167,7 +162,6 @@ With prefix ARG, turn ElDoc mode on if and only if ARG is positive." (eldoc-mode 1)) -;; Idle timers are part of Emacs 19.31 and later. (defun eldoc-schedule-timer () (or (and eldoc-timer (memq eldoc-timer timer-idle-list)) @@ -235,7 +229,7 @@ With prefix ARG, turn ElDoc mode on if and only if ARG is positive." (not (eq (selected-window) (minibuffer-window))))) -(defvar eldoc-print-current-symbol-info-function nil +(defvar eldoc-documentation-function nil "If non-nil, function to call to return doc string. The function of no args should return a one-line string for displaying doc about a function etc. appropriate to the context around point. @@ -249,8 +243,8 @@ Emacs Lisp mode) that support Eldoc.") (defun eldoc-print-current-symbol-info () (condition-case err (and (eldoc-display-message-p) - (if eldoc-print-current-symbol-info-function - (eldoc-message (funcall eldoc-print-current-symbol-info-function)) + (if eldoc-documentation-function + (eldoc-message (funcall eldoc-documentation-function)) (let* ((current-symbol (eldoc-current-symbol)) (current-fnsym (eldoc-fnsym-in-current-sexp)) (doc (cond -- cgit v1.2.3 From 49c650714b9b5601a85f91e4a26c532cb816fcc1 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 26 Apr 2005 11:00:56 +0000 Subject: Fix previous change. --- lisp/emacs-lisp/eldoc.el | 2 +- lispref/variables.texi | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 29167c70812..b23217151e3 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -45,7 +45,7 @@ ;; Major modes for other languages may use Eldoc by defining an ;; appropriate function as the buffer-local value of -;; `eldoc-print-current-symbol-info-function'. +;; `eldoc-documentation-function'. ;;; Code: diff --git a/lispref/variables.texi b/lispref/variables.texi index b39c4abb719..43f590503ec 100644 --- a/lispref/variables.texi +++ b/lispref/variables.texi @@ -1722,10 +1722,9 @@ stage in the future. @defmac make-obsolete-variable variable new &optional when This macro makes the byte-compiler warn that the variable @var{variable} is obsolete. If @var{new} is a symbol, it is the -variable's new name; the warning messages say to use @var{new} -instead of @var{variable}. -If @var{new} is a string, this is the message and there is no -replacement variable. +variable's new name; then the warning messages says to use @var{new} +instead of @var{variable}. If @var{new} is a string, this is the +message and there is no replacement variable. If provided, @var{when} should be a string indicating when the variable was first made obsolete---for example, a date or a release -- cgit v1.2.3 From c25eec81aae90f8f592d754d29ba865bb8e98f73 Mon Sep 17 00:00:00 2001 From: Lute Kamstra Date: Tue, 26 Apr 2005 14:17:51 +0000 Subject: (define-minor-mode): Fix docstring. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/easy-mmode.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 547a03aac22..34a54165692 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -26,6 +26,11 @@ 2005-04-26 Lute Kamstra + * emacs-lisp/easy-mmode.el (define-minor-mode): Fix docstring. + + * font-lock.el (font-lock-fontify-region-function): Fix docstring. + (font-lock-comment-delimiter-face): Ditto. + * calc/calc.el (calc-trail-mode): Don't set font-lock-defaults. 2005-04-25 Jay Belanger diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 01935c9d5e8..831ffb2d576 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -95,8 +95,8 @@ BODY contains code that will be executed each time the mode is (dis)activated. will be passed to `defcustom' if the minor mode is global): :group GROUP Custom group name to use in all generated `defcustom' forms. Defaults to MODE without the possible trailing \"-mode\". - (This default may not be a valid customization group defined - with `defgroup'. Make sure it is.) + Don't use this default group name unless you have written a + `defgroup' to define that group properly. :global GLOBAL If non-nil specifies that the minor mode is not meant to be buffer-local, so don't make the variable MODE buffer-local. By default, the mode is buffer-local. -- cgit v1.2.3 From 8af0371d68dd1a0413ef4fe90bc9944341acba0b Mon Sep 17 00:00:00 2001 From: Lute Kamstra Date: Thu, 28 Apr 2005 09:18:24 +0000 Subject: (generic-mode-internal): Simplify font-lock-defaults. --- lisp/emacs-lisp/generic.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/generic.el b/lisp/emacs-lisp/generic.el index 1bfa598a7c7..1dfc728906a 100644 --- a/lisp/emacs-lisp/generic.el +++ b/lisp/emacs-lisp/generic.el @@ -226,7 +226,7 @@ See the file generic-x.el for some examples of `define-generic-mode'." (when keyword-list (push (concat "\\_<" (regexp-opt keyword-list t) "\\_>") generic-font-lock-keywords)) - (setq font-lock-defaults '(generic-font-lock-keywords nil)) + (setq font-lock-defaults '(generic-font-lock-keywords)) ;; Call a list of functions (mapcar 'funcall function-list) -- cgit v1.2.3 From 817edb155f915562fd0e88685343fb72e1212011 Mon Sep 17 00:00:00 2001 From: Lute Kamstra Date: Thu, 28 Apr 2005 14:01:03 +0000 Subject: (define-generic-mode): Fix docstring. --- lisp/ChangeLog | 1 + lisp/emacs-lisp/generic.el | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d342fef9a2..ed6ff43e9fe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -28,6 +28,7 @@ * emacs-lisp/generic.el (generic-mode-internal): Simplify font-lock-defaults. + (define-generic-mode): Fix docstring. 2005-04-28 Stefan Monnier diff --git a/lisp/emacs-lisp/generic.el b/lisp/emacs-lisp/generic.el index 1dfc728906a..60ca75f23b1 100644 --- a/lisp/emacs-lisp/generic.el +++ b/lisp/emacs-lisp/generic.el @@ -129,11 +129,11 @@ string will be used instead. COMMENT-LIST is a list, whose entries are either a single character, a one or two character string or a cons pair. If the entry is a character or a string, it is added to the mode's -syntax table with `comment-start' syntax. If the entry is a cons -pair, the elements of the pair are considered to be -`comment-start' and `comment-end' respectively. (The latter -should be nil if you want comments to end at end of line.) Note -that Emacs has limitations regarding comment characters. +syntax table with \"comment starter\" syntax. If the entry is a +cons pair, the elements of the pair are considered to be +\"comment starter\" and \"comment ender\" respectively. (The +latter should be nil if you want comments to end at end of line.) +Note that Emacs has limitations regarding comment characters. KEYWORD-LIST is a list of keywords to highlight with `font-lock-keyword-face'. Each keyword should be a string. @@ -143,18 +143,20 @@ Each entry in the list should have the same form as an entry in `font-lock-keywords'. AUTO-MODE-LIST is a list of regular expressions to add to -`auto-mode-alist'. These regexps are added to `auto-mode-alist' -as soon as `define-generic-mode' is called. +`auto-mode-alist'. These regular expressions are added as soon +as `define-generic-mode' is called. FUNCTION-LIST is a list of functions to call to do some -additional setup. +additional setup. The mode command calls these functions just +before it runs the mode hook. The optional CUSTOM-KEYWORD-ARGS are pairs of keywords and -values. They will be passed to the generated `defcustom' form of -the mode hook variable MODE-hook. Defaults to MODE without the -possible trailing \"-mode\". (This default may not be a valid -customization group defined with `defgroup'. Make sure it is.) -You can specify keyword arguments without specifying a docstring. +values. They are passed to the generated `defcustom' form of the +mode hook variable MODE-hook. The default value for the `:group' +keyword is MODE without the possible trailing \"-mode\". (Don't +use this default group name unless you have written a `defgroup' +to define that group properly.) You can specify keyword +arguments without specifying a docstring. See the file generic-x.el for some examples of `define-generic-mode'." (declare (debug (sexp def-form def-form def-form form def-form -- cgit v1.2.3 From 74919c6f6a62a12b7dafdb344e27c57a67b80192 Mon Sep 17 00:00:00 2001 From: Lute Kamstra Date: Fri, 29 Apr 2005 13:12:26 +0000 Subject: Improve commentary section. (define-generic-mode): Improve docstring. --- lisp/emacs-lisp/generic.el | 66 +++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/generic.el b/lisp/emacs-lisp/generic.el index 60ca75f23b1..03f389aa4d1 100644 --- a/lisp/emacs-lisp/generic.el +++ b/lisp/emacs-lisp/generic.el @@ -35,15 +35,15 @@ ;; ;; Each generic mode can define the following: ;; -;; * List of comment-characters. The entries in this list should be -;; either a character, a one or two character string or a cons pair. -;; If the entry is a character or a string, it is added to the -;; mode's syntax table with `comment-start' syntax. If the entry is -;; a cons pair, the elements of the pair are considered to be -;; `comment-start' and `comment-end' respectively. (The latter -;; should be nil if you want comments to end at end of line.) -;; LIMITATIONS: Emacs does not support comment strings of more than -;; two characters in length. +;; * List of comment-characters. The elements of this list should be +;; either a character, a one or two character string, or a cons +;; cell. If the entry is a character or a string, it is added to +;; the mode's syntax table with "comment starter" syntax. If the +;; entry is a cons cell, the `car' and `cdr' of the pair are +;; considered the "comment starter" and "comment ender" +;; respectively. (The latter should be nil if you want comments to +;; end at the end of the line.) Emacs does not support comment +;; strings of more than two characters in length. ;; ;; * List of keywords to font-lock. Each keyword should be a string. ;; If you have additional keywords which should be highlighted in a @@ -121,42 +121,42 @@ instead (which see).") &rest custom-keyword-args) "Create a new generic mode MODE. -MODE is the name of the command for the generic mode; it need not -be quoted. The optional DOCSTRING is the documentation for the -mode command. If you do not supply it, a default documentation -string will be used instead. +MODE is the name of the command for the generic mode; don't quote +it. The optional DOCSTRING is the documentation for the mode +command. If you do not supply it, `define-generic-mode' uses a +default documentation string instead. -COMMENT-LIST is a list, whose entries are either a single -character, a one or two character string or a cons pair. If the -entry is a character or a string, it is added to the mode's -syntax table with \"comment starter\" syntax. If the entry is a -cons pair, the elements of the pair are considered to be -\"comment starter\" and \"comment ender\" respectively. (The -latter should be nil if you want comments to end at end of line.) -Note that Emacs has limitations regarding comment characters. +COMMENT-LIST is a list in which each element is either a +character, a string of one or two characters, or a cons cell. A +character or a string is set up in the mode's syntax table as a +\"comment starter\". If the entry is a cons cell, the `car' is +set up as a \"comment starter\" and the `cdr' as a \"comment +ender\". (Use nil for the latter if you want comments to end at +the end of the line.) Note that the syntax table has limitations +about what comment starters and enders are actually possible. KEYWORD-LIST is a list of keywords to highlight with `font-lock-keyword-face'. Each keyword should be a string. FONT-LOCK-LIST is a list of additional expressions to highlight. -Each entry in the list should have the same form as an entry in -`font-lock-keywords'. +Each element of this list should have the same form as an element +of `font-lock-keywords'. AUTO-MODE-LIST is a list of regular expressions to add to -`auto-mode-alist'. These regular expressions are added as soon -as `define-generic-mode' is called. +`auto-mode-alist'. These regular expressions are added when +Emacs runs the macro expansion. FUNCTION-LIST is a list of functions to call to do some additional setup. The mode command calls these functions just before it runs the mode hook. -The optional CUSTOM-KEYWORD-ARGS are pairs of keywords and -values. They are passed to the generated `defcustom' form of the -mode hook variable MODE-hook. The default value for the `:group' -keyword is MODE without the possible trailing \"-mode\". (Don't -use this default group name unless you have written a `defgroup' -to define that group properly.) You can specify keyword -arguments without specifying a docstring. +The optional CUSTOM-KEYWORD-ARGS are pairs of keywords and values +to include in the generated `defcustom' form for the mode hook +variable `MODE-hook'. The default value for the `:group' keyword +is MODE with the final \"-mode\" (if any) removed. (Don't use +this default group name unless you have written a `defgroup' to +define that group properly.) You can specify keyword arguments +without specifying a docstring. See the file generic-x.el for some examples of `define-generic-mode'." (declare (debug (sexp def-form def-form def-form form def-form @@ -180,7 +180,7 @@ See the file generic-x.el for some examples of `define-generic-mode'." (unless (plist-get custom-keyword-args :group) (setq custom-keyword-args - (plist-put custom-keyword-args + (plist-put custom-keyword-args :group `',(intern (replace-regexp-in-string "-mode\\'" "" name))))) -- cgit v1.2.3