diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 542761fda2f..0e6a568db49 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2004-01-04 Andreas Schwab + + * emacsclient.c (main): Fix socket name when using another user. + 2003-12-27 Paul Eggert * rcs2log (rlog_options): Append -rbranchtag if CVS/Tag indicates diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index f45ca56c0d3..d737b2a11eb 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -470,7 +470,7 @@ main (argc, argv) if (pw && (pw->pw_uid != geteuid ())) { /* We're running under su, apparently. */ - sprintf (server.sun_path, "/tmp/esrv%d-%s", + sprintf (server.sun_path, "/tmp/emacs%d-%s/server", (int) pw->pw_uid, system_name); sock_status = socket_status (server.sun_path); oerrno = errno; diff --git a/lisp/ChangeLog b/lisp/ChangeLog index de4f72cc020..14963f0ef8c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,38 @@ +2004-01-04 Karl Berry + + * emacs-lisp/copyright.el (copyright-regexp): allow the common + comment characters % and # in the copyright year notice, + as well as ;. + +2004-01-04 Per Abrahamsen + + * wid-edit.el (default): Define dummy :value-delete. + Reported by Jesper Harder . + +2004-01-03 Richard M. Stallman + + * progmodes/compile.el (compile-internal): Use point, not point-min, + for set-window-point. + + * textmodes/tex-mode.el (latex-find-indent): Avoid error at end of buf. + + * emacs-lisp/lisp-mnt.el (lm-section-end): require outline. + + * progmodes/grep.el (grep-mode-map): + Don't remap next-line, previous-line. + +2004-01-03 Eric M. Ludlam + + * speedbar.el (speedbar-edit-line): Change regexp to position + the cursor on the first character of this line's button. + +2004-01-03 Luc Teirlinck + + * subr.el (functionp): Doc fix. + 2004-01-03 Jesper Harder (tiny change) - * progmodes/idlwave.el (idlwave-make-tags): + * progmodes/idlwave.el (idlwave-make-tags): * textmodes/flyspell.el (flyspell-large-region):. * progmodes/make-mode.el (makefile-query-by-make-minus-q): * emulation/viper-util.el (viper-glob-unix-files): @@ -69,6 +101,9 @@ 2003-12-29 Richard M. Stallman + * mail/mail-utils.el (mail-unquote-printable-hexdigit): + Upcase the character. + * textmodes/flyspell.el (mail-mode-flyspell-verify): Search for header separator alone on a line, literally, and search for it backward, not forward. diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index fc0a5b74726..4532f7e5b77 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -1,6 +1,6 @@ ;;; copyright.el --- update the copyright notice in current buffer -;; Copyright (C) 1991, 92, 93, 94, 95, 1998, 2001, 2003 +;; Copyright (C) 1991, 92, 93, 94, 95, 1998, 2001, 2003, 2004 ;; Free Software Foundation, Inc. ;; Author: Daniel Pfeiffer @@ -47,7 +47,7 @@ A value of nil means to search whole buffer." (defcustom copyright-regexp "\\([]\\|@copyright{}\\|[Cc]opyright\\s *:?\\s *\\(?:(C)\\)?\ \\|[Cc]opyright\\s *:?\\s *[]\\)\ -\\s *\\([1-9]\\([-0-9, ';\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" +\\s *\\([1-9]\\([-0-9, ';%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" "*What your copyright notice looks like. The second \\( \\) construct must match the years." :group 'copyright diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index aeb7fb2258d..245772dfc54 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -214,6 +214,7 @@ The end of the section is defined as the beginning of the next section of the same level or lower. The function `lisp-outline-level' is used to compute the level of a section. If no such section exists, return the end of the buffer." + (require 'outline) ;; for outline-regexp. (let ((start (lm-section-start header))) (when start (save-excursion diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 6d76fe3384a..de050411411 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -754,7 +754,7 @@ Returns the compilation buffer created." compilation-directory-stack (list default-directory)) (set-window-start outwin (point-min)) (or (eq outwin (selected-window)) - (set-window-point outwin (point-min))) + (set-window-point outwin (point))) ;; The setup function is called before compilation-set-window-height ;; so it can set the compilation-window-height buffer locally. (if compilation-process-setup-function diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 35a5780aa45..cb8fcf6e042 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -157,8 +157,9 @@ The following place holders should be present in the string: (define-key map " " 'scroll-up) (define-key map "\^?" 'scroll-down) - (define-key map [remap next-line] 'compilation-next-error) - (define-key map [remap previous-line] 'compilation-previous-error) + ;; This is intolerable -- rms +;;; (define-key map [remap next-line] 'compilation-next-error) +;;; (define-key map [remap previous-line] 'compilation-previous-error) (define-key map "\r" 'compile-goto-error) ;; ? (define-key map "n" 'next-error-no-select) diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 5eef1359fad..f8e9386585d 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -3410,7 +3410,9 @@ directory with these items." (if (re-search-forward "[]>?}] [^ ]" (save-excursion (end-of-line) (point)) t) - (speedbar-do-function-pointer) + (progn + (forward-char -1) + (speedbar-do-function-pointer)) nil)) (speedbar-do-function-pointer))) diff --git a/lisp/subr.el b/lisp/subr.el index a2b09d6b63b..b251ab6573a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2205,7 +2205,10 @@ configuration." (eq (car object) 'frame-configuration))) (defun functionp (object) - "Non-nil iff OBJECT is a type of object that can be called as a function." + "Non-nil if OBJECT is any kind of function or a special form. +Also non-nil if OBJECT is a symbol and its function definition is +\(recursively) a function or special form. This does not include +macros." (or (and (symbolp object) (fboundp object) (condition-case nil (setq object (indirect-function object)) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 87dc8fcbc00..68b408af081 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2342,15 +2342,15 @@ There might be text before point." (+ indent (current-column) tex-indent-item)) (t (let ((col (current-column))) - (if (not (eq (char-syntax char) ?\()) + (if (or (null char) (not (eq (char-syntax char) ?\())) ;; If the first char was not an open-paren, there's ;; a risk that this is really not an argument to the ;; macro at all. - (+ indent col) - (forward-sexp 1) - (if (< (line-end-position) - (save-excursion (forward-comment (point-max)) - (point))) + (+ indent col) + (forward-sexp 1) + (if (< (line-end-position) + (save-excursion (forward-comment (point-max)) + (point))) ;; we're indenting the first argument. (min (current-column) (+ tex-indent-arg col)) (skip-syntax-forward " ") diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 63a254d1d67..2392ccdfb47 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1,6 +1,6 @@ ;;; wid-edit.el --- Functions for creating and using widgets -*-byte-compile-dynamic: t;-*- ;; -;; Copyright (C) 1996,97,1999,2000,01,02,2003 Free Software Foundation, Inc. +;; Copyright (C) 1996,97,1999,2000,01,02,2003, 2004 Free Software Foundation, Inc. ;; ;; Author: Per Abrahamsen ;; Maintainer: FSF @@ -1348,6 +1348,7 @@ The value of the :type attribute should be an unconverted widget type." :copy 'identity :value-set 'widget-default-value-set :value-inline 'widget-default-value-inline + :value-delete 'ignore :default-get 'widget-default-default-get :menu-tag-get 'widget-default-menu-tag-get :validate #'ignore diff --git a/lispref/ChangeLog b/lispref/ChangeLog index b3b4abf2460..1ef5bca1d46 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,21 @@ +2004-01-03 Richard M. Stallman + + * frames.texi (Frames and Windows): Delete frame-root-window. + +2004-01-03 Luc Teirlinck + + * eval.texi, hash.texi, help.texi, symbols.texi: Add anchors. + + * functions.texi: Various small changes in addition to the + following. + (What Is a Function): `functionp' returns nil for macros. Clarify + behavior of this and following functions for symbol arguments. + (Function Documentation): Add `\' in front of (fn @var{arglist}) + and explain why. + (Defining Functions): Mention DOCSTRING argument to `defalias'. + Add anchor. + (Mapping Functions): Add anchor. Unquote nil in mapcar* example. + 2004-01-01 Miles Bader * display.texi (Buttons): New section. diff --git a/lispref/eval.texi b/lispref/eval.texi index fcfde5849dd..7d1ebb9d307 100644 --- a/lispref/eval.texi +++ b/lispref/eval.texi @@ -313,6 +313,7 @@ symbol function indirection when calling @code{erste}. perform symbol function indirection explicitly. @c Emacs 19 feature +@anchor{Definition of indirect-function} @defun indirect-function function This function returns the meaning of @var{function} as a function. If @var{function} is a symbol, then it finds @var{function}'s function diff --git a/lispref/frames.texi b/lispref/frames.texi index ec3c1c6dc7c..a9b29332200 100644 --- a/lispref/frames.texi +++ b/lispref/frames.texi @@ -933,10 +933,6 @@ selected window. Conversely, selecting a window for Emacs with @code{select-window} also makes that window selected within its frame. @xref{Selecting Windows}. -@defun frame-root-window frame -This function returns the window at the top left corner of @var{frame}. -@end defun - Another function that (usually) returns one of the windows in a given frame is @code{minibuffer-window}. @xref{Minibuffer Misc}. diff --git a/lispref/functions.texi b/lispref/functions.texi index 4ee101ca871..4b727e76506 100644 --- a/lispref/functions.texi +++ b/lispref/functions.texi @@ -113,10 +113,15 @@ byte compiler. @xref{Byte-Code Type}. @end table @defun functionp object -This function returns @code{t} if @var{object} is any kind of function, -or a special form or macro. +This function returns @code{t} if @var{object} is any kind of +function, or a special form, or, recursively, a symbol whose function +definition is a function or special form. (This does not include +macros.) @end defun +Unlike @code{functionp}, the next three functions do @emph{not} +treat a symbol as its function definition. + @defun subrp object This function returns @code{t} if @var{object} is a built-in function (i.e., a Lisp primitive). @@ -428,13 +433,14 @@ conventions different from the actual function arguments. Write text like this: @example -(fn @var{arglist}) +\(fn @var{arglist}) @end example @noindent -following a blank line, with no newline following it inside the -documentation string. This feature is particularly useful for -macro definitions. +following a blank line, at the beginning of the line, with no newline +following it inside the documentation string. This feature is +particularly useful for macro definitions. The @samp{\} is used to +avoid confusing the Emacs motion commands. @node Function Names @section Naming a Function @@ -571,9 +577,15 @@ defined is often done deliberately, and there is no way to distinguish deliberate redefinition from unintentional redefinition. @end defspec -@defun defalias name definition +@anchor{Definition of defalias} +@defun defalias name definition &optional docstring This special form defines the symbol @var{name} as a function, with definition @var{definition} (which can be any valid Lisp function). +It returns @var{definition}. + +If @var{docstring} is non-@code{nil}, it becomes the function +documentation of @var{name}. Otherwise, any documentation provided by +@var{definition} is used. The proper place to use @code{defalias} is where a specific function name is being defined---especially where that name appears explicitly in @@ -587,7 +599,7 @@ records. @end defun You cannot create a new primitive function with @code{defun} or -@code{defalias}, but you use them to change the function definition of +@code{defalias}, but you can use them to change the function definition of any symbol, even one such as @code{car} or @code{x-popup-menu} whose normal definition is a primitive. However, this is risky: for instance, it is next to impossible to redefine @code{car} without @@ -700,8 +712,8 @@ primitive function; special forms and macros do not make sense in @end group @end example -For an interesting example of using @code{apply}, see the description of -@code{mapcar}, in @ref{Mapping Functions}. +For an interesting example of using @code{apply}, see @ref{Definition +of mapcar}. @end defun @cindex functionals @@ -726,19 +738,21 @@ This function ignores any arguments and returns @code{nil}. @section Mapping Functions @cindex mapping functions - A @dfn{mapping function} applies a given function to each element of a -list or other collection. Emacs Lisp has several such functions; -@code{mapcar} and @code{mapconcat}, which scan a list, are described -here. @xref{Creating Symbols}, for the function @code{mapatoms} which -maps over the symbols in an obarray. @xref{Hash Access}, for the -function @code{maphash} which maps over key/value associations in a -hash table. + A @dfn{mapping function} applies a given function (@emph{not} a +special form or macro) to each element of a list or other collection. +Emacs Lisp has several such functions; @code{mapcar} and +@code{mapconcat}, which scan a list, are described here. +@xref{Definition of mapatoms}, for the function @code{mapatoms} which +maps over the symbols in an obarray. @xref{Definition of maphash}, +for the function @code{maphash} which maps over key/value associations +in a hash table. These mapping functions do not allow char-tables because a char-table is a sparse array whose nominal range of indices is very large. To map over a char-table in a way that deals properly with its sparse nature, use the function @code{map-char-table} (@pxref{Char-Tables}). +@anchor{Definition of mapcar} @defun mapcar function sequence @code{mapcar} applies @var{function} to each element of @var{sequence} in turn, and returns a list of the results. @@ -770,7 +784,7 @@ length of @var{sequence}. "Apply FUNCTION to successive cars of all ARGS. Return the list of results." ;; @r{If no list is exhausted,} - (if (not (memq 'nil args)) + (if (not (memq nil args)) ;; @r{apply function to @sc{car}s.} (cons (apply function (mapcar 'car args)) (apply 'mapcar* function @@ -961,8 +975,8 @@ to be used only as a function, and therefore can safely be compiled. Contrast this with @code{quote}, in @ref{Quoting}. @end defspec - See @code{documentation} in @ref{Accessing Documentation}, for a -realistic example using @code{function} and an anonymous function. + @xref{describe-symbols example}, for a realistic example using +@code{function} and an anonymous function. @node Function Cells @section Accessing Function Cell Contents @@ -971,8 +985,8 @@ realistic example using @code{function} and an anonymous function. function cell of the symbol. The functions described here access, test, and set the function cell of symbols. - See also the function @code{indirect-function} in @ref{Function -Indirection}. + See also the function @code{indirect-function}. @xref{Definition of +indirect-function}. @defun symbol-function symbol @kindex void-function @@ -1027,8 +1041,9 @@ is a legitimate function. @defun fmakunbound symbol This function makes @var{symbol}'s function cell void, so that a -subsequent attempt to access this cell will cause a @code{void-function} -error. (See also @code{makunbound}, in @ref{Void Variables}.) +subsequent attempt to access this cell will cause a +@code{void-function} error. It returns @var{symbol}. (See also +@code{makunbound}, in @ref{Void Variables}.) @example @group @@ -1064,7 +1079,7 @@ There are three normal uses of this function: Copying one symbol's function definition to another---in other words, making an alternate name for a function. (If you think of this as the definition of the new name, you should use @code{defalias} instead of -@code{fset}; see @ref{Defining Functions}.) +@code{fset}; see @ref{Definition of defalias}.) @item Giving a symbol a function definition that is not a list and therefore @@ -1305,7 +1320,7 @@ See @ref{Anonymous Functions}. See @ref{Calling Functions}. @item indirect-function -See @ref{Function Indirection}. +See @ref{Definition of indirect-function}. @item interactive See @ref{Using Interactive}. diff --git a/lispref/hash.texi b/lispref/hash.texi index a27894fa24b..909c7fb0b7c 100644 --- a/lispref/hash.texi +++ b/lispref/hash.texi @@ -205,6 +205,7 @@ table. @end defun @tindex maphash +@anchor{Definition of maphash} @defun maphash function table This function calls @var{function} once for each of the associations in @var{table}. The function @var{function} should accept two diff --git a/lispref/help.texi b/lispref/help.texi index 343ffb66078..dc14b0226b5 100644 --- a/lispref/help.texi +++ b/lispref/help.texi @@ -156,6 +156,7 @@ Here is an example of using the two functions, @code{documentation} and @code{documentation-property}, to display the documentation strings for several symbols in a @samp{*Help*} buffer. +@anchor{describe-symbols example} @smallexample @group (defun describe-symbols (pattern) diff --git a/lispref/symbols.texi b/lispref/symbols.texi index 6cde2115259..632f2cc5174 100644 --- a/lispref/symbols.texi +++ b/lispref/symbols.texi @@ -360,6 +360,7 @@ This variable is the standard obarray for use by @code{intern} and @code{read}. @end defvar +@anchor{Definition of mapatoms} @defun mapatoms function &optional obarray This function calls @var{function} once with each symbol in the obarray @var{obarray}. Then it returns @code{nil}. If @var{obarray} is diff --git a/src/window.c b/src/window.c index c4d896532b1..f3f3c6b8bf0 100644 --- a/src/window.c +++ b/src/window.c @@ -394,6 +394,17 @@ decode_window (window) return XWINDOW (window); } +static struct window * +decode_any_window (window) + register Lisp_Object window; +{ + if (NILP (window)) + return XWINDOW (selected_window); + + CHECK_WINDOW (window); + return XWINDOW (window); +} + DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, doc: /* Return the buffer that WINDOW is displaying. */) (window) @@ -407,7 +418,7 @@ DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0, (window) Lisp_Object window; { - return decode_window (window)->total_lines; + return decode_any_window (window)->total_lines; } DEFUN ("window-width", Fwindow_width, Swindow_width, 0, 1, 0, @@ -418,7 +429,7 @@ use (let ((edges (window-edges))) (- (nth 2 edges) (nth 0 edges))). */) (window) Lisp_Object window; { - return make_number (window_box_text_cols (decode_window (window))); + return make_number (window_box_text_cols (decode_any_window (window))); } DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, @@ -491,7 +502,7 @@ To get the edges of the actual text area, use `window-inside-edges'. */) (window) Lisp_Object window; { - register struct window *w = decode_window (window); + register struct window *w = decode_any_window (window); return Fcons (make_number (WINDOW_LEFT_EDGE_COL (w)), Fcons (make_number (WINDOW_TOP_EDGE_LINE (w)), @@ -511,7 +522,7 @@ To get the edges of the actual text area, use `window-inside-pixel-edges'. */) (window) Lisp_Object window; { - register struct window *w = decode_window (window); + register struct window *w = decode_any_window (window); return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)), Fcons (make_number (WINDOW_TOP_EDGE_Y (w)), @@ -530,7 +541,7 @@ display margins, fringes, header line, and/or mode line. */) (window) Lisp_Object window; { - register struct window *w = decode_window (window); + register struct window *w = decode_any_window (window); return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w) + WINDOW_LEFT_MARGIN_COLS (w) @@ -554,7 +565,7 @@ display margins, fringes, header line, and/or mode line. */) (window) Lisp_Object window; { - register struct window *w = decode_window (window); + register struct window *w = decode_any_window (window); return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w) + WINDOW_LEFT_MARGIN_WIDTH (w) @@ -773,7 +784,7 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\ int x, y; Lisp_Object lx, ly; - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); w = XWINDOW (window); f = XFRAME (w->frame); CHECK_CONS (coordinates);