Now on revision 107687. ------------------------------------------------------------ revno: 107687 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-26 23:46:42 -0700 message: Small doc and elisp manual fixes related to searching * doc/lispref/searching.texi (String Search): Add xref to Emacs manual. Copyedits. Mention the function word-search-regexp. (Searching and Case): Add xref to Emacs manual. Copyedits. * src/search.c (Fword_search_backward_lax, Fword_search_forward_lax): Doc fixes. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-27 00:50:49 +0000 +++ doc/lispref/ChangeLog 2012-03-27 06:46:42 +0000 @@ -1,5 +1,9 @@ 2012-03-27 Glenn Morris + * searching.texi (String Search): Add xref to Emacs manual. + Copyedits. Mention the function word-search-regexp. + (Searching and Case): Add xref to Emacs manual. Copyedits. + * processes.texi (Network Servers): Standardize apostrophe usage. * os.texi (System Environment): Copyedits. Remove some examples === modified file 'doc/lispref/searching.texi' --- doc/lispref/searching.texi 2012-02-25 04:03:43 +0000 +++ doc/lispref/searching.texi 2012-03-27 06:46:42 +0000 @@ -38,7 +38,8 @@ buffer. They are meant for use in programs, but you may call them interactively. If you do so, they prompt for the search string; the arguments @var{limit} and @var{noerror} are @code{nil}, and @var{repeat} -is 1. +is 1. For more details on interactive searching, @pxref{Search,, +Searching and Replacement, emacs, The GNU Emacs Manual}. These search functions convert the search string to multibyte if the buffer is multibyte; they convert the search string to unibyte if the @@ -71,8 +72,8 @@ @end group @end example -The argument @var{limit} specifies the upper bound to the search. (It -must be a position in the current buffer.) No match extending after +The argument @var{limit} specifies the bound to the search, and should +be a position in the current buffer. No match extending after that position is accepted. If @var{limit} is omitted or @code{nil}, it defaults to the end of the accessible portion of the buffer. @@ -82,9 +83,14 @@ error is signaled. If @var{noerror} is @code{t}, @code{search-forward} returns @code{nil} and does nothing. If @var{noerror} is neither @code{nil} nor @code{t}, then @code{search-forward} moves point to the -upper bound and returns @code{nil}. (It would be more consistent now to -return the new position of point in that case, but some existing -programs may depend on a value of @code{nil}.) +upper bound and returns @code{nil}. +@c I see no prospect of this ever changing, and frankly the current +@c behavior seems better, so there seems no need to mention this. +@ignore +(It would be more consistent now to return the new position of point +in that case, but some existing programs may depend on a value of +@code{nil}.) +@end ignore The argument @var{noerror} only affects valid searches which fail to find a match. Invalid arguments cause errors regardless of @@ -132,7 +138,7 @@ @group (word-search-forward "Please find the ball, boy.") - @result{} 35 + @result{} 36 ---------- Buffer: foo ---------- He said "Please! Find @@ -153,11 +159,16 @@ If @var{repeat} is non-@code{nil}, then the search is repeated that many times. Point is positioned at the end of the last match. + +@findex word-search-regexp +Internal, @code{word-search-forward} and related functions use the +function @code{word-search-regexp} to convert @var{string} to a +regular expression that ignores punctuation. @end deffn @deffn Command word-search-forward-lax string &optional limit noerror repeat This command is identical to @code{word-search-forward}, except that -the end of @code{string} need not match a word boundary unless it ends +the end of @var{string} need not match a word boundary, unless @var{string} ends in whitespace. For instance, searching for @samp{ball boy} matches @samp{ball boyee}, but does not match @samp{aball boy}. @end deffn @@ -171,7 +182,7 @@ @deffn Command word-search-backward-lax string &optional limit noerror repeat This command is identical to @code{word-search-backward}, except that -the end of @code{string} need not match a word boundary unless it ends +the end of @var{string} need not match a word boundary, unless @var{string} ends in whitespace. @end deffn @@ -189,24 +200,26 @@ @code{case-fold-search} to @code{nil}. Then all letters must match exactly, including case. This is a buffer-local variable; altering the variable affects only the current buffer. (@xref{Intro to -Buffer-Local}.) Alternatively, you may change the default value of -@code{case-fold-search}. +Buffer-Local}.) Alternatively, you may change the default value. +In Lisp code, you will more typically use @code{let} to bind +@code{case-fold-search} to the desired value. Note that the user-level incremental search feature handles case distinctions differently. When the search string contains only lower case letters, the search ignores case, but when the search string contains one or more upper case letters, the search becomes case-sensitive. But this has nothing to do with the searching -functions used in Lisp code. +functions used in Lisp code. @xref{Incremental Search,,, emacs, +The GNU Emacs Manual}. @defopt case-fold-search This buffer-local variable determines whether searches should ignore case. If the variable is @code{nil} they do not ignore case; otherwise -they do ignore case. +(and by default) they do ignore case. @end defopt @defopt case-replace -This variable determines whether the higher level replacement +This variable determines whether the higher-level replacement functions should preserve case. If the variable is @code{nil}, that means to use the replacement text verbatim. A non-@code{nil} value means to convert the case of the replacement text according to the === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-26 05:43:05 +0000 +++ src/ChangeLog 2012-03-27 06:46:42 +0000 @@ -1,3 +1,8 @@ +2012-03-27 Glenn Morris + + * search.c (Fword_search_backward_lax, Fword_search_forward_lax): + Doc fixes. + 2012-03-26 Kenichi Handa * dispextern.h (struct glyph): Fix previous change. Change the === modified file 'src/search.c' --- src/search.c 2012-01-26 15:48:27 +0000 +++ src/search.c 2012-03-27 06:46:42 +0000 @@ -1,6 +1,7 @@ /* String search routines for GNU Emacs. - Copyright (C) 1985-1987, 1993-1994, 1997-1999, 2001-2012 - Free Software Foundation, Inc. + +Copyright (C) 1985-1987, 1993-1994, 1997-1999, 2001-2012 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2257,7 +2258,7 @@ Set point to the beginning of the occurrence found, and return point. Unlike `word-search-backward', the end of STRING need not match a word -boundary unless it ends in whitespace. +boundary, unless STRING ends in whitespace. An optional second argument bounds the search; it is a buffer position. The match found must not extend before that position. @@ -2279,7 +2280,7 @@ Set point to the end of the occurrence found, and return point. Unlike `word-search-forward', the end of STRING need not match a word -boundary unless it ends in whitespace. +boundary, unless STRING ends in whitespace. An optional second argument bounds the search; it is a buffer position. The match found must not extend after that position. ------------------------------------------------------------ revno: 107686 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-26 23:45:12 -0700 message: * lisp/startup.el (mail-host-address): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-26 19:10:00 +0000 +++ lisp/ChangeLog 2012-03-27 06:45:12 +0000 @@ -1,3 +1,7 @@ +2012-03-27 Glenn Morris + + * startup.el (mail-host-address): Doc fix. + 2012-03-26 Stefan Monnier * emacs-lisp/bytecomp.el (byte-compile-constants-vector): Allow more === modified file 'lisp/startup.el' --- lisp/startup.el 2012-03-26 00:37:04 +0000 +++ lisp/startup.el 2012-03-27 06:45:12 +0000 @@ -339,7 +339,9 @@ (error "Customizing `site-run-file' does not work"))) (defcustom mail-host-address nil - "Name of this machine, for purposes of naming users." + "Name of this machine, for purposes of naming users. +If non-nil, Emacs uses this instead of `system-name' when constructing +email addresses." :type '(choice (const nil) string) :group 'mail) ------------------------------------------------------------ revno: 107685 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-26 20:50:49 -0400 message: * doc/lispref/processes.texi (Network Servers): Standardize apostrophe usage. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-27 00:49:32 +0000 +++ doc/lispref/ChangeLog 2012-03-27 00:50:49 +0000 @@ -1,5 +1,7 @@ 2012-03-27 Glenn Morris + * processes.texi (Network Servers): Standardize apostrophe usage. + * os.texi (System Environment): Copyedits. Remove some examples that do not seem useful. Mention setenv third arg. tty-erase-char does not seem to be nil under a window-system. === modified file 'doc/lispref/processes.texi' --- doc/lispref/processes.texi 2012-02-28 08:17:21 +0000 +++ doc/lispref/processes.texi 2012-03-27 00:50:49 +0000 @@ -2054,7 +2054,7 @@ @itemize @bullet @item The connection's process name is constructed by concatenating the -server process' @var{name} with a client identification string. The +server process's @var{name} with a client identification string. The client identification string for an IPv4 connection looks like @samp{<@var{a}.@var{b}.@var{c}.@var{d}:@var{p}>}. Otherwise, it is a unique number in brackets, as in @samp{<@var{nnn}>}. The number @@ -2087,7 +2087,7 @@ number used for the connection. @item -The client process' plist is initialized from the server's plist. +The client process's plist is initialized from the server's plist. @end itemize @node Datagrams ------------------------------------------------------------ revno: 107684 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-26 20:49:32 -0400 message: More lispref/os.texi small edits * doc/lispref/os.texi (System Environment): Copyedits. Remove some examples that do not seem useful. Mention setenv third arg. tty-erase-char does not seem to be nil under a window-system. (User Identification): Copyedits. Remove some examples that do not seem useful. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-26 01:35:47 +0000 +++ doc/lispref/ChangeLog 2012-03-27 00:49:32 +0000 @@ -1,3 +1,11 @@ +2012-03-27 Glenn Morris + + * os.texi (System Environment): Copyedits. Remove some examples + that do not seem useful. Mention setenv third arg. + tty-erase-char does not seem to be nil under a window-system. + (User Identification): Copyedits. + Remove some examples that do not seem useful. + 2012-03-26 Glenn Morris * os.texi (Startup Summary): Copyedits. Fix startup screen logic. === modified file 'doc/lispref/os.texi' --- doc/lispref/os.texi 2012-03-26 01:35:47 +0000 +++ doc/lispref/os.texi 2012-03-27 00:49:32 +0000 @@ -833,15 +833,15 @@ @defvar system-configuration This variable holds the standard GNU configuration name for the -hardware/software configuration of your system, as a string. The -convenient way to test parts of this string is with -@code{string-match}. +hardware/software configuration of your system, as a string. For +example, a typical value for a 64-bit GNU/Linux system is +@samp{"x86_64-unknown-linux-gnu"}. @end defvar @cindex system type and name @defvar system-type The value of this variable is a symbol indicating the type of operating -system Emacs is operating on. Here is a table of the possible values: +system Emacs is running on. The possible values are: @table @code @item aix @@ -861,7 +861,7 @@ @item gnu/linux A GNU/Linux system---that is, a variant GNU system, using the Linux -kernel. (These systems are the ones people often call ``Linux,'' but +kernel. (These systems are the ones people often call ``Linux'', but actually Linux is just the kernel, not the whole system.) @item gnu/kfreebsd @@ -874,33 +874,28 @@ Silicon Graphics Irix system. @item ms-dos -Microsoft MS-DOS ``operating system.'' Emacs compiled with DJGPP for -MS-DOS binds @code{system-type} to @code{ms-dos} even when you run it on -MS-Windows. +Microsoft's DOS. Emacs compiled with DJGPP for MS-DOS binds +@code{system-type} to @code{ms-dos} even when you run it on MS-Windows. @item usg-unix-v AT&T Unix System V. @item windows-nt -Microsoft Windows NT and later. The same executable supports Windows -9X, but the value of @code{system-type} is @code{windows-nt} in either -case. +Microsoft Windows NT, 9X and later. The value of @code{system-type} +is always @code{windows-nt}, e.g. even on Windows 7. @end table We do not wish to add new symbols to make finer distinctions unless it is absolutely necessary! In fact, we hope to eliminate some of these -alternatives in the future. We recommend using -@code{system-configuration} to distinguish between different operating -systems. +alternatives in the future. If you need to make a finer distinction +than @code{system-type} allows for, you can test +@code{system-configuration}, e.g. against a regexp. @end defvar @defun system-name -This function returns the name of the machine you are running on. -@example -(system-name) - @result{} "www.gnu.org" -@end example +This function returns the name of the machine you are running on, as a +string. @end defun The symbol @code{system-name} is a variable as well as a function. In @@ -910,6 +905,7 @@ system. The variable is also useful for constructing frame titles (@pxref{Frame Titles}). +@c FIXME seems like this section is not the best place for this option? @defopt mail-host-address If this variable is non-@code{nil}, it is used instead of @code{system-name} for purposes of generating email addresses. For @@ -917,37 +913,43 @@ @code{user-mail-address}. @xref{User Identification}. (Since this is done when Emacs starts up, the value actually used is the one saved when Emacs was dumped. @xref{Building Emacs}.) +@c FIXME sounds like should probably give this a :set-after and some +@c custom-initialize-delay voodoo. @end defopt @deffn Command getenv var &optional frame @cindex environment variable access This function returns the value of the environment variable @var{var}, as a string. @var{var} should be a string. If @var{var} is undefined -in the environment, @code{getenv} returns @code{nil}. If returns -@samp{""} if @var{var} is set but null. Within Emacs, the environment -variable values are kept in the Lisp variable @code{process-environment}. +in the environment, @code{getenv} returns @code{nil}. It returns +@samp{""} if @var{var} is set but null. Within Emacs, a list of environment +variables and their values is kept in the variable @code{process-environment}. @example @group (getenv "USER") @result{} "lewis" @end group - +@end example + +The shell command @code{printenv} prints all or part of the environment: + +@example @group -lewis@@slug[10] % printenv -PATH=.:/user/lewis/bin:/usr/bin:/usr/local/bin +bash$ printenv +PATH=/usr/local/bin:/usr/bin:/bin USER=lewis @end group @group -TERM=ibmapa16 -SHELL=/bin/csh -HOME=/user/lewis +TERM=xterm +SHELL=/bin/bash +HOME=/home/lewis @end group +@dots{} @end example @end deffn -@c Emacs 19 feature -@deffn Command setenv variable &optional value +@deffn Command setenv variable &optional value substitute This command sets the value of the environment variable named @var{variable} to @var{value}. @var{variable} should be a string. Internally, Emacs Lisp can handle any string. However, normally @@ -955,8 +957,13 @@ of letters, digits and underscores, starting with a letter or underscore. Otherwise, errors may occur if subprocesses of Emacs try to access the value of @var{variable}. If @var{value} is omitted or -@code{nil}, @code{setenv} removes @var{variable} from the environment. -Otherwise, @var{value} should be a string. +@code{nil} (or, interactively, with a prefix argument), @code{setenv} +removes @var{variable} from the environment. Otherwise, @var{value} +should be a string. + +If the optional argument @var{substitute} is non-@code{nil}, Emacs +calls the function @code{substitute-env-vars} to expand any +environment variables in @var{value}. @code{setenv} works by modifying @code{process-environment}; binding that variable with @code{let} is also reasonable practice. @@ -973,14 +980,14 @@ @smallexample @group process-environment -@result{} ("l=/usr/stanford/lib/gnuemacs/lisp" - "PATH=.:/user/lewis/bin:/usr/class:/nfsusr/local/bin" +@result{} ("PATH=/usr/local/bin:/usr/bin:/bin" "USER=lewis" @end group @group - "TERM=ibmapa16" - "SHELL=/bin/csh" - "HOME=/user/lewis") + "TERM=xterm" + "SHELL=/bin/bash" + "HOME=/home/lewis" + @dots{}) @end group @end smallexample @@ -991,23 +998,21 @@ @defvar initial-environment This variable holds the list of environment variables Emacs inherited -from its parent process. It is computed during startup, see -@ref{Startup Summary}. +from its parent process when Emacs started. @end defvar @defvar path-separator -This variable holds a string which says which character separates +This variable holds a string that says which character separates directories in a search path (as found in an environment variable). Its -value is @code{":"} for Unix and GNU systems, and @code{";"} for MS-DOS -and MS-Windows. +value is @code{":"} for Unix and GNU systems, and @code{";"} for MS systems. @end defvar @defun parse-colon-path path -This function takes a search path string such as would be the value of +This function takes a search path string such as the value of the @code{PATH} environment variable, and splits it at the separators, -returning a list of directory names. @code{nil} in this list stands for -``use the current directory.'' Although the function's name says -``colon,'' it actually uses the value of @code{path-separator}. +returning a list of directory names. @code{nil} in this list means +the current directory. Although the function's name says +``colon'', it actually uses the value of @code{path-separator}. @example (parse-colon-path ":/foo:/bar") @@ -1022,30 +1027,32 @@ @defvar invocation-directory This variable holds the directory from which the Emacs executable was -invoked, or perhaps @code{nil} if that directory cannot be determined. +invoked, or @code{nil} if that directory cannot be determined. @end defvar @defvar installation-directory If non-@code{nil}, this is a directory within which to look for the -@file{lib-src} and @file{etc} subdirectories. This is non-@code{nil} +@file{lib-src} and @file{etc} subdirectories. In an installed Emacs, +it is normally @code{nil}. It is non-@code{nil} when Emacs can't find those directories in their standard installed locations, but can find them in a directory related somehow to the one -containing the Emacs executable. +containing the Emacs executable (i.e., @code{invocation-directory}). @end defvar @defun load-average &optional use-float -This function returns the current 1-minute, 5-minute, and 15-minute load -averages, in a list. +This function returns the current 1-minute, 5-minute, and 15-minute +system load averages, in a list. The load average indicates the +number of processes trying to run on the system. By default, the values are integers that are 100 times the system load -averages, which indicate the average number of processes trying to run. -If @var{use-float} is non-@code{nil}, then they are returned -as floating point numbers and without multiplying by 100. +averages, but if @var{use-float} is non-@code{nil}, then they are +returned as floating point numbers without multiplying by 100. If it is impossible to obtain the load average, this function signals an error. On some platforms, access to load averages requires installing Emacs as setuid or setgid so that it can read kernel information, and that usually isn't advisable. +@c FIXME which platforms are these? Are they still relevant? If the 1-minute load average is available, but the 5- or 15-minute averages are not, this function returns a shortened list containing @@ -1060,13 +1067,9 @@ (load-average t) @result{} (1.69 0.48 0.36) @end group - -@group -lewis@@rocky[5] % uptime - 11:55am up 1 day, 19:37, 3 users, - load average: 1.69, 0.48, 0.36 -@end group @end example + +The shell command @code{uptime} returns similar information. @end defun @defun emacs-pid @@ -1077,7 +1080,8 @@ @defvar tty-erase-char This variable holds the erase character that was selected in the system's terminal driver, before Emacs was started. -The value is @code{nil} if Emacs is running under a window system. +@c FIXME? Seems untrue since 23.1. For me, it is 0. +@c The value is @code{nil} if Emacs is running under a window system. @end defvar @node User Identification @@ -1107,27 +1111,18 @@ @end defopt @defun user-login-name &optional uid -If you don't specify @var{uid}, this function returns the name under -which the user is logged in. If the environment variable @code{LOGNAME} -is set, that value is used. Otherwise, if the environment variable -@code{USER} is set, that value is used. Otherwise, the value is based -on the effective @acronym{UID}, not the real @acronym{UID}. - -If you specify @var{uid}, the value is the user name that corresponds -to @var{uid} (which should be an integer), or @code{nil} if there is -no such user. - -@example -@group -(user-login-name) - @result{} "lewis" -@end group -@end example +This function returns the name under which the user is logged in. +It uses the environment variables @code{LOGNAME} or @code{USER} if +either is set. Otherwise, the value is based on the effective +@acronym{UID}, not the real @acronym{UID}. + +If you specify @var{uid} (a number), the result is the user name that +corresponds to @var{uid}, or @code{nil} if there is no such user. @end defun @defun user-real-login-name This function returns the user name corresponding to Emacs's real -@acronym{UID}. This ignores the effective @acronym{UID} and ignores the +@acronym{UID}. This ignores the effective @acronym{UID}, and the environment variables @code{LOGNAME} and @code{USER}. @end defun @@ -1135,16 +1130,8 @@ This function returns the full name of the logged-in user---or the value of the environment variable @code{NAME}, if that is set. -@c "Bil" is the correct spelling. -@example -@group -(user-full-name) - @result{} "Bil Lewis" -@end group -@end example - -If the Emacs job's user-id does not correspond to any known user (and -provided @code{NAME} is not set), the value is @code{"unknown"}. +If the Emacs process's user-id does not correspond to any known user (and +provided @code{NAME} is not set), the result is @code{"unknown"}. If @var{uid} is non-@code{nil}, then it should be a number (a user-id) or a string (a login name). Then @code{user-full-name} returns the full @@ -1164,14 +1151,8 @@ @defun user-real-uid This function returns the real @acronym{UID} of the user. -The value may be a floating point number. - -@example -@group -(user-real-uid) - @result{} 19 -@end group -@end example +The value may be a floating point number, in the (unlikely) event that +the UID is too large to fit in a Lisp integer. @end defun @defun user-uid ------------------------------------------------------------ revno: 107683 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-03-26 15:10:00 -0400 message: * emacs-lisp/bytecomp.el (byte-compile-constants-vector): Allow more than 197 variables. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-26 03:08:15 +0000 +++ lisp/ChangeLog 2012-03-26 19:10:00 +0000 @@ -1,3 +1,8 @@ +2012-03-26 Stefan Monnier + + * emacs-lisp/bytecomp.el (byte-compile-constants-vector): Allow more + than 197 variables. + 2012-03-26 Ami Fischman * vc/vc-git.el (vc-git-state): Avoid unnecessarily locking. === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2012-02-09 21:51:03 +0000 +++ lisp/emacs-lisp/bytecomp.el 2012-03-26 19:10:00 +0000 @@ -2694,7 +2694,8 @@ (limits '(5 ; Use the 1-byte varref codes, 63 ; 1-constlim ; 1-byte byte-constant codes, 255 ; 2-byte varref codes, - 65535)) ; 3-byte codes for the rest. + 65535 ; 3-byte codes for the rest. + 65535)) ; twice since we step when we swap. limit) (while (or rest other) (setq limit (car limits)) @@ -2708,8 +2709,8 @@ (setcdr (car rest) (setq i (1+ i))) (setq ret (cons (car rest) ret)))) (setq rest (cdr rest))) - (setq limits (cdr limits) - rest (prog1 other + (setq limits (cdr limits) ;Step + rest (prog1 other ;&Swap. (setq other rest)))) (apply 'vector (nreverse (mapcar 'car ret))))) ------------------------------------------------------------ revno: 107682 [merge] committer: Kenichi Handa branch nick: trunk timestamp: Mon 2012-03-26 14:43:36 +0900 message: dispextern.h (struct glyph): Fix previous change. Change the bit length of glyphless.ch to 25 (Bug#11082). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-26 04:06:31 +0000 +++ src/ChangeLog 2012-03-26 05:43:05 +0000 @@ -1,3 +1,8 @@ +2012-03-26 Kenichi Handa + + * dispextern.h (struct glyph): Fix previous change. Change the + bit length of glyphless.ch to 25 (Bug#11082). + 2012-03-26 Chong Yidong * keyboard.c (Vselection_inhibit_update_commands): New variable. === modified file 'src/dispextern.h' --- src/dispextern.h 2012-03-25 15:35:23 +0000 +++ src/dispextern.h 2012-03-26 05:43:05 +0000 @@ -454,7 +454,7 @@ /* Length of acronym or hexadecimal code string (at most 8). */ unsigned len : 4; /* Character to display. Actually we need only 22 bits. */ - unsigned ch : 22; + unsigned ch : 25; } glyphless; /* Used to compare all bit-fields above in one step. */ ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.