summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2005-05-05 00:04:55 +0000
committerMiles Bader <miles@gnu.org>2005-05-05 00:04:55 +0000
commitcca4e3b099ec4c3f4a36fd0cb865c618a5589069 (patch)
tree711e73e53dbe1ab3a59b53fb56a10836e777b43e /lisp/emacs-lisp
parentd469f5c370dbb6fac0e8d6687b47ccfcf96a13a5 (diff)
parentd68a5392cafedbe0ee6c3eca0444fce4a58b6cdf (diff)
downloademacs-cca4e3b099ec4c3f4a36fd0cb865c618a5589069.tar.gz
emacs-cca4e3b099ec4c3f4a36fd0cb865c618a5589069.tar.bz2
emacs-cca4e3b099ec4c3f4a36fd0cb865c618a5589069.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-44
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 272-288) - src/xdisp.c (dump_glyph_row): Don't display overlay_arrow_p field. - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 67) - Update from CVS
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/byte-run.el24
-rw-r--r--lisp/emacs-lisp/bytecomp.el3
-rw-r--r--lisp/emacs-lisp/easy-mmode.el4
-rw-r--r--lisp/emacs-lisp/easymenu.el24
-rw-r--r--lisp/emacs-lisp/eldoc.el24
-rw-r--r--lisp/emacs-lisp/generic.el70
6 files changed, 83 insertions, 66 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 60fc862676d..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.
@@ -129,6 +141,18 @@ was first made obsolete, for example a date or a release number."
(put variable 'byte-obsolete-variable (cons new when))
variable)
+(defmacro define-obsolete-variable-alias (variable new
+ &optional when docstring)
+ "Make VARIABLE a variable alias for NEW and warn that VARIABLE is obsolete.
+If provided, WHEN should be a string indicating when VARIABLE was
+first made obsolete, for example a date or a release number. The
+optional argument DOCSTRING specifies the documentation string
+for VARIABLE; if DOCSTRING is omitted or nil, VARIABLE uses the
+documentation string of NEW unless it already has one."
+ `(progn
+ (defvaralias ,variable ,new ,docstring)
+ (make-obsolete-variable ,variable ,new ,when)))
+
(defmacro dont-compile (&rest body)
"Like `progn', but the body always runs interpreted (not compiled).
If you think you need this, you're probably making a mistake somewhere."
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 950193463f7..a752f9f9b61 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2900,9 +2900,6 @@ That command is designed for interactive use only" fn))
(put 'byte-concatN 'byte-opcode-invert 'concat)
(put 'byte-insertN 'byte-opcode-invert 'insert)
-(byte-defop-compiler (dot byte-point) 0)
-(byte-defop-compiler (dot-max byte-point-max) 0)
-(byte-defop-compiler (dot-min byte-point-min) 0)
(byte-defop-compiler point 0)
;;(byte-defop-compiler mark 0) ;; obsolete
(byte-defop-compiler point-max 0)
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.
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index b0f3b9b9d3e..78ba1fe27bf 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -160,18 +160,18 @@ A menu item can be a list with the same format as MENU. This is a submenu."
(let ((keymap (easy-menu-create-menu (car menu) (cdr menu))))
(when symbol
(set symbol keymap)
- (fset symbol
- `(lambda (event) ,doc (interactive "@e")
- ;; FIXME: XEmacs uses popup-menu which calls the binding
- ;; while x-popup-menu only returns the selection.
- (x-popup-menu event
- (or (and (symbolp ,symbol)
- (funcall
- (or (plist-get (get ,symbol 'menu-prop)
- :filter)
- 'identity)
- (symbol-function ,symbol)))
- ,symbol)))))
+ (defalias symbol
+ `(lambda (event) ,doc (interactive "@e")
+ ;; FIXME: XEmacs uses popup-menu which calls the binding
+ ;; while x-popup-menu only returns the selection.
+ (x-popup-menu event
+ (or (and (symbolp ,symbol)
+ (funcall
+ (or (plist-get (get ,symbol 'menu-prop)
+ :filter)
+ 'identity)
+ (symbol-function ,symbol)))
+ ,symbol)))))
(mapcar (lambda (map)
(define-key map (vector 'menu-bar (easy-menu-intern (car menu)))
(cons 'menu-item
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index f31dafb7b11..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:
@@ -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
diff --git a/lisp/emacs-lisp/generic.el b/lisp/emacs-lisp/generic.el
index 6851faeddd6..410b1d8eaa5 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,40 +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-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.
+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 regexps are added to `auto-mode-alist'
-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.
+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.
+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
@@ -178,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)))))
@@ -226,7 +228,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)