Now on revision 110557. ------------------------------------------------------------ revno: 110557 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-10-16 06:22:25 +0400 message: * editfns.c (get_system_name): Remove. * lisp.h (get_system_name): Remove prototype. * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes. (get_environ_db): Use Vsystem_name. Avoid call to strlen. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-15 16:49:57 +0000 +++ src/ChangeLog 2012-10-16 02:22:25 +0000 @@ -1,3 +1,10 @@ +2012-10-16 Dmitry Antipov + + * editfns.c (get_system_name): Remove. + * lisp.h (get_system_name): Remove prototype. + * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes. + (get_environ_db): Use Vsystem_name. Avoid call to strlen. + 2012-10-15 Daniel Colascione * dbusbind.c: Add comment explaining reason for previous change. === modified file 'src/editfns.c' --- src/editfns.c 2012-10-11 13:23:12 +0000 +++ src/editfns.c 2012-10-16 02:22:25 +0000 @@ -1339,15 +1339,6 @@ return Vsystem_name; } -const char * -get_system_name (void) -{ - if (STRINGP (Vsystem_name)) - return SSDATA (Vsystem_name); - else - return ""; -} - DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0, doc: /* Return the process ID of Emacs, as a number. */) (void) === modified file 'src/lisp.h' --- src/lisp.h 2012-10-12 15:19:54 +0000 +++ src/lisp.h 2012-10-16 02:22:25 +0000 @@ -3127,7 +3127,6 @@ extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, bool); extern void init_editfns (void); -const char *get_system_name (void); extern void syms_of_editfns (void); extern void set_time_zone_rule (const char *); === modified file 'src/xrdb.c' --- src/xrdb.c 2012-09-15 07:06:56 +0000 +++ src/xrdb.c 2012-10-16 02:22:25 +0000 @@ -24,7 +24,7 @@ #include #include #include - +#include #include #include "lisp.h" @@ -48,11 +48,6 @@ #include "keyboard.h" #endif -extern char *getenv (const char *); - -extern struct passwd *getpwuid (uid_t); -extern struct passwd *getpwnam (const char *); - char *x_get_string_resource (XrmDatabase rdb, const char *name, const char *class); static int file_p (const char *filename); @@ -429,8 +424,9 @@ { static char const xdefaults[] = ".Xdefaults-"; char *home = gethomedir (); - char const *host = get_system_name (); - ptrdiff_t pathsize = strlen (home) + sizeof xdefaults + strlen (host); + char const *host = SSDATA (Vsystem_name); + ptrdiff_t pathsize = (strlen (home) + sizeof xdefaults + + SBYTES (Vsystem_name)); path = xrealloc (home, pathsize); strcat (strcat (path, xdefaults), host); p = path; ------------------------------------------------------------ revno: 110556 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-10-15 17:57:20 -0400 message: (install-etc): Fix previous change diff: === modified file 'Makefile.in' --- Makefile.in 2012-10-15 20:56:07 +0000 +++ Makefile.in 2012-10-15 21:57:20 +0000 @@ -647,9 +647,9 @@ ( cd $${thisdir}; ${MKDIR_P} $(DESTDIR)${icondir}/$${dir} ) ; \ for icon in $${dir}/*.*; do \ [ -r $${icon} ] || continue ; \ - dest=`echo "$${icon}" | sed '$(TRANSFORM)'` ; \ + dest=`echo "$${icon}" | sed -e 's|.*/||' -e '$(TRANSFORM)'` ; \ ( cd $${thisdir}; \ - ${INSTALL_DATA} ${iconsrcdir}/$${icon} $(DESTDIR)${icondir}/$${dest} ) \ + ${INSTALL_DATA} ${iconsrcdir}/$${icon} $(DESTDIR)${icondir}/$${dir}/$${dest} ) \ || exit 1; \ done ; \ done ------------------------------------------------------------ revno: 110555 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-10-15 17:00:19 -0400 message: Improve previous NEWS change diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-10-15 20:56:07 +0000 +++ etc/NEWS 2012-10-15 21:00:19 +0000 @@ -62,10 +62,11 @@ to emacs-VERSION. --- -** The configure option `--program-transform-name' applies to more than -just the installed binaries. Now it also affects the man pages, icons, -and desktop file. It does not affect the info pages, since this would -break links between the various manuals. +** The configure options `--program-prefix', `--program-suffix', and +`--program-transform-name' apply to more than just the installed +binaries. Now they also affect the man pages, icons, and the +etc/emacs.desktop file; but not the info pages, since this would break +links between the various manuals. --- ** Emacs uses libtinfo in preference to libncurses, if available. ------------------------------------------------------------ revno: 110554 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-10-15 16:56:07 -0400 message: Apply program-transform-name etc in more places (bug#12536#34) * Makefile.in (install-man, install-etc): Apply $TRANSFORM. (clean): Delete etc/emacs.tmpdesktop. * .bzrignore: Add etc/emacs.tmpdesktop. * etc/NEWS: Mention this. Unrelated copyedits. diff: === modified file '.bzrignore' --- .bzrignore 2012-10-11 11:26:26 +0000 +++ .bzrignore 2012-10-15 20:56:07 +0000 @@ -66,6 +66,7 @@ !doc/lispintro/cons-*.pdf !doc/lispintro/drawers.pdf !doc/lispintro/lambda-*.pdf +etc/emacs.tmpdesktop etc/refcards/*.aux etc/refcards/*.log info/*.info === modified file 'ChangeLog' --- ChangeLog 2012-10-11 11:29:47 +0000 +++ ChangeLog 2012-10-15 20:56:07 +0000 @@ -1,3 +1,9 @@ +2012-10-15 Glenn Morris + + * Makefile.in (install-man, install-etc): + Apply $TRANSFORM. (Bug#12536#34) + (clean): Delete etc/emacs.tmpdesktop. + 2012-10-11 Kenichi Handa * .bzrignore: Add several files under admin/charsets. === modified file 'Makefile.in' --- Makefile.in 2012-09-29 22:01:57 +0000 +++ Makefile.in 2012-10-15 20:56:07 +0000 @@ -622,18 +622,24 @@ thisdir=`/bin/pwd`; \ cd ${mansrcdir}; \ for page in *.1; do \ + dest=`echo "$${page}" | sed '$(TRANSFORM)'`; \ (cd $${thisdir}; \ - ${INSTALL_DATA} ${mansrcdir}/$${page} $(DESTDIR)${man1dir}/$${page}); \ + ${INSTALL_DATA} ${mansrcdir}/$${page} $(DESTDIR)${man1dir}/$${dest}); \ ( [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ] ) || continue ; \ - rm -f $(DESTDIR)${man1dir}/$${page}.gz; \ - ${GZIP_PROG} -9n $(DESTDIR)${man1dir}/$${page}; \ + rm -f $(DESTDIR)${man1dir}/$${dest}.gz; \ + ${GZIP_PROG} -9n $(DESTDIR)${man1dir}/$${dest}; \ done ## Install those items from etc/ that need to end up elsewhere. install-etc: umask 022; ${MKDIR_P} $(DESTDIR)${desktopdir} - ${INSTALL_DATA} ${srcdir}/etc/emacs.desktop \ - $(DESTDIR)${desktopdir}/emacs.desktop + dest=`echo emacs | sed '$(TRANSFORM)'`; \ + tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \ + sed -e "/^Exec=emacs/ s/emacs/$${dest}/" \ + -e "/^Icon=emacs/ s/emacs/$${dest}/" \ + ${srcdir}/etc/emacs.desktop > $${tmp}; \ + ${INSTALL_DATA} $${tmp} $(DESTDIR)${desktopdir}/$${dest}.desktop; \ + rm -f $${tmp} thisdir=`/bin/pwd`; \ cd ${iconsrcdir} || exit 1; umask 022 ; \ for dir in */*/apps */*/mimetypes; do \ @@ -641,8 +647,9 @@ ( cd $${thisdir}; ${MKDIR_P} $(DESTDIR)${icondir}/$${dir} ) ; \ for icon in $${dir}/*.*; do \ [ -r $${icon} ] || continue ; \ + dest=`echo "$${icon}" | sed '$(TRANSFORM)'` ; \ ( cd $${thisdir}; \ - ${INSTALL_DATA} ${iconsrcdir}/$${icon} $(DESTDIR)${icondir}/$${icon} ) \ + ${INSTALL_DATA} ${iconsrcdir}/$${icon} $(DESTDIR)${icondir}/$${dest} ) \ || exit 1; \ done ; \ done @@ -729,6 +736,7 @@ ### ### Delete `.dvi' files here if they are not part of the distribution. clean: FRC + -rm -f etc/emacs.tmpdesktop (cd src; $(MAKE) $(MFLAGS) clean) (cd oldXMenu; $(MAKE) $(MFLAGS) clean) (cd lwlib; $(MAKE) $(MFLAGS) clean) === modified file 'etc/NEWS' --- etc/NEWS 2012-10-13 01:18:52 +0000 +++ etc/NEWS 2012-10-15 20:56:07 +0000 @@ -47,7 +47,7 @@ may be useful. --- -** The configuration option '--enable-use-lisp-union-type' has been +** The configure option '--enable-use-lisp-union-type' has been renamed to '--enable-check-lisp-object-type', as the resulting Lisp_Object type no longer uses a union to implement the compile time check that this option enables. @@ -62,6 +62,12 @@ to emacs-VERSION. --- +** The configure option `--program-transform-name' applies to more than +just the installed binaries. Now it also affects the man pages, icons, +and desktop file. It does not affect the info pages, since this would +break links between the various manuals. + +--- ** Emacs uses libtinfo in preference to libncurses, if available. --- @@ -203,7 +209,9 @@ --- *** Fullscreen and frame parameter fullscreen is supported. --- -*** A file dialog is used when open/saved is done from the menu/toolbar. +*** A file dialog is used for open/save operations initiated from the +menu/toolbar. + * Editing Changes in Emacs 24.3 @@ -415,8 +423,8 @@ channel keys found, if any. ** Flymake uses fringe bitmaps to indicate errors and warnings. -See flymake-fringe-indicator-position, flymake-error-bitmap and -flymake-warning-bitmap. +See `flymake-fringe-indicator-position', `flymake-error-bitmap' and +`flymake-warning-bitmap'. ** Follow mode @@ -634,6 +642,10 @@ * New Modes and Packages in Emacs 24.3 + +FIXME? erc-desktop-notifications.el, gv.el, profiler.el, +gnus-notifications.el, mm-archive.el + * Incompatible Lisp Changes in Emacs 24.3 @@ -848,7 +860,7 @@ ** Miscellaneous new functions: *** `autoloadp' -*** `autoload-do-load'. +*** `autoload-do-load' +++ *** `buffer-narrowed-p' tests if the buffer is narrowed. *** `file-name-base' returns a file name sans directory and extension. @@ -873,7 +885,7 @@ *** `automount-dir-prefix' *** `buffer-has-markers-at' -*** `macro-declaration-function' (use `macro-declarations-alist'). +*** `macro-declaration-function' (use `macro-declarations-alist') *** `window-system-version' *** `dired-pop-to-buffer' (use `dired-mark-pop-up') *** `query-replace-interactive' @@ -881,21 +893,20 @@ * Changes in Emacs 24.3 on non-free operating systems -** New configure.bat options on MS-Windows: - -*** --without-libxml2 omits support for libxml2, even if its presence -is detected. ++++ +** On MS Windows, you can pass --without-libxml2 to configure.bat to omit +support for libxml2, even if its presence is detected. ** When invoked with the -nw switch to run on the Windows text-mode terminal, Emacs now supports mouse highlight, help-echo (in the echo area), and -mouse-autoselect-window. +`mouse-autoselect-window'. -** Two new functions are available in Cygwin builds of Emacs: -cygwin-convert-path-from-windows and cygwin-convert-path-to-windows. +** Two new functions are available in Cygwin builds: +`cygwin-convert-path-from-windows' and `cygwin-convert-path-to-windows'. These functions allow Lisp code to access the Cygwin file-name mapping machinery to convert between Cygwin and Windows-native file names. -** On MS-Windows Vista and later Emacs now supports symbolic links. +** On MS Windows Vista and later Emacs now supports symbolic links. * Changes in Emacs 24.2 ------------------------------------------------------------ revno: 110553 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-10-15 12:49:57 -0400 message: * lisp/erc/erc.el (erc-log): Make it into a defsubst. (erc-with-server-buffer, define-erc-module, erc-with-buffer) (erc-with-all-buffers-of-server): Use `declare'. * lisp/erc/erc-backend.el (erc-log): Adjust autoload accordingly. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2012-10-07 02:07:46 +0000 +++ lisp/erc/ChangeLog 2012-10-15 16:49:57 +0000 @@ -1,3 +1,10 @@ +2012-10-15 Stefan Monnier + + * erc.el (erc-log): Make it into a defsubst. + (erc-with-server-buffer, define-erc-module, erc-with-buffer) + (erc-with-all-buffers-of-server): Use `declare'. + * erc-backend.el (erc-log): Adjust autoload accordingly. + 2012-10-07 Deniz Dogan * erc-log.el (erc-generate-log-file-name-function): @@ -42,8 +49,8 @@ 2012-08-21 Julien Danjou - * erc-match.el (erc-match-message): Use - `erc-match-exclude-server-buffer' not + * erc-match.el (erc-match-message): + Use `erc-match-exclude-server-buffer' not `erc-track-exclude-server-buffer'. 2012-08-20 Josh Feinstein @@ -56,8 +63,8 @@ (erc-lurker-threshold-time): New variables. (erc-lurker-maybe-trim, erc-lurker-initialize, erc-lurker-cleanup) (erc-hide-current-message-p, erc-canonicalize-server-name) - (erc-lurker-update-status, erc-lurker-p): New functions. Together - they maintain state about which users have spoken in the last + (erc-lurker-update-status, erc-lurker-p): New functions. + Together they maintain state about which users have spoken in the last erc-lurker-threshold-time, with all other users being considered lurkers whose messages of types in erc-lurker-hide-list will not be displayed by erc-display-message. @@ -192,7 +199,7 @@ * erc.el (erc-ssl): Made into a synonym for erc-tls, which provides a superset of the same functionality. - (erc-open-ssl-stream): Removed. + (erc-open-ssl-stream): Remove. (erc-open-tls-stream): Use `open-network-stream' instead of `open-tls-stream' directly to be able to use the built-in TLS support. === modified file 'lisp/erc/erc-backend.el' --- lisp/erc/erc-backend.el 2012-10-07 01:28:04 +0000 +++ lisp/erc/erc-backend.el 2012-10-15 16:49:57 +0000 @@ -100,7 +100,7 @@ (require 'erc-compat) (eval-when-compile (require 'cl)) (autoload 'erc-with-buffer "erc" nil nil 'macro) -(autoload 'erc-log "erc" nil nil 'macro) +(autoload 'erc-log "erc") ;;;; Variables and options === modified file 'lisp/erc/erc.el' --- lisp/erc/erc.el 2012-10-06 20:30:26 +0000 +++ lisp/erc/erc.el 2012-10-15 16:49:57 +0000 @@ -362,13 +362,12 @@ (defmacro erc-with-server-buffer (&rest body) "Execute BODY in the current ERC server buffer. If no server buffer exists, return nil." + (declare (indent 0) (debug (body))) (let ((buffer (make-symbol "buffer"))) `(let ((,buffer (erc-server-buffer))) (when (buffer-live-p ,buffer) (with-current-buffer ,buffer ,@body))))) -(put 'erc-with-server-buffer 'lisp-indent-function 0) -(put 'erc-with-server-buffer 'edebug-form-spec '(body)) (defstruct (erc-server-user (:type vector) :named) ;; User data @@ -1236,6 +1235,7 @@ 'erc-replace-insert)) ((remove-hook 'erc-insert-modify-hook 'erc-replace-insert)))" + (declare (doc-string 3)) (let* ((sn (symbol-name name)) (mode (intern (format "erc-%s-mode" (downcase sn)))) (group (intern (format "erc-%s" (downcase sn)))) @@ -1281,8 +1281,6 @@ (put ',enable 'definition-name ',name) (put ',disable 'definition-name ',name)))) -(put 'define-erc-module 'doc-string-elt 3) - (defun erc-once-with-server-event (event &rest forms) "Execute FORMS the next time EVENT occurs in the `current-buffer'. @@ -1334,10 +1332,10 @@ (add-hook hook fun nil nil) fun)) -(defmacro erc-log (string) +(defsubst erc-log (string) "Logs STRING if logging is on (see `erc-log-p')." - `(when erc-log-p - (erc-log-aux ,string))) + (when erc-log-p + (erc-log-aux string))) (defun erc-server-buffer () "Return the server buffer for the current buffer's process. @@ -1621,6 +1619,7 @@ See also `with-current-buffer'. \(fn (TARGET [PROCESS]) BODY...)" + (declare (indent 1) (debug ((form &optional form) body))) (let ((buf (make-symbol "buf")) (proc (make-symbol "proc")) (target (make-symbol "target")) @@ -1637,8 +1636,6 @@ (when (buffer-live-p ,buf) (with-current-buffer ,buf ,@body))))) -(put 'erc-with-buffer 'lisp-indent-function 1) -(put 'erc-with-buffer 'edebug-form-spec '((form &optional form) body)) (defun erc-get-buffer (target &optional proc) "Return the buffer matching TARGET in the process PROC. @@ -1688,6 +1685,7 @@ FORMS will be evaluated in all buffers having the process PROCESS and where PRED matches or in all buffers of the server process if PRED is nil." + (declare (indent 1) (debug (form form body))) ;; Make the evaluation have the correct order (let ((pre (make-symbol "pre")) (pro (make-symbol "pro"))) @@ -1701,8 +1699,6 @@ ;; Silence the byte-compiler by binding the result of mapcar to ;; a variable. res))) -(put 'erc-with-all-buffers-of-server 'lisp-indent-function 1) -(put 'erc-with-all-buffers-of-server 'edebug-form-spec '(form form body)) ;; (iswitchb-mode) will autoload iswitchb.el (defvar iswitchb-temp-buflist) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-15 10:10:17 +0000 +++ src/ChangeLog 2012-10-15 16:49:57 +0000 @@ -80,8 +80,7 @@ a file exists. This avoids expensive system calls on MS-Windows. (Bug#12587) - * w32.c (init_environment): Call 'check_existing' instead of - 'stat'. + * w32.c (init_environment): Call 'check_existing' instead of 'stat'. * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to determine whether a file exists and is not a directory. @@ -299,8 +298,8 @@ * w32heap.c: Include w32common.h. (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version) - (w32_minor_version, w32_build_number, w32_subtype): Remove - duplicate definitions. + (w32_minor_version, w32_build_number, w32_subtype): + Remove duplicate definitions. * w32fns.c: Include w32common.h; include w32heap.h only in WINDOWSNT. @@ -512,8 +511,8 @@ * nsterm.m (ns_in_resize): Remove (Bug#12479). (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove. - (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove - ns_in_resize check. + (ns_clear_frame, sendEvent, windowDidResize, drawRect:): + Remove ns_in_resize check. (ns_clear_frame_area): Remove resize handle code. * nsfns.m (ns_in_resize): Remove. @@ -560,8 +559,8 @@ * w32proc.c (stop_timer_thread): Fix declaration of 'err'. * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so - that time stamps of directories could also be changed. Don't - request the too broad GENERIC_WRITE, only the more restrictive + that time stamps of directories could also be changed. + Don't request the too broad GENERIC_WRITE, only the more restrictive FILE_WRITE_ATTRIBUTES access rights. * fileio.c (Fset_file_times): Special-case ignoring errors for ------------------------------------------------------------ revno: 110552 committer: Daniel Colascione branch nick: cyg timestamp: Mon 2012-10-15 02:10:17 -0800 message: Add comment for undef of "interface" diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-15 09:03:56 +0000 +++ src/ChangeLog 2012-10-15 10:10:17 +0000 @@ -1,3 +1,7 @@ +2012-10-15 Daniel Colascione + + * dbusbind.c: Add comment explaining reason for previous change. + 2012-10-15 Martin Rudalics * window.c (Fwindow_end): Rewrite check whether cached position === modified file 'src/dbusbind.c' --- src/dbusbind.c 2012-10-15 01:38:07 +0000 +++ src/dbusbind.c 2012-10-15 10:10:17 +0000 @@ -32,6 +32,10 @@ #define DBUS_NUM_MESSAGE_TYPES 5 #endif + +/* Some platforms define the symbol "interface", but we want to use it + * as a variable name below. */ + #ifdef interface #undef interface #endif ------------------------------------------------------------ revno: 110551 committer: martin rudalics branch nick: trunk timestamp: Mon 2012-10-15 11:03:56 +0200 message: Fix Fwindow_end's handling of cached position (Bug#12600). * window.c (Fwindow_end): Rewrite check whether cached position can be used (Bug#12600). (resize_frame_windows, grow_mini_window, shrink_mini_window): Set windows_or_buffers_changed. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-10-15 01:38:07 +0000 +++ src/ChangeLog 2012-10-15 09:03:56 +0000 @@ -1,3 +1,10 @@ +2012-10-15 Martin Rudalics + + * window.c (Fwindow_end): Rewrite check whether cached position + can be used (Bug#12600). + (resize_frame_windows, grow_mini_window, shrink_mini_window): + Set windows_or_buffers_changed. + 2012-10-15 Daniel Colascione * dbusbind.c: Fix cygw32 build break when compiling with dbus === modified file 'src/window.c' --- src/window.c 2012-10-07 22:31:58 +0000 +++ src/window.c 2012-10-15 09:03:56 +0000 @@ -1464,9 +1464,7 @@ #endif if (! NILP (update) - && ! (! NILP (w->window_end_valid) - && w->last_modified >= BUF_MODIFF (b) - && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b)) + && (windows_or_buffers_changed || NILP (w->window_end_valid)) && !noninteractive) { struct text_pos startp; @@ -3795,6 +3793,8 @@ (m, make_number (XINT (r->top_line) + XINT (r->total_lines))); } } + + windows_or_buffers_changed++; } @@ -4208,6 +4208,7 @@ w->last_modified = 0; w->last_overlay_modified = 0; + windows_or_buffers_changed++; adjust_glyphs (f); unblock_input (); } @@ -4245,6 +4246,7 @@ w->last_modified = 0; w->last_overlay_modified = 0; + windows_or_buffers_changed++; adjust_glyphs (f); unblock_input (); } ------------------------------------------------------------ revno: 110550 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-10-15 12:03:04 +0800 message: More documentation fixes for changes to defun, defmacro, etc. * doc/lispref/functions.texi (Anonymous Functions): Explicitly list the docstring, declare, and interactive arguments to lambda. (Defining Functions): Likewise for defun. (Inline Functions): Likewise for defsubst. (Declare Form): Tweak description. * doc/lispref/macros.texi (Defining Macros): defmacro is now a macro. Explicitly list the docstring and declare arguments. * emacs-lisp/byte-run.el (defsubst): Doc fix. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-10-13 01:18:52 +0000 +++ doc/lispref/ChangeLog 2012-10-15 04:03:04 +0000 @@ -1,3 +1,14 @@ +2012-10-15 Chong Yidong + + * macros.texi (Defining Macros): defmacro is now a macro. + Explicitly list the docstring and declare arguments. + + * functions.texi (Anonymous Functions): Explicitly list the + docstring, declare, and interactive arguments to lambda. + (Defining Functions): Likewise for defun. + (Inline Functions): Likewise for defsubst. + (Declare Form): Tweak description. + 2012-10-13 Chong Yidong * display.texi (ImageMagick Images): ImageMagick enabled by default. === modified file 'doc/lispref/functions.texi' --- doc/lispref/functions.texi 2012-10-05 07:38:05 +0000 +++ doc/lispref/functions.texi 2012-10-15 04:03:04 +0000 @@ -522,21 +522,20 @@ is called @dfn{defining a function}, and it is done with the @code{defun} special form. -@defmac defun name argument-list body-forms... +@defmac defun name args [doc] [declare] [interactive] body@dots{} @code{defun} is the usual way to define new Lisp functions. It -defines the symbol @var{name} as a function that looks like this: - -@example -(lambda @var{argument-list} . @var{body-forms}) -@end example - -@code{defun} stores this lambda expression in the function cell of -@var{name}. Its return value is @emph{undefined}. - -As described previously, @var{argument-list} is a list of argument -names and may include the keywords @code{&optional} and @code{&rest}. -Also, the first two of the @var{body-forms} may be a documentation -string and an interactive declaration. @xref{Lambda Components}. +defines the symbol @var{name} as a function with argument list +@var{args} and body forms given by @var{body}. Neither @var{name} nor +@var{args} should be quoted. + +@var{doc}, if present, should be a string specifying the function's +documentation string (@pxref{Function Documentation}). @var{declare}, +if present, should be a @code{declare} form specifying function +metadata (@pxref{Declare Form}). @var{interactive}, if present, +should be an @code{interactive} form specifying how the function is to +be called interactively (@pxref{Interactive Call}). + +The return value of @code{defun} is undefined. Here are some examples: @@ -582,14 +581,14 @@ @end defmac @cindex function aliases -@defun defalias name definition &optional docstring +@defun defalias name definition &optional doc @anchor{Definition of defalias} This special form defines the symbol @var{name} as a function, with definition @var{definition} (which can be any valid Lisp function). Its return value is @emph{undefined}. -If @var{docstring} is non-@code{nil}, it becomes the function -documentation of @var{name}. Otherwise, any documentation provided by +If @var{doc} 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 @@ -902,11 +901,14 @@ But typically you should use the @code{lambda} macro, or the @code{function} special form, or the @code{#'} read syntax: -@defmac lambda args body... -This macro returns an anonymous function with argument list @var{args} -and body forms given by @var{body}. In effect, this macro makes -@code{lambda} forms ``self-quoting'': evaluating a form whose @sc{car} -is @code{lambda} yields the form itself: +@defmac lambda args [doc] [interactive] body@dots{} +This macro returns an anonymous function with argument list +@var{args}, documentation string @var{doc} (if any), interactive spec +@var{interactive} (if any), and body forms given by @var{body}. + +In effect, this macro makes @code{lambda} forms ``self-quoting'': +evaluating a form whose @sc{car} is @code{lambda} yields the form +itself: @example (lambda (x) (* x x)) @@ -1169,13 +1171,13 @@ was first made obsolete---for example, a date or a release number. @end defun -@defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring +@defmac define-obsolete-function-alias obsolete-name current-name &optional when doc This convenience macro marks the function @var{obsolete-name} obsolete and also defines it as an alias for the function @var{current-name}. It is equivalent to the following: @example -(defalias @var{obsolete-name} @var{current-name} @var{docstring}) +(defalias @var{obsolete-name} @var{current-name} @var{doc}) (make-obsolete @var{obsolete-name} @var{current-name} @var{when}) @end example @end defmac @@ -1213,16 +1215,16 @@ @section Inline Functions @cindex inline functions -@defmac defsubst name argument-list body-forms... -Define an inline function. The syntax is exactly the same as -@code{defun} (@pxref{Defining Functions}). -@end defmac - - You can define an @dfn{inline function} by using @code{defsubst} -instead of @code{defun}. An inline function works just like an -ordinary function except for one thing: when you byte-compile a call + An @dfn{inline function} is a function that works just like an +ordinary function, except for one thing: when you byte-compile a call to the function (@pxref{Byte Compilation}), the function's definition -is expanded into the caller. +is expanded into the caller. To define an inline function, use +@code{defsubst} instead of @code{defun}. + +@defmac defsubst name args [doc] [declare] [interactive] body@dots{} +This macro defines an inline function. Its syntax is exactly the same +as @code{defun} (@pxref{Defining Functions}). +@end defmac Making a function inline often makes its function calls run faster. But it also has disadvantages. For one thing, it reduces flexibility; @@ -1266,16 +1268,13 @@ @anchor{Definition of declare} @defmac declare @var{specs}@dots{} This macro ignores its arguments and evaluates to @code{nil}; it has -no run-time effect. However, when a @code{declare} form occurs as the -@emph{very first form} in the body of a @code{defun} function -definition or a @code{defmacro} macro definition (@pxref{Defining -Macros}, for a description of @code{defmacro}), it appends the -properties specified by @var{specs} to the function or macro. This -work is specially performed by the @code{defun} and @code{defmacro} -macros. - -Note that if you put a @code{declare} form in an interactive function, -it should go before the @code{interactive} form. +no run-time effect. However, when a @code{declare} form occurs in the +@var{declare} argument of a @code{defun} or @code{defsubst} function +definition (@pxref{Defining Functions}) or a @code{defmacro} macro +definition (@pxref{Defining Macros}), it appends the properties +specified by @var{specs} to the function or macro. This work is +specially performed by @code{defun}, @code{defsubst}, and +@code{defmacro}. Each element in @var{specs} should have the form @code{(@var{property} @var{args}@dots{})}, which should not be quoted. These have the === modified file 'doc/lispref/macros.texi' --- doc/lispref/macros.texi 2012-09-30 09:18:38 +0000 +++ doc/lispref/macros.texi 2012-10-15 04:03:04 +0000 @@ -185,35 +185,38 @@ @node Defining Macros @section Defining Macros - A Lisp macro is a list whose @sc{car} is @code{macro}. Its @sc{cdr} should -be a function; expansion of the macro works by applying the function -(with @code{apply}) to the list of unevaluated argument-expressions -from the macro call. + A Lisp macro object is a list whose @sc{car} is @code{macro}, and +whose @sc{cdr} is a lambda expression. Expansion of the macro works +by applying the lambda expression (with @code{apply}) to the list of +@emph{unevaluated} arguments from the macro call. It is possible to use an anonymous Lisp macro just like an anonymous -function, but this is never done, because it does not make sense to pass -an anonymous macro to functionals such as @code{mapcar}. In practice, -all Lisp macros have names, and they are usually defined with the -special form @code{defmacro}. +function, but this is never done, because it does not make sense to +pass an anonymous macro to functionals such as @code{mapcar}. In +practice, all Lisp macros have names, and they are almost always +defined with the @code{defmacro} macro. -@defspec defmacro name argument-list body-forms@dots{} -@code{defmacro} defines the symbol @var{name} as a macro that looks -like this: +@defmac defmacro name args [doc] [declare] body@dots{} +@code{defmacro} defines the symbol @var{name} (which should not be +quoted) as a macro that looks like this: @example -(macro lambda @var{argument-list} . @var{body-forms}) +(macro lambda @var{args} . @var{body}) @end example -(Note that the @sc{cdr} of this list is a function---a lambda expression.) -This macro object is stored in the function cell of @var{name}. Its return -value is @emph{undefined}. +(Note that the @sc{cdr} of this list is a lambda expression.) This +macro object is stored in the function cell of @var{name}. The +meaning of @var{args} is the same as in a function, and the keywords +@code{&rest} and @code{&optional} may be used (@pxref{Argument List}). +Neither @var{name} nor @var{args} should be quoted. The return value +of @code{defmacro} is undefined. -The shape and meaning of @var{argument-list} is the same as in a -function, and the keywords @code{&rest} and @code{&optional} may be used -(@pxref{Argument List}). Macros may have a documentation string, but -any @code{interactive} declaration is ignored since macros cannot be -called interactively. -@end defspec +@var{doc}, if present, should be a string specifying the macro's +documentation string. @var{declare}, if present, should be a +@code{declare} form specifying metadata for the macro (@pxref{Declare +Form}). Note that macros cannot have interactive declarations, since +they cannot be called interactively. +@end defmac Macros often need to construct large list structures from a mixture of constants and nonconstant parts. To make this easier, use the === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-14 17:07:00 +0000 +++ lisp/ChangeLog 2012-10-15 04:03:04 +0000 @@ -1,3 +1,7 @@ +2012-10-15 Chong Yidong + + * emacs-lisp/byte-run.el (defsubst): Doc fix. + 2012-10-14 Eli Zaretskii * window.el (display-buffer): Doc fix. === modified file 'lisp/emacs-lisp/byte-run.el' --- lisp/emacs-lisp/byte-run.el 2012-09-25 04:13:02 +0000 +++ lisp/emacs-lisp/byte-run.el 2012-10-15 04:03:04 +0000 @@ -232,7 +232,8 @@ ;; fns))) (defmacro defsubst (name arglist &rest body) - "Define an inline function. The syntax is just like that of `defun'." + "Define an inline function. The syntax is just like that of `defun'. +\(fn NAME ARGLIST &optional DOCSTRING DECL &rest BODY)" (declare (debug defun) (doc-string 3)) (or (memq (get name 'byte-optimizer) '(nil byte-compile-inline-expand))