diff options
| author | Kenichi Handa | 2012-10-30 20:38:37 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-10-30 20:38:37 +0900 |
| commit | 6ccc848cd85e75d77d6b11a46f5f23f860db9ff5 (patch) | |
| tree | e10cb69f3bbe6f2d9616d3867f12bf035c70e0f8 | |
| parent | aee5b18ec3c7844ca125249914113eeaef04342c (diff) | |
| parent | fcc1acdadbeae00d8dcabeb6dccb20da9672af2c (diff) | |
| download | emacs-6ccc848cd85e75d77d6b11a46f5f23f860db9ff5.tar.gz emacs-6ccc848cd85e75d77d6b11a46f5f23f860db9ff5.zip | |
merge trun
174 files changed, 4606 insertions, 3024 deletions
| @@ -1,3 +1,31 @@ | |||
| 1 | 2012-10-26 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * Makefile.in (EMACS_NAME): New variable. | ||
| 4 | (EMACS, install-etc, uninstall): Use $EMACS_NAME. | ||
| 5 | |||
| 6 | * Makefile.in (EMACS, EMACSFULL): Transformations should not be | ||
| 7 | applied to $EXEEXT. | ||
| 8 | |||
| 9 | * Makefile.in (uninstall): Don't abort if some directories are missing. | ||
| 10 | Apply transformation rules to manual pages, desktop and icon files. | ||
| 11 | No more emacs22 icons to uninstall. | ||
| 12 | |||
| 13 | 2012-10-24 Glenn Morris <rgm@gnu.org> | ||
| 14 | |||
| 15 | * Makefile.in (install-etc, install-man): | ||
| 16 | Don't apply program transform to standard file suffixes. | ||
| 17 | |||
| 18 | 2012-10-23 Paul Eggert <eggert@cs.ucla.edu> | ||
| 19 | |||
| 20 | * configure.ac (_FORTIFY_SOURCE): Do not multiply define (Bug#12714). | ||
| 21 | This ports to Gentoo. Problem originally reported against coreutils, | ||
| 22 | but Emacs has it too. | ||
| 23 | |||
| 24 | 2012-10-23 Glenn Morris <rgm@gnu.org> | ||
| 25 | |||
| 26 | * Makefile.in (emacs_transform): Remove. | ||
| 27 | (install-man): Revert 2012-10-21 change. (Bug#12713) | ||
| 28 | |||
| 1 | 2012-10-21 Glenn Morris <rgm@gnu.org> | 29 | 2012-10-21 Glenn Morris <rgm@gnu.org> |
| 2 | 30 | ||
| 3 | * Makefile.in (install-etc): Don't install emacs22 icons. | 31 | * Makefile.in (install-etc): Don't install emacs22 icons. |
diff --git a/Makefile.in b/Makefile.in index d80496d8b7b..78630ef58ff 100644 --- a/Makefile.in +++ b/Makefile.in | |||
| @@ -259,8 +259,9 @@ GZIP_INFO = @GZIP_INFO@ | |||
| 259 | TRANSFORM = @program_transform_name@ | 259 | TRANSFORM = @program_transform_name@ |
| 260 | 260 | ||
| 261 | # What emacs should be called when installed. | 261 | # What emacs should be called when installed. |
| 262 | EMACS = `echo emacs${EXEEXT} | sed '$(TRANSFORM)'` | 262 | EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'` |
| 263 | EMACSFULL = `echo emacs-${version}${EXEEXT} | sed '$(TRANSFORM)'` | 263 | EMACS = ${EMACS_NAME}${EXEEXT} |
| 264 | EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT} | ||
| 264 | 265 | ||
| 265 | # Subdirectories to make recursively. | 266 | # Subdirectories to make recursively. |
| 266 | SUBDIR = lib lib-src src lisp leim | 267 | SUBDIR = lib lib-src src lisp leim |
| @@ -622,7 +623,7 @@ install-man: | |||
| 622 | thisdir=`/bin/pwd`; \ | 623 | thisdir=`/bin/pwd`; \ |
| 623 | cd ${mansrcdir}; \ | 624 | cd ${mansrcdir}; \ |
| 624 | for page in *.1; do \ | 625 | for page in *.1; do \ |
| 625 | dest=`echo "$${page}" | sed '$(TRANSFORM)'`; \ | 626 | dest=`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1; \ |
| 626 | (cd $${thisdir}; \ | 627 | (cd $${thisdir}; \ |
| 627 | ${INSTALL_DATA} ${mansrcdir}/$${page} $(DESTDIR)${man1dir}/$${dest}); \ | 628 | ${INSTALL_DATA} ${mansrcdir}/$${page} $(DESTDIR)${man1dir}/$${dest}); \ |
| 628 | ( [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ] ) || continue ; \ | 629 | ( [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ] ) || continue ; \ |
| @@ -631,17 +632,14 @@ install-man: | |||
| 631 | done | 632 | done |
| 632 | 633 | ||
| 633 | ## Install those items from etc/ that need to end up elsewhere. | 634 | ## Install those items from etc/ that need to end up elsewhere. |
| 634 | |||
| 635 | # Like EMACS, but without EXEEXT. | ||
| 636 | emacs_transform = `echo emacs | sed '$(TRANSFORM)'` | ||
| 637 | |||
| 638 | install-etc: | 635 | install-etc: |
| 639 | umask 022; ${MKDIR_P} $(DESTDIR)${desktopdir} | 636 | umask 022; ${MKDIR_P} $(DESTDIR)${desktopdir} |
| 640 | tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \ | 637 | tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \ |
| 641 | sed -e '/^Exec=emacs/ s/emacs/${emacs_transform}/' \ | 638 | emacs_name=`echo emacs | sed '$(TRANSFORM)'`; \ |
| 642 | -e '/^Icon=emacs/ s/emacs/${emacs_transform}/' \ | 639 | sed -e "/^Exec=emacs/ s/emacs/$${emacs_name}/" \ |
| 640 | -e "/^Icon=emacs/ s/emacs/$${emacs_name}/" \ | ||
| 643 | ${srcdir}/etc/emacs.desktop > $${tmp}; \ | 641 | ${srcdir}/etc/emacs.desktop > $${tmp}; \ |
| 644 | ${INSTALL_DATA} $${tmp} $(DESTDIR)${desktopdir}/${emacs_transform}.desktop; \ | 642 | ${INSTALL_DATA} $${tmp} $(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop; \ |
| 645 | rm -f $${tmp} | 643 | rm -f $${tmp} |
| 646 | thisdir=`/bin/pwd`; \ | 644 | thisdir=`/bin/pwd`; \ |
| 647 | cd ${iconsrcdir} || exit 1; umask 022 ; \ | 645 | cd ${iconsrcdir} || exit 1; umask 022 ; \ |
| @@ -650,7 +648,8 @@ install-etc: | |||
| 650 | ( cd $${thisdir}; ${MKDIR_P} $(DESTDIR)${icondir}/$${dir} ) ; \ | 648 | ( cd $${thisdir}; ${MKDIR_P} $(DESTDIR)${icondir}/$${dir} ) ; \ |
| 651 | for icon in $${dir}/emacs[.-]*; do \ | 649 | for icon in $${dir}/emacs[.-]*; do \ |
| 652 | [ -r $${icon} ] || continue ; \ | 650 | [ -r $${icon} ] || continue ; \ |
| 653 | dest=`echo "$${icon}" | sed -e 's|.*/||' -e '$(TRANSFORM)'` ; \ | 651 | ext=`echo "$${icon}" | sed -e 's|.*\.||'`; \ |
| 652 | dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\.$${ext}$$||" -e '$(TRANSFORM)'`.$${ext} ; \ | ||
| 654 | ( cd $${thisdir}; \ | 653 | ( cd $${thisdir}; \ |
| 655 | ${INSTALL_DATA} ${iconsrcdir}/$${icon} $(DESTDIR)${icondir}/$${dir}/$${dest} ) \ | 654 | ${INSTALL_DATA} ${iconsrcdir}/$${icon} $(DESTDIR)${icondir}/$${dir}/$${dest} ) \ |
| 656 | || exit 1; \ | 655 | || exit 1; \ |
| @@ -687,21 +686,28 @@ uninstall: | |||
| 687 | -rm -rf $(DESTDIR)${libexecdir}/emacs/${version} | 686 | -rm -rf $(DESTDIR)${libexecdir}/emacs/${version} |
| 688 | thisdir=`/bin/pwd`; \ | 687 | thisdir=`/bin/pwd`; \ |
| 689 | (info_misc=`cd doc/misc; ${MAKE} echo-info | sed '/ing directory/d'`; \ | 688 | (info_misc=`cd doc/misc; ${MAKE} echo-info | sed '/ing directory/d'`; \ |
| 690 | cd $(DESTDIR)${infodir} && \ | 689 | if cd $(DESTDIR)${infodir}; then \ |
| 691 | for elt in ${INFO_NONMISC} $${info_misc}; do \ | 690 | for elt in ${INFO_NONMISC} $${info_misc}; do \ |
| 692 | (cd $${thisdir}; \ | 691 | (cd $${thisdir}; \ |
| 693 | $(INSTALL_INFO) --remove --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \ | 692 | $(INSTALL_INFO) --remove --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \ |
| 694 | if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \ | 693 | if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \ |
| 695 | ext=.gz; else ext=; fi; \ | 694 | ext=.gz; else ext=; fi; \ |
| 696 | rm -f $$elt$$ext $$elt-[1-9]$$ext $$elt-[1-9][0-9]$$ext; \ | 695 | rm -f $$elt$$ext $$elt-[1-9]$$ext $$elt-[1-9][0-9]$$ext; \ |
| 697 | done;) | 696 | done; \ |
| 697 | fi) | ||
| 698 | (if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \ | 698 | (if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \ |
| 699 | ext=.gz; else ext=; fi; \ | 699 | ext=.gz; else ext=; fi; \ |
| 700 | cd ${mansrcdir} && for page in *.1; do \ | 700 | if cd ${mansrcdir}; then \ |
| 701 | rm -f $(DESTDIR)${man1dir}/$$page$$ext; done ) | 701 | for page in *.1; do \ |
| 702 | (cd $(DESTDIR)${bindir} && rm -f $(EMACSFULL) $(EMACS)) | 702 | rm -f $(DESTDIR)${man1dir}/`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1$$ext; done; \ |
| 703 | (cd $(DESTDIR)${icondir} && rm -f hicolor/*x*/apps/emacs.png hicolor/*x*/apps/emacs22.png hicolor/scalable/apps/emacs.svg hicolor/scalable/mimetypes/emacs-document.svg ) | 703 | fi) |
| 704 | -rm -f $(DESTDIR)${desktopdir}/emacs.desktop | 704 | (cd $(DESTDIR)${bindir} && rm -f $(EMACSFULL) $(EMACS) || true) |
| 705 | (if cd $(DESTDIR)${icondir}; then \ | ||
| 706 | rm -f hicolor/*x*/apps/${EMACS_NAME}.png \ | ||
| 707 | hicolor/scalable/apps/${EMACS_NAME}.svg \ | ||
| 708 | hicolor/scalable/mimetypes/`echo emacs-document | sed '$(TRANSFORM)'`.svg; \ | ||
| 709 | fi) | ||
| 710 | -rm -f $(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop | ||
| 705 | for file in snake-scores tetris-scores; do \ | 711 | for file in snake-scores tetris-scores; do \ |
| 706 | file=$(DESTDIR)${gamedir}/$${file}; \ | 712 | file=$(DESTDIR)${gamedir}/$${file}; \ |
| 707 | [ -s $${file} ] || rm -f $$file; \ | 713 | [ -s $${file} ] || rm -f $$file; \ |
diff --git a/autogen/config.in b/autogen/config.in index c5f32371dd7..8fe2170d89d 100644 --- a/autogen/config.in +++ b/autogen/config.in | |||
| @@ -144,7 +144,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 144 | 144 | ||
| 145 | /* Enable compile-time and run-time bounds-checking, and some warnings, | 145 | /* Enable compile-time and run-time bounds-checking, and some warnings, |
| 146 | without upsetting glibc 2.15+. */ | 146 | without upsetting glibc 2.15+. */ |
| 147 | #if defined __OPTIMIZE__ && __OPTIMIZE__ | 147 | #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ |
| 148 | # define _FORTIFY_SOURCE 2 | 148 | # define _FORTIFY_SOURCE 2 |
| 149 | #endif | 149 | #endif |
| 150 | 150 | ||
diff --git a/configure.ac b/configure.ac index 7104b9de170..4564bc3085e 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -743,7 +743,7 @@ else | |||
| 743 | AH_VERBATIM([FORTIFY_SOURCE], | 743 | AH_VERBATIM([FORTIFY_SOURCE], |
| 744 | [/* Enable compile-time and run-time bounds-checking, and some warnings, | 744 | [/* Enable compile-time and run-time bounds-checking, and some warnings, |
| 745 | without upsetting glibc 2.15+. */ | 745 | without upsetting glibc 2.15+. */ |
| 746 | #if defined __OPTIMIZE__ && __OPTIMIZE__ | 746 | #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ |
| 747 | # define _FORTIFY_SOURCE 2 | 747 | # define _FORTIFY_SOURCE 2 |
| 748 | #endif | 748 | #endif |
| 749 | ]) | 749 | ]) |
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 90beb08233d..ea5621e7ccf 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,53 @@ | |||
| 1 | 2012-10-29 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * dired.texi (Shell Commands in Dired): Document changes to the | ||
| 4 | dired-do-async-shell-command. | ||
| 5 | |||
| 6 | 2012-10-28 Glenn Morris <rgm@gnu.org> | ||
| 7 | |||
| 8 | * ack.texi (Acknowledgments): Mention gv.el. | ||
| 9 | |||
| 10 | 2012-10-27 Bastien Guerry <bzg@gnu.org> | ||
| 11 | |||
| 12 | * screen.texi (Menu Bar): Fix typo. | ||
| 13 | |||
| 14 | 2012-10-27 Chong Yidong <cyd@gnu.org> | ||
| 15 | |||
| 16 | * frames.texi (Mouse Avoidance): Mention new variable | ||
| 17 | mouse-avoidance-banish-position. | ||
| 18 | |||
| 19 | * programs.texi (Which Function): Which Function mode now works in | ||
| 20 | all major modes by default. | ||
| 21 | |||
| 22 | * mule.texi (Recognize Coding): Remove an unreferenced vindex. | ||
| 23 | |||
| 24 | * files.texi (Misc File Ops): Symbolic links on Windows only work | ||
| 25 | on Vista and later. | ||
| 26 | |||
| 27 | * building.texi (Compilation): Document compilation-always-kill. | ||
| 28 | |||
| 29 | * search.texi (Symbol Search): New node. | ||
| 30 | |||
| 31 | * package.texi (Package Menu): Document the "new" status. | ||
| 32 | |||
| 33 | * windows.texi (Window Choice): Don't refer to the obsolete | ||
| 34 | special-display feature. | ||
| 35 | |||
| 36 | 2012-10-24 Chong Yidong <cyd@gnu.org> | ||
| 37 | |||
| 38 | * mule.texi (Text Coding): set-buffer-file-coding-system can now | ||
| 39 | be invoked from the mode line. | ||
| 40 | |||
| 41 | * dired.texi (Dired Deletion, Marks vs Flags): Document Emacs 24.3 | ||
| 42 | changes to the mark and unmark commands. | ||
| 43 | (Comparison in Dired): Document chages to dired-diff. Remove M-=, | ||
| 44 | which is no longer bound to dired-backup-diff. | ||
| 45 | |||
| 46 | 2012-10-23 Bastien Guerry <bzg@gnu.org> | ||
| 47 | |||
| 48 | * text.texi (Org Authoring): Use a comma after @ref to avoid the | ||
| 49 | insertion of a period in the Info output. | ||
| 50 | |||
| 1 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> | 51 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 52 | ||
| 3 | * custom.texi (Hooks): Clarify that -hooks is deprecated. | 53 | * custom.texi (Hooks): Clarify that -hooks is deprecated. |
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi index 8d1e4221a6c..79710f4992b 100644 --- a/doc/emacs/ack.texi +++ b/doc/emacs/ack.texi | |||
| @@ -835,8 +835,9 @@ diffs; @file{css-mode.el} for Cascading Style Sheets; | |||
| 835 | client for the ``Music Player Daemon''; @file{smie.el}, a generic | 835 | client for the ``Music Player Daemon''; @file{smie.el}, a generic |
| 836 | indentation engine; and @file{pcase.el}, implementing ML-style pattern | 836 | indentation engine; and @file{pcase.el}, implementing ML-style pattern |
| 837 | matching. In Emacs 24, he integrated the lexical binding code, | 837 | matching. In Emacs 24, he integrated the lexical binding code, |
| 838 | and cleaned up the CL namespace (making it acceptable to use CL | 838 | cleaned up the CL namespace (making it acceptable to use CL |
| 839 | functions at runtime). | 839 | functions at runtime), and added generalized variables to core Emacs |
| 840 | Lisp. | ||
| 840 | 841 | ||
| 841 | @item | 842 | @item |
| 842 | Morioka Tomohiko wrote several packages for MIME support in Gnus and | 843 | Morioka Tomohiko wrote several packages for MIME support in Gnus and |
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index eaee16ac8d5..3a3630138de 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi | |||
| @@ -108,11 +108,14 @@ directory, which is the directory in which the previous compilation | |||
| 108 | was started. | 108 | was started. |
| 109 | 109 | ||
| 110 | @findex kill-compilation | 110 | @findex kill-compilation |
| 111 | @vindex compilation-always-kill | ||
| 111 | Starting a new compilation also kills any compilation already | 112 | Starting a new compilation also kills any compilation already |
| 112 | running in @file{*compilation*}, as the buffer can only handle one | 113 | running in @file{*compilation*}, as the buffer can only handle one |
| 113 | compilation at any time. However, @kbd{M-x compile} asks for | 114 | compilation at any time. However, @kbd{M-x compile} asks for |
| 114 | confirmation before actually killing a compilation that is running. | 115 | confirmation before actually killing a compilation that is running; to |
| 115 | You can also kill the compilation process with @kbd{M-x | 116 | always automatically kill the compilation without asking, change the |
| 117 | variable @code{compilation-always-kill} to @code{t}. You can also | ||
| 118 | kill a compilation process with the command @kbd{M-x | ||
| 116 | kill-compilation}. | 119 | kill-compilation}. |
| 117 | 120 | ||
| 118 | To run two compilations at once, start the first one, then rename | 121 | To run two compilations at once, start the first one, then rename |
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 0dcded78364..c08dc02b04b 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi | |||
| @@ -167,13 +167,14 @@ deletion, then delete the files that were flagged. | |||
| 167 | 167 | ||
| 168 | @table @kbd | 168 | @table @kbd |
| 169 | @item d | 169 | @item d |
| 170 | Flag this file for deletion. | 170 | Flag this file for deletion (@code{dired-flag-file-deletion}). |
| 171 | @item u | 171 | @item u |
| 172 | Remove deletion flag on this line. | 172 | Remove the deletion flag (@code{dired-unmark}). |
| 173 | @item @key{DEL} | 173 | @item @key{DEL} |
| 174 | Move point to previous line and remove the deletion flag on that line. | 174 | Move point to previous line and remove the deletion flag on that line |
| 175 | (@code{dired-unmark-backward}). | ||
| 175 | @item x | 176 | @item x |
| 176 | Delete the files that are flagged for deletion. | 177 | Delete files flagged for deletion (@code{dired-do-flagged-delete}). |
| 177 | @end table | 178 | @end table |
| 178 | 179 | ||
| 179 | @kindex d @r{(Dired)} | 180 | @kindex d @r{(Dired)} |
| @@ -182,8 +183,12 @@ Delete the files that are flagged for deletion. | |||
| 182 | the file and typing @kbd{d} (@code{dired-flag-file-deletion}). The | 183 | the file and typing @kbd{d} (@code{dired-flag-file-deletion}). The |
| 183 | deletion flag is visible as a @samp{D} at the beginning of the line. | 184 | deletion flag is visible as a @samp{D} at the beginning of the line. |
| 184 | This command moves point to the next line, so that repeated @kbd{d} | 185 | This command moves point to the next line, so that repeated @kbd{d} |
| 185 | commands flag successive files. A numeric argument serves as a repeat | 186 | commands flag successive files. A numeric prefix argument serves as a |
| 186 | count. | 187 | repeat count; a negative count means to flag preceding files. |
| 188 | |||
| 189 | If the region is active, the @kbd{d} command flags all files in the | ||
| 190 | region for deletion; in this case, the command does not move point, | ||
| 191 | and ignores any prefix argument. | ||
| 187 | 192 | ||
| 188 | @kindex u @r{(Dired deletion)} | 193 | @kindex u @r{(Dired deletion)} |
| 189 | @kindex DEL @r{(Dired)} | 194 | @kindex DEL @r{(Dired)} |
| @@ -194,14 +199,17 @@ can remove deletion flags using the commands @kbd{u} and @key{DEL}. | |||
| 194 | @kbd{u} (@code{dired-unmark}) works just like @kbd{d}, but removes | 199 | @kbd{u} (@code{dired-unmark}) works just like @kbd{d}, but removes |
| 195 | flags rather than making flags. @key{DEL} | 200 | flags rather than making flags. @key{DEL} |
| 196 | (@code{dired-unmark-backward}) moves upward, removing flags; it is | 201 | (@code{dired-unmark-backward}) moves upward, removing flags; it is |
| 197 | like @kbd{u} with argument @minus{}1. | 202 | like @kbd{u} with argument @minus{}1. A numeric prefix argument to |
| 203 | either command serves as a repeat count, with a negative count meaning | ||
| 204 | to unflag in the opposite direction. If the region is active, these | ||
| 205 | commands instead unflag all files in the region, without moving point. | ||
| 198 | 206 | ||
| 199 | @kindex x @r{(Dired)} | 207 | @kindex x @r{(Dired)} |
| 200 | @findex dired-do-flagged-delete | 208 | @findex dired-do-flagged-delete |
| 201 | To delete the flagged files, type @kbd{x} | 209 | To delete flagged files, type @kbd{x} |
| 202 | (@code{dired-do-flagged-delete}). This command first displays a list | 210 | (@code{dired-do-flagged-delete}). This command displays a list of all |
| 203 | of all the file names flagged for deletion, and requests confirmation | 211 | the file names flagged for deletion, and requests confirmation with |
| 204 | with @kbd{yes}. If you confirm, Dired deletes the flagged files, then | 212 | @kbd{yes}. If you confirm, Dired deletes the flagged files, then |
| 205 | deletes their lines from the text of the Dired buffer. The Dired | 213 | deletes their lines from the text of the Dired buffer. The Dired |
| 206 | buffer, with somewhat fewer lines, remains selected. | 214 | buffer, with somewhat fewer lines, remains selected. |
| 207 | 215 | ||
| @@ -387,10 +395,11 @@ and unflag files.) | |||
| 387 | @kindex m @r{(Dired)} | 395 | @kindex m @r{(Dired)} |
| 388 | @kindex * m @r{(Dired)} | 396 | @kindex * m @r{(Dired)} |
| 389 | @findex dired-mark | 397 | @findex dired-mark |
| 390 | Mark the current file with @samp{*} (@code{dired-mark}). With a numeric | 398 | Mark the current file with @samp{*} (@code{dired-mark}). If the |
| 391 | argument @var{n}, mark the next @var{n} files starting with the current | 399 | region is active, mark all files in the region instead; otherwise, if |
| 392 | file. (If @var{n} is negative, mark the previous @minus{}@var{n} | 400 | a numeric argument @var{n} is supplied, mark the next @var{n} files |
| 393 | files.) | 401 | instead, starting with the current file (if @var{n} is negative, mark |
| 402 | the previous @minus{}@var{n} files). | ||
| 394 | 403 | ||
| 395 | @item * * | 404 | @item * * |
| 396 | @kindex * * @r{(Dired)} | 405 | @kindex * * @r{(Dired)} |
| @@ -426,7 +435,11 @@ and @file{..} (@code{dired-mark-subdir-files}). | |||
| 426 | @kindex u @r{(Dired)} | 435 | @kindex u @r{(Dired)} |
| 427 | @kindex * u @r{(Dired)} | 436 | @kindex * u @r{(Dired)} |
| 428 | @findex dired-unmark | 437 | @findex dired-unmark |
| 429 | Remove any mark on this line (@code{dired-unmark}). | 438 | Remove any mark on this line (@code{dired-unmark}). If the region is |
| 439 | active, unmark all files in the region instead; otherwise, if a | ||
| 440 | numeric argument @var{n} is supplied, unmark the next @var{n} files | ||
| 441 | instead, starting with the current file (if @var{n} is negative, | ||
| 442 | unmark the previous @minus{}@var{n} files). | ||
| 430 | 443 | ||
| 431 | @item @key{DEL} | 444 | @item @key{DEL} |
| 432 | @itemx * @key{DEL} | 445 | @itemx * @key{DEL} |
| @@ -434,7 +447,11 @@ Remove any mark on this line (@code{dired-unmark}). | |||
| 434 | @findex dired-unmark-backward | 447 | @findex dired-unmark-backward |
| 435 | @cindex unmarking files (in Dired) | 448 | @cindex unmarking files (in Dired) |
| 436 | Move point to previous line and remove any mark on that line | 449 | Move point to previous line and remove any mark on that line |
| 437 | (@code{dired-unmark-backward}). | 450 | (@code{dired-unmark-backward}). If the region is active, unmark all |
| 451 | files in the region instead; otherwise, if a numeric argument @var{n} | ||
| 452 | is supplied, unmark the @var{n} preceding files instead, starting with | ||
| 453 | the current file (if @var{n} is negative, unmark the next | ||
| 454 | @minus{}@var{n} files). | ||
| 438 | 455 | ||
| 439 | @item * ! | 456 | @item * ! |
| 440 | @itemx U | 457 | @itemx U |
| @@ -782,15 +799,20 @@ more matches. @xref{Tags Search}. | |||
| 782 | @kindex ! @r{(Dired)} | 799 | @kindex ! @r{(Dired)} |
| 783 | @kindex X @r{(Dired)} | 800 | @kindex X @r{(Dired)} |
| 784 | The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a | 801 | The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a |
| 785 | shell command string in the minibuffer and runs that shell command on | 802 | shell command string in the minibuffer, and runs that shell command on |
| 786 | one or more files. The files that the shell command operates on are | 803 | one or more files. The files that the shell command operates on are |
| 787 | determined in the usual way for Dired commands (@pxref{Operating on | 804 | determined in the usual way for Dired commands (@pxref{Operating on |
| 788 | Files}). The command @kbd{X} is a synonym for @kbd{!}. | 805 | Files}). The command @kbd{X} is a synonym for @kbd{!}. |
| 789 | 806 | ||
| 790 | The command @kbd{&} (@code{dired-do-async-shell-command}) does the | 807 | The command @kbd{&} (@code{dired-do-async-shell-command}) does the |
| 791 | same, except that it runs the shell command asynchronously. You can | 808 | same, except that it runs the shell command asynchronously. (You can |
| 792 | also do this with @kbd{!}, by appending a @samp{&} character to the | 809 | also do this with @kbd{!}, by appending a @samp{&} character to the |
| 793 | end of the shell command. | 810 | end of the shell command.) When the command operates on more than one |
| 811 | file, it runs multiple parallel copies of the specified shell command, | ||
| 812 | one for each file. As an exception, if the specified shell command | ||
| 813 | ends in @samp{;} or @samp{;&}, the shell command is run in the | ||
| 814 | background on each file sequentially; Emacs waits for each invoked | ||
| 815 | shell command to terminate before running the next one. | ||
| 794 | 816 | ||
| 795 | For both @kbd{!} and @kbd{&}, the working directory for the shell | 817 | For both @kbd{!} and @kbd{&}, the working directory for the shell |
| 796 | command is the top-level directory of the Dired buffer. | 818 | command is the top-level directory of the Dired buffer. |
| @@ -936,32 +958,19 @@ default. | |||
| 936 | @cindex file comparison (in Dired) | 958 | @cindex file comparison (in Dired) |
| 937 | @cindex compare files (in Dired) | 959 | @cindex compare files (in Dired) |
| 938 | 960 | ||
| 939 | Here are two Dired commands that compare specified files using | ||
| 940 | @code{diff}. They show the output in a buffer using Diff mode | ||
| 941 | (@pxref{Comparing Files}). | ||
| 942 | |||
| 943 | @table @kbd | ||
| 944 | @item = | ||
| 945 | @findex dired-diff | 961 | @findex dired-diff |
| 946 | @kindex = @r{(Dired)} | 962 | @kindex = @r{(Dired)} |
| 947 | Compare the current file (the file at point) with another file (the | 963 | The @kbd{=} (@code{dired-diff}) command compares the current file |
| 948 | file at the mark) using the @code{diff} program (@code{dired-diff}). | 964 | (the file at point) with another file (read using the minibuffer) |
| 949 | The file at the mark is the first argument of @code{diff}, and the | 965 | using the @command{diff} program. The file specified with the |
| 950 | file at point is the second argument. This refers to the ordinary | 966 | minibuffer is the first argument of @command{diff}, and file at point |
| 951 | Emacs mark, not Dired marks; use @kbd{C-@key{SPC}} | 967 | is the second argument. The output of the @command{diff} program is |
| 952 | (@code{set-mark-command}) to set the mark at the first file's line | 968 | shown in a buffer using Diff mode (@pxref{Comparing Files}). |
| 953 | (@pxref{Setting Mark}). | 969 | |
| 954 | 970 | If the region is active, the default for the file read using the | |
| 955 | @findex dired-backup-diff | 971 | minibuffer is the file at the mark (i.e.@: the ordinary Emacs mark, |
| 956 | @kindex M-= @r{(Dired)} | 972 | not a Dired mark; @pxref{Setting Mark}). Otherwise, if the file at |
| 957 | @item M-= | 973 | point has a backup file (@pxref{Backup}), that is the default. |
| 958 | Compare the current file with its latest backup file | ||
| 959 | (@code{dired-backup-diff}). If the current file is itself a backup, | ||
| 960 | compare it with the file it is a backup of; this way, you can compare | ||
| 961 | a file with any one of its backups. | ||
| 962 | |||
| 963 | The backup file is the first file given to @code{diff}. | ||
| 964 | @end table | ||
| 965 | 974 | ||
| 966 | @node Subdirectories in Dired | 975 | @node Subdirectories in Dired |
| 967 | @section Subdirectories in Dired | 976 | @section Subdirectories in Dired |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index a2eaaf673e5..e7e0feb9e88 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -373,6 +373,7 @@ Searching and Replacement | |||
| 373 | * Incremental Search:: Search happens as you type the string. | 373 | * Incremental Search:: Search happens as you type the string. |
| 374 | * Nonincremental Search:: Specify entire string and then search. | 374 | * Nonincremental Search:: Specify entire string and then search. |
| 375 | * Word Search:: Search for sequence of words. | 375 | * Word Search:: Search for sequence of words. |
| 376 | * Symbol Search:: Search for a source code symbol. | ||
| 376 | * Regexp Search:: Search for match for a regexp. | 377 | * Regexp Search:: Search for match for a regexp. |
| 377 | * Regexps:: Syntax of regular expressions. | 378 | * Regexps:: Syntax of regular expressions. |
| 378 | * Regexp Backslash:: Regular expression constructs starting with `\'. | 379 | * Regexp Backslash:: Regular expression constructs starting with `\'. |
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index e12bb385653..36cd3658e2d 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1564,9 +1564,8 @@ open file @var{linkname} will refer to whatever file is named | |||
| 1564 | @var{target} at the time the opening is done, or will get an error if | 1564 | @var{target} at the time the opening is done, or will get an error if |
| 1565 | the name @var{target} is nonexistent at that time. This command does | 1565 | the name @var{target} is nonexistent at that time. This command does |
| 1566 | not expand the argument @var{target}, so that it allows you to specify | 1566 | not expand the argument @var{target}, so that it allows you to specify |
| 1567 | a relative name as the target of the link. Not all systems support | 1567 | a relative name as the target of the link. On MS-Windows, this |
| 1568 | symbolic links; on systems that don't support them, this command is | 1568 | command works only on MS Windows Vista and later. |
| 1569 | not defined. | ||
| 1570 | 1569 | ||
| 1571 | @kindex C-x i | 1570 | @kindex C-x i |
| 1572 | @findex insert-file | 1571 | @findex insert-file |
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index e1b849e630e..0ce5c64c0eb 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi | |||
| @@ -1092,17 +1092,19 @@ to various values to move the mouse in several ways: | |||
| 1092 | 1092 | ||
| 1093 | @table @code | 1093 | @table @code |
| 1094 | @item banish | 1094 | @item banish |
| 1095 | Move the mouse to the upper-right corner on any key-press; | 1095 | Move the pointer to a corner of the frame on any key-press. You can |
| 1096 | customize the variable @code{mouse-avoidance-banish-position} to | ||
| 1097 | specify where the pointer goes when it is banished. | ||
| 1096 | @item exile | 1098 | @item exile |
| 1097 | Move the mouse to the corner only if the cursor gets too close, | 1099 | Banish the pointer only if the cursor gets too close, and allow it to |
| 1098 | and allow it to return once the cursor is out of the way; | 1100 | return once the cursor is out of the way. |
| 1099 | @item jump | 1101 | @item jump |
| 1100 | If the cursor gets too close to the mouse, displace the mouse | 1102 | If the cursor gets too close to the pointer, displace the pointer by a |
| 1101 | a random distance & direction; | 1103 | random distance and direction. |
| 1102 | @item animate | 1104 | @item animate |
| 1103 | As @code{jump}, but shows steps along the way for illusion of motion; | 1105 | As @code{jump}, but shows steps along the way for illusion of motion. |
| 1104 | @item cat-and-mouse | 1106 | @item cat-and-mouse |
| 1105 | The same as @code{animate}; | 1107 | The same as @code{animate}. |
| 1106 | @item proteus | 1108 | @item proteus |
| 1107 | As @code{animate}, but changes the shape of the mouse pointer too. | 1109 | As @code{animate}, but changes the shape of the mouse pointer too. |
| 1108 | @end table | 1110 | @end table |
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 1dfae79c788..ff0d43c566a 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi | |||
| @@ -920,7 +920,6 @@ Unlike the previous two, this variable does not override any | |||
| 920 | @samp{-*-coding:-*-} tag. | 920 | @samp{-*-coding:-*-} tag. |
| 921 | 921 | ||
| 922 | @c FIXME? This seems somewhat out of place. Move to the Rmail section? | 922 | @c FIXME? This seems somewhat out of place. Move to the Rmail section? |
| 923 | @vindex rmail-decode-mime-charset | ||
| 924 | @vindex rmail-file-coding-system | 923 | @vindex rmail-file-coding-system |
| 925 | When you get new mail in Rmail, each message is translated | 924 | When you get new mail in Rmail, each message is translated |
| 926 | automatically from the coding system it is written in, as if it were a | 925 | automatically from the coding system it is written in, as if it were a |
| @@ -1040,12 +1039,16 @@ decoding it using coding system @var{right} instead. | |||
| 1040 | @findex set-buffer-file-coding-system | 1039 | @findex set-buffer-file-coding-system |
| 1041 | The command @kbd{C-x @key{RET} f} | 1040 | The command @kbd{C-x @key{RET} f} |
| 1042 | (@code{set-buffer-file-coding-system}) sets the file coding system for | 1041 | (@code{set-buffer-file-coding-system}) sets the file coding system for |
| 1043 | the current buffer---in other words, it says which coding system to | 1042 | the current buffer (i.e.@: the coding system to use when saving or |
| 1044 | use when saving or reverting the visited file. You specify which | 1043 | reverting the file). You specify which coding system using the |
| 1045 | coding system using the minibuffer. If you specify a coding system | 1044 | minibuffer. You can also invoke this command by clicking with |
| 1046 | that cannot handle all of the characters in the buffer, Emacs warns | 1045 | @kbd{Mouse-3} on the coding system indicator in the mode line |
| 1047 | you about the troublesome characters when you actually save the | 1046 | (@pxref{Mode Line}). |
| 1048 | buffer. | 1047 | |
| 1048 | If you specify a coding system that cannot handle all the characters | ||
| 1049 | in the buffer, Emacs will warn you about the troublesome characters, | ||
| 1050 | and ask you to choose another coding system, when you try to save the | ||
| 1051 | buffer (@pxref{Output Coding}). | ||
| 1049 | 1052 | ||
| 1050 | @cindex specify end-of-line conversion | 1053 | @cindex specify end-of-line conversion |
| 1051 | You can also use this command to specify the end-of-line conversion | 1054 | You can also use this command to specify the end-of-line conversion |
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 4435590536f..df87cf9cb23 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi | |||
| @@ -62,8 +62,12 @@ The package's status---normally one of @samp{available} (can be | |||
| 62 | downloaded from the package archive), @samp{installed}, or | 62 | downloaded from the package archive), @samp{installed}, or |
| 63 | @samp{built-in} (included in Emacs by default). | 63 | @samp{built-in} (included in Emacs by default). |
| 64 | 64 | ||
| 65 | In some instances, the status can be @samp{held}, @samp{disabled}, or | 65 | The status can also be @samp{new}. This is equivalent to |
| 66 | @samp{obsolete}. @xref{Package Installation}. | 66 | @samp{available}, except that it means the package became newly |
| 67 | available on the package archive after your last invocation of | ||
| 68 | @kbd{M-x list-packages}. In other instances, a package may have the | ||
| 69 | status @samp{held}, @samp{disabled}, or @samp{obsolete}. | ||
| 70 | @xref{Package Installation}. | ||
| 67 | 71 | ||
| 68 | @item | 72 | @item |
| 69 | A short description of the package. | 73 | A short description of the package. |
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index e5340655770..b5bb33ad666 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -326,12 +326,13 @@ as you move around in a buffer. | |||
| 326 | @findex which-function-mode | 326 | @findex which-function-mode |
| 327 | @vindex which-func-modes | 327 | @vindex which-func-modes |
| 328 | To either enable or disable Which Function mode, use the command | 328 | To either enable or disable Which Function mode, use the command |
| 329 | @kbd{M-x which-function-mode}. Although Which Function mode is a | 329 | @kbd{M-x which-function-mode}. Which Function mode is a global minor |
| 330 | global minor mode, it takes effect only in certain major modes: those | 330 | mode. By default, it takes effect in all major modes major modes that |
| 331 | listed in the variable @code{which-func-modes}. If the value of | 331 | know how to support it (i.e.@: all the major modes that support |
| 332 | @code{which-func-modes} is @code{t} rather than a list of modes, then | 332 | Imenu). You can restrict it to a specific list of major modes by |
| 333 | Which Function mode applies to all major modes that know how to | 333 | changing the value of the variable @code{which-func-modes} from |
| 334 | support it---in other words, all the major modes that support Imenu. | 334 | @code{t} (which means to support all available major modes) to a list |
| 335 | of major mode names. | ||
| 335 | 336 | ||
| 336 | @node Program Indent | 337 | @node Program Indent |
| 337 | @section Indentation for Programs | 338 | @section Indentation for Programs |
diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi index 989cf998bfd..2b8edaf9375 100644 --- a/doc/emacs/screen.texi +++ b/doc/emacs/screen.texi | |||
| @@ -314,5 +314,5 @@ the echo area. You can use the up and down arrow keys to move through | |||
| 314 | the menu to different items, and then you can type @key{RET} to select | 314 | the menu to different items, and then you can type @key{RET} to select |
| 315 | the item. Each menu item is also designated by a letter or digit | 315 | the item. Each menu item is also designated by a letter or digit |
| 316 | (usually the initial of some word in the item's name). This letter or | 316 | (usually the initial of some word in the item's name). This letter or |
| 317 | digit is separated from the item name by @samp{=>}. You can type the | 317 | digit is separated from the item name by @samp{==>}. You can type the |
| 318 | item's letter or digit to select the item. | 318 | item's letter or digit to select the item. |
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 7e46e416219..7dc5855cdfc 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -21,6 +21,7 @@ thing, but search for patterns instead of fixed strings. | |||
| 21 | * Incremental Search:: Search happens as you type the string. | 21 | * Incremental Search:: Search happens as you type the string. |
| 22 | * Nonincremental Search:: Specify entire string and then search. | 22 | * Nonincremental Search:: Specify entire string and then search. |
| 23 | * Word Search:: Search for sequence of words. | 23 | * Word Search:: Search for sequence of words. |
| 24 | * Symbol Search:: Search for a source code symbol. | ||
| 24 | * Regexp Search:: Search for match for a regexp. | 25 | * Regexp Search:: Search for match for a regexp. |
| 25 | * Regexps:: Syntax of regular expressions. | 26 | * Regexps:: Syntax of regular expressions. |
| 26 | * Regexp Backslash:: Regular expression constructs starting with `\'. | 27 | * Regexp Backslash:: Regular expression constructs starting with `\'. |
| @@ -467,6 +468,47 @@ the search string can match part of a word, so that the matching | |||
| 467 | proceeds incrementally as you type. This additional laxity does not | 468 | proceeds incrementally as you type. This additional laxity does not |
| 468 | apply to the lazy highlight, which always matches whole words. | 469 | apply to the lazy highlight, which always matches whole words. |
| 469 | 470 | ||
| 471 | @node Symbol Search | ||
| 472 | @section Symbol Search | ||
| 473 | @cindex symbol search | ||
| 474 | |||
| 475 | A @dfn{symbol search} is much like an ordinary search, except that | ||
| 476 | the boundaries of the search must match the boundaries of a symbol. | ||
| 477 | The meaning of @dfn{symbol} in this context depends on the major mode, | ||
| 478 | and usually refers to a source code token, such as a Lisp symbol in | ||
| 479 | Emacs Lisp mode. For instance, if you perform an incremental symbol | ||
| 480 | search for the Lisp symbol @code{forward-word}, it would not match | ||
| 481 | @code{isearch-forward-word}. This feature is thus mainly useful for | ||
| 482 | searching source code. | ||
| 483 | |||
| 484 | @table @kbd | ||
| 485 | @item M-s _ | ||
| 486 | If incremental search is active, toggle symbol search mode | ||
| 487 | (@code{isearch-toggle-symbol}); otherwise, begin an incremental | ||
| 488 | forward symbol search (@code{isearch-forward-symbol}). | ||
| 489 | @item M-s _ @key{RET} @var{symbol} @key{RET} | ||
| 490 | Search forward for @var{symbol}, nonincrementally. | ||
| 491 | @item M-s _ C-r @key{RET} @var{symbol} @key{RET} | ||
| 492 | Search backward for @var{symbol}, nonincrementally. | ||
| 493 | @end table | ||
| 494 | |||
| 495 | @kindex M-s _ | ||
| 496 | @findex isearch-forward-symbol | ||
| 497 | To begin a forward incremental symbol search, type @kbd{M-s _}. If | ||
| 498 | incremental search is not already active, this runs the command | ||
| 499 | @code{isearch-forward-symbol}. If incremental search is already | ||
| 500 | active, @kbd{M-s _} switches to a symbol search, preserving the | ||
| 501 | direction of the search and the current search string; you can disable | ||
| 502 | symbol search by typing @kbd{M-s _} again. In incremental symbol | ||
| 503 | search, only the beginning of the search string is required to match | ||
| 504 | the beginning of a symbol. | ||
| 505 | |||
| 506 | To begin a nonincremental symbol search, type @kbd{M-s _ @key{RET}} | ||
| 507 | for a forward search, or @kbd{M-s _ C-r @key{RET}} or a backward | ||
| 508 | search. In nonincremental symbol searches, the beginning and end of | ||
| 509 | the search string are required to match the beginning and end of a | ||
| 510 | symbol, respectively. | ||
| 511 | |||
| 470 | @node Regexp Search | 512 | @node Regexp Search |
| 471 | @section Regular Expression Search | 513 | @section Regular Expression Search |
| 472 | @cindex regexp search | 514 | @cindex regexp search |
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index f10e78e17ad..6e895d3ac3c 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi | |||
| @@ -1399,7 +1399,7 @@ This is an example. | |||
| 1399 | #+end_example | 1399 | #+end_example |
| 1400 | @end example | 1400 | @end example |
| 1401 | 1401 | ||
| 1402 | For further details, see @ref{Exporting,,,org, The Org Manual} and | 1402 | For further details, @ref{Exporting,,,org, The Org Manual}, and |
| 1403 | @ref{Publishing,,,org, The Org Manual}. | 1403 | @ref{Publishing,,,org, The Org Manual}. |
| 1404 | 1404 | ||
| 1405 | @node TeX Mode | 1405 | @node TeX Mode |
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 04d1353006f..f87da5f3913 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi | |||
| @@ -384,12 +384,6 @@ Otherwise, if the buffer is already displayed in an existing window, | |||
| 384 | are considered, but windows on other frames are also reusable if you | 384 | are considered, but windows on other frames are also reusable if you |
| 385 | change @code{pop-up-frames} (see below) to @code{t}. | 385 | change @code{pop-up-frames} (see below) to @code{t}. |
| 386 | 386 | ||
| 387 | @item | ||
| 388 | Otherwise, if you specified that the buffer should be displayed in a | ||
| 389 | special frame by customizing @code{special-display-buffer-names} or | ||
| 390 | @code{special-display-regexps}, do so. @xref{Choosing Window | ||
| 391 | Options,,, elisp, The Emacs Lisp Reference Manual}. | ||
| 392 | |||
| 393 | @vindex pop-up-frames | 387 | @vindex pop-up-frames |
| 394 | @item | 388 | @item |
| 395 | Otherwise, optionally create a new frame and display the buffer there. | 389 | Otherwise, optionally create a new frame and display the buffer there. |
diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog index 6c524f5a0ae..396e3857c58 100644 --- a/doc/lispintro/ChangeLog +++ b/doc/lispintro/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-10-24 Paul Eggert <eggert@penguin.cs.ucla.edu> | ||
| 2 | |||
| 3 | * emacs-lisp-intro.texi (Files List): | ||
| 4 | Update manual for new time stamp format (Bug#12706). | ||
| 5 | |||
| 1 | 2012-10-17 Gregor Zattler <grfz@gmx.de> (tiny change) | 6 | 2012-10-17 Gregor Zattler <grfz@gmx.de> (tiny change) |
| 2 | 7 | ||
| 3 | * emacs-lisp-intro.texi (Narrowing advantages): | 8 | * emacs-lisp-intro.texi (Narrowing advantages): |
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 70ddb81c776..f885d6c15e8 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi | |||
| @@ -238,7 +238,7 @@ GNU Press, @hfill @uref{http://www.fsf.org/campaigns/gnu-press/}@* | |||
| 238 | a division of the @hfill email: @email{sales@@fsf.org}@* | 238 | a division of the @hfill email: @email{sales@@fsf.org}@* |
| 239 | Free Software Foundation, Inc. @hfill Tel: +1 (617) 542-5942@* | 239 | Free Software Foundation, Inc. @hfill Tel: +1 (617) 542-5942@* |
| 240 | 51 Franklin Street, Fifth Floor @hfill Fax: +1 (617) 542-2652@* | 240 | 51 Franklin Street, Fifth Floor @hfill Fax: +1 (617) 542-2652@* |
| 241 | Boston, MA 02110-1301 USA | 241 | Boston, MA 02110-1301 USA |
| 242 | @end iftex | 242 | @end iftex |
| 243 | 243 | ||
| 244 | @ifnottex | 244 | @ifnottex |
| @@ -249,7 +249,7 @@ GNU Press, http://www.fsf.org/campaigns/gnu-press/ | |||
| 249 | a division of the email: sales@@fsf.org | 249 | a division of the email: sales@@fsf.org |
| 250 | Free Software Foundation, Inc. Tel: +1 (617) 542-5942 | 250 | Free Software Foundation, Inc. Tel: +1 (617) 542-5942 |
| 251 | 51 Franklin Street, Fifth Floor Fax: +1 (617) 542-2652 | 251 | 51 Franklin Street, Fifth Floor Fax: +1 (617) 542-2652 |
| 252 | Boston, MA 02110-1301 USA | 252 | Boston, MA 02110-1301 USA |
| 253 | @end example | 253 | @end example |
| 254 | @end ifnottex | 254 | @end ifnottex |
| 255 | 255 | ||
| @@ -15680,11 +15680,11 @@ nil | |||
| 15680 | 100 | 15680 | 100 |
| 15681 | @end group | 15681 | @end group |
| 15682 | @group | 15682 | @group |
| 15683 | (17733 259) | 15683 | (20615 27034 579989 697000) |
| 15684 | (17491 28834) | 15684 | (17905 55681 0 0) |
| 15685 | (17596 62124) | 15685 | (20615 26327 734791 805000) |
| 15686 | 13157 | 15686 | 13188 |
| 15687 | "-rw-rw-r--" | 15687 | "-rw-r--r--" |
| 15688 | @end group | 15688 | @end group |
| 15689 | @group | 15689 | @group |
| 15690 | nil | 15690 | nil |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 26765e7a384..eca39e54203 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,86 @@ | |||
| 1 | 2012-10-30 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * variables.texi (Generalized Variables): Fix typo. | ||
| 4 | |||
| 5 | 2012-10-30 Chong Yidong <cyd@gnu.org> | ||
| 6 | |||
| 7 | * symbols.texi (Symbol Plists): Document function-get. | ||
| 8 | |||
| 9 | * loading.texi (Autoload): Document autoloadp, autoload-do-load. | ||
| 10 | |||
| 11 | * frames.texi (Visibility of Frames): Document tty-top-frame. | ||
| 12 | |||
| 13 | 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 14 | |||
| 15 | * keymaps.texi (Format of Keymaps): Document the multiple | ||
| 16 | inheritance format. | ||
| 17 | |||
| 18 | 2012-10-28 Martin Rudalics <rudalics@gmx.at> | ||
| 19 | |||
| 20 | * windows.texi (Basic Windows): Reformulate description of live, | ||
| 21 | internal and valid windows. | ||
| 22 | (Cyclic Window Ordering): Describe new argument of | ||
| 23 | get-lru-window and get-largest-window. Add description of | ||
| 24 | window-in-direction. | ||
| 25 | |||
| 26 | 2012-10-27 Glenn Morris <rgm@gnu.org> | ||
| 27 | |||
| 28 | * variables.texi (Generalized Variables): New section, | ||
| 29 | adapted from misc/cl.texi. | ||
| 30 | * elisp.texi (Top): Add Generalized Variables to menu. | ||
| 31 | * lists.texi (List Elements, List Variables): | ||
| 32 | Mention generalized variables. | ||
| 33 | |||
| 34 | * lists.texi (List Elements): Typo fix. | ||
| 35 | |||
| 36 | 2012-10-27 Chong Yidong <cyd@gnu.org> | ||
| 37 | |||
| 38 | * minibuf.texi (High-Level Completion): Don't mention removed | ||
| 39 | function iswitchb-read-buffer. | ||
| 40 | |||
| 41 | * commands.texi (Event Input Misc): Remove last-input-char. | ||
| 42 | (Command Loop Info): Remove last-command-char. | ||
| 43 | |||
| 44 | * frames.texi (Initial Parameters): Don't mention the obsolete | ||
| 45 | special-display feature. | ||
| 46 | |||
| 47 | * windows.texi (Choosing Window): Don't mention the obsolete | ||
| 48 | special display feature. | ||
| 49 | (Choosing Window Options): Remove obsolete special-display | ||
| 50 | variables, and the functions special-display-p and | ||
| 51 | special-display-popup-frame. | ||
| 52 | |||
| 53 | * display.texi (Fringe Bitmaps): Add exclamation-mark bitmap. | ||
| 54 | |||
| 55 | * hooks.texi (Standard Hooks): Remove obsolete hooks. | ||
| 56 | |||
| 57 | * markers.texi (Information from Markers): Remove obsolete | ||
| 58 | function buffer-has-markers-at. | ||
| 59 | |||
| 60 | * text.texi (Yanking): Document yank-handled-properties. | ||
| 61 | |||
| 62 | 2012-10-24 Paul Eggert <eggert@penguin.cs.ucla.edu> | ||
| 63 | |||
| 64 | Update manual for new time stamp format (Bug#12706). | ||
| 65 | * buffers.texi (Modification Time): | ||
| 66 | * files.texi (Testing Accessibility, File Attributes): | ||
| 67 | * intro.texi (Version Info): | ||
| 68 | * os.texi (Time of Day): | ||
| 69 | Update for new time stamp format (HIGH LOW MICROSEC PICOSEC). | ||
| 70 | These instances were missed the first time around. | ||
| 71 | Problem reported by Glenn Morris in <http://bugs.gnu.org/12706#25>. | ||
| 72 | |||
| 73 | 2012-10-24 Chong Yidong <cyd@gnu.org> | ||
| 74 | |||
| 75 | * minibuf.texi (Text from Minibuffer): Document read-regexp | ||
| 76 | changes. | ||
| 77 | |||
| 78 | * nonascii.texi (Selecting a Representation): Document | ||
| 79 | set-buffer-multibyte changes. | ||
| 80 | |||
| 81 | * keymaps.texi (Toolkit Differences): Node deleted. | ||
| 82 | (Easy Menu): New node. | ||
| 83 | |||
| 1 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> | 84 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 85 | ||
| 3 | * hooks.texi (Standard Hooks): Clarify that -hooks is deprecated. | 86 | * hooks.texi (Standard Hooks): Clarify that -hooks is deprecated. |
diff --git a/doc/lispref/anti.texi b/doc/lispref/anti.texi index f1f4a089f1b..6ece2149733 100644 --- a/doc/lispref/anti.texi +++ b/doc/lispref/anti.texi | |||
| @@ -71,9 +71,8 @@ been removed, including @code{display-buffer-overriding-action} and | |||
| 71 | related variables, as well as the @var{action} argument to | 71 | related variables, as well as the @var{action} argument to |
| 72 | @code{display-buffer} and other functions. The way to | 72 | @code{display-buffer} and other functions. The way to |
| 73 | programmatically control how Emacs chooses a window to display a | 73 | programmatically control how Emacs chooses a window to display a |
| 74 | buffer is to bind the right combination of | 74 | buffer is to bind the right combination of @code{pop-up-frames} and |
| 75 | @code{special-display-regexps}, @code{pop-up-frames}, and other | 75 | other variables. |
| 76 | variables. | ||
| 77 | 76 | ||
| 78 | @item | 77 | @item |
| 79 | The standard completion interface has been simplified, eliminating the | 78 | The standard completion interface has been simplified, eliminating the |
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index b9666a79f5b..4a556895de7 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi | |||
| @@ -634,7 +634,8 @@ file should not be done. | |||
| 634 | @c Emacs 19 feature | 634 | @c Emacs 19 feature |
| 635 | @defun visited-file-modtime | 635 | @defun visited-file-modtime |
| 636 | This function returns the current buffer's recorded last file | 636 | This function returns the current buffer's recorded last file |
| 637 | modification time, as a list of the form @code{(@var{high} @var{low})}. | 637 | modification time, as a list of the form @code{(@var{high} @var{low} |
| 638 | @var{microsec} @var{picosec})}. | ||
| 638 | (This is the same format that @code{file-attributes} uses to return | 639 | (This is the same format that @code{file-attributes} uses to return |
| 639 | time values; see @ref{File Attributes}.) | 640 | time values; see @ref{File Attributes}.) |
| 640 | 641 | ||
| @@ -664,9 +665,8 @@ is not @code{nil}, and otherwise to the last modification time of the | |||
| 664 | visited file. | 665 | visited file. |
| 665 | 666 | ||
| 666 | If @var{time} is neither @code{nil} nor zero, it should have the form | 667 | If @var{time} is neither @code{nil} nor zero, it should have the form |
| 667 | @code{(@var{high} . @var{low})} or @code{(@var{high} @var{low})}, in | 668 | @code{(@var{high} @var{low} @var{microsec} @var{picosec})}, |
| 668 | either case containing two integers, each of which holds 16 bits of the | 669 | the format used by @code{current-time} (@pxref{Time of Day}). |
| 669 | time. | ||
| 670 | 670 | ||
| 671 | This function is useful if the buffer was not read from the file | 671 | This function is useful if the buffer was not read from the file |
| 672 | normally, or if the file itself has been changed for some known benign | 672 | normally, or if the file itself has been changed for some known benign |
| @@ -1237,4 +1237,3 @@ This function returns the current gap position in the current buffer. | |||
| 1237 | @defun gap-size | 1237 | @defun gap-size |
| 1238 | This function returns the current gap size of the current buffer. | 1238 | This function returns the current gap size of the current buffer. |
| 1239 | @end defun | 1239 | @end defun |
| 1240 | |||
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 9ffa2b74857..c42e4b3b6dc 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -186,7 +186,6 @@ buffer: } prompts the user with @samp{Frobnicate buffer: } to enter | |||
| 186 | the name of an existing buffer, which becomes the second and final | 186 | the name of an existing buffer, which becomes the second and final |
| 187 | argument. | 187 | argument. |
| 188 | 188 | ||
| 189 | @c Emacs 19 feature | ||
| 190 | The prompt string can use @samp{%} to include previous argument values | 189 | The prompt string can use @samp{%} to include previous argument values |
| 191 | (starting with the first argument) in the prompt. This is done using | 190 | (starting with the first argument) in the prompt. This is done using |
| 192 | @code{format} (@pxref{Formatting Strings}). For example, here is how | 191 | @code{format} (@pxref{Formatting Strings}). For example, here is how |
| @@ -205,7 +204,6 @@ If @samp{*} appears at the beginning of the string, then an error is | |||
| 205 | signaled if the buffer is read-only. | 204 | signaled if the buffer is read-only. |
| 206 | 205 | ||
| 207 | @cindex @samp{@@} in @code{interactive} | 206 | @cindex @samp{@@} in @code{interactive} |
| 208 | @c Emacs 19 feature | ||
| 209 | If @samp{@@} appears at the beginning of the string, and if the key | 207 | If @samp{@@} appears at the beginning of the string, and if the key |
| 210 | sequence used to invoke the command includes any mouse events, then | 208 | sequence used to invoke the command includes any mouse events, then |
| 211 | the window associated with the first of those events is selected | 209 | the window associated with the first of those events is selected |
| @@ -910,7 +908,6 @@ up a menu. It is also used internally by @code{y-or-n-p} | |||
| 910 | @end defvar | 908 | @end defvar |
| 911 | 909 | ||
| 912 | @defvar last-command-event | 910 | @defvar last-command-event |
| 913 | @defvarx last-command-char | ||
| 914 | This variable is set to the last input event that was read by the | 911 | This variable is set to the last input event that was read by the |
| 915 | command loop as part of a command. The principal use of this variable | 912 | command loop as part of a command. The principal use of this variable |
| 916 | is in @code{self-insert-command}, which uses it to decide which | 913 | is in @code{self-insert-command}, which uses it to decide which |
| @@ -926,11 +923,8 @@ last-command-event | |||
| 926 | 923 | ||
| 927 | @noindent | 924 | @noindent |
| 928 | The value is 5 because that is the @acronym{ASCII} code for @kbd{C-e}. | 925 | The value is 5 because that is the @acronym{ASCII} code for @kbd{C-e}. |
| 929 | |||
| 930 | The alias @code{last-command-char} is obsolete. | ||
| 931 | @end defvar | 926 | @end defvar |
| 932 | 927 | ||
| 933 | @c Emacs 19 feature | ||
| 934 | @defvar last-event-frame | 928 | @defvar last-event-frame |
| 935 | This variable records which frame the last input event was directed to. | 929 | This variable records which frame the last input event was directed to. |
| 936 | Usually this is the frame that was selected when the event was | 930 | Usually this is the frame that was selected when the event was |
| @@ -2386,7 +2380,6 @@ mouse on the window's mode line, you get two events, like this: | |||
| 2386 | @end example | 2380 | @end example |
| 2387 | 2381 | ||
| 2388 | @defvar num-input-keys | 2382 | @defvar num-input-keys |
| 2389 | @c Emacs 19 feature | ||
| 2390 | This variable's value is the number of key sequences processed so far in | 2383 | This variable's value is the number of key sequences processed so far in |
| 2391 | this Emacs session. This includes key sequences read from the terminal | 2384 | this Emacs session. This includes key sequences read from the terminal |
| 2392 | and key sequences read from keyboard macros being executed. | 2385 | and key sequences read from keyboard macros being executed. |
| @@ -2539,7 +2532,6 @@ then continues to wait for a valid input character, or keyboard-quit. | |||
| 2539 | @code{keyboard-translate-table} (if applicable), before returning it | 2532 | @code{keyboard-translate-table} (if applicable), before returning it |
| 2540 | from @code{read-event}. | 2533 | from @code{read-event}. |
| 2541 | 2534 | ||
| 2542 | @c Emacs 19 feature | ||
| 2543 | @defvar extra-keyboard-modifiers | 2535 | @defvar extra-keyboard-modifiers |
| 2544 | This variable lets Lisp programs ``press'' the modifier keys on the | 2536 | This variable lets Lisp programs ``press'' the modifier keys on the |
| 2545 | keyboard. The value is a character. Only the modifiers of the | 2537 | keyboard. The value is a character. Only the modifiers of the |
| @@ -2755,7 +2747,6 @@ may return @code{t} when no input is available. | |||
| 2755 | @end defun | 2747 | @end defun |
| 2756 | 2748 | ||
| 2757 | @defvar last-input-event | 2749 | @defvar last-input-event |
| 2758 | @defvarx last-input-char | ||
| 2759 | This variable records the last terminal input event read, whether | 2750 | This variable records the last terminal input event read, whether |
| 2760 | as part of a command or explicitly by a Lisp program. | 2751 | as part of a command or explicitly by a Lisp program. |
| 2761 | 2752 | ||
| @@ -2774,8 +2765,6 @@ this expression) remains the value of @code{last-command-event}. | |||
| 2774 | @result{} 49 | 2765 | @result{} 49 |
| 2775 | @end group | 2766 | @end group |
| 2776 | @end example | 2767 | @end example |
| 2777 | |||
| 2778 | The alias @code{last-input-char} is obsolete. | ||
| 2779 | @end defvar | 2768 | @end defvar |
| 2780 | 2769 | ||
| 2781 | @defmac while-no-input body@dots{} | 2770 | @defmac while-no-input body@dots{} |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 0b5ada43744..68701a47126 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -3550,8 +3550,8 @@ Used to indicate buffer boundaries. | |||
| 3550 | @itemx @code{vertical-bar}, @code{horizontal-bar} | 3550 | @itemx @code{vertical-bar}, @code{horizontal-bar} |
| 3551 | Used for different types of fringe cursors. | 3551 | Used for different types of fringe cursors. |
| 3552 | 3552 | ||
| 3553 | @item @code{empty-line}, @code{question-mark}, @code{exclamation-mark} | 3553 | @item @code{empty-line}, @code{exclamation-mark}, @code{question-mark}, @code{exclamation-mark} |
| 3554 | Unused. | 3554 | Not used by core Emacs features. |
| 3555 | @end table | 3555 | @end table |
| 3556 | 3556 | ||
| 3557 | @noindent | 3557 | @noindent |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index d46cb071bf7..06a2ebfcaf8 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -486,6 +486,7 @@ Variables | |||
| 486 | * Variable Aliases:: Variables that are aliases for other variables. | 486 | * Variable Aliases:: Variables that are aliases for other variables. |
| 487 | * Variables with Restricted Values:: Non-constant variables whose value can | 487 | * Variables with Restricted Values:: Non-constant variables whose value can |
| 488 | @emph{not} be an arbitrary Lisp object. | 488 | @emph{not} be an arbitrary Lisp object. |
| 489 | * Generalized Variables:: Extending the concept of variables. | ||
| 489 | 490 | ||
| 490 | Scoping Rules for Variable Bindings | 491 | Scoping Rules for Variable Bindings |
| 491 | 492 | ||
| @@ -800,17 +801,14 @@ Menu Keymaps | |||
| 800 | * Menu Bar:: How to customize the menu bar. | 801 | * Menu Bar:: How to customize the menu bar. |
| 801 | * Tool Bar:: A tool bar is a row of images. | 802 | * Tool Bar:: A tool bar is a row of images. |
| 802 | * Modifying Menus:: How to add new items to a menu. | 803 | * Modifying Menus:: How to add new items to a menu. |
| 804 | * Easy Menu:: A convenience macro for defining menus. | ||
| 803 | 805 | ||
| 804 | Defining Menus | 806 | Defining Menus |
| 805 | 807 | ||
| 806 | * Simple Menu Items:: A simple kind of menu key binding, | 808 | * Simple Menu Items:: A simple kind of menu key binding. |
| 807 | limited in capabilities. | 809 | * Extended Menu Items:: More complex menu item definitions. |
| 808 | * Extended Menu Items:: More powerful menu item definitions | ||
| 809 | let you specify keywords to enable | ||
| 810 | various features. | ||
| 811 | * Menu Separators:: Drawing a horizontal line through a menu. | 810 | * Menu Separators:: Drawing a horizontal line through a menu. |
| 812 | * Alias Menu Items:: Using command aliases in menu items. | 811 | * Alias Menu Items:: Using command aliases in menu items. |
| 813 | * Toolkit Differences:: Not all toolkits provide the same features. | ||
| 814 | 812 | ||
| 815 | Major and Minor Modes | 813 | Major and Minor Modes |
| 816 | 814 | ||
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 285e6406426..a5710c789e9 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -938,7 +938,7 @@ on the 19th, @file{aug-20} was written on the 20th, and the file | |||
| 938 | @end example | 938 | @end example |
| 939 | 939 | ||
| 940 | You can use @code{file-attributes} to get a file's last modification | 940 | You can use @code{file-attributes} to get a file's last modification |
| 941 | time as a list of two numbers. @xref{File Attributes}. | 941 | time as a list of four integers. @xref{File Attributes}. |
| 942 | @end defun | 942 | @end defun |
| 943 | 943 | ||
| 944 | @node Kinds of Files | 944 | @node Kinds of Files |
| @@ -1228,11 +1228,11 @@ so this time will always hold the midnight of the day of last access. | |||
| 1228 | 1228 | ||
| 1229 | @cindex modification time of file | 1229 | @cindex modification time of file |
| 1230 | @item | 1230 | @item |
| 1231 | The time of last modification as a list of two integers (as above). | 1231 | The time of last modification as a list of four integers (as above). |
| 1232 | This is the last time when the file's contents were modified. | 1232 | This is the last time when the file's contents were modified. |
| 1233 | 1233 | ||
| 1234 | @item | 1234 | @item |
| 1235 | The time of last status change as a list of two integers (as above). | 1235 | The time of last status change as a list of four integers (as above). |
| 1236 | This is the time of the last change to the file's access mode bits, | 1236 | This is the time of the last change to the file's access mode bits, |
| 1237 | its owner and group, and other information recorded in the filesystem | 1237 | its owner and group, and other information recorded in the filesystem |
| 1238 | for the file, beyond the file's contents. | 1238 | for the file, beyond the file's contents. |
| @@ -1275,9 +1275,9 @@ For example, here are the file attributes for @file{files.texi}: | |||
| 1275 | @group | 1275 | @group |
| 1276 | (file-attributes "files.texi" 'string) | 1276 | (file-attributes "files.texi" 'string) |
| 1277 | @result{} (nil 1 "lh" "users" | 1277 | @result{} (nil 1 "lh" "users" |
| 1278 | (19145 42977) | 1278 | (20614 64019 50040 152000) |
| 1279 | (19141 59576) | 1279 | (20000 23 0 0) |
| 1280 | (18340 17300) | 1280 | (20614 64555 902289 872000) |
| 1281 | 122295 "-rw-rw-rw-" | 1281 | 122295 "-rw-rw-rw-" |
| 1282 | nil (5888 2 . 43978) | 1282 | nil (5888 2 . 43978) |
| 1283 | (15479 . 46724)) | 1283 | (15479 . 46724)) |
| @@ -1301,14 +1301,14 @@ is owned by the user with name "lh". | |||
| 1301 | @item "users" | 1301 | @item "users" |
| 1302 | is in the group with name "users". | 1302 | is in the group with name "users". |
| 1303 | 1303 | ||
| 1304 | @item (19145 42977) | 1304 | @item (20614 64019 50040 152000) |
| 1305 | was last accessed on Oct 5 2009, at 10:01:37. | 1305 | was last accessed on October 23, 2012, at 20:12:03.050040152 UTC. |
| 1306 | 1306 | ||
| 1307 | @item (19141 59576) | 1307 | @item (20000 23 0 0) |
| 1308 | last had its contents modified on Oct 2 2009, at 13:49:12. | 1308 | was last modified on July 15, 2001, at 08:53:43 UTC. |
| 1309 | 1309 | ||
| 1310 | @item (18340 17300) | 1310 | @item (20614 64555 902289 872000) |
| 1311 | last had its status changed on Feb 2 2008, at 12:19:00. | 1311 | last had its status changed on October 23, 2012, at 20:20:59.902289872 UTC. |
| 1312 | 1312 | ||
| 1313 | @item 122295 | 1313 | @item 122295 |
| 1314 | is 122295 bytes long. (It may not contain 122295 characters, though, | 1314 | is 122295 bytes long. (It may not contain 122295 characters, though, |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index af6f4b4c079..f58d62675e5 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -437,13 +437,11 @@ Emacs frames---the first frame, and subsequent frames. When using the X | |||
| 437 | Window System, you can get the same results by means of X resources | 437 | Window System, you can get the same results by means of X resources |
| 438 | in many cases. | 438 | in many cases. |
| 439 | 439 | ||
| 440 | Setting this variable does not affect existing frames. | 440 | Setting this variable does not affect existing frames. Furthermore, |
| 441 | functions that display a buffer in a separate frame may override the | ||
| 442 | default parameters by supplying their own parameters. | ||
| 441 | @end defopt | 443 | @end defopt |
| 442 | 444 | ||
| 443 | Functions that display a buffer in a separate frame can override the | ||
| 444 | default parameters by supplying their own parameters. @xref{Definition | ||
| 445 | of special-display-frame-alist}. | ||
| 446 | |||
| 447 | If you invoke Emacs with command-line options that specify frame | 445 | If you invoke Emacs with command-line options that specify frame |
| 448 | appearance, those options take effect by adding elements to either | 446 | appearance, those options take effect by adding elements to either |
| 449 | @code{initial-frame-alist} or @code{default-frame-alist}. Options | 447 | @code{initial-frame-alist} or @code{default-frame-alist}. Options |
| @@ -1495,8 +1493,9 @@ This function returns the visibility status of frame @var{frame}. The | |||
| 1495 | value is @code{t} if @var{frame} is visible, @code{nil} if it is | 1493 | value is @code{t} if @var{frame} is visible, @code{nil} if it is |
| 1496 | invisible, and @code{icon} if it is iconified. | 1494 | invisible, and @code{icon} if it is iconified. |
| 1497 | 1495 | ||
| 1498 | On a text terminal, all frames are considered visible, whether they | 1496 | On a text terminal, all frames are considered ``visible'' for the |
| 1499 | are currently being displayed or not. | 1497 | purposes of this function, even though only one frame is displayed. |
| 1498 | @xref{Raising and Lowering}. | ||
| 1500 | @end defun | 1499 | @end defun |
| 1501 | 1500 | ||
| 1502 | @deffn Command iconify-frame &optional frame | 1501 | @deffn Command iconify-frame &optional frame |
| @@ -1552,9 +1551,21 @@ If this is non-@code{nil}, activation of the minibuffer raises the frame | |||
| 1552 | that the minibuffer window is in. | 1551 | that the minibuffer window is in. |
| 1553 | @end defopt | 1552 | @end defopt |
| 1554 | 1553 | ||
| 1555 | You can also enable auto-raise (raising automatically when a frame is | 1554 | On window systems, you can also enable auto-raising (on frame |
| 1556 | selected) or auto-lower (lowering automatically when it is deselected) | 1555 | selection) or auto-lowering (on frame deselection) using frame |
| 1557 | for any frame using frame parameters. @xref{Management Parameters}. | 1556 | parameters. @xref{Management Parameters}. |
| 1557 | |||
| 1558 | @cindex top frame | ||
| 1559 | The concept of raising and lowering frames also applies to text | ||
| 1560 | terminal frames. On each text terminal, only the top frame is | ||
| 1561 | displayed at any one time. | ||
| 1562 | |||
| 1563 | @defun tty-top-frame terminal | ||
| 1564 | This function returns the top frame on @var{terminal}. @var{terminal} | ||
| 1565 | should be a terminal object, a frame (meaning that frame's terminal), | ||
| 1566 | or @code{nil} (meaning the selected frame's terminal). If it does not | ||
| 1567 | refer to a text terminal, the return value is @code{nil}. | ||
| 1568 | @end defun | ||
| 1558 | 1569 | ||
| 1559 | @node Frame Configurations | 1570 | @node Frame Configurations |
| 1560 | @section Frame Configurations | 1571 | @section Frame Configurations |
diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi index a7f01243641..a6ac2c70e84 100644 --- a/doc/lispref/hooks.texi +++ b/doc/lispref/hooks.texi | |||
| @@ -120,14 +120,7 @@ The command loop runs this soon after @code{post-command-hook} (q.v.). | |||
| 120 | @item delete-terminal-functions | 120 | @item delete-terminal-functions |
| 121 | @xref{Multiple Terminals}. | 121 | @xref{Multiple Terminals}. |
| 122 | 122 | ||
| 123 | @ignore | ||
| 124 | @item disabled-command-function | ||
| 125 | @xref{Disabling Commands}. | ||
| 126 | @end ignore | ||
| 127 | |||
| 128 | @item display-buffer-function | ||
| 129 | @itemx pop-up-frame-function | 123 | @itemx pop-up-frame-function |
| 130 | @itemx special-display-function | ||
| 131 | @itemx split-window-preferred-function | 124 | @itemx split-window-preferred-function |
| 132 | @xref{Choosing Window Options}. | 125 | @xref{Choosing Window Options}. |
| 133 | 126 | ||
| @@ -272,7 +265,6 @@ deferred-action-function | |||
| 272 | input-method-function | 265 | input-method-function |
| 273 | load-read-function | 266 | load-read-function |
| 274 | load-source-file-function | 267 | load-source-file-function |
| 275 | macro-declaration-function | ||
| 276 | read-buffer-function | 268 | read-buffer-function |
| 277 | ring-bell-function | 269 | ring-bell-function |
| 278 | select-safe-coding-system-function | 270 | select-safe-coding-system-function |
diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi index e61e13662db..4770701b601 100644 --- a/doc/lispref/intro.texi +++ b/doc/lispref/intro.texi | |||
| @@ -493,13 +493,13 @@ giving a prefix argument makes @var{here} non-@code{nil}. | |||
| 493 | 493 | ||
| 494 | @defvar emacs-build-time | 494 | @defvar emacs-build-time |
| 495 | The value of this variable indicates the time at which Emacs was | 495 | The value of this variable indicates the time at which Emacs was |
| 496 | built. It is a list of three integers, like the value of | 496 | built. It is a list of four integers, like the value of |
| 497 | @code{current-time} (@pxref{Time of Day}). | 497 | @code{current-time} (@pxref{Time of Day}). |
| 498 | 498 | ||
| 499 | @example | 499 | @example |
| 500 | @group | 500 | @group |
| 501 | emacs-build-time | 501 | emacs-build-time |
| 502 | @result{} (18846 52016 156039) | 502 | @result{} (20614 63694 515336 438000) |
| 503 | @end group | 503 | @end group |
| 504 | @end example | 504 | @end example |
| 505 | @end defvar | 505 | @end defvar |
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 9fa6193a804..f658f7e66fb 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi | |||
| @@ -210,6 +210,11 @@ Aside from elements that specify bindings for keys, a keymap can also | |||
| 210 | have a string as an element. This is called the @dfn{overall prompt | 210 | have a string as an element. This is called the @dfn{overall prompt |
| 211 | string} and makes it possible to use the keymap as a menu. | 211 | string} and makes it possible to use the keymap as a menu. |
| 212 | @xref{Defining Menus}. | 212 | @xref{Defining Menus}. |
| 213 | |||
| 214 | @item (keymap @dots{}) | ||
| 215 | If an element of a keymap is itself a keymap, it counts as if this inner keymap | ||
| 216 | were inlined in the outer keymap. This is used for multiple-inheritance, such | ||
| 217 | as in @code{make-composed-keymap}. | ||
| 213 | @end table | 218 | @end table |
| 214 | 219 | ||
| 215 | When the binding is @code{nil}, it doesn't constitute a definition | 220 | When the binding is @code{nil}, it doesn't constitute a definition |
| @@ -1963,13 +1968,14 @@ is active for the next input event, that activates the keyboard menu | |||
| 1963 | feature. | 1968 | feature. |
| 1964 | 1969 | ||
| 1965 | @menu | 1970 | @menu |
| 1966 | * Defining Menus:: How to make a keymap that defines a menu. | 1971 | * Defining Menus:: How to make a keymap that defines a menu. |
| 1967 | * Mouse Menus:: How users actuate the menu with the mouse. | 1972 | * Mouse Menus:: How users actuate the menu with the mouse. |
| 1968 | * Keyboard Menus:: How users actuate the menu with the keyboard. | 1973 | * Keyboard Menus:: How users actuate the menu with the keyboard. |
| 1969 | * Menu Example:: Making a simple menu. | 1974 | * Menu Example:: Making a simple menu. |
| 1970 | * Menu Bar:: How to customize the menu bar. | 1975 | * Menu Bar:: How to customize the menu bar. |
| 1971 | * Tool Bar:: A tool bar is a row of images. | 1976 | * Tool Bar:: A tool bar is a row of images. |
| 1972 | * Modifying Menus:: How to add new items to a menu. | 1977 | * Modifying Menus:: How to add new items to a menu. |
| 1978 | * Easy Menu:: A convenience macro for making menus. | ||
| 1973 | @end menu | 1979 | @end menu |
| 1974 | 1980 | ||
| 1975 | @node Defining Menus | 1981 | @node Defining Menus |
| @@ -2015,17 +2021,12 @@ an existing menu, you can specify its position in the menu using | |||
| 2015 | @code{define-key-after} (@pxref{Modifying Menus}). | 2021 | @code{define-key-after} (@pxref{Modifying Menus}). |
| 2016 | 2022 | ||
| 2017 | @menu | 2023 | @menu |
| 2018 | * Simple Menu Items:: A simple kind of menu key binding, | 2024 | * Simple Menu Items:: A simple kind of menu key binding. |
| 2019 | limited in capabilities. | 2025 | * Extended Menu Items:: More complex menu item definitions. |
| 2020 | * Extended Menu Items:: More powerful menu item definitions | ||
| 2021 | let you specify keywords to enable | ||
| 2022 | various features. | ||
| 2023 | * Menu Separators:: Drawing a horizontal line through a menu. | 2026 | * Menu Separators:: Drawing a horizontal line through a menu. |
| 2024 | * Alias Menu Items:: Using command aliases in menu items. | 2027 | * Alias Menu Items:: Using command aliases in menu items. |
| 2025 | * Toolkit Differences:: Not all toolkits provide the same features. | ||
| 2026 | @end menu | 2028 | @end menu |
| 2027 | 2029 | ||
| 2028 | |||
| 2029 | @node Simple Menu Items | 2030 | @node Simple Menu Items |
| 2030 | @subsubsection Simple Menu Items | 2031 | @subsubsection Simple Menu Items |
| 2031 | 2032 | ||
| @@ -2312,28 +2313,6 @@ itself). To request this, give the alias symbol a non-@code{nil} | |||
| 2312 | causes menu items for @code{make-read-only} and @code{make-writable} to | 2313 | causes menu items for @code{make-read-only} and @code{make-writable} to |
| 2313 | show the keyboard bindings for @code{read-only-mode}. | 2314 | show the keyboard bindings for @code{read-only-mode}. |
| 2314 | 2315 | ||
| 2315 | @node Toolkit Differences | ||
| 2316 | @subsubsection Toolkit Differences | ||
| 2317 | |||
| 2318 | The various toolkits with which you can build Emacs do not all support | ||
| 2319 | the same set of features for menus. Some code works as expected with | ||
| 2320 | one toolkit, but not under another. | ||
| 2321 | |||
| 2322 | One example is menu actions or buttons in a top-level menu bar. The | ||
| 2323 | following works with the Lucid toolkit or on MS Windows, but not with | ||
| 2324 | GTK or Nextstep, where clicking on the item has no effect. | ||
| 2325 | |||
| 2326 | @example | ||
| 2327 | (defun menu-action-greet () | ||
| 2328 | (interactive) | ||
| 2329 | (message "Hello Emacs User!")) | ||
| 2330 | |||
| 2331 | (defun top-level-menu () | ||
| 2332 | (interactive) | ||
| 2333 | (define-key lisp-interaction-mode-map [menu-bar m] | ||
| 2334 | '(menu-item "Action Button" menu-action-greet))) | ||
| 2335 | @end example | ||
| 2336 | |||
| 2337 | @node Mouse Menus | 2316 | @node Mouse Menus |
| 2338 | @subsection Menus and the Mouse | 2317 | @subsection Menus and the Mouse |
| 2339 | 2318 | ||
| @@ -2813,3 +2792,125 @@ menu of Shell mode, after the item @code{break}: | |||
| 2813 | [work] '("Work" . work-command) 'break) | 2792 | [work] '("Work" . work-command) 'break) |
| 2814 | @end example | 2793 | @end example |
| 2815 | @end defun | 2794 | @end defun |
| 2795 | |||
| 2796 | @node Easy Menu | ||
| 2797 | @subsection Easy Menu | ||
| 2798 | |||
| 2799 | The following macro provides a convenient way to define pop-up menus | ||
| 2800 | and/or menu bar menus. | ||
| 2801 | |||
| 2802 | @defmac easy-menu-define symbol maps doc menu | ||
| 2803 | This macro defines a pop-up menu and/or menu bar submenu, whose | ||
| 2804 | contents are given by @var{menu}. | ||
| 2805 | |||
| 2806 | If @var{symbol} is non-@code{nil}, it should be a symbol; then this | ||
| 2807 | macro defines @var{symbol} as a function for popping up the menu | ||
| 2808 | (@pxref{Pop-Up Menus}), with @var{doc} as its documentation string. | ||
| 2809 | @var{symbol} should not be quoted. | ||
| 2810 | |||
| 2811 | Regardless of the value of @var{symbol}, if @var{maps} is a keymap, | ||
| 2812 | the menu is added to that keymap, as a top-level menu for the menu bar | ||
| 2813 | (@pxref{Menu Bar}). It can also be a list of keymaps, in which case | ||
| 2814 | the menu is added separately to each of those keymaps. | ||
| 2815 | |||
| 2816 | The first element of @var{menu} must be a string, which serves as the | ||
| 2817 | menu label. It may be followed by any number of the following | ||
| 2818 | keyword-argument pairs: | ||
| 2819 | |||
| 2820 | @table @code | ||
| 2821 | @item :filter @var{function} | ||
| 2822 | @var{function} must be a function which, if called with one | ||
| 2823 | argument---the list of the other menu items---returns the actual items | ||
| 2824 | to be displayed in the menu. | ||
| 2825 | |||
| 2826 | @item :visible @var{include} | ||
| 2827 | @var{include} is an expression; if it evaluates to @code{nil}, the | ||
| 2828 | menu is made invisible. @code{:included} is an alias for | ||
| 2829 | @code{:visible}. | ||
| 2830 | |||
| 2831 | @item :active @var{enable} | ||
| 2832 | @var{enable} is an expression; if it evaluates to @code{nil}, the menu | ||
| 2833 | is not selectable. @code{:enable} is an alias for @code{:active}. | ||
| 2834 | @end table | ||
| 2835 | |||
| 2836 | The remaining elements in @var{menu} are menu items. | ||
| 2837 | |||
| 2838 | A menu item can be a vector of three elements, @code{[@var{name} | ||
| 2839 | @var{callback} @var{enable}]}. @var{name} is the menu item name (a | ||
| 2840 | string). @var{callback} is a command to run, or an expression to | ||
| 2841 | evaluate, when the item is chosen. @var{enable} is an expression; if | ||
| 2842 | it evaluates to @code{nil}, the item is disabled for selection. | ||
| 2843 | |||
| 2844 | Alternatively, a menu item may have the form: | ||
| 2845 | |||
| 2846 | @smallexample | ||
| 2847 | [ @var{name} @var{callback} [ @var{keyword} @var{arg} ]... ] | ||
| 2848 | @end smallexample | ||
| 2849 | |||
| 2850 | @noindent | ||
| 2851 | where @var{name} and @var{callback} have the same meanings as above, | ||
| 2852 | and each optional @var{keyword} and @var{arg} pair should be one of | ||
| 2853 | the following: | ||
| 2854 | |||
| 2855 | @table @code | ||
| 2856 | @item :keys @var{keys} | ||
| 2857 | @var{keys} is a keyboard equivalent to the menu item (a string). This | ||
| 2858 | is normally not needed, as keyboard equivalents are computed | ||
| 2859 | automatically. @var{keys} is expanded with | ||
| 2860 | @code{substitute-command-keys} before it is displayed (@pxref{Keys in | ||
| 2861 | Documentation}). | ||
| 2862 | |||
| 2863 | @item :key-sequence @var{keys} | ||
| 2864 | @var{keys} is a hint for speeding up Emacs's first display of the | ||
| 2865 | menu. It should be nil if you know that the menu item has no keyboard | ||
| 2866 | equivalent; otherwise it should be a string or vector specifying a | ||
| 2867 | keyboard equivalent for the menu item. | ||
| 2868 | |||
| 2869 | @item :active @var{enable} | ||
| 2870 | @var{enable} is an expression; if it evaluates to @code{nil}, the item | ||
| 2871 | is make unselectable.. @code{:enable} is an alias for @code{:active}. | ||
| 2872 | |||
| 2873 | @item :visible @var{include} | ||
| 2874 | @var{include} is an expression; if it evaluates to @code{nil}, the | ||
| 2875 | item is made invisible. @code{:included} is an alias for | ||
| 2876 | @code{:visible}. | ||
| 2877 | |||
| 2878 | @item :label @var{form} | ||
| 2879 | @var{form} is an expression that is evaluated to obtain a value which | ||
| 2880 | serves as the menu item's label (the default is @var{name}). | ||
| 2881 | |||
| 2882 | @item :suffix @var{form} | ||
| 2883 | @var{form} is an expression that is dynamically evaluated and whose | ||
| 2884 | value is concatenated with the menu entry's label. | ||
| 2885 | |||
| 2886 | @item :style @var{style} | ||
| 2887 | @var{style} is a symbol describing the type of menu item; it should be | ||
| 2888 | @code{toggle} (a checkbox), or @code{radio} (a radio button), or | ||
| 2889 | anything else (meaning an ordinary menu item). | ||
| 2890 | |||
| 2891 | @item :selected @var{selected} | ||
| 2892 | @var{selected} is an expression; the checkbox or radio button is | ||
| 2893 | selected whenever the expression's value is non-nil. | ||
| 2894 | |||
| 2895 | @item :help @var{help} | ||
| 2896 | @var{help} is a string describing the menu item. | ||
| 2897 | @end table | ||
| 2898 | |||
| 2899 | Alternatively, a menu item can be a string. Then that string appears | ||
| 2900 | in the menu as unselectable text. A string consisting of dashes is | ||
| 2901 | displayed as a separator (@pxref{Menu Separators}). | ||
| 2902 | |||
| 2903 | Alternatively, a menu item can be a list with the same format as | ||
| 2904 | @var{menu}. This is a submenu. | ||
| 2905 | @end defmac | ||
| 2906 | |||
| 2907 | Here is an example of using @code{easy-menu-define} to define a menu | ||
| 2908 | similar to the one defined in the example in @ref{Menu Bar}: | ||
| 2909 | |||
| 2910 | @example | ||
| 2911 | (easy-menu-define words-menu global-map | ||
| 2912 | "Menu for word navigation commands." | ||
| 2913 | '("Words" | ||
| 2914 | ["Forward word" forward-word] | ||
| 2915 | ["Backward word" backward-word])) | ||
| 2916 | @end example | ||
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 4a8740a5734..09948caaa13 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi | |||
| @@ -236,6 +236,10 @@ This is in contrast to @code{cdr}, which signals an error if | |||
| 236 | @defmac pop listname | 236 | @defmac pop listname |
| 237 | This macro is a way of examining the @sc{car} of a list, | 237 | This macro is a way of examining the @sc{car} of a list, |
| 238 | and taking it off the list, all at once. | 238 | and taking it off the list, all at once. |
| 239 | @c FIXME I don't think is a particularly good way to do it, | ||
| 240 | @c but generalized variables have not been introduced yet. | ||
| 241 | (In fact, this macro can act on generalized variables, not just lists. | ||
| 242 | @xref{Generalized Variables}.) | ||
| 239 | 243 | ||
| 240 | It operates on the list which is stored in the symbol @var{listname}. | 244 | It operates on the list which is stored in the symbol @var{listname}. |
| 241 | It removes this element from the list by setting @var{listname} | 245 | It removes this element from the list by setting @var{listname} |
| @@ -252,7 +256,7 @@ x | |||
| 252 | @end example | 256 | @end example |
| 253 | 257 | ||
| 254 | @noindent | 258 | @noindent |
| 255 | For the @code{pop} macro, which removes an element from a list, | 259 | For the @code{push} macro, which adds an element to a list, |
| 256 | @xref{List Variables}. | 260 | @xref{List Variables}. |
| 257 | @end defmac | 261 | @end defmac |
| 258 | 262 | ||
| @@ -682,6 +686,10 @@ to modify a list which is stored in a variable. | |||
| 682 | @defmac push newelt listname | 686 | @defmac push newelt listname |
| 683 | This macro provides an alternative way to write | 687 | This macro provides an alternative way to write |
| 684 | @code{(setq @var{listname} (cons @var{newelt} @var{listname}))}. | 688 | @code{(setq @var{listname} (cons @var{newelt} @var{listname}))}. |
| 689 | @c FIXME I don't think is a particularly good way to do it, | ||
| 690 | @c but generalized variables have not been introduced yet. | ||
| 691 | (In fact, this macro can act on generalized variables, not just lists. | ||
| 692 | @xref{Generalized Variables}.) | ||
| 685 | 693 | ||
| 686 | @example | 694 | @example |
| 687 | (setq l '(a b)) | 695 | (setq l '(a b)) |
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 77a31cfde7a..6a18bea2977 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi | |||
| @@ -408,9 +408,9 @@ to load automatically from @var{filename}. The string @var{filename} | |||
| 408 | specifies the file to load to get the real definition of @var{function}. | 408 | specifies the file to load to get the real definition of @var{function}. |
| 409 | 409 | ||
| 410 | If @var{filename} does not contain either a directory name, or the | 410 | If @var{filename} does not contain either a directory name, or the |
| 411 | suffix @code{.el} or @code{.elc}, then @code{autoload} insists on adding | 411 | suffix @code{.el} or @code{.elc}, this function insists on adding one |
| 412 | one of these suffixes, and it will not load from a file whose name is | 412 | of these suffixes, and it will not load from a file whose name is just |
| 413 | just @var{filename} with no added suffix. (The variable | 413 | @var{filename} with no added suffix. (The variable |
| 414 | @code{load-suffixes} specifies the exact required suffixes.) | 414 | @code{load-suffixes} specifies the exact required suffixes.) |
| 415 | 415 | ||
| 416 | The argument @var{docstring} is the documentation string for the | 416 | The argument @var{docstring} is the documentation string for the |
| @@ -442,10 +442,11 @@ and calls @code{define-key}; not even if the variable name is the same | |||
| 442 | symbol @var{function}. | 442 | symbol @var{function}. |
| 443 | 443 | ||
| 444 | @cindex function cell in autoload | 444 | @cindex function cell in autoload |
| 445 | If @var{function} already has a non-void function definition that is not | 445 | if @var{function} already has non-void function definition that is not |
| 446 | an autoload object, @code{autoload} does nothing and returns @code{nil}. | 446 | an autoload object, this function does nothing and returns @code{nil}. |
| 447 | If the function cell of @var{function} is void, or is already an autoload | 447 | Otherwise, it constructs an autoload object (@pxref{Autoload Type}), |
| 448 | object, then it is defined as an autoload object like this: | 448 | and stores it as the function definition for @var{function}. The |
| 449 | autoload object has this form: | ||
| 449 | 450 | ||
| 450 | @example | 451 | @example |
| 451 | (autoload @var{filename} @var{docstring} @var{interactive} @var{type}) | 452 | (autoload @var{filename} @var{docstring} @var{interactive} @var{type}) |
| @@ -468,6 +469,16 @@ refers to the documentation string in the | |||
| 468 | not a macro or a keymap. | 469 | not a macro or a keymap. |
| 469 | @end defun | 470 | @end defun |
| 470 | 471 | ||
| 472 | @defun autoloadp object | ||
| 473 | This function returns non-@code{nil} if @var{object} is an autoload | ||
| 474 | object. For example, to check if @code{run-prolog} is defined as an | ||
| 475 | autoloaded function, evaluate | ||
| 476 | |||
| 477 | @smallexample | ||
| 478 | (autoloadp (symbol-function 'run-prolog)) | ||
| 479 | @end smallexample | ||
| 480 | @end defun | ||
| 481 | |||
| 471 | @cindex autoload errors | 482 | @cindex autoload errors |
| 472 | The autoloaded file usually contains other definitions and may require | 483 | The autoloaded file usually contains other definitions and may require |
| 473 | or provide one or more features. If the file is not completely loaded | 484 | or provide one or more features. If the file is not completely loaded |
| @@ -599,6 +610,19 @@ override that, e.g., in the ``Local Variables'' section of a | |||
| 599 | assumed to contain a trailer starting with a formfeed character. | 610 | assumed to contain a trailer starting with a formfeed character. |
| 600 | @end defvar | 611 | @end defvar |
| 601 | 612 | ||
| 613 | The following function may be used to explicitly load the library | ||
| 614 | specified by an autoload object: | ||
| 615 | |||
| 616 | @defun autoload-do-load autoload &optional name macro-only | ||
| 617 | This function performs the loading specified by @var{autoload}, which | ||
| 618 | whould be an autoload object. The optional argument @var{name}, if | ||
| 619 | non-@code{nil}, should be a symbol whose function value is | ||
| 620 | @var{autoload}; in that case, the return value of this function is the | ||
| 621 | symbol's new function value. If the value of the optional argument | ||
| 622 | @var{macro-only} is @code{macro}, this function avoids loading a | ||
| 623 | function, only a macro. | ||
| 624 | @end defun | ||
| 625 | |||
| 602 | @node Repeated Loading | 626 | @node Repeated Loading |
| 603 | @section Repeated Loading | 627 | @section Repeated Loading |
| 604 | @cindex repeated loading | 628 | @cindex repeated loading |
diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi index 80136f2e6f4..fa884269b36 100644 --- a/doc/lispref/markers.texi +++ b/doc/lispref/markers.texi | |||
| @@ -307,11 +307,6 @@ This function returns the buffer that @var{marker} points into, or | |||
| 307 | @end example | 307 | @end example |
| 308 | @end defun | 308 | @end defun |
| 309 | 309 | ||
| 310 | @defun buffer-has-markers-at position | ||
| 311 | This function returns @code{t} if one or more markers | ||
| 312 | point at position @var{position} in the current buffer. | ||
| 313 | @end defun | ||
| 314 | |||
| 315 | @node Marker Insertion Types | 310 | @node Marker Insertion Types |
| 316 | @section Marker Insertion Types | 311 | @section Marker Insertion Types |
| 317 | 312 | ||
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 39b4fca3b25..7243f46b882 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -211,22 +211,25 @@ This function works by calling the | |||
| 211 | @end smallexample | 211 | @end smallexample |
| 212 | @end defun | 212 | @end defun |
| 213 | 213 | ||
| 214 | @defun read-regexp prompt &optional default | 214 | @defun read-regexp prompt &optional default history |
| 215 | This function reads a regular expression as a string from the | 215 | This function reads a regular expression as a string from the |
| 216 | minibuffer and returns it. The argument @var{prompt} is used as in | 216 | minibuffer and returns it. The argument @var{prompt} is used as in |
| 217 | @code{read-from-minibuffer}. The keymap used is | 217 | @code{read-from-minibuffer}. |
| 218 | @code{minibuffer-local-map}, and @code{regexp-history} is used as the | ||
| 219 | history list (@pxref{Minibuffer History, regexp-history}). | ||
| 220 | 218 | ||
| 221 | The optional argument @var{default} specifies a default value to | 219 | The optional argument @var{default} specifies a default value to |
| 222 | return if the user enters null input; it should be a string, or | 220 | return if the user enters null input; it should be a string, or |
| 223 | @code{nil}, which is equivalent to an empty string. | 221 | @code{nil}, which is equivalent to an empty string. |
| 224 | 222 | ||
| 225 | In addition, @code{read-regexp} collects a few useful candidates for | 223 | The optional argument @var{history}, if non-@code{nil}, is a symbol |
| 226 | input and passes them to @code{read-from-minibuffer}, to make them | 224 | specifying a minibuffer history list to use (@pxref{Minibuffer |
| 227 | available to the user as the ``future minibuffer history list'' | 225 | History}). If it is omitted or @code{nil}, the history list defaults |
| 228 | (@pxref{Minibuffer History, future list,, emacs, The GNU Emacs | 226 | to @code{regexp-history}. |
| 229 | Manual}). These candidates are: | 227 | |
| 228 | @code{read-regexp} also collects a few useful candidates for input and | ||
| 229 | passes them to @code{read-from-minibuffer}, to make them available to | ||
| 230 | the user as the ``future minibuffer history list'' (@pxref{Minibuffer | ||
| 231 | History, future list,, emacs, The GNU Emacs Manual}). These | ||
| 232 | candidates are: | ||
| 230 | 233 | ||
| 231 | @itemize @minus | 234 | @itemize @minus |
| 232 | @item | 235 | @item |
| @@ -1215,11 +1218,9 @@ Buffer name (default foo): @point{} | |||
| 1215 | @end defun | 1218 | @end defun |
| 1216 | 1219 | ||
| 1217 | @defopt read-buffer-function | 1220 | @defopt read-buffer-function |
| 1218 | This variable specifies how to read buffer names. The function is | 1221 | This variable, if non-@code{nil}, specifies a function for reading |
| 1219 | called with the arguments passed to @code{read-buffer}. For example, | 1222 | buffer names. @code{read-buffer} calls this function instead of doing |
| 1220 | if you set this variable to @code{iswitchb-read-buffer}, all Emacs | 1223 | its usual work, with the same arguments passed to @code{read-buffer}. |
| 1221 | commands that call @code{read-buffer} to read a buffer name will | ||
| 1222 | actually use the @code{iswitchb} package to read it. | ||
| 1223 | @end defopt | 1224 | @end defopt |
| 1224 | 1225 | ||
| 1225 | @defopt read-buffer-completion-ignore-case | 1226 | @defopt read-buffer-completion-ignore-case |
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index 2f6f516c587..e384d40176e 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi | |||
| @@ -241,8 +241,12 @@ representation is in use. It also adjusts various data in the buffer | |||
| 241 | (including overlays, text properties and markers) so that they cover the | 241 | (including overlays, text properties and markers) so that they cover the |
| 242 | same text as they did before. | 242 | same text as they did before. |
| 243 | 243 | ||
| 244 | You cannot use @code{set-buffer-multibyte} on an indirect buffer, | 244 | This function signals an error if the buffer is narrowed, since the |
| 245 | because indirect buffers always inherit the representation of the | 245 | narrowing might have occurred in the middle of multibyte character |
| 246 | sequences. | ||
| 247 | |||
| 248 | This function also signals an error if the buffer is an indirect | ||
| 249 | buffer. An indirect buffer always inherits the representation of its | ||
| 246 | base buffer. | 250 | base buffer. |
| 247 | @end defun | 251 | @end defun |
| 248 | 252 | ||
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index d3c3c6fd241..6c5f6e85683 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -1199,7 +1199,7 @@ Similarly, the fourth list element @var{picosec}, if present, gives | |||
| 1199 | the number of picoseconds from the start of that microsecond to the | 1199 | the number of picoseconds from the start of that microsecond to the |
| 1200 | specified time. | 1200 | specified time. |
| 1201 | 1201 | ||
| 1202 | The return value of @code{current-time} represents time using three | 1202 | The return value of @code{current-time} represents time using four |
| 1203 | integers, as do the timestamps in the return value of | 1203 | integers, as do the timestamps in the return value of |
| 1204 | @code{file-attributes} (@pxref{Definition of | 1204 | @code{file-attributes} (@pxref{Definition of |
| 1205 | file-attributes}). In function arguments, e.g.@: the @var{time-value} | 1205 | file-attributes}). In function arguments, e.g.@: the @var{time-value} |
diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi index d7497ab6f3f..326c6cd4ab2 100644 --- a/doc/lispref/symbols.texi +++ b/doc/lispref/symbols.texi | |||
| @@ -487,6 +487,12 @@ using @code{eq}, so any object is a legitimate property. | |||
| 487 | See @code{put} for an example. | 487 | See @code{put} for an example. |
| 488 | @end defun | 488 | @end defun |
| 489 | 489 | ||
| 490 | @defun function-get symbol property | ||
| 491 | This function is identical to @code{get}, except that if @var{symbol} | ||
| 492 | is the name of a function alias, it looks in the property list of the | ||
| 493 | symbol naming the actual function. @xref{Defining Functions}. | ||
| 494 | @end defun | ||
| 495 | |||
| 490 | @defun put symbol property value | 496 | @defun put symbol property value |
| 491 | This function puts @var{value} onto @var{symbol}'s property list under | 497 | This function puts @var{value} onto @var{symbol}'s property list under |
| 492 | the property name @var{property}, replacing any previous property value. | 498 | the property name @var{property}, replacing any previous property value. |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 50b97cd4204..57df02b74a0 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -899,31 +899,34 @@ In Lisp programs, it is better to use @code{kill-new} or | |||
| 899 | @node Yanking | 899 | @node Yanking |
| 900 | @subsection Yanking | 900 | @subsection Yanking |
| 901 | 901 | ||
| 902 | Yanking means inserting text from the kill ring, but it does | 902 | Yanking means inserting text from the kill ring, but it does not |
| 903 | not insert the text blindly. Yank commands and some other commands | 903 | insert the text blindly. The @code{yank} command, and related |
| 904 | use @code{insert-for-yank} to perform special processing on the | 904 | commands, use @code{insert-for-yank} to perform special processing on |
| 905 | text that they copy into the buffer. | 905 | the text before it is inserted. |
| 906 | 906 | ||
| 907 | @defun insert-for-yank string | 907 | @defun insert-for-yank string |
| 908 | This function normally works like @code{insert} except that it doesn't | 908 | This function works like @code{insert}, except that it processes the |
| 909 | insert the text properties (@pxref{Text Properties}) in the list | 909 | text in @var{string} according to the @code{yank-handler} text |
| 910 | variable @code{yank-excluded-properties}. However, if any part of | 910 | property, as well as the variables @code{yank-handled-properties} and |
| 911 | @var{string} has a non-@code{nil} @code{yank-handler} text property, | 911 | @code{yank-excluded-properties} (see below), before inserting the |
| 912 | that property can do various special processing on that part of the | 912 | result into the current buffer. |
| 913 | text being inserted. | ||
| 914 | @end defun | 913 | @end defun |
| 915 | 914 | ||
| 916 | @defun insert-buffer-substring-as-yank buf &optional start end | 915 | @defun insert-buffer-substring-as-yank buf &optional start end |
| 917 | This function resembles @code{insert-buffer-substring} except that it | 916 | This function resembles @code{insert-buffer-substring}, except that it |
| 918 | doesn't insert the text properties in the | 917 | processes the text according to @code{yank-handled-properties} and |
| 919 | @code{yank-excluded-properties} list. | 918 | @code{yank-excluded-properties}. (It does not handle the |
| 919 | @code{yank-handler} property, which does not normally occur in buffer | ||
| 920 | text anyway.) | ||
| 920 | @end defun | 921 | @end defun |
| 921 | 922 | ||
| 922 | You can put a @code{yank-handler} text property on all or part of | 923 | If you put a @code{yank-handler} text property on all or part of a |
| 923 | the text to control how it will be inserted if it is yanked. The | 924 | string, that alters how @code{insert-for-yank} inserts the string. If |
| 924 | @code{insert-for-yank} function looks for that property. The property | 925 | different parts of the string have different @code{yank-handler} |
| 925 | value must be a list of one to four elements, with the following | 926 | values (comparison being done with @code{eq}), each substring is |
| 926 | format (where elements after the first may be omitted): | 927 | handled separately. The property value must be a list of one to four |
| 928 | elements, with the following format (where elements after the first | ||
| 929 | may be omitted): | ||
| 927 | 930 | ||
| 928 | @example | 931 | @example |
| 929 | (@var{function} @var{param} @var{noexclude} @var{undo}) | 932 | (@var{function} @var{param} @var{noexclude} @var{undo}) |
| @@ -933,22 +936,21 @@ format (where elements after the first may be omitted): | |||
| 933 | 936 | ||
| 934 | @table @var | 937 | @table @var |
| 935 | @item function | 938 | @item function |
| 936 | When @var{function} is present and non-@code{nil}, it is called instead of | 939 | When @var{function} is non-@code{nil}, it is called instead of |
| 937 | @code{insert} to insert the string. @var{function} takes one | 940 | @code{insert} to insert the string, with one argument---the string to |
| 938 | argument---the string to insert. | 941 | insert. |
| 939 | 942 | ||
| 940 | @item param | 943 | @item param |
| 941 | If @var{param} is present and non-@code{nil}, it replaces @var{string} | 944 | If @var{param} is present and non-@code{nil}, it replaces @var{string} |
| 942 | (or the part of @var{string} being processed) as the object passed to | 945 | (or the substring of @var{string} being processed) as the object |
| 943 | @var{function} (or @code{insert}); for example, if @var{function} is | 946 | passed to @var{function} (or @code{insert}). For example, if |
| 944 | @code{yank-rectangle}, @var{param} should be a list of strings to | 947 | @var{function} is @code{yank-rectangle}, @var{param} should be a list |
| 945 | insert as a rectangle. | 948 | of strings to insert as a rectangle. |
| 946 | 949 | ||
| 947 | @item noexclude | 950 | @item noexclude |
| 948 | If @var{noexclude} is present and non-@code{nil}, the normal removal of the | 951 | If @var{noexclude} is present and non-@code{nil}, that disables the |
| 949 | yank-excluded-properties is not performed; instead @var{function} is | 952 | normal action of @code{yank-handled-properties} and |
| 950 | responsible for removing those properties. This may be necessary | 953 | @code{yank-excluded-properties} on the inserted string. |
| 951 | if @var{function} adjusts point before or after inserting the object. | ||
| 952 | 954 | ||
| 953 | @item undo | 955 | @item undo |
| 954 | If @var{undo} is present and non-@code{nil}, it is a function that will be | 956 | If @var{undo} is present and non-@code{nil}, it is a function that will be |
| @@ -959,14 +961,29 @@ the @var{undo} value. | |||
| 959 | @end table | 961 | @end table |
| 960 | 962 | ||
| 961 | @cindex yanking and text properties | 963 | @cindex yanking and text properties |
| 964 | @defopt yank-handled-properties | ||
| 965 | This variable specifies special text property handling conditions for | ||
| 966 | yanked text. It takes effect after the text has been inserted (either | ||
| 967 | normally, or via the @code{yank-handler} property), and prior to | ||
| 968 | @code{yank-excluded-properties} taking effect. | ||
| 969 | |||
| 970 | The value should be an alist of elements @code{(@var{prop} | ||
| 971 | . @var{fun})}. Each alist element is handled in order. The inserted | ||
| 972 | text is scanned for stretches of text having text properties @code{eq} | ||
| 973 | to @var{prop}; for each such stretch, @var{fun} is called with three | ||
| 974 | arguments: the value of the property, and the start and end positions | ||
| 975 | of the text. | ||
| 976 | @end defopt | ||
| 977 | |||
| 962 | @defopt yank-excluded-properties | 978 | @defopt yank-excluded-properties |
| 963 | Yanking discards certain text properties from the yanked text, as | 979 | The value of this variable is the list of properties to remove from |
| 964 | described above. The value of this variable is the list of properties | 980 | inserted text. Its default value contains properties that might lead |
| 965 | to discard. Its default value contains properties that might lead to | 981 | to annoying results, such as causing the text to respond to the mouse |
| 966 | annoying results, such as causing the text to respond to the mouse or | 982 | or specifying key bindings. It takes effect after |
| 967 | specifying key bindings. | 983 | @code{yank-handled-properties}. |
| 968 | @end defopt | 984 | @end defopt |
| 969 | 985 | ||
| 986 | |||
| 970 | @node Yank Commands | 987 | @node Yank Commands |
| 971 | @subsection Functions for Yanking | 988 | @subsection Functions for Yanking |
| 972 | 989 | ||
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 1c0abcb8e66..580dd8258df 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -41,6 +41,7 @@ representing the variable. | |||
| 41 | * Variable Aliases:: Variables that are aliases for other variables. | 41 | * Variable Aliases:: Variables that are aliases for other variables. |
| 42 | * Variables with Restricted Values:: Non-constant variables whose value can | 42 | * Variables with Restricted Values:: Non-constant variables whose value can |
| 43 | @emph{not} be an arbitrary Lisp object. | 43 | @emph{not} be an arbitrary Lisp object. |
| 44 | * Generalized Variables:: Extending the concept of variables. | ||
| 44 | @end menu | 45 | @end menu |
| 45 | 46 | ||
| 46 | @node Global Variables | 47 | @node Global Variables |
| @@ -1946,3 +1947,105 @@ Attempting to assign them any other value will result in an error: | |||
| 1946 | (setq undo-limit 1000.0) | 1947 | (setq undo-limit 1000.0) |
| 1947 | @error{} Wrong type argument: integerp, 1000.0 | 1948 | @error{} Wrong type argument: integerp, 1000.0 |
| 1948 | @end example | 1949 | @end example |
| 1950 | |||
| 1951 | @c FIXME? Not sure this is the right place for this section. | ||
| 1952 | @node Generalized Variables | ||
| 1953 | @section Generalized Variables | ||
| 1954 | |||
| 1955 | A @dfn{generalized variable} or @dfn{place form} is one of the many places | ||
| 1956 | in Lisp memory where values can be stored. The simplest place form is | ||
| 1957 | a regular Lisp variable. But the @sc{car}s and @sc{cdr}s of lists, elements | ||
| 1958 | of arrays, properties of symbols, and many other locations are also | ||
| 1959 | places where Lisp values are stored. | ||
| 1960 | |||
| 1961 | @c FIXME? Not sure this is a useful analogy... | ||
| 1962 | Generalized variables are analogous to ``lvalues'' in the C | ||
| 1963 | language, where @samp{x = a[i]} gets an element from an array | ||
| 1964 | and @samp{a[i] = x} stores an element using the same notation. | ||
| 1965 | Just as certain forms like @code{a[i]} can be lvalues in C, there | ||
| 1966 | is a set of forms that can be generalized variables in Lisp. | ||
| 1967 | |||
| 1968 | The @code{setf} macro is the most basic way to operate on generalized | ||
| 1969 | variables. The @code{setf} form is like @code{setq}, except that it | ||
| 1970 | accepts arbitrary place forms on the left side rather than just | ||
| 1971 | symbols. For example, @code{(setf (car a) b)} sets the car of | ||
| 1972 | @code{a} to @code{b}, doing the same operation as @code{(setcar a b)}, | ||
| 1973 | but without having to remember two separate functions for setting and | ||
| 1974 | accessing every type of place. | ||
| 1975 | |||
| 1976 | @defmac setf [place form]@dots{} | ||
| 1977 | This macro evaluates @var{form} and stores it in @var{place}, which | ||
| 1978 | must be a valid generalized variable form. If there are several | ||
| 1979 | @var{place} and @var{form} pairs, the assignments are done sequentially | ||
| 1980 | just as with @code{setq}. @code{setf} returns the value of the last | ||
| 1981 | @var{form}. | ||
| 1982 | @end defmac | ||
| 1983 | |||
| 1984 | The following Lisp forms will work as generalized variables, and | ||
| 1985 | so may appear in the @var{place} argument of @code{setf}: | ||
| 1986 | |||
| 1987 | @itemize | ||
| 1988 | @item | ||
| 1989 | A symbol naming a variable. In other words, @code{(setf x y)} is | ||
| 1990 | exactly equivalent to @code{(setq x y)}, and @code{setq} itself is | ||
| 1991 | strictly speaking redundant given that @code{setf} exists. Many | ||
| 1992 | programmers continue to prefer @code{setq} for setting simple | ||
| 1993 | variables, though, purely for stylistic or historical reasons. | ||
| 1994 | The macro @code{(setf x y)} actually expands to @code{(setq x y)}, | ||
| 1995 | so there is no performance penalty for using it in compiled code. | ||
| 1996 | |||
| 1997 | @item | ||
| 1998 | A call to any of the following standard Lisp functions: | ||
| 1999 | |||
| 2000 | @smallexample | ||
| 2001 | car cdr nth nthcdr | ||
| 2002 | caar cadr cdar cddr | ||
| 2003 | aref elt get gethash | ||
| 2004 | symbol-function symbol-value symbol-plist | ||
| 2005 | @end smallexample | ||
| 2006 | |||
| 2007 | @item | ||
| 2008 | The following Emacs-specific functions are also @code{setf}-able: | ||
| 2009 | |||
| 2010 | @smallexample | ||
| 2011 | default-value process-get | ||
| 2012 | frame-parameter process-sentinel | ||
| 2013 | terminal-parameter window-buffer | ||
| 2014 | keymap-parent window-display-table | ||
| 2015 | match-data window-dedicated-p | ||
| 2016 | overlay-get window-hscroll | ||
| 2017 | overlay-start window-parameter | ||
| 2018 | overlay-end window-point | ||
| 2019 | process-buffer window-start | ||
| 2020 | process-filter | ||
| 2021 | @end smallexample | ||
| 2022 | @end itemize | ||
| 2023 | |||
| 2024 | @noindent | ||
| 2025 | Using any forms other than these in the @var{place} argument to | ||
| 2026 | @code{setf} will signal an error. | ||
| 2027 | |||
| 2028 | @c And for cl-lib's cl-getf. | ||
| 2029 | Note that for @code{nthcdr}, the list argument of the function must | ||
| 2030 | itself be a valid @var{place} form. For example, @code{(setf (nthcdr | ||
| 2031 | 0 foo) 7)} will set @code{foo} itself to 7. | ||
| 2032 | @c The use of @code{nthcdr} as a @var{place} form is an extension | ||
| 2033 | @c to standard Common Lisp. | ||
| 2034 | |||
| 2035 | @c FIXME I don't think is a particularly good way to do it, | ||
| 2036 | @c but these macros are introduced before gvs are. | ||
| 2037 | The macros @code{push} (@pxref{List Variables}) and @code{pop} | ||
| 2038 | (@pxref{List Elements}) can manipulate generalized variables, | ||
| 2039 | not just lists. @code{(pop @var{place})} removes and returns the first | ||
| 2040 | element of the list stored in @var{place}. It is analogous to | ||
| 2041 | @code{(prog1 (car @var{place}) (setf @var{place} (cdr @var{place})))}, | ||
| 2042 | except that it takes care to evaluate all subforms only once. | ||
| 2043 | @code{(push @var{x} @var{place})} inserts @var{x} at the front of | ||
| 2044 | the list stored in @var{place}. It is analogous to @code{(setf | ||
| 2045 | @var{place} (cons @var{x} @var{place}))}, except for evaluation of the | ||
| 2046 | subforms. Note that @code{push} and @code{pop} on an @code{nthcdr} | ||
| 2047 | place can be used to insert or delete at any position in a list. | ||
| 2048 | |||
| 2049 | The @file{cl-lib} library defines various extensions for generalized | ||
| 2050 | variables, including additional @code{setf} places. | ||
| 2051 | @xref{Generalized Variables,,, cl, Common Lisp Extensions}. | ||
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index ea48a46359c..d0e149eb165 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -76,30 +76,35 @@ within the area of the frame. When a window is created, resized, or | |||
| 76 | deleted, the change in window space is taken from or given to the | 76 | deleted, the change in window space is taken from or given to the |
| 77 | adjacent windows, so that the total area of the frame is unchanged. | 77 | adjacent windows, so that the total area of the frame is unchanged. |
| 78 | 78 | ||
| 79 | @cindex live windows | ||
| 80 | @cindex internal windows | ||
| 81 | A @dfn{live window} is one that is actually displaying a buffer in a | ||
| 82 | frame. Such a window can be @dfn{deleted}, i.e. removed from the | ||
| 83 | frame (@pxref{Deleting Windows}); then it is no longer live, but the | ||
| 84 | Lisp object representing it might be still referenced from other Lisp | ||
| 85 | objects. A deleted window may be brought back to life by restoring a | ||
| 86 | saved window configuration (@pxref{Window Configurations}). | ||
| 87 | |||
| 88 | @defun windowp object | 79 | @defun windowp object |
| 89 | This function returns @code{t} if @var{object} is a window (whether or | 80 | This function returns @code{t} if @var{object} is a window (whether or |
| 90 | not it is live). Otherwise, it returns @code{nil}. | 81 | not it displays a buffer). Otherwise, it returns @code{nil}. |
| 91 | @end defun | 82 | @end defun |
| 92 | 83 | ||
| 84 | @cindex live windows | ||
| 85 | A @dfn{live window} is one that is actually displaying a buffer in a | ||
| 86 | frame. | ||
| 87 | |||
| 93 | @defun window-live-p object | 88 | @defun window-live-p object |
| 94 | This function returns @code{t} if @var{object} is a live window and | 89 | This function returns @code{t} if @var{object} is a live window and |
| 95 | @code{nil} otherwise. A live window is one that displays a buffer. | 90 | @code{nil} otherwise. A live window is one that displays a buffer. |
| 96 | @end defun | 91 | @end defun |
| 97 | 92 | ||
| 98 | The windows in each frame are organized into a @dfn{window tree}. | 93 | @cindex internal windows |
| 99 | @xref{Windows and Frames}. The leaf nodes of each window tree are | 94 | The windows in each frame are organized into a @dfn{window tree}. |
| 100 | live windows---the ones actually displaying buffers. The internal | 95 | @xref{Windows and Frames}. The leaf nodes of each window tree are live |
| 101 | nodes of the window tree are internal windows, which are not live. | 96 | windows---the ones actually displaying buffers. The internal nodes of |
| 102 | You can distinguish internal windows from deleted windows with | 97 | the window tree are @dfn{internal windows}, which are not live. |
| 98 | |||
| 99 | @cindex valid windows | ||
| 100 | A @dfn{valid window} is one that is either live or internal. A valid | ||
| 101 | window can be @dfn{deleted}, i.e. removed from its frame | ||
| 102 | (@pxref{Deleting Windows}); then it is no longer valid, but the Lisp | ||
| 103 | object representing it might be still referenced from other Lisp | ||
| 104 | objects. A deleted window may be made valid again by restoring a saved | ||
| 105 | window configuration (@pxref{Window Configurations}). | ||
| 106 | |||
| 107 | You can distinguish valid windows from deleted windows with | ||
| 103 | @code{window-valid-p}. | 108 | @code{window-valid-p}. |
| 104 | 109 | ||
| 105 | @defun window-valid-p object | 110 | @defun window-valid-p object |
| @@ -1317,31 +1322,37 @@ meaning as for @code{next-window}. | |||
| 1317 | criterion, without selecting it: | 1322 | criterion, without selecting it: |
| 1318 | 1323 | ||
| 1319 | @cindex least recently used window | 1324 | @cindex least recently used window |
| 1320 | @defun get-lru-window &optional all-frames dedicated | 1325 | @defun get-lru-window &optional all-frames dedicated not-selected |
| 1321 | This function returns a live window which is heuristically the ``least | 1326 | This function returns a live window which is heuristically the ``least |
| 1322 | recently used'' window. The optional argument @var{all-frames} has | 1327 | recently used'' window. The optional argument @var{all-frames} has |
| 1323 | the same meaning as in @code{next-window}. | 1328 | the same meaning as in @code{next-window}. |
| 1324 | 1329 | ||
| 1325 | If any full-width windows are present, only those windows are | 1330 | If any full-width windows are present, only those windows are |
| 1326 | considered. The selected window is never returned, unless it is the | 1331 | considered. A minibuffer window is never a candidate. A dedicated |
| 1327 | only candidate. A minibuffer window is never a candidate. A | 1332 | window (@pxref{Dedicated Windows}) is never a candidate unless the |
| 1328 | dedicated window (@pxref{Dedicated Windows}) is never a candidate | 1333 | optional argument @var{dedicated} is non-@code{nil}. The selected |
| 1329 | unless the optional argument @var{dedicated} is non-@code{nil}. | 1334 | window is never returned, unless it is the only candidate. However, if |
| 1335 | the optional argument @var{not-selected} is non-@code{nil}, this | ||
| 1336 | function returns @code{nil} in that case. | ||
| 1330 | @end defun | 1337 | @end defun |
| 1331 | 1338 | ||
| 1332 | @cindex largest window | 1339 | @cindex largest window |
| 1333 | @defun get-largest-window &optional all-frames dedicated | 1340 | @defun get-largest-window &optional all-frames dedicated not-selected |
| 1334 | This function returns the window with the largest area (height times | 1341 | This function returns the window with the largest area (height times |
| 1335 | width). A minibuffer window is never a candidate. A dedicated window | 1342 | width). The optional argument @var{all-frames} specifies the windows to |
| 1343 | search, and has the same meaning as in @code{next-window}. | ||
| 1344 | |||
| 1345 | A minibuffer window is never a candidate. A dedicated window | ||
| 1336 | (@pxref{Dedicated Windows}) is never a candidate unless the optional | 1346 | (@pxref{Dedicated Windows}) is never a candidate unless the optional |
| 1337 | argument @var{dedicated} is non-@code{nil}. | 1347 | argument @var{dedicated} is non-@code{nil}. The selected window is not |
| 1348 | a candidate if the optional argument @var{not-selected} is | ||
| 1349 | non-@code{nil}. If the optional argument @var{not-selected} is | ||
| 1350 | non-@code{nil} and the selected window is the only candidate, this | ||
| 1351 | function returns @code{nil}. | ||
| 1338 | 1352 | ||
| 1339 | If there are two candidate windows of the same size, this function | 1353 | If there are two candidate windows of the same size, this function |
| 1340 | prefers the one that comes first in the cyclic ordering of windows, | 1354 | prefers the one that comes first in the cyclic ordering of windows, |
| 1341 | starting from the selected window. | 1355 | starting from the selected window. |
| 1342 | |||
| 1343 | The optional argument @var{all-frames} specifies the windows to | ||
| 1344 | search, and has the same meaning as in @code{next-window}. | ||
| 1345 | @end defun | 1356 | @end defun |
| 1346 | 1357 | ||
| 1347 | @cindex window that satisfies a predicate | 1358 | @cindex window that satisfies a predicate |
| @@ -1359,6 +1370,26 @@ windows to search, and have the same meanings as in | |||
| 1359 | @code{next-window}. | 1370 | @code{next-window}. |
| 1360 | @end defun | 1371 | @end defun |
| 1361 | 1372 | ||
| 1373 | @cindex window in direction | ||
| 1374 | @defun window-in-direction direction &optional window ignore | ||
| 1375 | This function returns the nearest window in direction @var{direction} as | ||
| 1376 | seen from the position of @code{window-point} in window @var{window}. | ||
| 1377 | The argument @var{direction} must be one of @code{above}, @code{below}, | ||
| 1378 | @code{left} or @code{right}. The optional argument @var{window} must | ||
| 1379 | denote a live window and defaults to the selected one. | ||
| 1380 | |||
| 1381 | This function does not return a window whose @code{no-other-window} | ||
| 1382 | parameter is non-@code{nil}. If the nearest window's | ||
| 1383 | @code{no-other-window} parameter is non-@code{nil}, this function tries | ||
| 1384 | to find another window in the indicated direction whose | ||
| 1385 | @code{no-other-window} parameter is @code{nil}. If the optional | ||
| 1386 | argument @var{ignore} is non-@code{nil}, a window may be returned even | ||
| 1387 | if its @code{no-other-window} parameter is non-@code{nil}. | ||
| 1388 | |||
| 1389 | If it doesn't find a suitable window, this function returns @code{nil}. | ||
| 1390 | @end defun | ||
| 1391 | |||
| 1392 | |||
| 1362 | @node Buffers and Windows | 1393 | @node Buffers and Windows |
| 1363 | @section Buffers and Windows | 1394 | @section Buffers and Windows |
| 1364 | @cindex examining windows | 1395 | @cindex examining windows |
| @@ -1632,11 +1663,6 @@ The variable @code{display-buffer-overriding-action}. | |||
| 1632 | The user option @code{display-buffer-alist}. | 1663 | The user option @code{display-buffer-alist}. |
| 1633 | 1664 | ||
| 1634 | @item | 1665 | @item |
| 1635 | A special action for handling @code{special-display-buffer-names} and | ||
| 1636 | @code{special-display-regexps}, if either of those variables is | ||
| 1637 | non-@code{nil}. @xref{Choosing Window Options}. | ||
| 1638 | |||
| 1639 | @item | ||
| 1640 | The @var{action} argument. | 1666 | The @var{action} argument. |
| 1641 | 1667 | ||
| 1642 | @item | 1668 | @item |
| @@ -1864,91 +1890,6 @@ Parameters}), which is used by the default function in | |||
| 1864 | @code{nil}. | 1890 | @code{nil}. |
| 1865 | @end defopt | 1891 | @end defopt |
| 1866 | 1892 | ||
| 1867 | @defopt special-display-buffer-names | ||
| 1868 | A list of buffer names identifying buffers that should be displayed | ||
| 1869 | specially. If the name of @var{buffer-or-name} is in this list, | ||
| 1870 | @code{display-buffer} handles the buffer specially. By default, special | ||
| 1871 | display means to give the buffer a dedicated frame. | ||
| 1872 | |||
| 1873 | If an element is a list, instead of a string, then the @sc{car} of that | ||
| 1874 | list is the buffer name, and the rest of that list says how to create | ||
| 1875 | the frame. There are two possibilities for the rest of that list (its | ||
| 1876 | @sc{cdr}): It can be an alist, specifying frame parameters, or it can | ||
| 1877 | contain a function and arguments to give to it. (The function's first | ||
| 1878 | argument is always the buffer to be displayed; the arguments from the | ||
| 1879 | list come after that.) | ||
| 1880 | |||
| 1881 | For example: | ||
| 1882 | |||
| 1883 | @example | ||
| 1884 | (("myfile" (minibuffer) (menu-bar-lines . 0))) | ||
| 1885 | @end example | ||
| 1886 | |||
| 1887 | @noindent | ||
| 1888 | specifies to display a buffer named @samp{myfile} in a dedicated frame | ||
| 1889 | with specified @code{minibuffer} and @code{menu-bar-lines} parameters. | ||
| 1890 | |||
| 1891 | The list of frame parameters can also use the phony frame parameters | ||
| 1892 | @code{same-frame} and @code{same-window}. If the specified frame | ||
| 1893 | parameters include @code{(same-window . @var{value})} and @var{value} | ||
| 1894 | is non-@code{nil}, that means to display the buffer in the current | ||
| 1895 | selected window. Otherwise, if they include @code{(same-frame . | ||
| 1896 | @var{value})} and @var{value} is non-@code{nil}, that means to display | ||
| 1897 | the buffer in a new window in the currently selected frame. | ||
| 1898 | @end defopt | ||
| 1899 | |||
| 1900 | @defopt special-display-regexps | ||
| 1901 | A list of regular expressions specifying buffers that should be | ||
| 1902 | displayed specially. If the buffer's name matches any of the regular | ||
| 1903 | expressions in this list, @code{display-buffer} handles the buffer | ||
| 1904 | specially. By default, special display means to give the buffer a | ||
| 1905 | dedicated frame. | ||
| 1906 | |||
| 1907 | If an element is a list, instead of a string, then the @sc{car} of the | ||
| 1908 | list is the regular expression, and the rest of the list says how to | ||
| 1909 | create the frame. See @code{special-display-buffer-names} above. | ||
| 1910 | @end defopt | ||
| 1911 | |||
| 1912 | @defun special-display-p buffer-name | ||
| 1913 | This function returns non-@code{nil} if displaying a buffer | ||
| 1914 | named @var{buffer-name} with @code{display-buffer} would | ||
| 1915 | create a special frame. The value is @code{t} if it would | ||
| 1916 | use the default frame parameters, or else the specified list | ||
| 1917 | of frame parameters. | ||
| 1918 | @end defun | ||
| 1919 | |||
| 1920 | @defopt special-display-function | ||
| 1921 | This variable holds the function to call to display a buffer specially. | ||
| 1922 | It receives the buffer as an argument, and should return the window in | ||
| 1923 | which it is displayed. The default value of this variable is | ||
| 1924 | @code{special-display-popup-frame}, see below. | ||
| 1925 | @end defopt | ||
| 1926 | |||
| 1927 | @defun special-display-popup-frame buffer &optional args | ||
| 1928 | This function tries to make @var{buffer} visible in a frame of its own. | ||
| 1929 | If @var{buffer} is already displayed in some window, it makes that | ||
| 1930 | window's frame visible and raises it. Otherwise, it creates a frame | ||
| 1931 | that is dedicated to @var{buffer}. The return value is the window used | ||
| 1932 | to display @var{buffer}. | ||
| 1933 | |||
| 1934 | If @var{args} is an alist, it specifies frame parameters for the new | ||
| 1935 | frame. If @var{args} is a list whose @sc{car} is a symbol, then | ||
| 1936 | @code{(car @var{args})} is a function to actually create and | ||
| 1937 | set up the frame; it is called with @var{buffer} as first argument, and | ||
| 1938 | @code{(cdr @var{args})} as additional arguments. | ||
| 1939 | |||
| 1940 | This function always uses an existing window displaying @var{buffer}, | ||
| 1941 | whether or not it is in a frame of its own; but if you set up the above | ||
| 1942 | variables in your init file, before @var{buffer} was created, then | ||
| 1943 | presumably the window was previously made by this function. | ||
| 1944 | @end defun | ||
| 1945 | |||
| 1946 | @defopt special-display-frame-alist | ||
| 1947 | @anchor{Definition of special-display-frame-alist} | ||
| 1948 | This variable holds frame parameters for | ||
| 1949 | @code{special-display-popup-frame} to use when it creates a frame. | ||
| 1950 | @end defopt | ||
| 1951 | |||
| 1952 | @defopt same-window-buffer-names | 1893 | @defopt same-window-buffer-names |
| 1953 | A list of buffer names for buffers that should be displayed in the | 1894 | A list of buffer names for buffers that should be displayed in the |
| 1954 | selected window. If a buffer's name is in this list, | 1895 | selected window. If a buffer's name is in this list, |
| @@ -1969,19 +1910,6 @@ named @var{buffer-name} with @code{display-buffer} would | |||
| 1969 | put it in the selected window. | 1910 | put it in the selected window. |
| 1970 | @end defun | 1911 | @end defun |
| 1971 | 1912 | ||
| 1972 | @c Emacs 19 feature | ||
| 1973 | @defopt display-buffer-function | ||
| 1974 | This variable is the most flexible way to customize the behavior of | ||
| 1975 | @code{display-buffer}. If it is non-@code{nil}, it should be a function | ||
| 1976 | that @code{display-buffer} calls to do the work. The function should | ||
| 1977 | accept two arguments, the first two arguments that @code{display-buffer} | ||
| 1978 | received. It should choose or create a window, display the specified | ||
| 1979 | buffer in it, and then return the window. | ||
| 1980 | |||
| 1981 | This variable takes precedence over all the other options described | ||
| 1982 | above. | ||
| 1983 | @end defopt | ||
| 1984 | |||
| 1985 | @node Window History | 1913 | @node Window History |
| 1986 | @section Window History | 1914 | @section Window History |
| 1987 | @cindex window history | 1915 | @cindex window history |
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index cda4f272ca2..941c430ce74 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,96 @@ | |||
| 1 | 2012-10-30 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * cl.texi (Modify Macros): Update for cl-letf changes. | ||
| 4 | (Obsolete Lexical Macros): Say a little more about letf/cl-letf. | ||
| 5 | (Setf Extensions): Partially restore note about cl-getf, | ||
| 6 | mainly moved to lispref/variables.texi. | ||
| 7 | (Property Lists): Fix cl-getf typos. | ||
| 8 | (Mapping over Sequences): Mention cl-mapc naming oddity. | ||
| 9 | |||
| 10 | 2012-10-29 Glenn Morris <rgm@gnu.org> | ||
| 11 | |||
| 12 | * cl.texi (Organization): More details on cl-lib.el versus cl.el. | ||
| 13 | (Setf Extensions): Remove `apply' setf since it seems to be disabled. | ||
| 14 | (Customizing Setf): Move contents to "Obsolete Setf Customization". | ||
| 15 | (Modify Macros, Multiple Values, Other Clauses): | ||
| 16 | Remove mentions of obsolete features. | ||
| 17 | (Obsolete Setf Customization): Don't mention `apply' setf. | ||
| 18 | |||
| 19 | 2012-10-28 Glenn Morris <rgm@gnu.org> | ||
| 20 | |||
| 21 | * cl.texi (Multiple Values, Common Lisp Compatibility): | ||
| 22 | More namespace updates. | ||
| 23 | (Obsolete Features): Copyedits. | ||
| 24 | (Obsolete Lexical Macros, Obsolete Setf Customization): | ||
| 25 | New subsections. | ||
| 26 | |||
| 27 | * cl.texi (Porting Common Lisp, Lexical Bindings): | ||
| 28 | Add some xrefs to the Elisp manual. | ||
| 29 | |||
| 30 | * cl.texi (Lexical Bindings): Move to appendix of obsolete features. | ||
| 31 | (Porting Common Lisp): Emacs Lisp can do true lexical binding now. | ||
| 32 | (Obsolete Features): New appendix. Move Lexical Bindings here. | ||
| 33 | |||
| 34 | 2012-10-27 Glenn Morris <rgm@gnu.org> | ||
| 35 | |||
| 36 | * cl.texi: Use defmac for macros rather than defspec. | ||
| 37 | (Efficiency Concerns): Related copyedit. | ||
| 38 | |||
| 39 | * cl.texi (Control Structure): Update for setf now being in core. | ||
| 40 | (Setf Extensions): Rename from Basic Setf. Move much of the | ||
| 41 | former content to lispref/variables.texi. | ||
| 42 | (Modify Macros): Move pop, push details to lispref/variables.texi. | ||
| 43 | (Customizing Setf): Copyedits for setf etc being in core. | ||
| 44 | (Modify Macros, Efficiency Concerns, Porting Common Lisp): | ||
| 45 | Further namespaces updates. | ||
| 46 | |||
| 47 | 2012-10-26 Bastien Guerry <bzg@gnu.org> | ||
| 48 | |||
| 49 | * org.texi (Installation): Update the link to Org's ELPA. Also | ||
| 50 | don't mention org-install.el anymore as the replacement file | ||
| 51 | org-loaddefs.el is now loaded by org.el. | ||
| 52 | |||
| 53 | 2012-10-25 Michael Albinus <michael.albinus@gmx.de> | ||
| 54 | |||
| 55 | * tramp.texi (Frequently Asked Questions): Mention | ||
| 56 | `tramp-completion-reread-directory-timeout' for performance | ||
| 57 | improvement. | ||
| 58 | |||
| 59 | 2012-10-25 Glenn Morris <rgm@gnu.org> | ||
| 60 | |||
| 61 | * cl.texi: Don't mess with the TeX section number counter. | ||
| 62 | Use Texinfo recommended convention for quotes+punctuation. | ||
| 63 | (Overview, Sequence Functions): Rephrase for better line-breaking. | ||
| 64 | (Time of Evaluation, Type Predicates, Modify Macros, Function Bindings) | ||
| 65 | (Macro Bindings, Conditionals, Iteration, Loop Basics) | ||
| 66 | (Random Numbers, Mapping over Sequences, Structures) | ||
| 67 | (Porting Common Lisp): Further updates for cl-lib namespace. | ||
| 68 | (Modify Macros, Declarations, Macro Bindings, Structures): | ||
| 69 | Break long lines in examples. | ||
| 70 | (Dynamic Bindings): Update for changed progv behavior. | ||
| 71 | (Loop Examples, Efficiency Concerns): Markup fixes. | ||
| 72 | (Structures): Remove TeX margin change. | ||
| 73 | (Declarations): Fix typos. | ||
| 74 | |||
| 75 | 2012-10-24 Glenn Morris <rgm@gnu.org> | ||
| 76 | |||
| 77 | * cl.texi (Overview, Multiple Values, Creating Symbols) | ||
| 78 | (Numerical Functions): Say less/nothing about the original cl.el. | ||
| 79 | (Old CL Compatibility): Remove. | ||
| 80 | (Assertions): Remove ignore-errors (standard Elisp for some time). | ||
| 81 | |||
| 82 | * cl.texi (Basic Setf, Macros, Declarations, Symbols, Numbers) | ||
| 83 | (Sequences, Lists, Structures, Assertions, Efficiency Concerns) | ||
| 84 | (Efficiency Concerns, Efficiency Concerns) | ||
| 85 | (Common Lisp Compatibility, Old CL Compatibility): | ||
| 86 | Further updates for cl-lib namespace. | ||
| 87 | |||
| 88 | 2012-10-24 Paul Eggert <eggert@penguin.cs.ucla.edu> | ||
| 89 | |||
| 90 | Update manual for new time stamp format (Bug#12706). | ||
| 91 | * emacs-mime.texi (time-date): Update for new format. | ||
| 92 | Also, fix bogus time stamp and modernize a bit. | ||
| 93 | |||
| 1 | 2012-10-23 Glenn Morris <rgm@gnu.org> | 94 | 2012-10-23 Glenn Morris <rgm@gnu.org> |
| 2 | 95 | ||
| 3 | * cl.texi: Include emacsver.texi. Use Emacs version number rather | 96 | * cl.texi: Include emacsver.texi. Use Emacs version number rather |
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 12fd76e2e1c..8cee1cf9639 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi | |||
| @@ -57,7 +57,7 @@ developing GNU and promoting software freedom.'' | |||
| 57 | * Overview:: Basics, usage, etc. | 57 | * Overview:: Basics, usage, etc. |
| 58 | * Program Structure:: Arglists, @code{cl-eval-when}, @code{defalias}. | 58 | * Program Structure:: Arglists, @code{cl-eval-when}, @code{defalias}. |
| 59 | * Predicates:: @code{cl-typep} and @code{cl-equalp}. | 59 | * Predicates:: @code{cl-typep} and @code{cl-equalp}. |
| 60 | * Control Structure:: @code{setf}, @code{cl-do}, @code{cl-loop}, etc. | 60 | * Control Structure:: @code{cl-do}, @code{cl-loop}, etc. |
| 61 | * Macros:: Destructuring, @code{cl-define-compiler-macro}. | 61 | * Macros:: Destructuring, @code{cl-define-compiler-macro}. |
| 62 | * Declarations:: @code{cl-proclaim}, @code{cl-declare}, etc. | 62 | * Declarations:: @code{cl-proclaim}, @code{cl-declare}, etc. |
| 63 | * Symbols:: Property lists, @code{cl-gensym}. | 63 | * Symbols:: Property lists, @code{cl-gensym}. |
| @@ -65,12 +65,12 @@ developing GNU and promoting software freedom.'' | |||
| 65 | * Sequences:: Mapping, functions, searching, sorting. | 65 | * Sequences:: Mapping, functions, searching, sorting. |
| 66 | * Lists:: @code{cl-caddr}, @code{cl-sublis}, @code{cl-member}, @code{cl-assoc}, etc. | 66 | * Lists:: @code{cl-caddr}, @code{cl-sublis}, @code{cl-member}, @code{cl-assoc}, etc. |
| 67 | * Structures:: @code{cl-defstruct}. | 67 | * Structures:: @code{cl-defstruct}. |
| 68 | * Assertions:: @code{cl-check-type}, @code{cl-assert}, @code{ignore-errors}. | 68 | * Assertions:: @code{cl-check-type}, @code{cl-assert}. |
| 69 | 69 | ||
| 70 | * Efficiency Concerns:: Hints and techniques. | 70 | * Efficiency Concerns:: Hints and techniques. |
| 71 | * Common Lisp Compatibility:: All known differences with Steele. | 71 | * Common Lisp Compatibility:: All known differences with Steele. |
| 72 | * Old CL Compatibility:: All known differences with old cl.el. | ||
| 73 | * Porting Common Lisp:: Hints for porting Common Lisp code. | 72 | * Porting Common Lisp:: Hints for porting Common Lisp code. |
| 73 | * Obsolete Features:: Obsolete features. | ||
| 74 | 74 | ||
| 75 | * GNU Free Documentation License:: The license for this documentation. | 75 | * GNU Free Documentation License:: The license for this documentation. |
| 76 | * Function Index:: | 76 | * Function Index:: |
| @@ -116,19 +116,16 @@ features. | |||
| 116 | 116 | ||
| 117 | @end itemize | 117 | @end itemize |
| 118 | 118 | ||
| 119 | The package described here was originally written by Dave Gillespie, | 119 | This package was originally written by Dave Gillespie, |
| 120 | @file{daveg@@synaptics.com}, as a total rewrite of an earlier | 120 | @file{daveg@@synaptics.com}, as a total rewrite of an earlier 1986 |
| 121 | 1986 @file{cl.el} package by Cesar Quiroz. Most features of the | 121 | @file{cl.el} package by Cesar Quiroz. Care has been taken to ensure |
| 122 | Quiroz package were retained; any incompatibilities are | 122 | that each function is defined efficiently, concisely, and with minimal |
| 123 | noted in the descriptions below. Care has been taken in this | 123 | impact on the rest of the Emacs environment. Stefan Monnier added the |
| 124 | version to ensure that each function is defined efficiently, | 124 | file @file{cl-lib.el} and rationalized the namespace for Emacs 24.3. |
| 125 | concisely, and with minimal impact on the rest of the Emacs | ||
| 126 | environment. Stefan Monnier added the file @file{cl-lib.el} and | ||
| 127 | rationalized the namespace for Emacs 24.3. | ||
| 128 | 125 | ||
| 129 | @menu | 126 | @menu |
| 130 | * Usage:: How to use the CL package. | 127 | * Usage:: How to use the CL package. |
| 131 | * Organization:: The package's five component files. | 128 | * Organization:: The package's component files. |
| 132 | * Naming Conventions:: Notes on CL function names. | 129 | * Naming Conventions:: Notes on CL function names. |
| 133 | @end menu | 130 | @end menu |
| 134 | 131 | ||
| @@ -185,25 +182,37 @@ All you have to do is @code{(require 'cl-lib)}, and @file{cl-lib.el} | |||
| 185 | will take care of pulling in the other files when they are | 182 | will take care of pulling in the other files when they are |
| 186 | needed. | 183 | needed. |
| 187 | 184 | ||
| 188 | There is another file, @file{cl.el}, which was the main entry point | 185 | There is another file, @file{cl.el}, which was the main entry point to |
| 189 | to the CL package prior to Emacs 24.3. Nowadays, it is replaced | 186 | the CL package prior to Emacs 24.3. Nowadays, it is replaced by |
| 190 | by @file{cl-lib.el}. The two provide the same features, but use | 187 | @file{cl-lib.el}. The two provide the same features (in most cases), |
| 191 | different function names (in fact, @file{cl.el} just defines aliases | 188 | but use different function names (in fact, @file{cl.el} mainly just |
| 192 | to the @file{cl-lib.el} definitions). In particular, the old @file{cl.el} | 189 | defines aliases to the @file{cl-lib.el} definitions). Where |
| 193 | does not use a clean namespace. For this reason, Emacs has a policy | 190 | @file{cl-lib.el} defines a function called, for example, |
| 194 | that packages distributed with Emacs must not load @code{cl} at run time. | 191 | @code{cl-incf}, @file{cl.el} uses the same name but without the |
| 195 | (It is ok for them to load @code{cl} at @emph{compile} time, with | 192 | @samp{cl-} prefix, e.g. @code{incf} in this example. There are a few |
| 196 | @code{eval-when-compile}, and use the macros it provides.) There is | 193 | exceptions to this. First, functions such as @code{cl-defun} where |
| 197 | no such restriction on the use of @code{cl-lib}. New code should use | 194 | the unprefixed version was already used for a standard Emacs Lisp |
| 198 | @code{cl-lib} rather than @code{cl}. @xref{Naming Conventions}. | 195 | function. In such cases, the @file{cl.el} version adds a @samp{*} |
| 196 | suffix, e.g. @code{defun*}. Second, there are some obsolete features | ||
| 197 | that are only implemented in @file{cl.el}, not in @file{cl-lib.el}, | ||
| 198 | because they are replaced by other standard Emacs Lisp features. | ||
| 199 | Finally, in a very few cases the old @file{cl.el} versions do not | ||
| 200 | behave in exactly the same way as the @file{cl-lib.el} versions. | ||
| 201 | @xref{Obsolete Features}. | ||
| 202 | @c There is also cl-mapc, which was called cl-mapc even before cl-lib.el. | ||
| 203 | @c But not autoloaded, so maybe not much used? | ||
| 204 | |||
| 205 | Since the old @file{cl.el} does not use a clean namespace, Emacs has a | ||
| 206 | policy that packages distributed with Emacs must not load @code{cl} at | ||
| 207 | run time. (It is ok for them to load @code{cl} at @emph{compile} | ||
| 208 | time, with @code{eval-when-compile}, and use the macros it provides.) | ||
| 209 | There is no such restriction on the use of @code{cl-lib}. New code | ||
| 210 | should use @code{cl-lib} rather than @code{cl}. | ||
| 199 | 211 | ||
| 200 | There is one more file, @file{cl-compat.el}, which defines some | 212 | There is one more file, @file{cl-compat.el}, which defines some |
| 201 | routines from the older CL package that are not otherwise | 213 | routines from the older Quiroz CL package that are not otherwise |
| 202 | present in the new package. This includes internal routines | 214 | present in the new package. This file is obsolete and should not be |
| 203 | like @code{setelt} and @code{zip-lists}, deprecated features | 215 | used in new code. |
| 204 | like @code{defkeyword}, and an emulation of the old-style | ||
| 205 | multiple-values feature. This file is obsolete and should not be used | ||
| 206 | in new code. @xref{Old CL Compatibility}. | ||
| 207 | 216 | ||
| 208 | @node Naming Conventions | 217 | @node Naming Conventions |
| 209 | @section Naming Conventions | 218 | @section Naming Conventions |
| @@ -217,7 +226,6 @@ Internal function and variable names in the package are prefixed | |||
| 217 | by @code{cl--}. Here is a complete list of functions prefixed by | 226 | by @code{cl--}. Here is a complete list of functions prefixed by |
| 218 | @code{cl-} that were not taken from Common Lisp: | 227 | @code{cl-} that were not taken from Common Lisp: |
| 219 | 228 | ||
| 220 | @c FIXME lexical-let lexical-let* | ||
| 221 | @example | 229 | @example |
| 222 | cl-callf cl-callf2 cl-defsubst | 230 | cl-callf cl-callf2 cl-defsubst |
| 223 | cl-floatp-safe cl-letf cl-letf* | 231 | cl-floatp-safe cl-letf cl-letf* |
| @@ -260,10 +268,6 @@ and the @code{cl-eval-when} construct. | |||
| 260 | * Time of Evaluation:: The @code{cl-eval-when} construct. | 268 | * Time of Evaluation:: The @code{cl-eval-when} construct. |
| 261 | @end menu | 269 | @end menu |
| 262 | 270 | ||
| 263 | @iftex | ||
| 264 | @secno=1 | ||
| 265 | @end iftex | ||
| 266 | |||
| 267 | @node Argument Lists | 271 | @node Argument Lists |
| 268 | @section Argument Lists | 272 | @section Argument Lists |
| 269 | 273 | ||
| @@ -279,14 +283,14 @@ this package to implement Common Lisp argument lists seamlessly. | |||
| 279 | Instead, this package defines alternates for several Lisp forms | 283 | Instead, this package defines alternates for several Lisp forms |
| 280 | which you must use if you need Common Lisp argument lists. | 284 | which you must use if you need Common Lisp argument lists. |
| 281 | 285 | ||
| 282 | @defspec cl-defun name arglist body... | 286 | @defmac cl-defun name arglist body... |
| 283 | This form is identical to the regular @code{defun} form, except | 287 | This form is identical to the regular @code{defun} form, except |
| 284 | that @var{arglist} is allowed to be a full Common Lisp argument | 288 | that @var{arglist} is allowed to be a full Common Lisp argument |
| 285 | list. Also, the function body is enclosed in an implicit block | 289 | list. Also, the function body is enclosed in an implicit block |
| 286 | called @var{name}; @pxref{Blocks and Exits}. | 290 | called @var{name}; @pxref{Blocks and Exits}. |
| 287 | @end defspec | 291 | @end defmac |
| 288 | 292 | ||
| 289 | @defspec cl-defsubst name arglist body... | 293 | @defmac cl-defsubst name arglist body... |
| 290 | This is just like @code{cl-defun}, except that the function that | 294 | This is just like @code{cl-defun}, except that the function that |
| 291 | is defined is automatically proclaimed @code{inline}, i.e., | 295 | is defined is automatically proclaimed @code{inline}, i.e., |
| 292 | calls to it may be expanded into in-line code by the byte compiler. | 296 | calls to it may be expanded into in-line code by the byte compiler. |
| @@ -296,9 +300,9 @@ works in all versions of Emacs, and also generates somewhat more | |||
| 296 | efficient inline expansions. In particular, @code{cl-defsubst} | 300 | efficient inline expansions. In particular, @code{cl-defsubst} |
| 297 | arranges for the processing of keyword arguments, default values, | 301 | arranges for the processing of keyword arguments, default values, |
| 298 | etc., to be done at compile-time whenever possible. | 302 | etc., to be done at compile-time whenever possible. |
| 299 | @end defspec | 303 | @end defmac |
| 300 | 304 | ||
| 301 | @defspec cl-defmacro name arglist body... | 305 | @defmac cl-defmacro name arglist body... |
| 302 | This is identical to the regular @code{defmacro} form, | 306 | This is identical to the regular @code{defmacro} form, |
| 303 | except that @var{arglist} is allowed to be a full Common Lisp | 307 | except that @var{arglist} is allowed to be a full Common Lisp |
| 304 | argument list. The @code{&environment} keyword is supported as | 308 | argument list. The @code{&environment} keyword is supported as |
| @@ -307,13 +311,13 @@ within destructured lists (see below); top-level @code{&whole} | |||
| 307 | cannot be implemented with the current Emacs Lisp interpreter. | 311 | cannot be implemented with the current Emacs Lisp interpreter. |
| 308 | The macro expander body is enclosed in an implicit block called | 312 | The macro expander body is enclosed in an implicit block called |
| 309 | @var{name}. | 313 | @var{name}. |
| 310 | @end defspec | 314 | @end defmac |
| 311 | 315 | ||
| 312 | @defspec cl-function symbol-or-lambda | 316 | @defmac cl-function symbol-or-lambda |
| 313 | This is identical to the regular @code{function} form, | 317 | This is identical to the regular @code{function} form, |
| 314 | except that if the argument is a @code{lambda} form then that | 318 | except that if the argument is a @code{lambda} form then that |
| 315 | form may use a full Common Lisp argument list. | 319 | form may use a full Common Lisp argument list. |
| 316 | @end defspec | 320 | @end defmac |
| 317 | 321 | ||
| 318 | Also, all forms (such as @code{cl-flet} and @code{cl-labels}) defined | 322 | Also, all forms (such as @code{cl-flet} and @code{cl-labels}) defined |
| 319 | in this package that include @var{arglist}s in their syntax allow | 323 | in this package that include @var{arglist}s in their syntax allow |
| @@ -502,7 +506,7 @@ For example, the compiler effectively evaluates @code{defmacro} forms | |||
| 502 | at compile-time so that later parts of the file can refer to the | 506 | at compile-time so that later parts of the file can refer to the |
| 503 | macros that are defined. | 507 | macros that are defined. |
| 504 | 508 | ||
| 505 | @defspec cl-eval-when (situations...) forms... | 509 | @defmac cl-eval-when (situations...) forms... |
| 506 | This form controls when the body @var{forms} are evaluated. | 510 | This form controls when the body @var{forms} are evaluated. |
| 507 | The @var{situations} list may contain any set of the symbols | 511 | The @var{situations} list may contain any set of the symbols |
| 508 | @code{compile}, @code{load}, and @code{eval} (or their long-winded | 512 | @code{compile}, @code{load}, and @code{eval} (or their long-winded |
| @@ -572,19 +576,19 @@ last four would have been equivalent to the corresponding @code{setq}s. | |||
| 572 | Note that @code{(cl-eval-when (load eval) @dots{})} is equivalent | 576 | Note that @code{(cl-eval-when (load eval) @dots{})} is equivalent |
| 573 | to @code{(progn @dots{})} in all contexts. The compiler treats | 577 | to @code{(progn @dots{})} in all contexts. The compiler treats |
| 574 | certain top-level forms, like @code{defmacro} (sort-of) and | 578 | certain top-level forms, like @code{defmacro} (sort-of) and |
| 575 | @code{require}, as if they were wrapped in @code{(eval-when | 579 | @code{require}, as if they were wrapped in @code{(cl-eval-when |
| 576 | (compile load eval) @dots{})}. | 580 | (compile load eval) @dots{})}. |
| 577 | @end defspec | 581 | @end defmac |
| 578 | 582 | ||
| 579 | Emacs includes two special forms related to @code{cl-eval-when}. | 583 | Emacs includes two special forms related to @code{cl-eval-when}. |
| 580 | One of these, @code{eval-when-compile}, is not quite equivalent to | 584 | One of these, @code{eval-when-compile}, is not quite equivalent to |
| 581 | any @code{eval-when} construct and is described below. | 585 | any @code{cl-eval-when} construct and is described below. |
| 582 | 586 | ||
| 583 | The other form, @code{(eval-and-compile @dots{})}, is exactly | 587 | The other form, @code{(eval-and-compile @dots{})}, is exactly |
| 584 | equivalent to @samp{(eval-when (compile load eval) @dots{})} and | 588 | equivalent to @samp{(cl-eval-when (compile load eval) @dots{})} and |
| 585 | so is not itself defined by this package. | 589 | so is not itself defined by this package. |
| 586 | 590 | ||
| 587 | @defspec eval-when-compile forms... | 591 | @defmac eval-when-compile forms... |
| 588 | The @var{forms} are evaluated at compile-time; at execution time, | 592 | The @var{forms} are evaluated at compile-time; at execution time, |
| 589 | this form acts like a quoted constant of the resulting value. Used | 593 | this form acts like a quoted constant of the resulting value. Used |
| 590 | at top-level, @code{eval-when-compile} is just like @samp{eval-when | 594 | at top-level, @code{eval-when-compile} is just like @samp{eval-when |
| @@ -593,9 +597,9 @@ allows code to be evaluated once at compile-time for efficiency | |||
| 593 | or other reasons. | 597 | or other reasons. |
| 594 | 598 | ||
| 595 | This form is similar to the @samp{#.} syntax of true Common Lisp. | 599 | This form is similar to the @samp{#.} syntax of true Common Lisp. |
| 596 | @end defspec | 600 | @end defmac |
| 597 | 601 | ||
| 598 | @defspec cl-load-time-value form | 602 | @defmac cl-load-time-value form |
| 599 | The @var{form} is evaluated at load-time; at execution time, | 603 | The @var{form} is evaluated at load-time; at execution time, |
| 600 | this form acts like a quoted constant of the resulting value. | 604 | this form acts like a quoted constant of the resulting value. |
| 601 | 605 | ||
| @@ -636,7 +640,7 @@ Byte-compiled, the above defun will result in the following code | |||
| 636 | ", and loaded on: " | 640 | ", and loaded on: " |
| 637 | --temp--)) | 641 | --temp--)) |
| 638 | @end example | 642 | @end example |
| 639 | @end defspec | 643 | @end defmac |
| 640 | 644 | ||
| 641 | @node Predicates | 645 | @node Predicates |
| 642 | @chapter Predicates | 646 | @chapter Predicates |
| @@ -653,10 +657,6 @@ facts are true or false. | |||
| 653 | @node Type Predicates | 657 | @node Type Predicates |
| 654 | @section Type Predicates | 658 | @section Type Predicates |
| 655 | 659 | ||
| 656 | @noindent | ||
| 657 | The @code{CL} package defines a version of the Common Lisp @code{typep} | ||
| 658 | predicate. | ||
| 659 | |||
| 660 | @defun cl-typep object type | 660 | @defun cl-typep object type |
| 661 | Check if @var{object} is of type @var{type}, where @var{type} is a | 661 | Check if @var{object} is of type @var{type}, where @var{type} is a |
| 662 | (quoted) type name of the sort used by Common Lisp. For example, | 662 | (quoted) type name of the sort used by Common Lisp. For example, |
| @@ -737,7 +737,7 @@ related to @code{cl-typep}. | |||
| 737 | @defun cl-coerce object type | 737 | @defun cl-coerce object type |
| 738 | This function attempts to convert @var{object} to the specified | 738 | This function attempts to convert @var{object} to the specified |
| 739 | @var{type}. If @var{object} is already of that type as determined by | 739 | @var{type}. If @var{object} is already of that type as determined by |
| 740 | @code{typep}, it is simply returned. Otherwise, certain types of | 740 | @code{cl-typep}, it is simply returned. Otherwise, certain types of |
| 741 | conversions will be made: If @var{type} is any sequence type | 741 | conversions will be made: If @var{type} is any sequence type |
| 742 | (@code{string}, @code{list}, etc.) then @var{object} will be | 742 | (@code{string}, @code{list}, etc.) then @var{object} will be |
| 743 | converted to that type if possible. If @var{type} is | 743 | converted to that type if possible. If @var{type} is |
| @@ -748,7 +748,7 @@ floats. In all other circumstances, @code{cl-coerce} signals an | |||
| 748 | error. | 748 | error. |
| 749 | @end defun | 749 | @end defun |
| 750 | 750 | ||
| 751 | @defspec cl-deftype name arglist forms... | 751 | @defmac cl-deftype name arglist forms... |
| 752 | This macro defines a new type called @var{name}. It is similar | 752 | This macro defines a new type called @var{name}. It is similar |
| 753 | to @code{defmacro} in many ways; when @var{name} is encountered | 753 | to @code{defmacro} in many ways; when @var{name} is encountered |
| 754 | as a type name, the body @var{forms} are evaluated and should | 754 | as a type name, the body @var{forms} are evaluated and should |
| @@ -776,7 +776,7 @@ unsigned-byte @equiv{} (integer 0 *) | |||
| 776 | The last example shows how the Common Lisp @code{unsigned-byte} | 776 | The last example shows how the Common Lisp @code{unsigned-byte} |
| 777 | type specifier could be implemented if desired; this package does | 777 | type specifier could be implemented if desired; this package does |
| 778 | not implement @code{unsigned-byte} by default. | 778 | not implement @code{unsigned-byte} by default. |
| 779 | @end defspec | 779 | @end defmac |
| 780 | 780 | ||
| 781 | The @code{cl-typecase} and @code{cl-check-type} macros also use type | 781 | The @code{cl-typecase} and @code{cl-check-type} macros also use type |
| 782 | names. @xref{Conditionals}. @xref{Assertions}. The @code{cl-map}, | 782 | names. @xref{Conditionals}. @xref{Assertions}. The @code{cl-map}, |
| @@ -816,23 +816,21 @@ In Emacs, use @code{memq} (or @code{cl-member}) and @code{assq} (or | |||
| 816 | 816 | ||
| 817 | @noindent | 817 | @noindent |
| 818 | The features described in the following sections implement | 818 | The features described in the following sections implement |
| 819 | various advanced control structures, including the powerful | 819 | various advanced control structures, including extensions to the |
| 820 | @c FIXME setf is now in gv.el, not cl. | 820 | standard @code{setf} facility, and a number of looping and conditional |
| 821 | @code{setf} facility and a number of looping and conditional | ||
| 822 | constructs. | 821 | constructs. |
| 823 | 822 | ||
| 824 | @c FIXME setf, push are standard now. | 823 | @c FIXME |
| 825 | @c lexical-let is obsolete; flet is not cl-flet. | 824 | @c flet is not cl-flet. |
| 826 | @c values is not cl-values. | ||
| 827 | @menu | 825 | @menu |
| 828 | * Assignment:: The @code{cl-psetq} form. | 826 | * Assignment:: The @code{cl-psetq} form. |
| 829 | * Generalized Variables:: @code{setf}, @code{cl-incf}, @code{push}, etc. | 827 | * Generalized Variables:: Extensions to generalized variables. |
| 830 | * Variable Bindings:: @code{cl-progv}, @code{lexical-let}, @code{flet}, @code{cl-macrolet}. | 828 | * Variable Bindings:: @code{cl-progv}, @code{flet}, @code{cl-macrolet}. |
| 831 | * Conditionals:: @code{cl-case}, @code{cl-typecase}. | 829 | * Conditionals:: @code{cl-case}, @code{cl-typecase}. |
| 832 | * Blocks and Exits:: @code{cl-block}, @code{cl-return}, @code{cl-return-from}. | 830 | * Blocks and Exits:: @code{cl-block}, @code{cl-return}, @code{cl-return-from}. |
| 833 | * Iteration:: @code{cl-do}, @code{cl-dotimes}, @code{cl-dolist}, @code{cl-do-symbols}. | 831 | * Iteration:: @code{cl-do}, @code{cl-dotimes}, @code{cl-dolist}, @code{cl-do-symbols}. |
| 834 | * Loop Facility:: The Common Lisp @code{cl-loop} macro. | 832 | * Loop Facility:: The Common Lisp @code{cl-loop} macro. |
| 835 | * Multiple Values:: @code{values}, @code{cl-multiple-value-bind}, etc. | 833 | * Multiple Values:: @code{cl-values}, @code{cl-multiple-value-bind}, etc. |
| 836 | @end menu | 834 | @end menu |
| 837 | 835 | ||
| 838 | @node Assignment | 836 | @node Assignment |
| @@ -842,7 +840,7 @@ constructs. | |||
| 842 | The @code{cl-psetq} form is just like @code{setq}, except that multiple | 840 | The @code{cl-psetq} form is just like @code{setq}, except that multiple |
| 843 | assignments are done in parallel rather than sequentially. | 841 | assignments are done in parallel rather than sequentially. |
| 844 | 842 | ||
| 845 | @defspec cl-psetq [symbol form]@dots{} | 843 | @defmac cl-psetq [symbol form]@dots{} |
| 846 | This special form (actually a macro) is used to assign to several | 844 | This special form (actually a macro) is used to assign to several |
| 847 | variables simultaneously. Given only one @var{symbol} and @var{form}, | 845 | variables simultaneously. Given only one @var{symbol} and @var{form}, |
| 848 | it has the same effect as @code{setq}. Given several @var{symbol} | 846 | it has the same effect as @code{setq}. Given several @var{symbol} |
| @@ -870,132 +868,79 @@ provides an even more convenient way to swap two variables; | |||
| 870 | @pxref{Modify Macros}.) | 868 | @pxref{Modify Macros}.) |
| 871 | 869 | ||
| 872 | @code{cl-psetq} always returns @code{nil}. | 870 | @code{cl-psetq} always returns @code{nil}. |
| 873 | @end defspec | 871 | @end defmac |
| 874 | 872 | ||
| 875 | @c FIXME now in gv.el. | ||
| 876 | @node Generalized Variables | 873 | @node Generalized Variables |
| 877 | @section Generalized Variables | 874 | @section Generalized Variables |
| 878 | 875 | ||
| 879 | @noindent | 876 | A @dfn{generalized variable} or @dfn{place form} is one of the many |
| 880 | A ``generalized variable'' or ``place form'' is one of the many places | 877 | places in Lisp memory where values can be stored. The simplest place |
| 881 | in Lisp memory where values can be stored. The simplest place form is | 878 | form is a regular Lisp variable. But the cars and cdrs of lists, |
| 882 | a regular Lisp variable. But the cars and cdrs of lists, elements | 879 | elements of arrays, properties of symbols, and many other locations |
| 883 | of arrays, properties of symbols, and many other locations are also | 880 | are also places where Lisp values are stored. For basic information, |
| 884 | places where Lisp values are stored. | 881 | @pxref{Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}. |
| 885 | 882 | This package provides several additional features related to | |
| 886 | The @code{setf} form is like @code{setq}, except that it accepts | 883 | generalized variables. |
| 887 | arbitrary place forms on the left side rather than just | ||
| 888 | symbols. For example, @code{(setf (car a) b)} sets the car of | ||
| 889 | @code{a} to @code{b}, doing the same operation as @code{(setcar a b)} | ||
| 890 | but without having to remember two separate functions for setting | ||
| 891 | and accessing every type of place. | ||
| 892 | |||
| 893 | Generalized variables are analogous to ``lvalues'' in the C | ||
| 894 | language, where @samp{x = a[i]} gets an element from an array | ||
| 895 | and @samp{a[i] = x} stores an element using the same notation. | ||
| 896 | Just as certain forms like @code{a[i]} can be lvalues in C, there | ||
| 897 | is a set of forms that can be generalized variables in Lisp. | ||
| 898 | 884 | ||
| 899 | @menu | 885 | @menu |
| 900 | * Basic Setf:: @code{setf} and place forms. | 886 | * Setf Extensions:: Additional @code{setf} places. |
| 901 | * Modify Macros:: @code{cl-incf}, @code{push}, @code{cl-rotatef}, @code{letf}, @code{cl-callf}, etc. | 887 | * Modify Macros:: @code{cl-incf}, @code{cl-rotatef}, @code{cl-letf}, @code{cl-callf}, etc. |
| 902 | * Customizing Setf:: @code{define-modify-macro}, @code{defsetf}, @code{define-setf-method}. | ||
| 903 | @end menu | 888 | @end menu |
| 904 | 889 | ||
| 905 | @node Basic Setf | 890 | @node Setf Extensions |
| 906 | @subsection Basic Setf | 891 | @subsection Setf Extensions |
| 907 | |||
| 908 | @noindent | ||
| 909 | The @code{setf} macro is the most basic way to operate on generalized | ||
| 910 | variables. | ||
| 911 | |||
| 912 | @defspec setf [place form]@dots{} | ||
| 913 | This macro evaluates @var{form} and stores it in @var{place}, which | ||
| 914 | must be a valid generalized variable form. If there are several | ||
| 915 | @var{place} and @var{form} pairs, the assignments are done sequentially | ||
| 916 | just as with @code{setq}. @code{setf} returns the value of the last | ||
| 917 | @var{form}. | ||
| 918 | |||
| 919 | The following Lisp forms will work as generalized variables, and | ||
| 920 | so may appear in the @var{place} argument of @code{setf}: | ||
| 921 | 892 | ||
| 922 | @itemize @bullet | 893 | Several standard (e.g. @code{car}) and Emacs-specific |
| 923 | @item | 894 | (e.g. @code{window-point}) Lisp functions are @code{setf}-able by default. |
| 924 | A symbol naming a variable. In other words, @code{(setf x y)} is | 895 | This package defines @code{setf} handlers for several additional functions: |
| 925 | exactly equivalent to @code{(setq x y)}, and @code{setq} itself is | ||
| 926 | strictly speaking redundant now that @code{setf} exists. Many | ||
| 927 | programmers continue to prefer @code{setq} for setting simple | ||
| 928 | variables, though, purely for stylistic or historical reasons. | ||
| 929 | The macro @code{(setf x y)} actually expands to @code{(setq x y)}, | ||
| 930 | so there is no performance penalty for using it in compiled code. | ||
| 931 | 896 | ||
| 897 | @itemize | ||
| 932 | @item | 898 | @item |
| 933 | A call to any of the following Lisp functions: | 899 | Functions from @code{CL} itself: |
| 934 | |||
| 935 | @smallexample | 900 | @smallexample |
| 936 | car cdr caar .. cddddr | 901 | cl-caaar .. cl-cddddr cl-first .. cl-tenth |
| 937 | nth rest first .. tenth | 902 | cl-rest cl-get cl-getf cl-subseq |
| 938 | aref elt nthcdr | ||
| 939 | symbol-function symbol-value symbol-plist | ||
| 940 | get get* getf | ||
| 941 | gethash subseq | ||
| 942 | @end smallexample | 903 | @end smallexample |
| 943 | 904 | ||
| 944 | @noindent | 905 | @noindent |
| 945 | Note that for @code{nthcdr} and @code{getf}, the list argument | 906 | Note that for @code{cl-getf} (as for @code{nthcdr}), the list argument |
| 946 | of the function must itself be a valid @var{place} form. For | 907 | of the function must itself be a valid @var{place} form. |
| 947 | example, @code{(setf (nthcdr 0 foo) 7)} will set @code{foo} itself | ||
| 948 | to 7. Note that @code{push} and @code{pop} on an @code{nthcdr} | ||
| 949 | place can be used to insert or delete at any position in a list. | ||
| 950 | The use of @code{nthcdr} as a @var{place} form is an extension | ||
| 951 | to standard Common Lisp. | ||
| 952 | 908 | ||
| 953 | @item | 909 | @item |
| 954 | The following Emacs-specific functions are also @code{setf}-able. | 910 | General Emacs Lisp functions: |
| 955 | |||
| 956 | @smallexample | 911 | @smallexample |
| 957 | buffer-file-name marker-position | 912 | buffer-file-name getenv |
| 958 | buffer-modified-p match-data | 913 | buffer-modified-p global-key-binding |
| 959 | buffer-name mouse-position | 914 | buffer-name local-key-binding |
| 960 | buffer-string overlay-end | 915 | buffer-string mark |
| 961 | buffer-substring overlay-get | 916 | buffer-substring mark-marker |
| 962 | current-buffer overlay-start | 917 | current-buffer marker-position |
| 963 | current-case-table point | 918 | current-case-table mouse-position |
| 964 | current-column point-marker | 919 | current-column point |
| 965 | current-global-map point-max | 920 | current-global-map point-marker |
| 966 | current-input-mode point-min | 921 | current-input-mode point-max |
| 967 | current-local-map process-buffer | 922 | current-local-map point-min |
| 968 | current-window-configuration process-filter | 923 | current-window-configuration read-mouse-position |
| 969 | default-file-modes process-sentinel | 924 | default-file-modes screen-height |
| 970 | default-value read-mouse-position | 925 | documentation-property screen-width |
| 971 | documentation-property screen-height | 926 | face-background selected-window |
| 972 | extent-data screen-menubar | 927 | face-background-pixmap selected-screen |
| 973 | extent-end-position screen-width | 928 | face-font selected-frame |
| 974 | extent-start-position selected-window | 929 | face-foreground standard-case-table |
| 975 | face-background selected-screen | 930 | face-underline-p syntax-table |
| 976 | face-background-pixmap selected-frame | 931 | file-modes visited-file-modtime |
| 977 | face-font standard-case-table | 932 | frame-height window-height |
| 978 | face-foreground syntax-table | 933 | frame-parameters window-width |
| 979 | face-underline-p window-buffer | 934 | frame-visible-p x-get-secondary-selection |
| 980 | file-modes window-dedicated-p | 935 | frame-width x-get-selection |
| 981 | frame-height window-display-table | 936 | get-register |
| 982 | frame-parameters window-height | ||
| 983 | frame-visible-p window-hscroll | ||
| 984 | frame-width window-point | ||
| 985 | get-register window-start | ||
| 986 | getenv window-width | ||
| 987 | global-key-binding x-get-secondary-selection | ||
| 988 | keymap-parent x-get-selection | ||
| 989 | local-key-binding | ||
| 990 | mark | ||
| 991 | mark-marker | ||
| 992 | @end smallexample | 937 | @end smallexample |
| 993 | 938 | ||
| 994 | Most of these have directly corresponding ``set'' functions, like | 939 | Most of these have directly corresponding ``set'' functions, like |
| 995 | @code{use-local-map} for @code{current-local-map}, or @code{goto-char} | 940 | @code{use-local-map} for @code{current-local-map}, or @code{goto-char} |
| 996 | for @code{point}. A few, like @code{point-min}, expand to longer | 941 | for @code{point}. A few, like @code{point-min}, expand to longer |
| 997 | sequences of code when they are @code{setf}'d (@code{(narrow-to-region | 942 | sequences of code when they are used with @code{setf} |
| 998 | x (point-max))} in this case). | 943 | (@code{(narrow-to-region x (point-max))} in this case). |
| 999 | 944 | ||
| 1000 | @item | 945 | @item |
| 1001 | A call of the form @code{(substring @var{subplace} @var{n} [@var{m}])}, | 946 | A call of the form @code{(substring @var{subplace} @var{n} [@var{m}])}, |
| @@ -1022,6 +967,10 @@ a | |||
| 1022 | The generalized variable @code{buffer-substring}, listed above, | 967 | The generalized variable @code{buffer-substring}, listed above, |
| 1023 | also works in this way by replacing a portion of the current buffer. | 968 | also works in this way by replacing a portion of the current buffer. |
| 1024 | 969 | ||
| 970 | @c FIXME? Also `eq'? (see cl-lib.el) | ||
| 971 | |||
| 972 | @c Currently commented out in cl.el. | ||
| 973 | @ignore | ||
| 1025 | @item | 974 | @item |
| 1026 | A call of the form @code{(apply '@var{func} @dots{})} or | 975 | A call of the form @code{(apply '@var{func} @dots{})} or |
| 1027 | @code{(apply (function @var{func}) @dots{})}, where @var{func} | 976 | @code{(apply (function @var{func}) @dots{})}, where @var{func} |
| @@ -1030,6 +979,8 @@ in the sense described in Steele's book; since none of the standard | |||
| 1030 | Emacs place functions are suitable in this sense, this feature is | 979 | Emacs place functions are suitable in this sense, this feature is |
| 1031 | only interesting when used with places you define yourself with | 980 | only interesting when used with places you define yourself with |
| 1032 | @code{define-setf-method} or the long form of @code{defsetf}. | 981 | @code{define-setf-method} or the long form of @code{defsetf}. |
| 982 | @xref{Obsolete Setf Customization}. | ||
| 983 | @end ignore | ||
| 1033 | 984 | ||
| 1034 | @item | 985 | @item |
| 1035 | A macro call, in which case the macro is expanded and @code{setf} | 986 | A macro call, in which case the macro is expanded and @code{setf} |
| @@ -1037,21 +988,21 @@ is applied to the resulting form. | |||
| 1037 | 988 | ||
| 1038 | @item | 989 | @item |
| 1039 | Any form for which a @code{defsetf} or @code{define-setf-method} | 990 | Any form for which a @code{defsetf} or @code{define-setf-method} |
| 1040 | has been made. | 991 | has been made. @xref{Obsolete Setf Customization}. |
| 1041 | @end itemize | 992 | @end itemize |
| 1042 | 993 | ||
| 1043 | Using any forms other than these in the @var{place} argument to | 994 | @c FIXME should this be in lispref? It seems self-evident. |
| 1044 | @code{setf} will signal an error. | 995 | @c Contrast with the cl-incf example later on. |
| 1045 | 996 | @c Here it really only serves as a constrast to wrong-order. | |
| 1046 | The @code{setf} macro takes care to evaluate all subforms in | 997 | The @code{setf} macro takes care to evaluate all subforms in |
| 1047 | the proper left-to-right order; for example, | 998 | the proper left-to-right order; for example, |
| 1048 | 999 | ||
| 1049 | @example | 1000 | @example |
| 1050 | (setf (aref vec (incf i)) i) | 1001 | (setf (aref vec (cl-incf i)) i) |
| 1051 | @end example | 1002 | @end example |
| 1052 | 1003 | ||
| 1053 | @noindent | 1004 | @noindent |
| 1054 | looks like it will evaluate @code{(incf i)} exactly once, before the | 1005 | looks like it will evaluate @code{(cl-incf i)} exactly once, before the |
| 1055 | following access to @code{i}; the @code{setf} expander will insert | 1006 | following access to @code{i}; the @code{setf} expander will insert |
| 1056 | temporary variables as necessary to ensure that it does in fact work | 1007 | temporary variables as necessary to ensure that it does in fact work |
| 1057 | this way no matter what setf-method is defined for @code{aref}. | 1008 | this way no matter what setf-method is defined for @code{aref}. |
| @@ -1071,35 +1022,34 @@ will be preserved. Adapting an example from Steele, given | |||
| 1071 | the form @code{(setf (wrong-order @var{a} @var{b}) 17)} will | 1022 | the form @code{(setf (wrong-order @var{a} @var{b}) 17)} will |
| 1072 | evaluate @var{b} first, then @var{a}, just as in an actual call | 1023 | evaluate @var{b} first, then @var{a}, just as in an actual call |
| 1073 | to @code{wrong-order}. | 1024 | to @code{wrong-order}. |
| 1074 | @end defspec | ||
| 1075 | 1025 | ||
| 1076 | @node Modify Macros | 1026 | @node Modify Macros |
| 1077 | @subsection Modify Macros | 1027 | @subsection Modify Macros |
| 1078 | 1028 | ||
| 1079 | @noindent | 1029 | @noindent |
| 1080 | This package defines a number of other macros besides @code{setf} | 1030 | This package defines a number of macros that operate on generalized |
| 1081 | that operate on generalized variables. Many are interesting and | 1031 | variables. Many are interesting and useful even when the @var{place} |
| 1082 | useful even when the @var{place} is just a variable name. | 1032 | is just a variable name. |
| 1083 | 1033 | ||
| 1084 | @defspec psetf [place form]@dots{} | 1034 | @defmac cl-psetf [place form]@dots{} |
| 1085 | This macro is to @code{setf} what @code{cl-psetq} is to @code{setq}: | 1035 | This macro is to @code{setf} what @code{cl-psetq} is to @code{setq}: |
| 1086 | When several @var{place}s and @var{form}s are involved, the | 1036 | When several @var{place}s and @var{form}s are involved, the |
| 1087 | assignments take place in parallel rather than sequentially. | 1037 | assignments take place in parallel rather than sequentially. |
| 1088 | Specifically, all subforms are evaluated from left to right, then | 1038 | Specifically, all subforms are evaluated from left to right, then |
| 1089 | all the assignments are done (in an undefined order). | 1039 | all the assignments are done (in an undefined order). |
| 1090 | @end defspec | 1040 | @end defmac |
| 1091 | 1041 | ||
| 1092 | @defspec incf place &optional x | 1042 | @defmac cl-incf place &optional x |
| 1093 | This macro increments the number stored in @var{place} by one, or | 1043 | This macro increments the number stored in @var{place} by one, or |
| 1094 | by @var{x} if specified. The incremented value is returned. For | 1044 | by @var{x} if specified. The incremented value is returned. For |
| 1095 | example, @code{(incf i)} is equivalent to @code{(setq i (1+ i))}, and | 1045 | example, @code{(cl-incf i)} is equivalent to @code{(setq i (1+ i))}, and |
| 1096 | @code{(incf (car x) 2)} is equivalent to @code{(setcar x (+ (car x) 2))}. | 1046 | @code{(cl-incf (car x) 2)} is equivalent to @code{(setcar x (+ (car x) 2))}. |
| 1097 | 1047 | ||
| 1098 | Once again, care is taken to preserve the ``apparent'' order of | 1048 | As with @code{setf}, care is taken to preserve the ``apparent'' order |
| 1099 | evaluation. For example, | 1049 | of evaluation. For example, |
| 1100 | 1050 | ||
| 1101 | @example | 1051 | @example |
| 1102 | (incf (aref vec (incf i))) | 1052 | (cl-incf (aref vec (cl-incf i))) |
| 1103 | @end example | 1053 | @end example |
| 1104 | 1054 | ||
| 1105 | @noindent | 1055 | @noindent |
| @@ -1109,93 +1059,81 @@ does, which means the above form is @emph{not} equivalent to the | |||
| 1109 | ``obvious'' expansion, | 1059 | ``obvious'' expansion, |
| 1110 | 1060 | ||
| 1111 | @example | 1061 | @example |
| 1112 | (setf (aref vec (incf i)) (1+ (aref vec (incf i)))) ; Wrong! | 1062 | (setf (aref vec (cl-incf i)) |
| 1063 | (1+ (aref vec (cl-incf i)))) ; wrong! | ||
| 1113 | @end example | 1064 | @end example |
| 1114 | 1065 | ||
| 1115 | @noindent | 1066 | @noindent |
| 1116 | but rather to something more like | 1067 | but rather to something more like |
| 1117 | 1068 | ||
| 1118 | @example | 1069 | @example |
| 1119 | (let ((temp (incf i))) | 1070 | (let ((temp (cl-incf i))) |
| 1120 | (setf (aref vec temp) (1+ (aref vec temp)))) | 1071 | (setf (aref vec temp) (1+ (aref vec temp)))) |
| 1121 | @end example | 1072 | @end example |
| 1122 | 1073 | ||
| 1123 | @noindent | 1074 | @noindent |
| 1124 | Again, all of this is taken care of automatically by @code{incf} and | 1075 | Again, all of this is taken care of automatically by @code{cl-incf} and |
| 1125 | the other generalized-variable macros. | 1076 | the other generalized-variable macros. |
| 1126 | 1077 | ||
| 1127 | As a more Emacs-specific example of @code{incf}, the expression | 1078 | As a more Emacs-specific example of @code{cl-incf}, the expression |
| 1128 | @code{(incf (point) @var{n})} is essentially equivalent to | 1079 | @code{(cl-incf (point) @var{n})} is essentially equivalent to |
| 1129 | @code{(forward-char @var{n})}. | 1080 | @code{(forward-char @var{n})}. |
| 1130 | @end defspec | 1081 | @end defmac |
| 1131 | 1082 | ||
| 1132 | @defspec decf place &optional x | 1083 | @defmac cl-decf place &optional x |
| 1133 | This macro decrements the number stored in @var{place} by one, or | 1084 | This macro decrements the number stored in @var{place} by one, or |
| 1134 | by @var{x} if specified. | 1085 | by @var{x} if specified. |
| 1135 | @end defspec | 1086 | @end defmac |
| 1136 | |||
| 1137 | @defspec pop place | ||
| 1138 | This macro removes and returns the first element of the list stored | ||
| 1139 | in @var{place}. It is analogous to @code{(prog1 (car @var{place}) | ||
| 1140 | (setf @var{place} (cdr @var{place})))}, except that it takes care | ||
| 1141 | to evaluate all subforms only once. | ||
| 1142 | @end defspec | ||
| 1143 | 1087 | ||
| 1144 | @defspec push x place | 1088 | @defmac cl-pushnew x place @t{&key :test :test-not :key} |
| 1145 | This macro inserts @var{x} at the front of the list stored in | ||
| 1146 | @var{place}. It is analogous to @code{(setf @var{place} (cons | ||
| 1147 | @var{x} @var{place}))}, except for evaluation of the subforms. | ||
| 1148 | @end defspec | ||
| 1149 | |||
| 1150 | @defspec pushnew x place @t{&key :test :test-not :key} | ||
| 1151 | This macro inserts @var{x} at the front of the list stored in | 1089 | This macro inserts @var{x} at the front of the list stored in |
| 1152 | @var{place}, but only if @var{x} was not @code{eql} to any | 1090 | @var{place}, but only if @var{x} was not @code{eql} to any |
| 1153 | existing element of the list. The optional keyword arguments | 1091 | existing element of the list. The optional keyword arguments |
| 1154 | are interpreted in the same way as for @code{adjoin}. | 1092 | are interpreted in the same way as for @code{cl-adjoin}. |
| 1155 | @xref{Lists as Sets}. | 1093 | @xref{Lists as Sets}. |
| 1156 | @end defspec | 1094 | @end defmac |
| 1157 | 1095 | ||
| 1158 | @defspec shiftf place@dots{} newvalue | 1096 | @defmac cl-shiftf place@dots{} newvalue |
| 1159 | This macro shifts the @var{place}s left by one, shifting in the | 1097 | This macro shifts the @var{place}s left by one, shifting in the |
| 1160 | value of @var{newvalue} (which may be any Lisp expression, not just | 1098 | value of @var{newvalue} (which may be any Lisp expression, not just |
| 1161 | a generalized variable), and returning the value shifted out of | 1099 | a generalized variable), and returning the value shifted out of |
| 1162 | the first @var{place}. Thus, @code{(shiftf @var{a} @var{b} @var{c} | 1100 | the first @var{place}. Thus, @code{(cl-shiftf @var{a} @var{b} @var{c} |
| 1163 | @var{d})} is equivalent to | 1101 | @var{d})} is equivalent to |
| 1164 | 1102 | ||
| 1165 | @example | 1103 | @example |
| 1166 | (prog1 | 1104 | (prog1 |
| 1167 | @var{a} | 1105 | @var{a} |
| 1168 | (psetf @var{a} @var{b} | 1106 | (cl-psetf @var{a} @var{b} |
| 1169 | @var{b} @var{c} | 1107 | @var{b} @var{c} |
| 1170 | @var{c} @var{d})) | 1108 | @var{c} @var{d})) |
| 1171 | @end example | 1109 | @end example |
| 1172 | 1110 | ||
| 1173 | @noindent | 1111 | @noindent |
| 1174 | except that the subforms of @var{a}, @var{b}, and @var{c} are actually | 1112 | except that the subforms of @var{a}, @var{b}, and @var{c} are actually |
| 1175 | evaluated only once each and in the apparent order. | 1113 | evaluated only once each and in the apparent order. |
| 1176 | @end defspec | 1114 | @end defmac |
| 1177 | 1115 | ||
| 1178 | @defspec rotatef place@dots{} | 1116 | @defmac cl-rotatef place@dots{} |
| 1179 | This macro rotates the @var{place}s left by one in circular fashion. | 1117 | This macro rotates the @var{place}s left by one in circular fashion. |
| 1180 | Thus, @code{(rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to | 1118 | Thus, @code{(cl-rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to |
| 1181 | 1119 | ||
| 1182 | @example | 1120 | @example |
| 1183 | (psetf @var{a} @var{b} | 1121 | (cl-psetf @var{a} @var{b} |
| 1184 | @var{b} @var{c} | 1122 | @var{b} @var{c} |
| 1185 | @var{c} @var{d} | 1123 | @var{c} @var{d} |
| 1186 | @var{d} @var{a}) | 1124 | @var{d} @var{a}) |
| 1187 | @end example | 1125 | @end example |
| 1188 | 1126 | ||
| 1189 | @noindent | 1127 | @noindent |
| 1190 | except for the evaluation of subforms. @code{rotatef} always | 1128 | except for the evaluation of subforms. @code{cl-rotatef} always |
| 1191 | returns @code{nil}. Note that @code{(rotatef @var{a} @var{b})} | 1129 | returns @code{nil}. Note that @code{(cl-rotatef @var{a} @var{b})} |
| 1192 | conveniently exchanges @var{a} and @var{b}. | 1130 | conveniently exchanges @var{a} and @var{b}. |
| 1193 | @end defspec | 1131 | @end defmac |
| 1194 | 1132 | ||
| 1195 | The following macros were invented for this package; they have no | 1133 | The following macros were invented for this package; they have no |
| 1196 | analogues in Common Lisp. | 1134 | analogues in Common Lisp. |
| 1197 | 1135 | ||
| 1198 | @defspec letf (bindings@dots{}) forms@dots{} | 1136 | @defmac cl-letf (bindings@dots{}) forms@dots{} |
| 1199 | This macro is analogous to @code{let}, but for generalized variables | 1137 | This macro is analogous to @code{let}, but for generalized variables |
| 1200 | rather than just symbols. Each @var{binding} should be of the form | 1138 | rather than just symbols. Each @var{binding} should be of the form |
| 1201 | @code{(@var{place} @var{value})}; the original contents of the | 1139 | @code{(@var{place} @var{value})}; the original contents of the |
| @@ -1208,294 +1146,91 @@ error. | |||
| 1208 | For example, | 1146 | For example, |
| 1209 | 1147 | ||
| 1210 | @example | 1148 | @example |
| 1211 | (letf (((point) (point-min)) | 1149 | (cl-letf (((point) (point-min)) |
| 1212 | (a 17)) | 1150 | (a 17)) |
| 1213 | ...) | 1151 | ...) |
| 1214 | @end example | 1152 | @end example |
| 1215 | 1153 | ||
| 1216 | @noindent | 1154 | @noindent |
| 1217 | moves ``point'' in the current buffer to the beginning of the buffer, | 1155 | moves point in the current buffer to the beginning of the buffer, |
| 1218 | and also binds @code{a} to 17 (as if by a normal @code{let}, since | 1156 | and also binds @code{a} to 17 (as if by a normal @code{let}, since |
| 1219 | @code{a} is just a regular variable). After the body exits, @code{a} | 1157 | @code{a} is just a regular variable). After the body exits, @code{a} |
| 1220 | is set back to its original value and point is moved back to its | 1158 | is set back to its original value and point is moved back to its |
| 1221 | original position. | 1159 | original position. |
| 1222 | 1160 | ||
| 1223 | Note that @code{letf} on @code{(point)} is not quite like a | 1161 | Note that @code{cl-letf} on @code{(point)} is not quite like a |
| 1224 | @code{save-excursion}, as the latter effectively saves a marker | 1162 | @code{save-excursion}, as the latter effectively saves a marker |
| 1225 | which tracks insertions and deletions in the buffer. Actually, | 1163 | which tracks insertions and deletions in the buffer. Actually, |
| 1226 | a @code{letf} of @code{(point-marker)} is much closer to this | 1164 | a @code{cl-letf} of @code{(point-marker)} is much closer to this |
| 1227 | behavior. (@code{point} and @code{point-marker} are equivalent | 1165 | behavior. (@code{point} and @code{point-marker} are equivalent |
| 1228 | as @code{setf} places; each will accept either an integer or a | 1166 | as @code{setf} places; each will accept either an integer or a |
| 1229 | marker as the stored value.) | 1167 | marker as the stored value.) |
| 1230 | 1168 | ||
| 1231 | Since generalized variables look like lists, @code{let}'s shorthand | 1169 | Since generalized variables look like lists, @code{let}'s shorthand |
| 1232 | of using @samp{foo} for @samp{(foo nil)} as a @var{binding} would | 1170 | of using @samp{foo} for @samp{(foo nil)} as a @var{binding} would |
| 1233 | be ambiguous in @code{letf} and is not allowed. | 1171 | be ambiguous in @code{cl-letf} and is not allowed. |
| 1234 | 1172 | ||
| 1235 | However, a @var{binding} specifier may be a one-element list | 1173 | However, a @var{binding} specifier may be a one-element list |
| 1236 | @samp{(@var{place})}, which is similar to @samp{(@var{place} | 1174 | @samp{(@var{place})}, which is similar to @samp{(@var{place} |
| 1237 | @var{place})}. In other words, the @var{place} is not disturbed | 1175 | @var{place})}. In other words, the @var{place} is not disturbed |
| 1238 | on entry to the body, and the only effect of the @code{letf} is | 1176 | on entry to the body, and the only effect of the @code{cl-letf} is |
| 1239 | to restore the original value of @var{place} afterwards. (The | 1177 | to restore the original value of @var{place} afterwards. |
| 1240 | redundant access-and-store suggested by the @code{(@var{place} | 1178 | @c I suspect this may no longer be true; either way it's |
| 1179 | @c implementation detail and so not essential to document. | ||
| 1180 | @ignore | ||
| 1181 | (The redundant access-and-store suggested by the @code{(@var{place} | ||
| 1241 | @var{place})} example does not actually occur.) | 1182 | @var{place})} example does not actually occur.) |
| 1242 | 1183 | @end ignore | |
| 1243 | In most cases, the @var{place} must have a well-defined value on | 1184 | |
| 1244 | entry to the @code{letf} form. The only exceptions are plain | 1185 | Note that in this case, and in fact almost every case, @var{place} |
| 1245 | variables and calls to @code{symbol-value} and @code{symbol-function}. | 1186 | must have a well-defined value outside the @code{cl-letf} body. |
| 1246 | If the symbol is not bound on entry, it is simply made unbound by | 1187 | There is essentially only one exception to this, which is @var{place} |
| 1247 | @code{makunbound} or @code{fmakunbound} on exit. | 1188 | a plain variable with a specified @var{value} (such as @code{(a 17)} |
| 1248 | @end defspec | 1189 | in the above example). |
| 1249 | 1190 | @c See http://debbugs.gnu.org/12758 | |
| 1250 | @defspec letf* (bindings@dots{}) forms@dots{} | 1191 | @c Some or all of this was true for cl.el, but not for cl-lib.el. |
| 1251 | This macro is to @code{letf} what @code{let*} is to @code{let}: | 1192 | @ignore |
| 1193 | The only exceptions are plain variables and calls to | ||
| 1194 | @code{symbol-value} and @code{symbol-function}. If the symbol is not | ||
| 1195 | bound on entry, it is simply made unbound by @code{makunbound} or | ||
| 1196 | @code{fmakunbound} on exit. | ||
| 1197 | @end ignore | ||
| 1198 | @end defmac | ||
| 1199 | |||
| 1200 | @defmac cl-letf* (bindings@dots{}) forms@dots{} | ||
| 1201 | This macro is to @code{cl-letf} what @code{let*} is to @code{let}: | ||
| 1252 | It does the bindings in sequential rather than parallel order. | 1202 | It does the bindings in sequential rather than parallel order. |
| 1253 | @end defspec | 1203 | @end defmac |
| 1254 | 1204 | ||
| 1255 | @defspec callf @var{function} @var{place} @var{args}@dots{} | 1205 | @defmac cl-callf @var{function} @var{place} @var{args}@dots{} |
| 1256 | This is the ``generic'' modify macro. It calls @var{function}, | 1206 | This is the ``generic'' modify macro. It calls @var{function}, |
| 1257 | which should be an unquoted function name, macro name, or lambda. | 1207 | which should be an unquoted function name, macro name, or lambda. |
| 1258 | It passes @var{place} and @var{args} as arguments, and assigns the | 1208 | It passes @var{place} and @var{args} as arguments, and assigns the |
| 1259 | result back to @var{place}. For example, @code{(incf @var{place} | 1209 | result back to @var{place}. For example, @code{(cl-incf @var{place} |
| 1260 | @var{n})} is the same as @code{(callf + @var{place} @var{n})}. | 1210 | @var{n})} is the same as @code{(cl-callf + @var{place} @var{n})}. |
| 1261 | Some more examples: | 1211 | Some more examples: |
| 1262 | 1212 | ||
| 1263 | @example | 1213 | @example |
| 1264 | (callf abs my-number) | 1214 | (cl-callf abs my-number) |
| 1265 | (callf concat (buffer-name) "<" (int-to-string n) ">") | 1215 | (cl-callf concat (buffer-name) "<" (number-to-string n) ">") |
| 1266 | (callf union happy-people (list joe bob) :test 'same-person) | 1216 | (cl-callf cl-union happy-people (list joe bob) :test 'same-person) |
| 1267 | @end example | 1217 | @end example |
| 1268 | 1218 | ||
| 1269 | @xref{Customizing Setf}, for @code{define-modify-macro}, a way | 1219 | Note again that @code{cl-callf} is an extension to standard Common Lisp. |
| 1270 | to create even more concise notations for modify macros. Note | 1220 | @end defmac |
| 1271 | again that @code{callf} is an extension to standard Common Lisp. | ||
| 1272 | @end defspec | ||
| 1273 | 1221 | ||
| 1274 | @defspec callf2 @var{function} @var{arg1} @var{place} @var{args}@dots{} | 1222 | @defmac cl-callf2 @var{function} @var{arg1} @var{place} @var{args}@dots{} |
| 1275 | This macro is like @code{callf}, except that @var{place} is | 1223 | This macro is like @code{cl-callf}, except that @var{place} is |
| 1276 | the @emph{second} argument of @var{function} rather than the | 1224 | the @emph{second} argument of @var{function} rather than the |
| 1277 | first. For example, @code{(push @var{x} @var{place})} is | 1225 | first. For example, @code{(push @var{x} @var{place})} is |
| 1278 | equivalent to @code{(callf2 cons @var{x} @var{place})}. | 1226 | equivalent to @code{(cl-callf2 cons @var{x} @var{place})}. |
| 1279 | @end defspec | 1227 | @end defmac |
| 1280 | 1228 | ||
| 1281 | The @code{callf} and @code{callf2} macros serve as building | 1229 | The @code{cl-callf} and @code{cl-callf2} macros serve as building |
| 1282 | blocks for other macros like @code{incf}, @code{pushnew}, and | 1230 | blocks for other macros like @code{cl-incf}, and @code{cl-pushnew}. |
| 1283 | @code{define-modify-macro}. The @code{letf} and @code{letf*} | 1231 | The @code{cl-letf} and @code{cl-letf*} macros are used in the processing |
| 1284 | macros are used in the processing of symbol macros; | 1232 | of symbol macros; @pxref{Macro Bindings}. |
| 1285 | @pxref{Macro Bindings}. | ||
| 1286 | 1233 | ||
| 1287 | @node Customizing Setf | ||
| 1288 | @subsection Customizing Setf | ||
| 1289 | |||
| 1290 | @noindent | ||
| 1291 | Common Lisp defines three macros, @code{define-modify-macro}, | ||
| 1292 | @code{defsetf}, and @code{define-setf-method}, that allow the | ||
| 1293 | user to extend generalized variables in various ways. | ||
| 1294 | |||
| 1295 | @defspec define-modify-macro name arglist function [doc-string] | ||
| 1296 | This macro defines a ``read-modify-write'' macro similar to | ||
| 1297 | @code{incf} and @code{decf}. The macro @var{name} is defined | ||
| 1298 | to take a @var{place} argument followed by additional arguments | ||
| 1299 | described by @var{arglist}. The call | ||
| 1300 | |||
| 1301 | @example | ||
| 1302 | (@var{name} @var{place} @var{args}...) | ||
| 1303 | @end example | ||
| 1304 | |||
| 1305 | @noindent | ||
| 1306 | will be expanded to | ||
| 1307 | |||
| 1308 | @example | ||
| 1309 | (callf @var{func} @var{place} @var{args}...) | ||
| 1310 | @end example | ||
| 1311 | |||
| 1312 | @noindent | ||
| 1313 | which in turn is roughly equivalent to | ||
| 1314 | |||
| 1315 | @example | ||
| 1316 | (setf @var{place} (@var{func} @var{place} @var{args}...)) | ||
| 1317 | @end example | ||
| 1318 | |||
| 1319 | For example: | ||
| 1320 | |||
| 1321 | @example | ||
| 1322 | (define-modify-macro incf (&optional (n 1)) +) | ||
| 1323 | (define-modify-macro concatf (&rest args) concat) | ||
| 1324 | @end example | ||
| 1325 | |||
| 1326 | Note that @code{&key} is not allowed in @var{arglist}, but | ||
| 1327 | @code{&rest} is sufficient to pass keywords on to the function. | ||
| 1328 | |||
| 1329 | Most of the modify macros defined by Common Lisp do not exactly | ||
| 1330 | follow the pattern of @code{define-modify-macro}. For example, | ||
| 1331 | @code{push} takes its arguments in the wrong order, and @code{pop} | ||
| 1332 | is completely irregular. You can define these macros ``by hand'' | ||
| 1333 | using @code{get-setf-method}, or consult the source file | ||
| 1334 | @file{cl-macs.el} to see how to use the internal @code{setf} | ||
| 1335 | building blocks. | ||
| 1336 | @end defspec | ||
| 1337 | |||
| 1338 | @defspec defsetf access-fn update-fn | ||
| 1339 | This is the simpler of two @code{defsetf} forms. Where | ||
| 1340 | @var{access-fn} is the name of a function which accesses a place, | ||
| 1341 | this declares @var{update-fn} to be the corresponding store | ||
| 1342 | function. From now on, | ||
| 1343 | |||
| 1344 | @example | ||
| 1345 | (setf (@var{access-fn} @var{arg1} @var{arg2} @var{arg3}) @var{value}) | ||
| 1346 | @end example | ||
| 1347 | |||
| 1348 | @noindent | ||
| 1349 | will be expanded to | ||
| 1350 | |||
| 1351 | @example | ||
| 1352 | (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} @var{value}) | ||
| 1353 | @end example | ||
| 1354 | |||
| 1355 | @noindent | ||
| 1356 | The @var{update-fn} is required to be either a true function, or | ||
| 1357 | a macro which evaluates its arguments in a function-like way. Also, | ||
| 1358 | the @var{update-fn} is expected to return @var{value} as its result. | ||
| 1359 | Otherwise, the above expansion would not obey the rules for the way | ||
| 1360 | @code{setf} is supposed to behave. | ||
| 1361 | |||
| 1362 | As a special (non-Common-Lisp) extension, a third argument of @code{t} | ||
| 1363 | to @code{defsetf} says that the @code{update-fn}'s return value is | ||
| 1364 | not suitable, so that the above @code{setf} should be expanded to | ||
| 1365 | something more like | ||
| 1366 | |||
| 1367 | @example | ||
| 1368 | (let ((temp @var{value})) | ||
| 1369 | (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} temp) | ||
| 1370 | temp) | ||
| 1371 | @end example | ||
| 1372 | |||
| 1373 | Some examples of the use of @code{defsetf}, drawn from the standard | ||
| 1374 | suite of setf methods, are: | ||
| 1375 | |||
| 1376 | @example | ||
| 1377 | (defsetf car setcar) | ||
| 1378 | (defsetf symbol-value set) | ||
| 1379 | (defsetf buffer-name rename-buffer t) | ||
| 1380 | @end example | ||
| 1381 | @end defspec | ||
| 1382 | |||
| 1383 | @defspec defsetf access-fn arglist (store-var) forms@dots{} | ||
| 1384 | This is the second, more complex, form of @code{defsetf}. It is | ||
| 1385 | rather like @code{defmacro} except for the additional @var{store-var} | ||
| 1386 | argument. The @var{forms} should return a Lisp form which stores | ||
| 1387 | the value of @var{store-var} into the generalized variable formed | ||
| 1388 | by a call to @var{access-fn} with arguments described by @var{arglist}. | ||
| 1389 | The @var{forms} may begin with a string which documents the @code{setf} | ||
| 1390 | method (analogous to the doc string that appears at the front of a | ||
| 1391 | function). | ||
| 1392 | |||
| 1393 | For example, the simple form of @code{defsetf} is shorthand for | ||
| 1394 | |||
| 1395 | @example | ||
| 1396 | (defsetf @var{access-fn} (&rest args) (store) | ||
| 1397 | (append '(@var{update-fn}) args (list store))) | ||
| 1398 | @end example | ||
| 1399 | |||
| 1400 | The Lisp form that is returned can access the arguments from | ||
| 1401 | @var{arglist} and @var{store-var} in an unrestricted fashion; | ||
| 1402 | macros like @code{setf} and @code{incf} which invoke this | ||
| 1403 | setf-method will insert temporary variables as needed to make | ||
| 1404 | sure the apparent order of evaluation is preserved. | ||
| 1405 | |||
| 1406 | Another example drawn from the standard package: | ||
| 1407 | |||
| 1408 | @example | ||
| 1409 | (defsetf nth (n x) (store) | ||
| 1410 | (list 'setcar (list 'nthcdr n x) store)) | ||
| 1411 | @end example | ||
| 1412 | @end defspec | ||
| 1413 | |||
| 1414 | @defspec define-setf-method access-fn arglist forms@dots{} | ||
| 1415 | This is the most general way to create new place forms. When | ||
| 1416 | a @code{setf} to @var{access-fn} with arguments described by | ||
| 1417 | @var{arglist} is expanded, the @var{forms} are evaluated and | ||
| 1418 | must return a list of five items: | ||
| 1419 | |||
| 1420 | @enumerate | ||
| 1421 | @item | ||
| 1422 | A list of @dfn{temporary variables}. | ||
| 1423 | |||
| 1424 | @item | ||
| 1425 | A list of @dfn{value forms} corresponding to the temporary variables | ||
| 1426 | above. The temporary variables will be bound to these value forms | ||
| 1427 | as the first step of any operation on the generalized variable. | ||
| 1428 | |||
| 1429 | @item | ||
| 1430 | A list of exactly one @dfn{store variable} (generally obtained | ||
| 1431 | from a call to @code{gensym}). | ||
| 1432 | |||
| 1433 | @item | ||
| 1434 | A Lisp form which stores the contents of the store variable into | ||
| 1435 | the generalized variable, assuming the temporaries have been | ||
| 1436 | bound as described above. | ||
| 1437 | |||
| 1438 | @item | ||
| 1439 | A Lisp form which accesses the contents of the generalized variable, | ||
| 1440 | assuming the temporaries have been bound. | ||
| 1441 | @end enumerate | ||
| 1442 | |||
| 1443 | This is exactly like the Common Lisp macro of the same name, | ||
| 1444 | except that the method returns a list of five values rather | ||
| 1445 | than the five values themselves, since Emacs Lisp does not | ||
| 1446 | support Common Lisp's notion of multiple return values. | ||
| 1447 | |||
| 1448 | Once again, the @var{forms} may begin with a documentation string. | ||
| 1449 | |||
| 1450 | A setf-method should be maximally conservative with regard to | ||
| 1451 | temporary variables. In the setf-methods generated by | ||
| 1452 | @code{defsetf}, the second return value is simply the list of | ||
| 1453 | arguments in the place form, and the first return value is a | ||
| 1454 | list of a corresponding number of temporary variables generated | ||
| 1455 | by @code{gensym}. Macros like @code{setf} and @code{incf} which | ||
| 1456 | use this setf-method will optimize away most temporaries that | ||
| 1457 | turn out to be unnecessary, so there is little reason for the | ||
| 1458 | setf-method itself to optimize. | ||
| 1459 | @end defspec | ||
| 1460 | |||
| 1461 | @defun get-setf-method place &optional env | ||
| 1462 | This function returns the setf-method for @var{place}, by | ||
| 1463 | invoking the definition previously recorded by @code{defsetf} | ||
| 1464 | or @code{define-setf-method}. The result is a list of five | ||
| 1465 | values as described above. You can use this function to build | ||
| 1466 | your own @code{incf}-like modify macros. (Actually, it is | ||
| 1467 | better to use the internal functions @code{cl-setf-do-modify} | ||
| 1468 | and @code{cl-setf-do-store}, which are a bit easier to use and | ||
| 1469 | which also do a number of optimizations; consult the source | ||
| 1470 | code for the @code{incf} function for a simple example.) | ||
| 1471 | |||
| 1472 | The argument @var{env} specifies the ``environment'' to be | ||
| 1473 | passed on to @code{macroexpand} if @code{get-setf-method} should | ||
| 1474 | need to expand a macro in @var{place}. It should come from | ||
| 1475 | an @code{&environment} argument to the macro or setf-method | ||
| 1476 | that called @code{get-setf-method}. | ||
| 1477 | |||
| 1478 | See also the source code for the setf-methods for @code{apply} | ||
| 1479 | and @code{substring}, each of which works by calling | ||
| 1480 | @code{get-setf-method} on a simpler case, then massaging | ||
| 1481 | the result in various ways. | ||
| 1482 | @end defun | ||
| 1483 | |||
| 1484 | Modern Common Lisp defines a second, independent way to specify | ||
| 1485 | the @code{setf} behavior of a function, namely ``@code{setf} | ||
| 1486 | functions'' whose names are lists @code{(setf @var{name})} | ||
| 1487 | rather than symbols. For example, @code{(defun (setf foo) @dots{})} | ||
| 1488 | defines the function that is used when @code{setf} is applied to | ||
| 1489 | @code{foo}. This package does not currently support @code{setf} | ||
| 1490 | functions. In particular, it is a compile-time error to use | ||
| 1491 | @code{setf} on a form which has not already been @code{defsetf}'d | ||
| 1492 | or otherwise declared; in newer Common Lisps, this would not be | ||
| 1493 | an error since the function @code{(setf @var{func})} might be | ||
| 1494 | defined later. | ||
| 1495 | |||
| 1496 | @iftex | ||
| 1497 | @secno=4 | ||
| 1498 | @end iftex | ||
| 1499 | 1234 | ||
| 1500 | @node Variable Bindings | 1235 | @node Variable Bindings |
| 1501 | @section Variable Bindings | 1236 | @section Variable Bindings |
| @@ -1504,14 +1239,13 @@ defined later. | |||
| 1504 | These Lisp forms make bindings to variables and function names, | 1239 | These Lisp forms make bindings to variables and function names, |
| 1505 | analogous to Lisp's built-in @code{let} form. | 1240 | analogous to Lisp's built-in @code{let} form. |
| 1506 | 1241 | ||
| 1507 | @xref{Modify Macros}, for the @code{letf} and @code{letf*} forms which | 1242 | @xref{Modify Macros}, for the @code{cl-letf} and @code{cl-letf*} forms which |
| 1508 | are also related to variable bindings. | 1243 | are also related to variable bindings. |
| 1509 | 1244 | ||
| 1510 | @menu | 1245 | @menu |
| 1511 | * Dynamic Bindings:: The @code{progv} form. | 1246 | * Dynamic Bindings:: The @code{cl-progv} form. |
| 1512 | * Lexical Bindings:: @code{lexical-let} and lexical closures. | ||
| 1513 | * Function Bindings:: @code{flet} and @code{labels}. | 1247 | * Function Bindings:: @code{flet} and @code{labels}. |
| 1514 | * Macro Bindings:: @code{macrolet} and @code{symbol-macrolet}. | 1248 | * Macro Bindings:: @code{cl-macrolet} and @code{cl-symbol-macrolet}. |
| 1515 | @end menu | 1249 | @end menu |
| 1516 | 1250 | ||
| 1517 | @node Dynamic Bindings | 1251 | @node Dynamic Bindings |
| @@ -1519,134 +1253,20 @@ are also related to variable bindings. | |||
| 1519 | 1253 | ||
| 1520 | @noindent | 1254 | @noindent |
| 1521 | The standard @code{let} form binds variables whose names are known | 1255 | The standard @code{let} form binds variables whose names are known |
| 1522 | at compile-time. The @code{progv} form provides an easy way to | 1256 | at compile-time. The @code{cl-progv} form provides an easy way to |
| 1523 | bind variables whose names are computed at run-time. | 1257 | bind variables whose names are computed at run-time. |
| 1524 | 1258 | ||
| 1525 | @defspec progv symbols values forms@dots{} | 1259 | @defmac cl-progv symbols values forms@dots{} |
| 1526 | This form establishes @code{let}-style variable bindings on a | 1260 | This form establishes @code{let}-style variable bindings on a |
| 1527 | set of variables computed at run-time. The expressions | 1261 | set of variables computed at run-time. The expressions |
| 1528 | @var{symbols} and @var{values} are evaluated, and must return lists | 1262 | @var{symbols} and @var{values} are evaluated, and must return lists |
| 1529 | of symbols and values, respectively. The symbols are bound to the | 1263 | of symbols and values, respectively. The symbols are bound to the |
| 1530 | corresponding values for the duration of the body @var{form}s. | 1264 | corresponding values for the duration of the body @var{form}s. |
| 1531 | If @var{values} is shorter than @var{symbols}, the last few symbols | 1265 | If @var{values} is shorter than @var{symbols}, the last few symbols |
| 1532 | are made unbound (as if by @code{makunbound}) inside the body. | 1266 | are bound to @code{nil}. |
| 1533 | If @var{symbols} is shorter than @var{values}, the excess values | 1267 | If @var{symbols} is shorter than @var{values}, the excess values |
| 1534 | are ignored. | 1268 | are ignored. |
| 1535 | @end defspec | 1269 | @end defmac |
| 1536 | |||
| 1537 | @node Lexical Bindings | ||
| 1538 | @subsection Lexical Bindings | ||
| 1539 | |||
| 1540 | @noindent | ||
| 1541 | The @code{CL} package defines the following macro which | ||
| 1542 | more closely follows the Common Lisp @code{let} form: | ||
| 1543 | |||
| 1544 | @defspec lexical-let (bindings@dots{}) forms@dots{} | ||
| 1545 | This form is exactly like @code{let} except that the bindings it | ||
| 1546 | establishes are purely lexical. Lexical bindings are similar to | ||
| 1547 | local variables in a language like C: Only the code physically | ||
| 1548 | within the body of the @code{lexical-let} (after macro expansion) | ||
| 1549 | may refer to the bound variables. | ||
| 1550 | |||
| 1551 | @example | ||
| 1552 | (setq a 5) | ||
| 1553 | (defun foo (b) (+ a b)) | ||
| 1554 | (let ((a 2)) (foo a)) | ||
| 1555 | @result{} 4 | ||
| 1556 | (lexical-let ((a 2)) (foo a)) | ||
| 1557 | @result{} 7 | ||
| 1558 | @end example | ||
| 1559 | |||
| 1560 | @noindent | ||
| 1561 | In this example, a regular @code{let} binding of @code{a} actually | ||
| 1562 | makes a temporary change to the global variable @code{a}, so @code{foo} | ||
| 1563 | is able to see the binding of @code{a} to 2. But @code{lexical-let} | ||
| 1564 | actually creates a distinct local variable @code{a} for use within its | ||
| 1565 | body, without any effect on the global variable of the same name. | ||
| 1566 | |||
| 1567 | The most important use of lexical bindings is to create @dfn{closures}. | ||
| 1568 | A closure is a function object that refers to an outside lexical | ||
| 1569 | variable. For example: | ||
| 1570 | |||
| 1571 | @example | ||
| 1572 | (defun make-adder (n) | ||
| 1573 | (lexical-let ((n n)) | ||
| 1574 | (function (lambda (m) (+ n m))))) | ||
| 1575 | (setq add17 (make-adder 17)) | ||
| 1576 | (funcall add17 4) | ||
| 1577 | @result{} 21 | ||
| 1578 | @end example | ||
| 1579 | |||
| 1580 | @noindent | ||
| 1581 | The call @code{(make-adder 17)} returns a function object which adds | ||
| 1582 | 17 to its argument. If @code{let} had been used instead of | ||
| 1583 | @code{lexical-let}, the function object would have referred to the | ||
| 1584 | global @code{n}, which would have been bound to 17 only during the | ||
| 1585 | call to @code{make-adder} itself. | ||
| 1586 | |||
| 1587 | @example | ||
| 1588 | (defun make-counter () | ||
| 1589 | (lexical-let ((n 0)) | ||
| 1590 | (function* (lambda (&optional (m 1)) (incf n m))))) | ||
| 1591 | (setq count-1 (make-counter)) | ||
| 1592 | (funcall count-1 3) | ||
| 1593 | @result{} 3 | ||
| 1594 | (funcall count-1 14) | ||
| 1595 | @result{} 17 | ||
| 1596 | (setq count-2 (make-counter)) | ||
| 1597 | (funcall count-2 5) | ||
| 1598 | @result{} 5 | ||
| 1599 | (funcall count-1 2) | ||
| 1600 | @result{} 19 | ||
| 1601 | (funcall count-2) | ||
| 1602 | @result{} 6 | ||
| 1603 | @end example | ||
| 1604 | |||
| 1605 | @noindent | ||
| 1606 | Here we see that each call to @code{make-counter} creates a distinct | ||
| 1607 | local variable @code{n}, which serves as a private counter for the | ||
| 1608 | function object that is returned. | ||
| 1609 | |||
| 1610 | Closed-over lexical variables persist until the last reference to | ||
| 1611 | them goes away, just like all other Lisp objects. For example, | ||
| 1612 | @code{count-2} refers to a function object which refers to an | ||
| 1613 | instance of the variable @code{n}; this is the only reference | ||
| 1614 | to that variable, so after @code{(setq count-2 nil)} the garbage | ||
| 1615 | collector would be able to delete this instance of @code{n}. | ||
| 1616 | Of course, if a @code{lexical-let} does not actually create any | ||
| 1617 | closures, then the lexical variables are free as soon as the | ||
| 1618 | @code{lexical-let} returns. | ||
| 1619 | |||
| 1620 | Many closures are used only during the extent of the bindings they | ||
| 1621 | refer to; these are known as ``downward funargs'' in Lisp parlance. | ||
| 1622 | When a closure is used in this way, regular Emacs Lisp dynamic | ||
| 1623 | bindings suffice and will be more efficient than @code{lexical-let} | ||
| 1624 | closures: | ||
| 1625 | |||
| 1626 | @example | ||
| 1627 | (defun add-to-list (x list) | ||
| 1628 | (mapcar (lambda (y) (+ x y))) list) | ||
| 1629 | (add-to-list 7 '(1 2 5)) | ||
| 1630 | @result{} (8 9 12) | ||
| 1631 | @end example | ||
| 1632 | |||
| 1633 | @noindent | ||
| 1634 | Since this lambda is only used while @code{x} is still bound, | ||
| 1635 | it is not necessary to make a true closure out of it. | ||
| 1636 | |||
| 1637 | You can use @code{defun} or @code{flet} inside a @code{lexical-let} | ||
| 1638 | to create a named closure. If several closures are created in the | ||
| 1639 | body of a single @code{lexical-let}, they all close over the same | ||
| 1640 | instance of the lexical variable. | ||
| 1641 | |||
| 1642 | The @code{lexical-let} form is an extension to Common Lisp. In | ||
| 1643 | true Common Lisp, all bindings are lexical unless declared otherwise. | ||
| 1644 | @end defspec | ||
| 1645 | |||
| 1646 | @defspec lexical-let* (bindings@dots{}) forms@dots{} | ||
| 1647 | This form is just like @code{lexical-let}, except that the bindings | ||
| 1648 | are made sequentially in the manner of @code{let*}. | ||
| 1649 | @end defspec | ||
| 1650 | 1270 | ||
| 1651 | @node Function Bindings | 1271 | @node Function Bindings |
| 1652 | @subsection Function Bindings | 1272 | @subsection Function Bindings |
| @@ -1655,12 +1275,12 @@ are made sequentially in the manner of @code{let*}. | |||
| 1655 | These forms make @code{let}-like bindings to functions instead | 1275 | These forms make @code{let}-like bindings to functions instead |
| 1656 | of variables. | 1276 | of variables. |
| 1657 | 1277 | ||
| 1658 | @defspec flet (bindings@dots{}) forms@dots{} | 1278 | @defmac flet (bindings@dots{}) forms@dots{} |
| 1659 | This form establishes @code{let}-style bindings on the function | 1279 | This form establishes @code{let}-style bindings on the function |
| 1660 | cells of symbols rather than on the value cells. Each @var{binding} | 1280 | cells of symbols rather than on the value cells. Each @var{binding} |
| 1661 | must be a list of the form @samp{(@var{name} @var{arglist} | 1281 | must be a list of the form @samp{(@var{name} @var{arglist} |
| 1662 | @var{forms}@dots{})}, which defines a function exactly as if | 1282 | @var{forms}@dots{})}, which defines a function exactly as if |
| 1663 | it were a @code{defun*} form. The function @var{name} is defined | 1283 | it were a @code{cl-defun} form. The function @var{name} is defined |
| 1664 | accordingly for the duration of the body of the @code{flet}; then | 1284 | accordingly for the duration of the body of the @code{flet}; then |
| 1665 | the old function definition, or lack thereof, is restored. | 1285 | the old function definition, or lack thereof, is restored. |
| 1666 | 1286 | ||
| @@ -1696,12 +1316,12 @@ handling. Attempts to redefine such functions using @code{flet} will | |||
| 1696 | fail if byte-compiled. In such cases, use @code{labels} instead. | 1316 | fail if byte-compiled. In such cases, use @code{labels} instead. |
| 1697 | 1317 | ||
| 1698 | Functions defined by @code{flet} may use the full Common Lisp | 1318 | Functions defined by @code{flet} may use the full Common Lisp |
| 1699 | argument notation supported by @code{defun*}; also, the function | 1319 | argument notation supported by @code{cl-defun}; also, the function |
| 1700 | body is enclosed in an implicit block as if by @code{defun*}. | 1320 | body is enclosed in an implicit block as if by @code{cl-defun}. |
| 1701 | @xref{Program Structure}. | 1321 | @xref{Program Structure}. |
| 1702 | @end defspec | 1322 | @end defmac |
| 1703 | 1323 | ||
| 1704 | @defspec labels (bindings@dots{}) forms@dots{} | 1324 | @defmac labels (bindings@dots{}) forms@dots{} |
| 1705 | The @code{labels} form is like @code{flet}, except that it | 1325 | The @code{labels} form is like @code{flet}, except that it |
| 1706 | makes lexical bindings of the function names rather than | 1326 | makes lexical bindings of the function names rather than |
| 1707 | dynamic bindings. (In true Common Lisp, both @code{flet} and | 1327 | dynamic bindings. (In true Common Lisp, both @code{flet} and |
| @@ -1722,29 +1342,33 @@ functions. | |||
| 1722 | A ``reference'' to a function name is either a call to that | 1342 | A ``reference'' to a function name is either a call to that |
| 1723 | function, or a use of its name quoted by @code{quote} or | 1343 | function, or a use of its name quoted by @code{quote} or |
| 1724 | @code{function} to be passed on to, say, @code{mapcar}. | 1344 | @code{function} to be passed on to, say, @code{mapcar}. |
| 1725 | @end defspec | 1345 | @end defmac |
| 1726 | 1346 | ||
| 1727 | @node Macro Bindings | 1347 | @node Macro Bindings |
| 1728 | @subsection Macro Bindings | 1348 | @subsection Macro Bindings |
| 1729 | 1349 | ||
| 1730 | @noindent | 1350 | @noindent |
| 1731 | These forms create local macros and ``symbol macros.'' | 1351 | These forms create local macros and ``symbol macros''. |
| 1732 | 1352 | ||
| 1733 | @defspec macrolet (bindings@dots{}) forms@dots{} | 1353 | @defmac cl-macrolet (bindings@dots{}) forms@dots{} |
| 1734 | This form is analogous to @code{flet}, but for macros instead of | 1354 | This form is analogous to @code{flet}, but for macros instead of |
| 1735 | functions. Each @var{binding} is a list of the same form as the | 1355 | functions. Each @var{binding} is a list of the same form as the |
| 1736 | arguments to @code{defmacro*} (i.e., a macro name, argument list, | 1356 | arguments to @code{cl-defmacro} (i.e., a macro name, argument list, |
| 1737 | and macro-expander forms). The macro is defined accordingly for | 1357 | and macro-expander forms). The macro is defined accordingly for |
| 1738 | use within the body of the @code{macrolet}. | 1358 | use within the body of the @code{cl-macrolet}. |
| 1739 | 1359 | ||
| 1740 | Because of the nature of macros, @code{macrolet} is lexically | 1360 | @c FIXME this should be modified to say ``even when lexical-binding |
| 1741 | scoped even in Emacs Lisp: The @code{macrolet} binding will | 1361 | @c is code{nil}'', but is that true? The doc of cl-macrolet just |
| 1362 | @c refers us to cl-flet, which refers to cl-labels, which says that it | ||
| 1363 | @c behaves differently according to whether l-b is true or not. | ||
| 1364 | Because of the nature of macros, @code{cl-macrolet} is lexically | ||
| 1365 | scoped even in Emacs Lisp: The @code{cl-macrolet} binding will | ||
| 1742 | affect only calls that appear physically within the body | 1366 | affect only calls that appear physically within the body |
| 1743 | @var{forms}, possibly after expansion of other macros in the | 1367 | @var{forms}, possibly after expansion of other macros in the |
| 1744 | body. | 1368 | body. |
| 1745 | @end defspec | 1369 | @end defmac |
| 1746 | 1370 | ||
| 1747 | @defspec symbol-macrolet (bindings@dots{}) forms@dots{} | 1371 | @defmac cl-symbol-macrolet (bindings@dots{}) forms@dots{} |
| 1748 | This form creates @dfn{symbol macros}, which are macros that look | 1372 | This form creates @dfn{symbol macros}, which are macros that look |
| 1749 | like variable references rather than function calls. Each | 1373 | like variable references rather than function calls. Each |
| 1750 | @var{binding} is a list @samp{(@var{var} @var{expansion})}; | 1374 | @var{binding} is a list @samp{(@var{var} @var{expansion})}; |
| @@ -1753,8 +1377,8 @@ replaced by @var{expansion}. | |||
| 1753 | 1377 | ||
| 1754 | @example | 1378 | @example |
| 1755 | (setq bar '(5 . 9)) | 1379 | (setq bar '(5 . 9)) |
| 1756 | (symbol-macrolet ((foo (car bar))) | 1380 | (cl-symbol-macrolet ((foo (car bar))) |
| 1757 | (incf foo)) | 1381 | (cl-incf foo)) |
| 1758 | bar | 1382 | bar |
| 1759 | @result{} (6 . 9) | 1383 | @result{} (6 . 9) |
| 1760 | @end example | 1384 | @end example |
| @@ -1764,25 +1388,28 @@ I.e., @code{(setq foo 4)} in the above would be equivalent to | |||
| 1764 | @code{(setf foo 4)}, which in turn expands to @code{(setf (car bar) 4)}. | 1388 | @code{(setf foo 4)}, which in turn expands to @code{(setf (car bar) 4)}. |
| 1765 | 1389 | ||
| 1766 | Likewise, a @code{let} or @code{let*} binding a symbol macro is | 1390 | Likewise, a @code{let} or @code{let*} binding a symbol macro is |
| 1767 | treated like a @code{letf} or @code{letf*}. This differs from true | 1391 | treated like a @code{cl-letf} or @code{cl-letf*}. This differs from true |
| 1392 | @c FIXME does it work like this in Emacs with lexical-binding = t? | ||
| 1768 | Common Lisp, where the rules of lexical scoping cause a @code{let} | 1393 | Common Lisp, where the rules of lexical scoping cause a @code{let} |
| 1769 | binding to shadow a @code{symbol-macrolet} binding. In this package, | 1394 | binding to shadow a @code{cl-symbol-macrolet} binding. In this package, |
| 1395 | @c FIXME obsolete. | ||
| 1770 | only @code{lexical-let} and @code{lexical-let*} will shadow a symbol | 1396 | only @code{lexical-let} and @code{lexical-let*} will shadow a symbol |
| 1771 | macro. | 1397 | macro. |
| 1772 | 1398 | ||
| 1773 | There is no analogue of @code{defmacro} for symbol macros; all symbol | 1399 | There is no analogue of @code{defmacro} for symbol macros; all symbol |
| 1774 | macros are local. A typical use of @code{symbol-macrolet} is in the | 1400 | macros are local. A typical use of @code{cl-symbol-macrolet} is in the |
| 1775 | expansion of another macro: | 1401 | expansion of another macro: |
| 1776 | 1402 | ||
| 1777 | @example | 1403 | @example |
| 1778 | (defmacro* my-dolist ((x list) &rest body) | 1404 | (cl-defmacro my-dolist ((x list) &rest body) |
| 1779 | (let ((var (gensym))) | 1405 | (let ((var (gensym))) |
| 1780 | (list 'loop 'for var 'on list 'do | 1406 | (list 'cl-loop 'for var 'on list 'do |
| 1781 | (list* 'symbol-macrolet (list (list x (list 'car var))) | 1407 | (cl-list* 'cl-symbol-macrolet |
| 1782 | body)))) | 1408 | (list (list x (list 'car var))) |
| 1409 | body)))) | ||
| 1783 | 1410 | ||
| 1784 | (setq mylist '(1 2 3 4)) | 1411 | (setq mylist '(1 2 3 4)) |
| 1785 | (my-dolist (x mylist) (incf x)) | 1412 | (my-dolist (x mylist) (cl-incf x)) |
| 1786 | mylist | 1413 | mylist |
| 1787 | @result{} (2 3 4 5) | 1414 | @result{} (2 3 4 5) |
| 1788 | @end example | 1415 | @end example |
| @@ -1794,22 +1421,22 @@ reference onto the elements of the list. The @code{my-dolist} call | |||
| 1794 | shown here expands to | 1421 | shown here expands to |
| 1795 | 1422 | ||
| 1796 | @example | 1423 | @example |
| 1797 | (loop for G1234 on mylist do | 1424 | (cl-loop for G1234 on mylist do |
| 1798 | (symbol-macrolet ((x (car G1234))) | 1425 | (cl-symbol-macrolet ((x (car G1234))) |
| 1799 | (incf x))) | 1426 | (cl-incf x))) |
| 1800 | @end example | 1427 | @end example |
| 1801 | 1428 | ||
| 1802 | @noindent | 1429 | @noindent |
| 1803 | which in turn expands to | 1430 | which in turn expands to |
| 1804 | 1431 | ||
| 1805 | @example | 1432 | @example |
| 1806 | (loop for G1234 on mylist do (incf (car G1234))) | 1433 | (cl-loop for G1234 on mylist do (cl-incf (car G1234))) |
| 1807 | @end example | 1434 | @end example |
| 1808 | 1435 | ||
| 1809 | @xref{Loop Facility}, for a description of the @code{loop} macro. | 1436 | @xref{Loop Facility}, for a description of the @code{cl-loop} macro. |
| 1810 | This package defines a nonstandard @code{in-ref} loop clause that | 1437 | This package defines a nonstandard @code{in-ref} loop clause that |
| 1811 | works much like @code{my-dolist}. | 1438 | works much like @code{my-dolist}. |
| 1812 | @end defspec | 1439 | @end defmac |
| 1813 | 1440 | ||
| 1814 | @node Conditionals | 1441 | @node Conditionals |
| 1815 | @section Conditionals | 1442 | @section Conditionals |
| @@ -1818,11 +1445,11 @@ works much like @code{my-dolist}. | |||
| 1818 | These conditional forms augment Emacs Lisp's simple @code{if}, | 1445 | These conditional forms augment Emacs Lisp's simple @code{if}, |
| 1819 | @code{and}, @code{or}, and @code{cond} forms. | 1446 | @code{and}, @code{or}, and @code{cond} forms. |
| 1820 | 1447 | ||
| 1821 | @defspec case keyform clause@dots{} | 1448 | @defmac cl-case keyform clause@dots{} |
| 1822 | This macro evaluates @var{keyform}, then compares it with the key | 1449 | This macro evaluates @var{keyform}, then compares it with the key |
| 1823 | values listed in the various @var{clause}s. Whichever clause matches | 1450 | values listed in the various @var{clause}s. Whichever clause matches |
| 1824 | the key is executed; comparison is done by @code{eql}. If no clause | 1451 | the key is executed; comparison is done by @code{eql}. If no clause |
| 1825 | matches, the @code{case} form returns @code{nil}. The clauses are | 1452 | matches, the @code{cl-case} form returns @code{nil}. The clauses are |
| 1826 | of the form | 1453 | of the form |
| 1827 | 1454 | ||
| 1828 | @example | 1455 | @example |
| @@ -1833,7 +1460,7 @@ of the form | |||
| 1833 | where @var{keylist} is a list of key values. If there is exactly | 1460 | where @var{keylist} is a list of key values. If there is exactly |
| 1834 | one value, and it is not a cons cell or the symbol @code{nil} or | 1461 | one value, and it is not a cons cell or the symbol @code{nil} or |
| 1835 | @code{t}, then it can be used by itself as a @var{keylist} without | 1462 | @code{t}, then it can be used by itself as a @var{keylist} without |
| 1836 | being enclosed in a list. All key values in the @code{case} form | 1463 | being enclosed in a list. All key values in the @code{cl-case} form |
| 1837 | must be distinct. The final clauses may use @code{t} in place of | 1464 | must be distinct. The final clauses may use @code{t} in place of |
| 1838 | a @var{keylist} to indicate a default clause that should be taken | 1465 | a @var{keylist} to indicate a default clause that should be taken |
| 1839 | if none of the other clauses match. (The symbol @code{otherwise} | 1466 | if none of the other clauses match. (The symbol @code{otherwise} |
| @@ -1846,28 +1473,28 @@ four things depending on whether it is an @samp{a}, a @samp{b}, | |||
| 1846 | a @key{RET} or @kbd{C-j}, or anything else. | 1473 | a @key{RET} or @kbd{C-j}, or anything else. |
| 1847 | 1474 | ||
| 1848 | @example | 1475 | @example |
| 1849 | (case (read-char) | 1476 | (cl-case (read-char) |
| 1850 | (?a (do-a-thing)) | 1477 | (?a (do-a-thing)) |
| 1851 | (?b (do-b-thing)) | 1478 | (?b (do-b-thing)) |
| 1852 | ((?\r ?\n) (do-ret-thing)) | 1479 | ((?\r ?\n) (do-ret-thing)) |
| 1853 | (t (do-other-thing))) | 1480 | (t (do-other-thing))) |
| 1854 | @end example | 1481 | @end example |
| 1855 | @end defspec | 1482 | @end defmac |
| 1856 | 1483 | ||
| 1857 | @defspec ecase keyform clause@dots{} | 1484 | @defmac cl-ecase keyform clause@dots{} |
| 1858 | This macro is just like @code{case}, except that if the key does | 1485 | This macro is just like @code{cl-case}, except that if the key does |
| 1859 | not match any of the clauses, an error is signaled rather than | 1486 | not match any of the clauses, an error is signaled rather than |
| 1860 | simply returning @code{nil}. | 1487 | simply returning @code{nil}. |
| 1861 | @end defspec | 1488 | @end defmac |
| 1862 | 1489 | ||
| 1863 | @defspec typecase keyform clause@dots{} | 1490 | @defmac cl-typecase keyform clause@dots{} |
| 1864 | This macro is a version of @code{case} that checks for types | 1491 | This macro is a version of @code{cl-case} that checks for types |
| 1865 | rather than values. Each @var{clause} is of the form | 1492 | rather than values. Each @var{clause} is of the form |
| 1866 | @samp{(@var{type} @var{body}...)}. @xref{Type Predicates}, | 1493 | @samp{(@var{type} @var{body}...)}. @xref{Type Predicates}, |
| 1867 | for a description of type specifiers. For example, | 1494 | for a description of type specifiers. For example, |
| 1868 | 1495 | ||
| 1869 | @example | 1496 | @example |
| 1870 | (typecase x | 1497 | (cl-typecase x |
| 1871 | (integer (munch-integer x)) | 1498 | (integer (munch-integer x)) |
| 1872 | (float (munch-float x)) | 1499 | (float (munch-float x)) |
| 1873 | (string (munch-integer (string-to-int x))) | 1500 | (string (munch-integer (string-to-int x))) |
| @@ -1877,13 +1504,13 @@ for a description of type specifiers. For example, | |||
| 1877 | The type specifier @code{t} matches any type of object; the word | 1504 | The type specifier @code{t} matches any type of object; the word |
| 1878 | @code{otherwise} is also allowed. To make one clause match any of | 1505 | @code{otherwise} is also allowed. To make one clause match any of |
| 1879 | several types, use an @code{(or ...)} type specifier. | 1506 | several types, use an @code{(or ...)} type specifier. |
| 1880 | @end defspec | 1507 | @end defmac |
| 1881 | 1508 | ||
| 1882 | @defspec etypecase keyform clause@dots{} | 1509 | @defmac cl-etypecase keyform clause@dots{} |
| 1883 | This macro is just like @code{typecase}, except that if the key does | 1510 | This macro is just like @code{cl-typecase}, except that if the key does |
| 1884 | not match any of the clauses, an error is signaled rather than | 1511 | not match any of the clauses, an error is signaled rather than |
| 1885 | simply returning @code{nil}. | 1512 | simply returning @code{nil}. |
| 1886 | @end defspec | 1513 | @end defmac |
| 1887 | 1514 | ||
| 1888 | @node Blocks and Exits | 1515 | @node Blocks and Exits |
| 1889 | @section Blocks and Exits | 1516 | @section Blocks and Exits |
| @@ -1891,26 +1518,26 @@ simply returning @code{nil}. | |||
| 1891 | @noindent | 1518 | @noindent |
| 1892 | Common Lisp @dfn{blocks} provide a non-local exit mechanism very | 1519 | Common Lisp @dfn{blocks} provide a non-local exit mechanism very |
| 1893 | similar to @code{catch} and @code{throw}, but lexically rather than | 1520 | similar to @code{catch} and @code{throw}, but lexically rather than |
| 1894 | dynamically scoped. This package actually implements @code{block} | 1521 | dynamically scoped. This package actually implements @code{cl-block} |
| 1895 | in terms of @code{catch}; however, the lexical scoping allows the | 1522 | in terms of @code{catch}; however, the lexical scoping allows the |
| 1896 | optimizing byte-compiler to omit the costly @code{catch} step if the | 1523 | optimizing byte-compiler to omit the costly @code{catch} step if the |
| 1897 | body of the block does not actually @code{return-from} the block. | 1524 | body of the block does not actually @code{cl-return-from} the block. |
| 1898 | 1525 | ||
| 1899 | @defspec block name forms@dots{} | 1526 | @defmac cl-block name forms@dots{} |
| 1900 | The @var{forms} are evaluated as if by a @code{progn}. However, | 1527 | The @var{forms} are evaluated as if by a @code{progn}. However, |
| 1901 | if any of the @var{forms} execute @code{(return-from @var{name})}, | 1528 | if any of the @var{forms} execute @code{(cl-return-from @var{name})}, |
| 1902 | they will jump out and return directly from the @code{block} form. | 1529 | they will jump out and return directly from the @code{cl-block} form. |
| 1903 | The @code{block} returns the result of the last @var{form} unless | 1530 | The @code{cl-block} returns the result of the last @var{form} unless |
| 1904 | a @code{return-from} occurs. | 1531 | a @code{cl-return-from} occurs. |
| 1905 | 1532 | ||
| 1906 | The @code{block}/@code{return-from} mechanism is quite similar to | 1533 | The @code{cl-block}/@code{cl-return-from} mechanism is quite similar to |
| 1907 | the @code{catch}/@code{throw} mechanism. The main differences are | 1534 | the @code{catch}/@code{throw} mechanism. The main differences are |
| 1908 | that block @var{name}s are unevaluated symbols, rather than forms | 1535 | that block @var{name}s are unevaluated symbols, rather than forms |
| 1909 | (such as quoted symbols) which evaluate to a tag at run-time; and | 1536 | (such as quoted symbols) which evaluate to a tag at run-time; and |
| 1910 | also that blocks are lexically scoped whereas @code{catch}/@code{throw} | 1537 | also that blocks are lexically scoped whereas @code{catch}/@code{throw} |
| 1911 | are dynamically scoped. This means that functions called from the | 1538 | are dynamically scoped. This means that functions called from the |
| 1912 | body of a @code{catch} can also @code{throw} to the @code{catch}, | 1539 | body of a @code{catch} can also @code{throw} to the @code{catch}, |
| 1913 | but the @code{return-from} referring to a block name must appear | 1540 | but the @code{cl-return-from} referring to a block name must appear |
| 1914 | physically within the @var{forms} that make up the body of the block. | 1541 | physically within the @var{forms} that make up the body of the block. |
| 1915 | They may not appear within other called functions, although they may | 1542 | They may not appear within other called functions, although they may |
| 1916 | appear within macro expansions or @code{lambda}s in the body. Block | 1543 | appear within macro expansions or @code{lambda}s in the body. Block |
| @@ -1919,11 +1546,11 @@ names and @code{catch} names form independent name-spaces. | |||
| 1919 | In true Common Lisp, @code{defun} and @code{defmacro} surround | 1546 | In true Common Lisp, @code{defun} and @code{defmacro} surround |
| 1920 | the function or expander bodies with implicit blocks with the | 1547 | the function or expander bodies with implicit blocks with the |
| 1921 | same name as the function or macro. This does not occur in Emacs | 1548 | same name as the function or macro. This does not occur in Emacs |
| 1922 | Lisp, but this package provides @code{defun*} and @code{defmacro*} | 1549 | Lisp, but this package provides @code{cl-defun} and @code{cl-defmacro} |
| 1923 | forms which do create the implicit block. | 1550 | forms which do create the implicit block. |
| 1924 | 1551 | ||
| 1925 | The Common Lisp looping constructs defined by this package, | 1552 | The Common Lisp looping constructs defined by this package, |
| 1926 | such as @code{loop} and @code{dolist}, also create implicit blocks | 1553 | such as @code{cl-loop} and @code{cl-dolist}, also create implicit blocks |
| 1927 | just as in Common Lisp. | 1554 | just as in Common Lisp. |
| 1928 | 1555 | ||
| 1929 | Because they are implemented in terms of Emacs Lisp @code{catch} | 1556 | Because they are implemented in terms of Emacs Lisp @code{catch} |
| @@ -1931,24 +1558,24 @@ and @code{throw}, blocks have the same overhead as actual | |||
| 1931 | @code{catch} constructs (roughly two function calls). However, | 1558 | @code{catch} constructs (roughly two function calls). However, |
| 1932 | the optimizing byte compiler will optimize away the @code{catch} | 1559 | the optimizing byte compiler will optimize away the @code{catch} |
| 1933 | if the block does | 1560 | if the block does |
| 1934 | not in fact contain any @code{return} or @code{return-from} calls | 1561 | not in fact contain any @code{cl-return} or @code{cl-return-from} calls |
| 1935 | that jump to it. This means that @code{do} loops and @code{defun*} | 1562 | that jump to it. This means that @code{cl-do} loops and @code{cl-defun} |
| 1936 | functions which don't use @code{return} don't pay the overhead to | 1563 | functions which don't use @code{cl-return} don't pay the overhead to |
| 1937 | support it. | 1564 | support it. |
| 1938 | @end defspec | 1565 | @end defmac |
| 1939 | 1566 | ||
| 1940 | @defspec return-from name [result] | 1567 | @defmac cl-return-from name [result] |
| 1941 | This macro returns from the block named @var{name}, which must be | 1568 | This macro returns from the block named @var{name}, which must be |
| 1942 | an (unevaluated) symbol. If a @var{result} form is specified, it | 1569 | an (unevaluated) symbol. If a @var{result} form is specified, it |
| 1943 | is evaluated to produce the result returned from the @code{block}. | 1570 | is evaluated to produce the result returned from the @code{block}. |
| 1944 | Otherwise, @code{nil} is returned. | 1571 | Otherwise, @code{nil} is returned. |
| 1945 | @end defspec | 1572 | @end defmac |
| 1946 | 1573 | ||
| 1947 | @defspec return [result] | 1574 | @defmac cl-return [result] |
| 1948 | This macro is exactly like @code{(return-from nil @var{result})}. | 1575 | This macro is exactly like @code{(cl-return-from nil @var{result})}. |
| 1949 | Common Lisp loops like @code{do} and @code{dolist} implicitly enclose | 1576 | Common Lisp loops like @code{cl-do} and @code{cl-dolist} implicitly enclose |
| 1950 | themselves in @code{nil} blocks. | 1577 | themselves in @code{nil} blocks. |
| 1951 | @end defspec | 1578 | @end defmac |
| 1952 | 1579 | ||
| 1953 | @node Iteration | 1580 | @node Iteration |
| 1954 | @section Iteration | 1581 | @section Iteration |
| @@ -1958,27 +1585,27 @@ The macros described here provide more sophisticated, high-level | |||
| 1958 | looping constructs to complement Emacs Lisp's basic @code{while} | 1585 | looping constructs to complement Emacs Lisp's basic @code{while} |
| 1959 | loop. | 1586 | loop. |
| 1960 | 1587 | ||
| 1961 | @defspec loop forms@dots{} | 1588 | @defmac cl-loop forms@dots{} |
| 1962 | The @code{CL} package supports both the simple, old-style meaning of | 1589 | The @code{CL} package supports both the simple, old-style meaning of |
| 1963 | @code{loop} and the extremely powerful and flexible feature known as | 1590 | @code{loop} and the extremely powerful and flexible feature known as |
| 1964 | the @dfn{Loop Facility} or @dfn{Loop Macro}. This more advanced | 1591 | the @dfn{Loop Facility} or @dfn{Loop Macro}. This more advanced |
| 1965 | facility is discussed in the following section; @pxref{Loop Facility}. | 1592 | facility is discussed in the following section; @pxref{Loop Facility}. |
| 1966 | The simple form of @code{loop} is described here. | 1593 | The simple form of @code{loop} is described here. |
| 1967 | 1594 | ||
| 1968 | If @code{loop} is followed by zero or more Lisp expressions, | 1595 | If @code{cl-loop} is followed by zero or more Lisp expressions, |
| 1969 | then @code{(loop @var{exprs}@dots{})} simply creates an infinite | 1596 | then @code{(cl-loop @var{exprs}@dots{})} simply creates an infinite |
| 1970 | loop executing the expressions over and over. The loop is | 1597 | loop executing the expressions over and over. The loop is |
| 1971 | enclosed in an implicit @code{nil} block. Thus, | 1598 | enclosed in an implicit @code{nil} block. Thus, |
| 1972 | 1599 | ||
| 1973 | @example | 1600 | @example |
| 1974 | (loop (foo) (if (no-more) (return 72)) (bar)) | 1601 | (cl-loop (foo) (if (no-more) (return 72)) (bar)) |
| 1975 | @end example | 1602 | @end example |
| 1976 | 1603 | ||
| 1977 | @noindent | 1604 | @noindent |
| 1978 | is exactly equivalent to | 1605 | is exactly equivalent to |
| 1979 | 1606 | ||
| 1980 | @example | 1607 | @example |
| 1981 | (block nil (while t (foo) (if (no-more) (return 72)) (bar))) | 1608 | (cl-block nil (while t (foo) (if (no-more) (return 72)) (bar))) |
| 1982 | @end example | 1609 | @end example |
| 1983 | 1610 | ||
| 1984 | If any of the expressions are plain symbols, the loop is instead | 1611 | If any of the expressions are plain symbols, the loop is instead |
| @@ -1986,9 +1613,9 @@ interpreted as a Loop Macro specification as described later. | |||
| 1986 | (This is not a restriction in practice, since a plain symbol | 1613 | (This is not a restriction in practice, since a plain symbol |
| 1987 | in the above notation would simply access and throw away the | 1614 | in the above notation would simply access and throw away the |
| 1988 | value of a variable.) | 1615 | value of a variable.) |
| 1989 | @end defspec | 1616 | @end defmac |
| 1990 | 1617 | ||
| 1991 | @defspec do (spec@dots{}) (end-test [result@dots{}]) forms@dots{} | 1618 | @defmac cl-do (spec@dots{}) (end-test [result@dots{}]) forms@dots{} |
| 1992 | This macro creates a general iterative loop. Each @var{spec} is | 1619 | This macro creates a general iterative loop. Each @var{spec} is |
| 1993 | of the form | 1620 | of the form |
| 1994 | 1621 | ||
| @@ -2004,15 +1631,15 @@ evaluated, then each @var{var} is set to the associated @var{step} | |||
| 2004 | expression (as if by a @code{cl-psetq} form) and the next iteration | 1631 | expression (as if by a @code{cl-psetq} form) and the next iteration |
| 2005 | begins. Once the @var{end-test} becomes true, the @var{result} | 1632 | begins. Once the @var{end-test} becomes true, the @var{result} |
| 2006 | forms are evaluated (with the @var{var}s still bound to their | 1633 | forms are evaluated (with the @var{var}s still bound to their |
| 2007 | values) to produce the result returned by @code{do}. | 1634 | values) to produce the result returned by @code{cl-do}. |
| 2008 | 1635 | ||
| 2009 | The entire @code{do} loop is enclosed in an implicit @code{nil} | 1636 | The entire @code{cl-do} loop is enclosed in an implicit @code{nil} |
| 2010 | block, so that you can use @code{(return)} to break out of the | 1637 | block, so that you can use @code{(cl-return)} to break out of the |
| 2011 | loop at any time. | 1638 | loop at any time. |
| 2012 | 1639 | ||
| 2013 | If there are no @var{result} forms, the loop returns @code{nil}. | 1640 | If there are no @var{result} forms, the loop returns @code{nil}. |
| 2014 | If a given @var{var} has no @var{step} form, it is bound to its | 1641 | If a given @var{var} has no @var{step} form, it is bound to its |
| 2015 | @var{init} value but not otherwise modified during the @code{do} | 1642 | @var{init} value but not otherwise modified during the @code{cl-do} |
| 2016 | loop (unless the code explicitly modifies it); this case is just | 1643 | loop (unless the code explicitly modifies it); this case is just |
| 2017 | a shorthand for putting a @code{(let ((@var{var} @var{init})) @dots{})} | 1644 | a shorthand for putting a @code{(let ((@var{var} @var{init})) @dots{})} |
| 2018 | around the loop. If @var{init} is also omitted it defaults to | 1645 | around the loop. If @var{init} is also omitted it defaults to |
| @@ -2023,21 +1650,21 @@ in place of @samp{(@var{var})}, again following the analogy with | |||
| 2023 | This example (from Steele) illustrates a loop which applies the | 1650 | This example (from Steele) illustrates a loop which applies the |
| 2024 | function @code{f} to successive pairs of values from the lists | 1651 | function @code{f} to successive pairs of values from the lists |
| 2025 | @code{foo} and @code{bar}; it is equivalent to the call | 1652 | @code{foo} and @code{bar}; it is equivalent to the call |
| 2026 | @code{(mapcar* 'f foo bar)}. Note that this loop has no body | 1653 | @code{(cl-mapcar 'f foo bar)}. Note that this loop has no body |
| 2027 | @var{forms} at all, performing all its work as side effects of | 1654 | @var{forms} at all, performing all its work as side effects of |
| 2028 | the rest of the loop. | 1655 | the rest of the loop. |
| 2029 | 1656 | ||
| 2030 | @example | 1657 | @example |
| 2031 | (do ((x foo (cdr x)) | 1658 | (cl-do ((x foo (cdr x)) |
| 2032 | (y bar (cdr y)) | 1659 | (y bar (cdr y)) |
| 2033 | (z nil (cons (f (car x) (car y)) z))) | 1660 | (z nil (cons (f (car x) (car y)) z))) |
| 2034 | ((or (null x) (null y)) | 1661 | ((or (null x) (null y)) |
| 2035 | (nreverse z))) | 1662 | (nreverse z))) |
| 2036 | @end example | 1663 | @end example |
| 2037 | @end defspec | 1664 | @end defmac |
| 2038 | 1665 | ||
| 2039 | @defspec do* (spec@dots{}) (end-test [result@dots{}]) forms@dots{} | 1666 | @defmac cl-do* (spec@dots{}) (end-test [result@dots{}]) forms@dots{} |
| 2040 | This is to @code{do} what @code{let*} is to @code{let}. In | 1667 | This is to @code{cl-do} what @code{let*} is to @code{let}. In |
| 2041 | particular, the initial values are bound as if by @code{let*} | 1668 | particular, the initial values are bound as if by @code{let*} |
| 2042 | rather than @code{let}, and the steps are assigned as if by | 1669 | rather than @code{let}, and the steps are assigned as if by |
| 2043 | @code{setq} rather than @code{cl-psetq}. | 1670 | @code{setq} rather than @code{cl-psetq}. |
| @@ -2045,18 +1672,18 @@ rather than @code{let}, and the steps are assigned as if by | |||
| 2045 | Here is another way to write the above loop: | 1672 | Here is another way to write the above loop: |
| 2046 | 1673 | ||
| 2047 | @example | 1674 | @example |
| 2048 | (do* ((xp foo (cdr xp)) | 1675 | (cl-do* ((xp foo (cdr xp)) |
| 2049 | (yp bar (cdr yp)) | 1676 | (yp bar (cdr yp)) |
| 2050 | (x (car xp) (car xp)) | 1677 | (x (car xp) (car xp)) |
| 2051 | (y (car yp) (car yp)) | 1678 | (y (car yp) (car yp)) |
| 2052 | z) | 1679 | z) |
| 2053 | ((or (null xp) (null yp)) | 1680 | ((or (null xp) (null yp)) |
| 2054 | (nreverse z)) | 1681 | (nreverse z)) |
| 2055 | (push (f x y) z)) | 1682 | (push (f x y) z)) |
| 2056 | @end example | 1683 | @end example |
| 2057 | @end defspec | 1684 | @end defmac |
| 2058 | 1685 | ||
| 2059 | @defspec dolist (var list [result]) forms@dots{} | 1686 | @defmac cl-dolist (var list [result]) forms@dots{} |
| 2060 | This is a more specialized loop which iterates across the elements | 1687 | This is a more specialized loop which iterates across the elements |
| 2061 | of a list. @var{list} should evaluate to a list; the body @var{forms} | 1688 | of a list. @var{list} should evaluate to a list; the body @var{forms} |
| 2062 | are executed with @var{var} bound to each element of the list in | 1689 | are executed with @var{var} bound to each element of the list in |
| @@ -2064,9 +1691,9 @@ turn. Finally, the @var{result} form (or @code{nil}) is evaluated | |||
| 2064 | with @var{var} bound to @code{nil} to produce the result returned by | 1691 | with @var{var} bound to @code{nil} to produce the result returned by |
| 2065 | the loop. Unlike with Emacs's built in @code{dolist}, the loop is | 1692 | the loop. Unlike with Emacs's built in @code{dolist}, the loop is |
| 2066 | surrounded by an implicit @code{nil} block. | 1693 | surrounded by an implicit @code{nil} block. |
| 2067 | @end defspec | 1694 | @end defmac |
| 2068 | 1695 | ||
| 2069 | @defspec dotimes (var count [result]) forms@dots{} | 1696 | @defmac cl-dotimes (var count [result]) forms@dots{} |
| 2070 | This is a more specialized loop which iterates a specified number | 1697 | This is a more specialized loop which iterates a specified number |
| 2071 | of times. The body is executed with @var{var} bound to the integers | 1698 | of times. The body is executed with @var{var} bound to the integers |
| 2072 | from zero (inclusive) to @var{count} (exclusive), in turn. Then | 1699 | from zero (inclusive) to @var{count} (exclusive), in turn. Then |
| @@ -2074,9 +1701,9 @@ the @code{result} form is evaluated with @var{var} bound to the total | |||
| 2074 | number of iterations that were done (i.e., @code{(max 0 @var{count})}) | 1701 | number of iterations that were done (i.e., @code{(max 0 @var{count})}) |
| 2075 | to get the return value for the loop form. Unlike with Emacs's built in | 1702 | to get the return value for the loop form. Unlike with Emacs's built in |
| 2076 | @code{dolist}, the loop is surrounded by an implicit @code{nil} block. | 1703 | @code{dolist}, the loop is surrounded by an implicit @code{nil} block. |
| 2077 | @end defspec | 1704 | @end defmac |
| 2078 | 1705 | ||
| 2079 | @defspec do-symbols (var [obarray [result]]) forms@dots{} | 1706 | @defmac cl-do-symbols (var [obarray [result]]) forms@dots{} |
| 2080 | This loop iterates over all interned symbols. If @var{obarray} | 1707 | This loop iterates over all interned symbols. If @var{obarray} |
| 2081 | is specified and is not @code{nil}, it loops over all symbols in | 1708 | is specified and is not @code{nil}, it loops over all symbols in |
| 2082 | that obarray. For each symbol, the body @var{forms} are evaluated | 1709 | that obarray. For each symbol, the body @var{forms} are evaluated |
| @@ -2084,12 +1711,12 @@ with @var{var} bound to that symbol. The symbols are visited in | |||
| 2084 | an unspecified order. Afterward the @var{result} form, if any, | 1711 | an unspecified order. Afterward the @var{result} form, if any, |
| 2085 | is evaluated (with @var{var} bound to @code{nil}) to get the return | 1712 | is evaluated (with @var{var} bound to @code{nil}) to get the return |
| 2086 | value. The loop is surrounded by an implicit @code{nil} block. | 1713 | value. The loop is surrounded by an implicit @code{nil} block. |
| 2087 | @end defspec | 1714 | @end defmac |
| 2088 | 1715 | ||
| 2089 | @defspec do-all-symbols (var [result]) forms@dots{} | 1716 | @defmac cl-do-all-symbols (var [result]) forms@dots{} |
| 2090 | This is identical to @code{do-symbols} except that the @var{obarray} | 1717 | This is identical to @code{cl-do-symbols} except that the @var{obarray} |
| 2091 | argument is omitted; it always iterates over the default obarray. | 1718 | argument is omitted; it always iterates over the default obarray. |
| 2092 | @end defspec | 1719 | @end defmac |
| 2093 | 1720 | ||
| 2094 | @xref{Mapping over Sequences}, for some more functions for | 1721 | @xref{Mapping over Sequences}, for some more functions for |
| 2095 | iterating over vectors or lists. | 1722 | iterating over vectors or lists. |
| @@ -2104,12 +1731,12 @@ that they are either too simple and limited, such as Common Lisp's | |||
| 2104 | obscure, like Common Lisp's @code{do} loop. | 1731 | obscure, like Common Lisp's @code{do} loop. |
| 2105 | 1732 | ||
| 2106 | To remedy this, recent versions of Common Lisp have added a new | 1733 | To remedy this, recent versions of Common Lisp have added a new |
| 2107 | construct called the ``Loop Facility'' or ``@code{loop} macro,'' | 1734 | construct called the ``Loop Facility'' or ``@code{loop} macro'', |
| 2108 | with an easy-to-use but very powerful and expressive syntax. | 1735 | with an easy-to-use but very powerful and expressive syntax. |
| 2109 | 1736 | ||
| 2110 | @menu | 1737 | @menu |
| 2111 | * Loop Basics:: @code{loop} macro, basic clause structure. | 1738 | * Loop Basics:: @code{cl-loop} macro, basic clause structure. |
| 2112 | * Loop Examples:: Working examples of @code{loop} macro. | 1739 | * Loop Examples:: Working examples of @code{cl-loop} macro. |
| 2113 | * For Clauses:: Clauses introduced by @code{for} or @code{as}. | 1740 | * For Clauses:: Clauses introduced by @code{for} or @code{as}. |
| 2114 | * Iteration Clauses:: @code{repeat}, @code{while}, @code{thereis}, etc. | 1741 | * Iteration Clauses:: @code{repeat}, @code{while}, @code{thereis}, etc. |
| 2115 | * Accumulation Clauses:: @code{collect}, @code{sum}, @code{maximize}, etc. | 1742 | * Accumulation Clauses:: @code{collect}, @code{sum}, @code{maximize}, etc. |
| @@ -2120,19 +1747,19 @@ with an easy-to-use but very powerful and expressive syntax. | |||
| 2120 | @subsection Loop Basics | 1747 | @subsection Loop Basics |
| 2121 | 1748 | ||
| 2122 | @noindent | 1749 | @noindent |
| 2123 | The @code{loop} macro essentially creates a mini-language within | 1750 | The @code{cl-loop} macro essentially creates a mini-language within |
| 2124 | Lisp that is specially tailored for describing loops. While this | 1751 | Lisp that is specially tailored for describing loops. While this |
| 2125 | language is a little strange-looking by the standards of regular Lisp, | 1752 | language is a little strange-looking by the standards of regular Lisp, |
| 2126 | it turns out to be very easy to learn and well-suited to its purpose. | 1753 | it turns out to be very easy to learn and well-suited to its purpose. |
| 2127 | 1754 | ||
| 2128 | Since @code{loop} is a macro, all parsing of the loop language | 1755 | Since @code{cl-loop} is a macro, all parsing of the loop language |
| 2129 | takes place at byte-compile time; compiled @code{loop}s are just | 1756 | takes place at byte-compile time; compiled @code{cl-loop}s are just |
| 2130 | as efficient as the equivalent @code{while} loops written longhand. | 1757 | as efficient as the equivalent @code{while} loops written longhand. |
| 2131 | 1758 | ||
| 2132 | @defspec loop clauses@dots{} | 1759 | @defmac cl-loop clauses@dots{} |
| 2133 | A loop construct consists of a series of @var{clause}s, each | 1760 | A loop construct consists of a series of @var{clause}s, each |
| 2134 | introduced by a symbol like @code{for} or @code{do}. Clauses | 1761 | introduced by a symbol like @code{for} or @code{do}. Clauses |
| 2135 | are simply strung together in the argument list of @code{loop}, | 1762 | are simply strung together in the argument list of @code{cl-loop}, |
| 2136 | with minimal extra parentheses. The various types of clauses | 1763 | with minimal extra parentheses. The various types of clauses |
| 2137 | specify initializations, such as the binding of temporary | 1764 | specify initializations, such as the binding of temporary |
| 2138 | variables, actions to be taken in the loop, stepping actions, | 1765 | variables, actions to be taken in the loop, stepping actions, |
| @@ -2142,9 +1769,9 @@ Common Lisp specifies a certain general order of clauses in a | |||
| 2142 | loop: | 1769 | loop: |
| 2143 | 1770 | ||
| 2144 | @example | 1771 | @example |
| 2145 | (loop @var{name-clause} | 1772 | (cl-loop @var{name-clause} |
| 2146 | @var{var-clauses}@dots{} | 1773 | @var{var-clauses}@dots{} |
| 2147 | @var{action-clauses}@dots{}) | 1774 | @var{action-clauses}@dots{}) |
| 2148 | @end example | 1775 | @end example |
| 2149 | 1776 | ||
| 2150 | The @var{name-clause} optionally gives a name to the implicit | 1777 | The @var{name-clause} optionally gives a name to the implicit |
| @@ -2155,7 +1782,7 @@ be modified or iterated throughout the course of the loop. The | |||
| 2155 | @var{action-clauses} are things to be done during the loop, such | 1782 | @var{action-clauses} are things to be done during the loop, such |
| 2156 | as computing, collecting, and returning values. | 1783 | as computing, collecting, and returning values. |
| 2157 | 1784 | ||
| 2158 | The Emacs version of the @code{loop} macro is less restrictive about | 1785 | The Emacs version of the @code{cl-loop} macro is less restrictive about |
| 2159 | the order of clauses, but things will behave most predictably if | 1786 | the order of clauses, but things will behave most predictably if |
| 2160 | you put the variable-binding clauses @code{with}, @code{for}, and | 1787 | you put the variable-binding clauses @code{with}, @code{for}, and |
| 2161 | @code{repeat} before the action clauses. As in Common Lisp, | 1788 | @code{repeat} before the action clauses. As in Common Lisp, |
| @@ -2166,9 +1793,9 @@ them to return a value by using an accumulation clause like | |||
| 2166 | @code{collect}, an end-test clause like @code{always}, or an | 1793 | @code{collect}, an end-test clause like @code{always}, or an |
| 2167 | explicit @code{return} clause to jump out of the implicit block. | 1794 | explicit @code{return} clause to jump out of the implicit block. |
| 2168 | (Because the loop body is enclosed in an implicit block, you can | 1795 | (Because the loop body is enclosed in an implicit block, you can |
| 2169 | also use regular Lisp @code{return} or @code{return-from} to | 1796 | also use regular Lisp @code{cl-return} or @code{cl-return-from} to |
| 2170 | break out of the loop.) | 1797 | break out of the loop.) |
| 2171 | @end defspec | 1798 | @end defmac |
| 2172 | 1799 | ||
| 2173 | The following sections give some examples of the Loop Macro in | 1800 | The following sections give some examples of the Loop Macro in |
| 2174 | action, and describe the particular loop clauses in great detail. | 1801 | action, and describe the particular loop clauses in great detail. |
| @@ -2180,25 +1807,25 @@ for additional discussion and examples of the @code{loop} macro. | |||
| 2180 | 1807 | ||
| 2181 | @noindent | 1808 | @noindent |
| 2182 | Before listing the full set of clauses that are allowed, let's | 1809 | Before listing the full set of clauses that are allowed, let's |
| 2183 | look at a few example loops just to get a feel for the @code{loop} | 1810 | look at a few example loops just to get a feel for the @code{cl-loop} |
| 2184 | language. | 1811 | language. |
| 2185 | 1812 | ||
| 2186 | @example | 1813 | @example |
| 2187 | (loop for buf in (buffer-list) | 1814 | (cl-loop for buf in (buffer-list) |
| 2188 | collect (buffer-file-name buf)) | 1815 | collect (buffer-file-name buf)) |
| 2189 | @end example | 1816 | @end example |
| 2190 | 1817 | ||
| 2191 | @noindent | 1818 | @noindent |
| 2192 | This loop iterates over all Emacs buffers, using the list | 1819 | This loop iterates over all Emacs buffers, using the list |
| 2193 | returned by @code{buffer-list}. For each buffer @code{buf}, | 1820 | returned by @code{buffer-list}. For each buffer @var{buf}, |
| 2194 | it calls @code{buffer-file-name} and collects the results into | 1821 | it calls @code{buffer-file-name} and collects the results into |
| 2195 | a list, which is then returned from the @code{loop} construct. | 1822 | a list, which is then returned from the @code{cl-loop} construct. |
| 2196 | The result is a list of the file names of all the buffers in | 1823 | The result is a list of the file names of all the buffers in |
| 2197 | Emacs's memory. The words @code{for}, @code{in}, and @code{collect} | 1824 | Emacs's memory. The words @code{for}, @code{in}, and @code{collect} |
| 2198 | are reserved words in the @code{loop} language. | 1825 | are reserved words in the @code{cl-loop} language. |
| 2199 | 1826 | ||
| 2200 | @example | 1827 | @example |
| 2201 | (loop repeat 20 do (insert "Yowsa\n")) | 1828 | (cl-loop repeat 20 do (insert "Yowsa\n")) |
| 2202 | @end example | 1829 | @end example |
| 2203 | 1830 | ||
| 2204 | @noindent | 1831 | @noindent |
| @@ -2206,7 +1833,7 @@ This loop inserts the phrase ``Yowsa'' twenty times in the | |||
| 2206 | current buffer. | 1833 | current buffer. |
| 2207 | 1834 | ||
| 2208 | @example | 1835 | @example |
| 2209 | (loop until (eobp) do (munch-line) (forward-line 1)) | 1836 | (cl-loop until (eobp) do (munch-line) (forward-line 1)) |
| 2210 | @end example | 1837 | @end example |
| 2211 | 1838 | ||
| 2212 | @noindent | 1839 | @noindent |
| @@ -2215,7 +1842,7 @@ of the buffer. If point is already at the end of the buffer, | |||
| 2215 | the loop exits immediately. | 1842 | the loop exits immediately. |
| 2216 | 1843 | ||
| 2217 | @example | 1844 | @example |
| 2218 | (loop do (munch-line) until (eobp) do (forward-line 1)) | 1845 | (cl-loop do (munch-line) until (eobp) do (forward-line 1)) |
| 2219 | @end example | 1846 | @end example |
| 2220 | 1847 | ||
| 2221 | @noindent | 1848 | @noindent |
| @@ -2223,10 +1850,10 @@ This loop is similar to the above one, except that @code{munch-line} | |||
| 2223 | is always called at least once. | 1850 | is always called at least once. |
| 2224 | 1851 | ||
| 2225 | @example | 1852 | @example |
| 2226 | (loop for x from 1 to 100 | 1853 | (cl-loop for x from 1 to 100 |
| 2227 | for y = (* x x) | 1854 | for y = (* x x) |
| 2228 | until (>= y 729) | 1855 | until (>= y 729) |
| 2229 | finally return (list x (= y 729))) | 1856 | finally return (list x (= y 729))) |
| 2230 | @end example | 1857 | @end example |
| 2231 | 1858 | ||
| 2232 | @noindent | 1859 | @noindent |
| @@ -2246,7 +1873,7 @@ Note that even though this loop contains three clauses (two | |||
| 2246 | @code{for}s and an @code{until}) that would have been enough to | 1873 | @code{for}s and an @code{until}) that would have been enough to |
| 2247 | define loops all by themselves, it still creates a single loop | 1874 | define loops all by themselves, it still creates a single loop |
| 2248 | rather than some sort of triple-nested loop. You must explicitly | 1875 | rather than some sort of triple-nested loop. You must explicitly |
| 2249 | nest your @code{loop} constructs if you want nested loops. | 1876 | nest your @code{cl-loop} constructs if you want nested loops. |
| 2250 | 1877 | ||
| 2251 | @node For Clauses | 1878 | @node For Clauses |
| 2252 | @subsection For Clauses | 1879 | @subsection For Clauses |
| @@ -2272,7 +1899,7 @@ The variable is bound around the loop as if by @code{let}: | |||
| 2272 | 1899 | ||
| 2273 | @example | 1900 | @example |
| 2274 | (setq i 'happy) | 1901 | (setq i 'happy) |
| 2275 | (loop for i from 1 to 10 do (do-something-with i)) | 1902 | (cl-loop for i from 1 to 10 do (do-something-with i)) |
| 2276 | i | 1903 | i |
| 2277 | @result{} happy | 1904 | @result{} happy |
| 2278 | @end example | 1905 | @end example |
| @@ -2302,10 +1929,10 @@ which are like @code{upto} and @code{downto} respectively except | |||
| 2302 | that they are exclusive rather than inclusive limits: | 1929 | that they are exclusive rather than inclusive limits: |
| 2303 | 1930 | ||
| 2304 | @example | 1931 | @example |
| 2305 | (loop for x to 10 collect x) | 1932 | (cl-loop for x to 10 collect x) |
| 2306 | @result{} (0 1 2 3 4 5 6 7 8 9 10) | 1933 | @result{} (0 1 2 3 4 5 6 7 8 9 10) |
| 2307 | (loop for x below 10 collect x) | 1934 | (cl-loop for x below 10 collect x) |
| 2308 | @result{} (0 1 2 3 4 5 6 7 8 9) | 1935 | @result{} (0 1 2 3 4 5 6 7 8 9) |
| 2309 | @end example | 1936 | @end example |
| 2310 | 1937 | ||
| 2311 | The @code{by} value is always positive, even for downward-counting | 1938 | The @code{by} value is always positive, even for downward-counting |
| @@ -2320,25 +1947,25 @@ is used to traverse the list instead of @code{cdr}; it must be a | |||
| 2320 | function taking one argument. For example: | 1947 | function taking one argument. For example: |
| 2321 | 1948 | ||
| 2322 | @example | 1949 | @example |
| 2323 | (loop for x in '(1 2 3 4 5 6) collect (* x x)) | 1950 | (cl-loop for x in '(1 2 3 4 5 6) collect (* x x)) |
| 2324 | @result{} (1 4 9 16 25 36) | 1951 | @result{} (1 4 9 16 25 36) |
| 2325 | (loop for x in '(1 2 3 4 5 6) by 'cddr collect (* x x)) | 1952 | (cl-loop for x in '(1 2 3 4 5 6) by 'cddr collect (* x x)) |
| 2326 | @result{} (1 9 25) | 1953 | @result{} (1 9 25) |
| 2327 | @end example | 1954 | @end example |
| 2328 | 1955 | ||
| 2329 | @item for @var{var} on @var{list} by @var{function} | 1956 | @item for @var{var} on @var{list} by @var{function} |
| 2330 | This clause iterates @var{var} over all the cons cells of @var{list}. | 1957 | This clause iterates @var{var} over all the cons cells of @var{list}. |
| 2331 | 1958 | ||
| 2332 | @example | 1959 | @example |
| 2333 | (loop for x on '(1 2 3 4) collect x) | 1960 | (cl-loop for x on '(1 2 3 4) collect x) |
| 2334 | @result{} ((1 2 3 4) (2 3 4) (3 4) (4)) | 1961 | @result{} ((1 2 3 4) (2 3 4) (3 4) (4)) |
| 2335 | @end example | 1962 | @end example |
| 2336 | 1963 | ||
| 2337 | With @code{by}, there is no real reason that the @code{on} expression | 1964 | With @code{by}, there is no real reason that the @code{on} expression |
| 2338 | must be a list. For example: | 1965 | must be a list. For example: |
| 2339 | 1966 | ||
| 2340 | @example | 1967 | @example |
| 2341 | (loop for x on first-animal by 'next-animal collect x) | 1968 | (cl-loop for x on first-animal by 'next-animal collect x) |
| 2342 | @end example | 1969 | @end example |
| 2343 | 1970 | ||
| 2344 | @noindent | 1971 | @noindent |
| @@ -2352,7 +1979,7 @@ a @code{setf}-able ``reference'' onto the elements of the list | |||
| 2352 | rather than just a temporary variable. For example, | 1979 | rather than just a temporary variable. For example, |
| 2353 | 1980 | ||
| 2354 | @example | 1981 | @example |
| 2355 | (loop for x in-ref my-list do (incf x)) | 1982 | (cl-loop for x in-ref my-list do (cl-incf x)) |
| 2356 | @end example | 1983 | @end example |
| 2357 | 1984 | ||
| 2358 | @noindent | 1985 | @noindent |
| @@ -2364,8 +1991,8 @@ This clause iterates @var{var} over all the elements of @var{array}, | |||
| 2364 | which may be a vector or a string. | 1991 | which may be a vector or a string. |
| 2365 | 1992 | ||
| 2366 | @example | 1993 | @example |
| 2367 | (loop for x across "aeiou" | 1994 | (cl-loop for x across "aeiou" |
| 2368 | do (use-vowel (char-to-string x))) | 1995 | do (use-vowel (char-to-string x))) |
| 2369 | @end example | 1996 | @end example |
| 2370 | 1997 | ||
| 2371 | @item for @var{var} across-ref @var{array} | 1998 | @item for @var{var} across-ref @var{array} |
| @@ -2397,10 +2024,10 @@ an unspecified order. | |||
| 2397 | As an example, | 2024 | As an example, |
| 2398 | 2025 | ||
| 2399 | @example | 2026 | @example |
| 2400 | (loop for sym being the symbols | 2027 | (cl-loop for sym being the symbols |
| 2401 | when (fboundp sym) | 2028 | when (fboundp sym) |
| 2402 | when (string-match "^map" (symbol-name sym)) | 2029 | when (string-match "^map" (symbol-name sym)) |
| 2403 | collect sym) | 2030 | collect sym) |
| 2404 | @end example | 2031 | @end example |
| 2405 | 2032 | ||
| 2406 | @noindent | 2033 | @noindent |
| @@ -2411,7 +2038,7 @@ are also recognized but are equivalent to @code{symbols} in Emacs Lisp. | |||
| 2411 | 2038 | ||
| 2412 | Due to a minor implementation restriction, it will not work to have | 2039 | Due to a minor implementation restriction, it will not work to have |
| 2413 | more than one @code{for} clause iterating over symbols, hash tables, | 2040 | more than one @code{for} clause iterating over symbols, hash tables, |
| 2414 | keymaps, overlays, or intervals in a given @code{loop}. Fortunately, | 2041 | keymaps, overlays, or intervals in a given @code{cl-loop}. Fortunately, |
| 2415 | it would rarely if ever be useful to do so. It @emph{is} valid to mix | 2042 | it would rarely if ever be useful to do so. It @emph{is} valid to mix |
| 2416 | one of these types of clauses with other clauses like @code{for ... to} | 2043 | one of these types of clauses with other clauses like @code{for ... to} |
| 2417 | or @code{while}. | 2044 | or @code{while}. |
| @@ -2423,10 +2050,10 @@ This clause iterates over the entries in @var{hash-table} with | |||
| 2423 | a second variable to the opposite part. | 2050 | a second variable to the opposite part. |
| 2424 | 2051 | ||
| 2425 | @example | 2052 | @example |
| 2426 | (loop for k being the hash-keys of h | 2053 | (cl-loop for k being the hash-keys of h |
| 2427 | using (hash-values v) | 2054 | using (hash-values v) |
| 2428 | do | 2055 | do |
| 2429 | (message "key %S -> value %S" k v)) | 2056 | (message "key %S -> value %S" k v)) |
| 2430 | @end example | 2057 | @end example |
| 2431 | 2058 | ||
| 2432 | @item for @var{var} being the key-codes of @var{keymap} | 2059 | @item for @var{var} being the key-codes of @var{keymap} |
| @@ -2438,10 +2065,10 @@ A @code{using} clause can access both the codes and the bindings | |||
| 2438 | together. | 2065 | together. |
| 2439 | 2066 | ||
| 2440 | @example | 2067 | @example |
| 2441 | (loop for c being the key-codes of (current-local-map) | 2068 | (cl-loop for c being the key-codes of (current-local-map) |
| 2442 | using (key-bindings b) | 2069 | using (key-bindings b) |
| 2443 | do | 2070 | do |
| 2444 | (message "key %S -> binding %S" c b)) | 2071 | (message "key %S -> binding %S" c b)) |
| 2445 | @end example | 2072 | @end example |
| 2446 | 2073 | ||
| 2447 | 2074 | ||
| @@ -2497,8 +2124,8 @@ and successive iterations it will be set by evaluating @var{expr2} | |||
| 2497 | these two loops are effectively the same: | 2124 | these two loops are effectively the same: |
| 2498 | 2125 | ||
| 2499 | @example | 2126 | @example |
| 2500 | (loop for x on my-list by 'cddr do ...) | 2127 | (cl-loop for x on my-list by 'cddr do ...) |
| 2501 | (loop for x = my-list then (cddr x) while x do ...) | 2128 | (cl-loop for x = my-list then (cddr x) while x do ...) |
| 2502 | @end example | 2129 | @end example |
| 2503 | 2130 | ||
| 2504 | Note that this type of @code{for} clause does not imply any sort | 2131 | Note that this type of @code{for} clause does not imply any sort |
| @@ -2509,7 +2136,7 @@ If you omit the @code{then} term, @var{expr1} is used both for | |||
| 2509 | the initial setting and for successive settings: | 2136 | the initial setting and for successive settings: |
| 2510 | 2137 | ||
| 2511 | @example | 2138 | @example |
| 2512 | (loop for x = (random) when (> x 0) return x) | 2139 | (cl-loop for x = (random) when (> x 0) return x) |
| 2513 | @end example | 2140 | @end example |
| 2514 | 2141 | ||
| 2515 | @noindent | 2142 | @noindent |
| @@ -2524,10 +2151,10 @@ in which case they are processed in parallel (as if by @code{let} | |||
| 2524 | and @code{cl-psetq}). | 2151 | and @code{cl-psetq}). |
| 2525 | 2152 | ||
| 2526 | @example | 2153 | @example |
| 2527 | (loop for x below 5 for y = nil then x collect (list x y)) | 2154 | (cl-loop for x below 5 for y = nil then x collect (list x y)) |
| 2528 | @result{} ((0 nil) (1 1) (2 2) (3 3) (4 4)) | 2155 | @result{} ((0 nil) (1 1) (2 2) (3 3) (4 4)) |
| 2529 | (loop for x below 5 and y = nil then x collect (list x y)) | 2156 | (cl-loop for x below 5 and y = nil then x collect (list x y)) |
| 2530 | @result{} ((0 nil) (1 0) (2 1) (3 2) (4 3)) | 2157 | @result{} ((0 nil) (1 0) (2 1) (3 2) (4 3)) |
| 2531 | @end example | 2158 | @end example |
| 2532 | 2159 | ||
| 2533 | @noindent | 2160 | @noindent |
| @@ -2537,7 +2164,7 @@ that was just set by the previous clause; in the second loop, | |||
| 2537 | based on the value of @code{x} left over from the previous time | 2164 | based on the value of @code{x} left over from the previous time |
| 2538 | through the loop. | 2165 | through the loop. |
| 2539 | 2166 | ||
| 2540 | Another feature of the @code{loop} macro is @dfn{destructuring}, | 2167 | Another feature of the @code{cl-loop} macro is @dfn{destructuring}, |
| 2541 | similar in concept to the destructuring provided by @code{defmacro}. | 2168 | similar in concept to the destructuring provided by @code{defmacro}. |
| 2542 | The @var{var} part of any @code{for} clause can be given as a list | 2169 | The @var{var} part of any @code{for} clause can be given as a list |
| 2543 | of variables instead of a single variable. The values produced | 2170 | of variables instead of a single variable. The values produced |
| @@ -2545,8 +2172,8 @@ during loop execution must be lists; the values in the lists are | |||
| 2545 | stored in the corresponding variables. | 2172 | stored in the corresponding variables. |
| 2546 | 2173 | ||
| 2547 | @example | 2174 | @example |
| 2548 | (loop for (x y) in '((2 3) (4 5) (6 7)) collect (+ x y)) | 2175 | (cl-loop for (x y) in '((2 3) (4 5) (6 7)) collect (+ x y)) |
| 2549 | @result{} (5 9 13) | 2176 | @result{} (5 9 13) |
| 2550 | @end example | 2177 | @end example |
| 2551 | 2178 | ||
| 2552 | In loop destructuring, if there are more values than variables | 2179 | In loop destructuring, if there are more values than variables |
| @@ -2558,9 +2185,9 @@ lists of variables like @code{(x . y)} are allowed, so for example | |||
| 2558 | to process an alist | 2185 | to process an alist |
| 2559 | 2186 | ||
| 2560 | @example | 2187 | @example |
| 2561 | (loop for (key . value) in '((a . 1) (b . 2)) | 2188 | (cl-loop for (key . value) in '((a . 1) (b . 2)) |
| 2562 | collect value) | 2189 | collect value) |
| 2563 | @result{} (1 2) | 2190 | @result{} (1 2) |
| 2564 | @end example | 2191 | @end example |
| 2565 | 2192 | ||
| 2566 | @node Iteration Clauses | 2193 | @node Iteration Clauses |
| @@ -2577,8 +2204,8 @@ This clause simply counts up to the specified number using an | |||
| 2577 | internal temporary variable. The loops | 2204 | internal temporary variable. The loops |
| 2578 | 2205 | ||
| 2579 | @example | 2206 | @example |
| 2580 | (loop repeat (1+ n) do ...) | 2207 | (cl-loop repeat (1+ n) do ...) |
| 2581 | (loop for temp to n do ...) | 2208 | (cl-loop for temp to n do ...) |
| 2582 | @end example | 2209 | @end example |
| 2583 | 2210 | ||
| 2584 | @noindent | 2211 | @noindent |
| @@ -2593,7 +2220,7 @@ that surrounds the second one: | |||
| 2593 | 2220 | ||
| 2594 | @example | 2221 | @example |
| 2595 | (while @var{cond} @var{forms}@dots{}) | 2222 | (while @var{cond} @var{forms}@dots{}) |
| 2596 | (loop while @var{cond} do @var{forms}@dots{}) | 2223 | (cl-loop while @var{cond} do @var{forms}@dots{}) |
| 2597 | @end example | 2224 | @end example |
| 2598 | 2225 | ||
| 2599 | @item until @var{condition} | 2226 | @item until @var{condition} |
| @@ -2607,7 +2234,7 @@ the @code{finally} clauses are not executed. If all the conditions | |||
| 2607 | were non-@code{nil}, the loop returns @code{t}: | 2234 | were non-@code{nil}, the loop returns @code{t}: |
| 2608 | 2235 | ||
| 2609 | @example | 2236 | @example |
| 2610 | (if (loop for size in size-list always (> size 10)) | 2237 | (if (cl-loop for size in size-list always (> size 10)) |
| 2611 | (some-big-sizes) | 2238 | (some-big-sizes) |
| 2612 | (no-big-sizes)) | 2239 | (no-big-sizes)) |
| 2613 | @end example | 2240 | @end example |
| @@ -2684,11 +2311,11 @@ It is valid for several accumulation clauses of the same type to | |||
| 2684 | accumulate into the same place. From Steele: | 2311 | accumulate into the same place. From Steele: |
| 2685 | 2312 | ||
| 2686 | @example | 2313 | @example |
| 2687 | (loop for name in '(fred sue alice joe june) | 2314 | (cl-loop for name in '(fred sue alice joe june) |
| 2688 | for kids in '((bob ken) () () (kris sunshine) ()) | 2315 | for kids in '((bob ken) () () (kris sunshine) ()) |
| 2689 | collect name | 2316 | collect name |
| 2690 | append kids) | 2317 | append kids) |
| 2691 | @result{} (fred bob ken sue alice joe kris sunshine june) | 2318 | @result{} (fred bob ken sue alice joe kris sunshine june) |
| 2692 | @end example | 2319 | @end example |
| 2693 | 2320 | ||
| 2694 | @node Other Clauses | 2321 | @node Other Clauses |
| @@ -2704,17 +2331,17 @@ otherwise leaves the variable alone during the loop. The following | |||
| 2704 | loops are basically equivalent: | 2331 | loops are basically equivalent: |
| 2705 | 2332 | ||
| 2706 | @example | 2333 | @example |
| 2707 | (loop with x = 17 do ...) | 2334 | (cl-loop with x = 17 do ...) |
| 2708 | (let ((x 17)) (loop do ...)) | 2335 | (let ((x 17)) (cl-loop do ...)) |
| 2709 | (loop for x = 17 then x do ...) | 2336 | (cl-loop for x = 17 then x do ...) |
| 2710 | @end example | 2337 | @end example |
| 2711 | 2338 | ||
| 2712 | Naturally, the variable @var{var} might be used for some purpose | 2339 | Naturally, the variable @var{var} might be used for some purpose |
| 2713 | in the rest of the loop. For example: | 2340 | in the rest of the loop. For example: |
| 2714 | 2341 | ||
| 2715 | @example | 2342 | @example |
| 2716 | (loop for x in my-list with res = nil do (push x res) | 2343 | (cl-loop for x in my-list with res = nil do (push x res) |
| 2717 | finally return res) | 2344 | finally return res) |
| 2718 | @end example | 2345 | @end example |
| 2719 | 2346 | ||
| 2720 | This loop inserts the elements of @code{my-list} at the front of | 2347 | This loop inserts the elements of @code{my-list} at the front of |
| @@ -2749,18 +2376,18 @@ by the name @code{it} in the ``then'' part. For example: | |||
| 2749 | @example | 2376 | @example |
| 2750 | (setq funny-numbers '(6 13 -1)) | 2377 | (setq funny-numbers '(6 13 -1)) |
| 2751 | @result{} (6 13 -1) | 2378 | @result{} (6 13 -1) |
| 2752 | (loop for x below 10 | 2379 | (cl-loop for x below 10 |
| 2753 | if (oddp x) | 2380 | if (oddp x) |
| 2754 | collect x into odds | 2381 | collect x into odds |
| 2755 | and if (memq x funny-numbers) return (cdr it) end | 2382 | and if (memq x funny-numbers) return (cdr it) end |
| 2756 | else | 2383 | else |
| 2757 | collect x into evens | 2384 | collect x into evens |
| 2758 | finally return (vector odds evens)) | 2385 | finally return (vector odds evens)) |
| 2759 | @result{} [(1 3 5 7 9) (0 2 4 6 8)] | 2386 | @result{} [(1 3 5 7 9) (0 2 4 6 8)] |
| 2760 | (setq funny-numbers '(6 7 13 -1)) | 2387 | (setq funny-numbers '(6 7 13 -1)) |
| 2761 | @result{} (6 7 13 -1) | 2388 | @result{} (6 7 13 -1) |
| 2762 | (loop <@r{same thing again}>) | 2389 | (cl-loop <@r{same thing again}>) |
| 2763 | @result{} (13 -1) | 2390 | @result{} (13 -1) |
| 2764 | @end example | 2391 | @end example |
| 2765 | 2392 | ||
| 2766 | Note the use of @code{and} to put two clauses into the ``then'' | 2393 | Note the use of @code{and} to put two clauses into the ``then'' |
| @@ -2823,20 +2450,20 @@ Of course, @code{return} is generally used inside an @code{if} or | |||
| 2823 | the loop would never get to ``loop'' more than once. | 2450 | the loop would never get to ``loop'' more than once. |
| 2824 | 2451 | ||
| 2825 | The clause @samp{return @var{form}} is equivalent to | 2452 | The clause @samp{return @var{form}} is equivalent to |
| 2453 | @c FIXME cl-do, cl-return? | ||
| 2826 | @samp{do (return @var{form})} (or @code{return-from} if the loop | 2454 | @samp{do (return @var{form})} (or @code{return-from} if the loop |
| 2827 | was named). The @code{return} clause is implemented a bit more | 2455 | was named). The @code{return} clause is implemented a bit more |
| 2828 | efficiently, though. | 2456 | efficiently, though. |
| 2829 | @end table | 2457 | @end table |
| 2830 | 2458 | ||
| 2831 | While there is no high-level way to add user extensions to @code{loop} | 2459 | While there is no high-level way to add user extensions to @code{cl-loop}, |
| 2832 | (comparable to @code{defsetf} for @code{setf}, say), this package | 2460 | this package does offer two properties called @code{cl-loop-handler} |
| 2833 | does offer two properties called @code{cl-loop-handler} and | 2461 | and @code{cl-loop-for-handler} which are functions to be called when a |
| 2834 | @code{cl-loop-for-handler} which are functions to be called when | 2462 | given symbol is encountered as a top-level loop clause or @code{for} |
| 2835 | a given symbol is encountered as a top-level loop clause or | 2463 | clause, respectively. Consult the source code in file |
| 2836 | @code{for} clause, respectively. Consult the source code in | 2464 | @file{cl-macs.el} for details. |
| 2837 | file @file{cl-macs.el} for details. | ||
| 2838 | 2465 | ||
| 2839 | This package's @code{loop} macro is compatible with that of Common | 2466 | This package's @code{cl-loop} macro is compatible with that of Common |
| 2840 | Lisp, except that a few features are not implemented: @code{loop-finish} | 2467 | Lisp, except that a few features are not implemented: @code{loop-finish} |
| 2841 | and data-type specifiers. Naturally, the @code{for} clauses which | 2468 | and data-type specifiers. Naturally, the @code{for} clauses which |
| 2842 | iterate over keymaps, overlays, intervals, frames, windows, and | 2469 | iterate over keymaps, overlays, intervals, frames, windows, and |
| @@ -2851,35 +2478,28 @@ functions, by contrast, always return exactly one result. This | |||
| 2851 | package makes no attempt to emulate Common Lisp multiple return | 2478 | package makes no attempt to emulate Common Lisp multiple return |
| 2852 | values; Emacs versions of Common Lisp functions that return more | 2479 | values; Emacs versions of Common Lisp functions that return more |
| 2853 | than one value either return just the first value (as in | 2480 | than one value either return just the first value (as in |
| 2854 | @code{compiler-macroexpand}) or return a list of values (as in | 2481 | @code{cl-compiler-macroexpand}) or return a list of values. |
| 2855 | @code{get-setf-method}). This package @emph{does} define placeholders | 2482 | This package @emph{does} define placeholders |
| 2856 | for the Common Lisp functions that work with multiple values, but | 2483 | for the Common Lisp functions that work with multiple values, but |
| 2857 | in Emacs Lisp these functions simply operate on lists instead. | 2484 | in Emacs Lisp these functions simply operate on lists instead. |
| 2858 | The @code{values} form, for example, is a synonym for @code{list} | 2485 | The @code{cl-values} form, for example, is a synonym for @code{list} |
| 2859 | in Emacs. | 2486 | in Emacs. |
| 2860 | 2487 | ||
| 2861 | @defspec multiple-value-bind (var@dots{}) values-form forms@dots{} | 2488 | @defmac cl-multiple-value-bind (var@dots{}) values-form forms@dots{} |
| 2862 | This form evaluates @var{values-form}, which must return a list of | 2489 | This form evaluates @var{values-form}, which must return a list of |
| 2863 | values. It then binds the @var{var}s to these respective values, | 2490 | values. It then binds the @var{var}s to these respective values, |
| 2864 | as if by @code{let}, and then executes the body @var{forms}. | 2491 | as if by @code{let}, and then executes the body @var{forms}. |
| 2865 | If there are more @var{var}s than values, the extra @var{var}s | 2492 | If there are more @var{var}s than values, the extra @var{var}s |
| 2866 | are bound to @code{nil}. If there are fewer @var{var}s than | 2493 | are bound to @code{nil}. If there are fewer @var{var}s than |
| 2867 | values, the excess values are ignored. | 2494 | values, the excess values are ignored. |
| 2868 | @end defspec | 2495 | @end defmac |
| 2869 | 2496 | ||
| 2870 | @defspec multiple-value-setq (var@dots{}) form | 2497 | @defmac cl-multiple-value-setq (var@dots{}) form |
| 2871 | This form evaluates @var{form}, which must return a list of values. | 2498 | This form evaluates @var{form}, which must return a list of values. |
| 2872 | It then sets the @var{var}s to these respective values, as if by | 2499 | It then sets the @var{var}s to these respective values, as if by |
| 2873 | @code{setq}. Extra @var{var}s or values are treated the same as | 2500 | @code{setq}. Extra @var{var}s or values are treated the same as |
| 2874 | in @code{multiple-value-bind}. | 2501 | in @code{cl-multiple-value-bind}. |
| 2875 | @end defspec | 2502 | @end defmac |
| 2876 | |||
| 2877 | The older Quiroz package attempted a more faithful (but still | ||
| 2878 | imperfect) emulation of Common Lisp multiple values. The old | ||
| 2879 | method ``usually'' simulated true multiple values quite well, | ||
| 2880 | but under certain circumstances would leave spurious return | ||
| 2881 | values in memory where a later, unrelated @code{multiple-value-bind} | ||
| 2882 | form would see them. | ||
| 2883 | 2503 | ||
| 2884 | Since a perfect emulation is not feasible in Emacs Lisp, this | 2504 | Since a perfect emulation is not feasible in Emacs Lisp, this |
| 2885 | package opts to keep it as simple and predictable as possible. | 2505 | package opts to keep it as simple and predictable as possible. |
| @@ -2897,7 +2517,7 @@ for @code{defmacro} due to technical difficulties. | |||
| 2897 | Destructuring is made available to the user by way of the | 2517 | Destructuring is made available to the user by way of the |
| 2898 | following macro: | 2518 | following macro: |
| 2899 | 2519 | ||
| 2900 | @defspec destructuring-bind arglist expr forms@dots{} | 2520 | @defmac cl-destructuring-bind arglist expr forms@dots{} |
| 2901 | This macro expands to code which executes @var{forms}, with | 2521 | This macro expands to code which executes @var{forms}, with |
| 2902 | the variables in @var{arglist} bound to the list of values | 2522 | the variables in @var{arglist} bound to the list of values |
| 2903 | returned by @var{expr}. The @var{arglist} can include all | 2523 | returned by @var{expr}. The @var{arglist} can include all |
| @@ -2906,13 +2526,13 @@ including destructuring. (The @code{&environment} keyword | |||
| 2906 | is not allowed.) The macro expansion will signal an error | 2526 | is not allowed.) The macro expansion will signal an error |
| 2907 | if @var{expr} returns a list of the wrong number of arguments | 2527 | if @var{expr} returns a list of the wrong number of arguments |
| 2908 | or with incorrect keyword arguments. | 2528 | or with incorrect keyword arguments. |
| 2909 | @end defspec | 2529 | @end defmac |
| 2910 | 2530 | ||
| 2911 | This package also includes the Common Lisp @code{define-compiler-macro} | 2531 | This package also includes the Common Lisp @code{cl-define-compiler-macro} |
| 2912 | facility, which allows you to define compile-time expansions and | 2532 | facility, which allows you to define compile-time expansions and |
| 2913 | optimizations for your functions. | 2533 | optimizations for your functions. |
| 2914 | 2534 | ||
| 2915 | @defspec define-compiler-macro name arglist forms@dots{} | 2535 | @defmac cl-define-compiler-macro name arglist forms@dots{} |
| 2916 | This form is similar to @code{defmacro}, except that it only expands | 2536 | This form is similar to @code{defmacro}, except that it only expands |
| 2917 | calls to @var{name} at compile-time; calls processed by the Lisp | 2537 | calls to @var{name} at compile-time; calls processed by the Lisp |
| 2918 | interpreter are not expanded, nor are they expanded by the | 2538 | interpreter are not expanded, nor are they expanded by the |
| @@ -2930,25 +2550,25 @@ For example, here is a simplified version of a definition that | |||
| 2930 | appears as a standard part of this package: | 2550 | appears as a standard part of this package: |
| 2931 | 2551 | ||
| 2932 | @example | 2552 | @example |
| 2933 | (define-compiler-macro member* (&whole form a list &rest keys) | 2553 | (cl-define-compiler-macro cl-member (&whole form a list &rest keys) |
| 2934 | (if (and (null keys) | 2554 | (if (and (null keys) |
| 2935 | (eq (car-safe a) 'quote) | 2555 | (eq (car-safe a) 'quote) |
| 2936 | (not (floatp-safe (cadr a)))) | 2556 | (not (floatp-safe (cadr a)))) |
| 2937 | (list 'memq a list) | 2557 | (list 'memq a list) |
| 2938 | form)) | 2558 | form)) |
| 2939 | @end example | 2559 | @end example |
| 2940 | 2560 | ||
| 2941 | @noindent | 2561 | @noindent |
| 2942 | This definition causes @code{(member* @var{a} @var{list})} to change | 2562 | This definition causes @code{(cl-member @var{a} @var{list})} to change |
| 2943 | to a call to the faster @code{memq} in the common case where @var{a} | 2563 | to a call to the faster @code{memq} in the common case where @var{a} |
| 2944 | is a non-floating-point constant; if @var{a} is anything else, or | 2564 | is a non-floating-point constant; if @var{a} is anything else, or |
| 2945 | if there are any keyword arguments in the call, then the original | 2565 | if there are any keyword arguments in the call, then the original |
| 2946 | @code{member*} call is left intact. (The actual compiler macro | 2566 | @code{cl-member} call is left intact. (The actual compiler macro |
| 2947 | for @code{member*} optimizes a number of other cases, including | 2567 | for @code{cl-member} optimizes a number of other cases, including |
| 2948 | common @code{:test} predicates.) | 2568 | common @code{:test} predicates.) |
| 2949 | @end defspec | 2569 | @end defmac |
| 2950 | 2570 | ||
| 2951 | @defun compiler-macroexpand form | 2571 | @defun cl-compiler-macroexpand form |
| 2952 | This function is analogous to @code{macroexpand}, except that it | 2572 | This function is analogous to @code{macroexpand}, except that it |
| 2953 | expands compiler macros rather than regular macros. It returns | 2573 | expands compiler macros rather than regular macros. It returns |
| 2954 | @var{form} unchanged if it is not a call to a function for which | 2574 | @var{form} unchanged if it is not a call to a function for which |
| @@ -2958,8 +2578,8 @@ decided to punt by returning its @code{&whole} argument. Like | |||
| 2958 | for which no further expansion is possible. | 2578 | for which no further expansion is possible. |
| 2959 | @end defun | 2579 | @end defun |
| 2960 | 2580 | ||
| 2961 | @xref{Macro Bindings}, for descriptions of the @code{macrolet} | 2581 | @xref{Macro Bindings}, for descriptions of the @code{cl-macrolet} |
| 2962 | and @code{symbol-macrolet} forms for making ``local'' macro | 2582 | and @code{cl-symbol-macrolet} forms for making ``local'' macro |
| 2963 | definitions. | 2583 | definitions. |
| 2964 | 2584 | ||
| 2965 | @node Declarations | 2585 | @node Declarations |
| @@ -2971,8 +2591,8 @@ mechanism that allows you to give the compiler special hints | |||
| 2971 | about the types of data that will be stored in particular variables, | 2591 | about the types of data that will be stored in particular variables, |
| 2972 | and about the ways those variables and functions will be used. This | 2592 | and about the ways those variables and functions will be used. This |
| 2973 | package defines versions of all the Common Lisp declaration forms: | 2593 | package defines versions of all the Common Lisp declaration forms: |
| 2974 | @code{declare}, @code{locally}, @code{proclaim}, @code{declaim}, | 2594 | @code{cl-declare}, @code{cl-locally}, @code{cl-proclaim}, @code{cl-declaim}, |
| 2975 | and @code{the}. | 2595 | and @code{cl-the}. |
| 2976 | 2596 | ||
| 2977 | Most of the Common Lisp declarations are not currently useful in | 2597 | Most of the Common Lisp declarations are not currently useful in |
| 2978 | Emacs Lisp, as the byte-code system provides little opportunity | 2598 | Emacs Lisp, as the byte-code system provides little opportunity |
| @@ -2982,53 +2602,53 @@ declarations are meaningful when the optimizing byte | |||
| 2982 | compiler is being used, however. Under the earlier non-optimizing | 2602 | compiler is being used, however. Under the earlier non-optimizing |
| 2983 | compiler, these declarations will effectively be ignored. | 2603 | compiler, these declarations will effectively be ignored. |
| 2984 | 2604 | ||
| 2985 | @defun proclaim decl-spec | 2605 | @defun cl-proclaim decl-spec |
| 2986 | This function records a ``global'' declaration specified by | 2606 | This function records a ``global'' declaration specified by |
| 2987 | @var{decl-spec}. Since @code{proclaim} is a function, @var{decl-spec} | 2607 | @var{decl-spec}. Since @code{cl-proclaim} is a function, @var{decl-spec} |
| 2988 | is evaluated and thus should normally be quoted. | 2608 | is evaluated and thus should normally be quoted. |
| 2989 | @end defun | 2609 | @end defun |
| 2990 | 2610 | ||
| 2991 | @defspec declaim decl-specs@dots{} | 2611 | @defmac cl-declaim decl-specs@dots{} |
| 2992 | This macro is like @code{proclaim}, except that it takes any number | 2612 | This macro is like @code{cl-proclaim}, except that it takes any number |
| 2993 | of @var{decl-spec} arguments, and the arguments are unevaluated and | 2613 | of @var{decl-spec} arguments, and the arguments are unevaluated and |
| 2994 | unquoted. The @code{declaim} macro also puts an @code{(eval-when | 2614 | unquoted. The @code{cl-declaim} macro also puts an @code{(cl-eval-when |
| 2995 | (compile load eval) ...)} around the declarations so that they will | 2615 | (compile load eval) ...)} around the declarations so that they will |
| 2996 | be registered at compile-time as well as at run-time. (This is vital, | 2616 | be registered at compile-time as well as at run-time. (This is vital, |
| 2997 | since normally the declarations are meant to influence the way the | 2617 | since normally the declarations are meant to influence the way the |
| 2998 | compiler treats the rest of the file that contains the @code{declaim} | 2618 | compiler treats the rest of the file that contains the @code{cl-declaim} |
| 2999 | form.) | 2619 | form.) |
| 3000 | @end defspec | 2620 | @end defmac |
| 3001 | 2621 | ||
| 3002 | @defspec declare decl-specs@dots{} | 2622 | @defmac cl-declare decl-specs@dots{} |
| 3003 | This macro is used to make declarations within functions and other | 2623 | This macro is used to make declarations within functions and other |
| 3004 | code. Common Lisp allows declarations in various locations, generally | 2624 | code. Common Lisp allows declarations in various locations, generally |
| 3005 | at the beginning of any of the many ``implicit @code{progn}s'' | 2625 | at the beginning of any of the many ``implicit @code{progn}s'' |
| 3006 | throughout Lisp syntax, such as function bodies, @code{let} bodies, | 2626 | throughout Lisp syntax, such as function bodies, @code{let} bodies, |
| 3007 | etc. Currently the only declaration understood by @code{declare} | 2627 | etc. Currently the only declaration understood by @code{cl-declare} |
| 3008 | is @code{special}. | 2628 | is @code{special}. |
| 3009 | @end defspec | 2629 | @end defmac |
| 3010 | 2630 | ||
| 3011 | @defspec locally declarations@dots{} forms@dots{} | 2631 | @defmac cl-locally declarations@dots{} forms@dots{} |
| 3012 | In this package, @code{locally} is no different from @code{progn}. | 2632 | In this package, @code{cl-locally} is no different from @code{progn}. |
| 3013 | @end defspec | 2633 | @end defmac |
| 3014 | 2634 | ||
| 3015 | @defspec the type form | 2635 | @defmac cl-the type form |
| 3016 | Type information provided by @code{the} is ignored in this package; | 2636 | Type information provided by @code{cl-the} is ignored in this package; |
| 3017 | in other words, @code{(the @var{type} @var{form})} is equivalent | 2637 | in other words, @code{(cl-the @var{type} @var{form})} is equivalent |
| 3018 | to @var{form}. Future versions of the optimizing byte-compiler may | 2638 | to @var{form}. Future versions of the optimizing byte-compiler may |
| 3019 | make use of this information. | 2639 | make use of this information. |
| 3020 | 2640 | ||
| 3021 | For example, @code{mapcar} can map over both lists and arrays. It is | 2641 | For example, @code{mapcar} can map over both lists and arrays. It is |
| 3022 | hard for the compiler to expand @code{mapcar} into an in-line loop | 2642 | hard for the compiler to expand @code{mapcar} into an in-line loop |
| 3023 | unless it knows whether the sequence will be a list or an array ahead | 2643 | unless it knows whether the sequence will be a list or an array ahead |
| 3024 | of time. With @code{(mapcar 'car (the vector foo))}, a future | 2644 | of time. With @code{(mapcar 'car (cl-the vector foo))}, a future |
| 3025 | compiler would have enough information to expand the loop in-line. | 2645 | compiler would have enough information to expand the loop in-line. |
| 3026 | For now, Emacs Lisp will treat the above code as exactly equivalent | 2646 | For now, Emacs Lisp will treat the above code as exactly equivalent |
| 3027 | to @code{(mapcar 'car foo)}. | 2647 | to @code{(mapcar 'car foo)}. |
| 3028 | @end defspec | 2648 | @end defmac |
| 3029 | 2649 | ||
| 3030 | Each @var{decl-spec} in a @code{proclaim}, @code{declaim}, or | 2650 | Each @var{decl-spec} in a @code{cl-proclaim}, @code{cl-declaim}, or |
| 3031 | @code{declare} should be a list beginning with a symbol that says | 2651 | @code{cl-declare} should be a list beginning with a symbol that says |
| 3032 | what kind of declaration it is. This package currently understands | 2652 | what kind of declaration it is. This package currently understands |
| 3033 | @code{special}, @code{inline}, @code{notinline}, @code{optimize}, | 2653 | @code{special}, @code{inline}, @code{notinline}, @code{optimize}, |
| 3034 | and @code{warn} declarations. (The @code{warn} declaration is an | 2654 | and @code{warn} declarations. (The @code{warn} declaration is an |
| @@ -3045,16 +2665,16 @@ bound in the body of the function. The compiler normally emits | |||
| 3045 | warnings for such references, since they could be typographical | 2665 | warnings for such references, since they could be typographical |
| 3046 | errors for references to local variables. | 2666 | errors for references to local variables. |
| 3047 | 2667 | ||
| 3048 | The declaration @code{(declare (special @var{var1} @var{var2}))} is | 2668 | The declaration @code{(cl-declare (special @var{var1} @var{var2}))} is |
| 3049 | equivalent to @code{(defvar @var{var1}) (defvar @var{var2})} in the | 2669 | equivalent to @code{(defvar @var{var1}) (defvar @var{var2})} in the |
| 3050 | optimizing compiler, or to nothing at all in older compilers (which | 2670 | optimizing compiler, or to nothing at all in older compilers (which |
| 3051 | do not warn for non-local references). | 2671 | do not warn for non-local references). |
| 3052 | 2672 | ||
| 3053 | In top-level contexts, it is generally better to write | 2673 | In top-level contexts, it is generally better to write |
| 3054 | @code{(defvar @var{var})} than @code{(declaim (special @var{var}))}, | 2674 | @code{(defvar @var{var})} than @code{(cl-declaim (special @var{var}))}, |
| 3055 | since @code{defvar} makes your intentions clearer. But the older | 2675 | since @code{defvar} makes your intentions clearer. But the older |
| 3056 | byte compilers can not handle @code{defvar}s appearing inside of | 2676 | byte compilers can not handle @code{defvar}s appearing inside of |
| 3057 | functions, while @code{(declare (special @var{var}))} takes care | 2677 | functions, while @code{(cl-declare (special @var{var}))} takes care |
| 3058 | to work correctly with all compilers. | 2678 | to work correctly with all compilers. |
| 3059 | 2679 | ||
| 3060 | @item inline | 2680 | @item inline |
| @@ -3072,8 +2692,9 @@ The following declarations are all equivalent. Note that the | |||
| 3072 | and declare it inline all at once. | 2692 | and declare it inline all at once. |
| 3073 | 2693 | ||
| 3074 | @example | 2694 | @example |
| 3075 | (declaim (inline foo bar)) | 2695 | (cl-declaim (inline foo bar)) |
| 3076 | (eval-when (compile load eval) (proclaim '(inline foo bar))) | 2696 | (cl-eval-when (compile load eval) |
| 2697 | (cl-proclaim '(inline foo bar))) | ||
| 3077 | (defsubst foo (...) ...) ; instead of defun | 2698 | (defsubst foo (...) ...) ; instead of defun |
| 3078 | @end example | 2699 | @end example |
| 3079 | 2700 | ||
| @@ -3083,10 +2704,10 @@ request that a function you have defined should be inlined, | |||
| 3083 | but it is impolite to use it to request inlining of an external | 2704 | but it is impolite to use it to request inlining of an external |
| 3084 | function. | 2705 | function. |
| 3085 | 2706 | ||
| 3086 | In Common Lisp, it is possible to use @code{(declare (inline @dots{}))} | 2707 | In Common Lisp, it is possible to use @code{(cl-declare (inline @dots{}))} |
| 3087 | before a particular call to a function to cause just that call to | 2708 | before a particular call to a function to cause just that call to |
| 3088 | be inlined; the current byte compilers provide no way to implement | 2709 | be inlined; the current byte compilers provide no way to implement |
| 3089 | this, so @code{(declare (inline @dots{}))} is currently ignored by | 2710 | this, so @code{(cl-declare (inline @dots{}))} is currently ignored by |
| 3090 | this package. | 2711 | this package. |
| 3091 | 2712 | ||
| 3092 | @item notinline | 2713 | @item notinline |
| @@ -3103,15 +2724,15 @@ The word @code{optimize} is followed by any number of lists like | |||
| 3103 | @code{(speed 3)} or @code{(safety 2)}. Common Lisp defines several | 2724 | @code{(speed 3)} or @code{(safety 2)}. Common Lisp defines several |
| 3104 | optimization ``qualities''; this package ignores all but @code{speed} | 2725 | optimization ``qualities''; this package ignores all but @code{speed} |
| 3105 | and @code{safety}. The value of a quality should be an integer from | 2726 | and @code{safety}. The value of a quality should be an integer from |
| 3106 | 0 to 3, with 0 meaning ``unimportant'' and 3 meaning ``very important.'' | 2727 | 0 to 3, with 0 meaning ``unimportant'' and 3 meaning ``very important''. |
| 3107 | The default level for both qualities is 1. | 2728 | The default level for both qualities is 1. |
| 3108 | 2729 | ||
| 3109 | In this package, with the optimizing compiler, the | 2730 | In this package, with the optimizing compiler, the |
| 3110 | @code{speed} quality is tied to the @code{byte-compile-optimize} | 2731 | @code{speed} quality is tied to the @code{byte-optimize} |
| 3111 | flag, which is set to @code{nil} for @code{(speed 0)} and to | 2732 | flag, which is set to @code{nil} for @code{(speed 0)} and to |
| 3112 | @code{t} for higher settings; and the @code{safety} quality is | 2733 | @code{t} for higher settings; and the @code{safety} quality is |
| 3113 | tied to the @code{byte-compile-delete-errors} flag, which is | 2734 | tied to the @code{byte-compile-delete-errors} flag, which is |
| 3114 | set to @code{t} for @code{(safety 3)} and to @code{nil} for all | 2735 | set to @code{nil} for @code{(safety 3)} and to @code{t} for all |
| 3115 | lower settings. (The latter flag controls whether the compiler | 2736 | lower settings. (The latter flag controls whether the compiler |
| 3116 | is allowed to optimize out code whose only side-effect could | 2737 | is allowed to optimize out code whose only side-effect could |
| 3117 | be to signal an error, e.g., rewriting @code{(progn foo bar)} to | 2738 | be to signal an error, e.g., rewriting @code{(progn foo bar)} to |
| @@ -3125,10 +2746,10 @@ Emacs itself, Emacs will not crash with a segmentation fault | |||
| 3125 | just because of an error in a fully-optimized Lisp program. | 2746 | just because of an error in a fully-optimized Lisp program. |
| 3126 | 2747 | ||
| 3127 | The @code{optimize} declaration is normally used in a top-level | 2748 | The @code{optimize} declaration is normally used in a top-level |
| 3128 | @code{proclaim} or @code{declaim} in a file; Common Lisp allows | 2749 | @code{cl-proclaim} or @code{cl-declaim} in a file; Common Lisp allows |
| 3129 | it to be used with @code{declare} to set the level of optimization | 2750 | it to be used with @code{cl-declare} to set the level of optimization |
| 3130 | locally for a given form, but this will not work correctly with the | 2751 | locally for a given form, but this will not work correctly with the |
| 3131 | current version of the optimizing compiler. (The @code{declare} | 2752 | current version of the optimizing compiler. (The @code{cl-declare} |
| 3132 | will set the new optimization level, but that level will not | 2753 | will set the new optimization level, but that level will not |
| 3133 | automatically be unset after the enclosing form is done.) | 2754 | automatically be unset after the enclosing form is done.) |
| 3134 | 2755 | ||
| @@ -3136,7 +2757,7 @@ automatically be unset after the enclosing form is done.) | |||
| 3136 | This declaration controls what sorts of warnings are generated | 2757 | This declaration controls what sorts of warnings are generated |
| 3137 | by the byte compiler. Again, only the optimizing compiler | 2758 | by the byte compiler. Again, only the optimizing compiler |
| 3138 | generates warnings. The word @code{warn} is followed by any | 2759 | generates warnings. The word @code{warn} is followed by any |
| 3139 | number of ``warning qualities,'' similar in form to optimization | 2760 | number of ``warning qualities'', similar in form to optimization |
| 3140 | qualities. The currently supported warning types are | 2761 | qualities. The currently supported warning types are |
| 3141 | @code{redefine}, @code{callargs}, @code{unresolved}, and | 2762 | @code{redefine}, @code{callargs}, @code{unresolved}, and |
| 3142 | @code{free-vars}; in the current system, a value of 0 will | 2763 | @code{free-vars}; in the current system, a value of 0 will |
| @@ -3152,8 +2773,8 @@ This package defines several symbol-related features that were | |||
| 3152 | missing from Emacs Lisp. | 2773 | missing from Emacs Lisp. |
| 3153 | 2774 | ||
| 3154 | @menu | 2775 | @menu |
| 3155 | * Property Lists:: @code{get*}, @code{remprop}, @code{getf}, @code{remf}. | 2776 | * Property Lists:: @code{cl-get}, @code{cl-remprop}, @code{cl-getf}, @code{cl-remf}. |
| 3156 | * Creating Symbols:: @code{gensym}, @code{gentemp}. | 2777 | * Creating Symbols:: @code{cl-gensym}, @code{cl-gentemp}. |
| 3157 | @end menu | 2778 | @end menu |
| 3158 | 2779 | ||
| 3159 | @node Property Lists | 2780 | @node Property Lists |
| @@ -3165,18 +2786,18 @@ and @code{put} for operating on properties attached to symbols. | |||
| 3165 | There are also functions for working with property lists as | 2786 | There are also functions for working with property lists as |
| 3166 | first-class data structures not attached to particular symbols. | 2787 | first-class data structures not attached to particular symbols. |
| 3167 | 2788 | ||
| 3168 | @defun get* symbol property &optional default | 2789 | @defun cl-get symbol property &optional default |
| 3169 | This function is like @code{get}, except that if the property is | 2790 | This function is like @code{get}, except that if the property is |
| 3170 | not found, the @var{default} argument provides the return value. | 2791 | not found, the @var{default} argument provides the return value. |
| 3171 | (The Emacs Lisp @code{get} function always uses @code{nil} as | 2792 | (The Emacs Lisp @code{get} function always uses @code{nil} as |
| 3172 | the default; this package's @code{get*} is equivalent to Common | 2793 | the default; this package's @code{cl-get} is equivalent to Common |
| 3173 | Lisp's @code{get}.) | 2794 | Lisp's @code{get}.) |
| 3174 | 2795 | ||
| 3175 | The @code{get*} function is @code{setf}-able; when used in this | 2796 | The @code{cl-get} function is @code{setf}-able; when used in this |
| 3176 | fashion, the @var{default} argument is allowed but ignored. | 2797 | fashion, the @var{default} argument is allowed but ignored. |
| 3177 | @end defun | 2798 | @end defun |
| 3178 | 2799 | ||
| 3179 | @defun remprop symbol property | 2800 | @defun cl-remprop symbol property |
| 3180 | This function removes the entry for @var{property} from the property | 2801 | This function removes the entry for @var{property} from the property |
| 3181 | list of @var{symbol}. It returns a true value if the property was | 2802 | list of @var{symbol}. It returns a true value if the property was |
| 3182 | indeed found and removed, or @code{nil} if there was no such property. | 2803 | indeed found and removed, or @code{nil} if there was no such property. |
| @@ -3184,10 +2805,10 @@ indeed found and removed, or @code{nil} if there was no such property. | |||
| 3184 | since @code{get} did not allow a @var{default}, it was very difficult | 2805 | since @code{get} did not allow a @var{default}, it was very difficult |
| 3185 | to distinguish between a missing property and a property whose value | 2806 | to distinguish between a missing property and a property whose value |
| 3186 | was @code{nil}; thus, setting a property to @code{nil} was close | 2807 | was @code{nil}; thus, setting a property to @code{nil} was close |
| 3187 | enough to @code{remprop} for most purposes.) | 2808 | enough to @code{cl-remprop} for most purposes.) |
| 3188 | @end defun | 2809 | @end defun |
| 3189 | 2810 | ||
| 3190 | @defun getf place property &optional default | 2811 | @defun cl-getf place property &optional default |
| 3191 | This function scans the list @var{place} as if it were a property | 2812 | This function scans the list @var{place} as if it were a property |
| 3192 | list, i.e., a list of alternating property names and values. If | 2813 | list, i.e., a list of alternating property names and values. If |
| 3193 | an even-numbered element of @var{place} is found which is @code{eq} | 2814 | an even-numbered element of @var{place} is found which is @code{eq} |
| @@ -3198,10 +2819,10 @@ is given). | |||
| 3198 | In particular, | 2819 | In particular, |
| 3199 | 2820 | ||
| 3200 | @example | 2821 | @example |
| 3201 | (get sym prop) @equiv{} (getf (symbol-plist sym) prop) | 2822 | (get sym prop) @equiv{} (cl-getf (symbol-plist sym) prop) |
| 3202 | @end example | 2823 | @end example |
| 3203 | 2824 | ||
| 3204 | It is valid to use @code{getf} as a @code{setf} place, in which case | 2825 | It is valid to use @code{cl-getf} as a @code{setf} place, in which case |
| 3205 | its @var{place} argument must itself be a valid @code{setf} place. | 2826 | its @var{place} argument must itself be a valid @code{setf} place. |
| 3206 | The @var{default} argument, if any, is ignored in this context. | 2827 | The @var{default} argument, if any, is ignored in this context. |
| 3207 | The effect is to change (via @code{setcar}) the value cell in the | 2828 | The effect is to change (via @code{setcar}) the value cell in the |
| @@ -3209,25 +2830,25 @@ list that corresponds to @var{property}, or to cons a new property-value | |||
| 3209 | pair onto the list if the property is not yet present. | 2830 | pair onto the list if the property is not yet present. |
| 3210 | 2831 | ||
| 3211 | @example | 2832 | @example |
| 3212 | (put sym prop val) @equiv{} (setf (getf (symbol-plist sym) prop) val) | 2833 | (put sym prop val) @equiv{} (setf (cl-getf (symbol-plist sym) prop) val) |
| 3213 | @end example | 2834 | @end example |
| 3214 | 2835 | ||
| 3215 | The @code{get} and @code{get*} functions are also @code{setf}-able. | 2836 | The @code{get} and @code{cl-get} functions are also @code{setf}-able. |
| 3216 | The fact that @code{default} is ignored can sometimes be useful: | 2837 | The fact that @code{default} is ignored can sometimes be useful: |
| 3217 | 2838 | ||
| 3218 | @example | 2839 | @example |
| 3219 | (incf (get* 'foo 'usage-count 0)) | 2840 | (cl-incf (cl-get 'foo 'usage-count 0)) |
| 3220 | @end example | 2841 | @end example |
| 3221 | 2842 | ||
| 3222 | Here, symbol @code{foo}'s @code{usage-count} property is incremented | 2843 | Here, symbol @code{foo}'s @code{usage-count} property is incremented |
| 3223 | if it exists, or set to 1 (an incremented 0) otherwise. | 2844 | if it exists, or set to 1 (an incremented 0) otherwise. |
| 3224 | 2845 | ||
| 3225 | When not used as a @code{setf} form, @code{getf} is just a regular | 2846 | When not used as a @code{setf} form, @code{cl-getf} is just a regular |
| 3226 | function and its @var{place} argument can actually be any Lisp | 2847 | function and its @var{place} argument can actually be any Lisp |
| 3227 | expression. | 2848 | expression. |
| 3228 | @end defun | 2849 | @end defun |
| 3229 | 2850 | ||
| 3230 | @defspec remf place property | 2851 | @defmac cl-remf place property |
| 3231 | This macro removes the property-value pair for @var{property} from | 2852 | This macro removes the property-value pair for @var{property} from |
| 3232 | the property list stored at @var{place}, which is any @code{setf}-able | 2853 | the property list stored at @var{place}, which is any @code{setf}-able |
| 3233 | place expression. It returns true if the property was found. Note | 2854 | place expression. It returns true if the property was found. Note |
| @@ -3235,11 +2856,7 @@ that if @var{property} happens to be first on the list, this will | |||
| 3235 | effectively do a @code{(setf @var{place} (cddr @var{place}))}, | 2856 | effectively do a @code{(setf @var{place} (cddr @var{place}))}, |
| 3236 | whereas if it occurs later, this simply uses @code{setcdr} to splice | 2857 | whereas if it occurs later, this simply uses @code{setcdr} to splice |
| 3237 | out the property and value cells. | 2858 | out the property and value cells. |
| 3238 | @end defspec | 2859 | @end defmac |
| 3239 | |||
| 3240 | @iftex | ||
| 3241 | @secno=2 | ||
| 3242 | @end iftex | ||
| 3243 | 2860 | ||
| 3244 | @node Creating Symbols | 2861 | @node Creating Symbols |
| 3245 | @section Creating Symbols | 2862 | @section Creating Symbols |
| @@ -3248,7 +2865,7 @@ out the property and value cells. | |||
| 3248 | These functions create unique symbols, typically for use as | 2865 | These functions create unique symbols, typically for use as |
| 3249 | temporary variables. | 2866 | temporary variables. |
| 3250 | 2867 | ||
| 3251 | @defun gensym &optional x | 2868 | @defun cl-gensym &optional x |
| 3252 | This function creates a new, uninterned symbol (using @code{make-symbol}) | 2869 | This function creates a new, uninterned symbol (using @code{make-symbol}) |
| 3253 | with a unique name. (The name of an uninterned symbol is relevant | 2870 | with a unique name. (The name of an uninterned symbol is relevant |
| 3254 | only if the symbol is printed.) By default, the name is generated | 2871 | only if the symbol is printed.) By default, the name is generated |
| @@ -3260,31 +2877,30 @@ their names will not conflict with ``real'' variables in the user's | |||
| 3260 | code. | 2877 | code. |
| 3261 | @end defun | 2878 | @end defun |
| 3262 | 2879 | ||
| 3263 | @defvar *gensym-counter* | 2880 | @defvar cl--gensym-counter |
| 3264 | This variable holds the counter used to generate @code{gensym} names. | 2881 | This variable holds the counter used to generate @code{cl-gensym} names. |
| 3265 | It is incremented after each use by @code{gensym}. In Common Lisp | 2882 | It is incremented after each use by @code{cl-gensym}. In Common Lisp |
| 3266 | this is initialized with 0, but this package initializes it with a | 2883 | this is initialized with 0, but this package initializes it with a |
| 3267 | random (time-dependent) value to avoid trouble when two files that | 2884 | random (time-dependent) value to avoid trouble when two files that |
| 3268 | each used @code{gensym} in their compilation are loaded together. | 2885 | each used @code{cl-gensym} in their compilation are loaded together. |
| 3269 | (Uninterned symbols become interned when the compiler writes them | 2886 | (Uninterned symbols become interned when the compiler writes them |
| 3270 | out to a file and the Emacs loader loads them, so their names have to | 2887 | out to a file and the Emacs loader loads them, so their names have to |
| 3271 | be treated a bit more carefully than in Common Lisp where uninterned | 2888 | be treated a bit more carefully than in Common Lisp where uninterned |
| 3272 | symbols remain uninterned after loading.) | 2889 | symbols remain uninterned after loading.) |
| 3273 | @end defvar | 2890 | @end defvar |
| 3274 | 2891 | ||
| 3275 | @defun gentemp &optional x | 2892 | @defun cl-gentemp &optional x |
| 3276 | This function is like @code{gensym}, except that it produces a new | 2893 | This function is like @code{cl-gensym}, except that it produces a new |
| 3277 | @emph{interned} symbol. If the symbol that is generated already | 2894 | @emph{interned} symbol. If the symbol that is generated already |
| 3278 | exists, the function keeps incrementing the counter and trying | 2895 | exists, the function keeps incrementing the counter and trying |
| 3279 | again until a new symbol is generated. | 2896 | again until a new symbol is generated. |
| 3280 | @end defun | 2897 | @end defun |
| 3281 | 2898 | ||
| 3282 | The Quiroz @file{cl.el} package also defined a @code{defkeyword} | 2899 | This package automatically creates all keywords that are called for by |
| 3283 | form for creating self-quoting keyword symbols. This package | 2900 | @code{&key} argument specifiers, and discourages the use of keywords |
| 3284 | automatically creates all keywords that are called for by | 2901 | as data unrelated to keyword arguments, so the related function |
| 3285 | @code{&key} argument specifiers, and discourages the use of | 2902 | @code{defkeyword} (to create self-quoting keyword symbols) is not |
| 3286 | keywords as data unrelated to keyword arguments, so the | 2903 | provided. |
| 3287 | @code{defkeyword} form has been discontinued. | ||
| 3288 | 2904 | ||
| 3289 | @node Numbers | 2905 | @node Numbers |
| 3290 | @chapter Numbers | 2906 | @chapter Numbers |
| @@ -3294,16 +2910,12 @@ This section defines a few simple Common Lisp operations on numbers | |||
| 3294 | which were left out of Emacs Lisp. | 2910 | which were left out of Emacs Lisp. |
| 3295 | 2911 | ||
| 3296 | @menu | 2912 | @menu |
| 3297 | * Predicates on Numbers:: @code{plusp}, @code{oddp}, @code{floatp-safe}, etc. | 2913 | * Predicates on Numbers:: @code{cl-plusp}, @code{cl-oddp}, @code{cl-floatp-safe}, etc. |
| 3298 | * Numerical Functions:: @code{abs}, @code{floor*}, etc. | 2914 | * Numerical Functions:: @code{abs}, @code{cl-floor}, etc. |
| 3299 | * Random Numbers:: @code{random*}, @code{make-random-state}. | 2915 | * Random Numbers:: @code{cl-random}, @code{cl-make-random-state}. |
| 3300 | * Implementation Parameters:: @code{most-positive-float}. | 2916 | * Implementation Parameters:: @code{cl-most-positive-float}. |
| 3301 | @end menu | 2917 | @end menu |
| 3302 | 2918 | ||
| 3303 | @iftex | ||
| 3304 | @secno=1 | ||
| 3305 | @end iftex | ||
| 3306 | |||
| 3307 | @node Predicates on Numbers | 2919 | @node Predicates on Numbers |
| 3308 | @section Predicates on Numbers | 2920 | @section Predicates on Numbers |
| 3309 | 2921 | ||
| @@ -3311,66 +2923,58 @@ which were left out of Emacs Lisp. | |||
| 3311 | These functions return @code{t} if the specified condition is | 2923 | These functions return @code{t} if the specified condition is |
| 3312 | true of the numerical argument, or @code{nil} otherwise. | 2924 | true of the numerical argument, or @code{nil} otherwise. |
| 3313 | 2925 | ||
| 3314 | @defun plusp number | 2926 | @defun cl-plusp number |
| 3315 | This predicate tests whether @var{number} is positive. It is an | 2927 | This predicate tests whether @var{number} is positive. It is an |
| 3316 | error if the argument is not a number. | 2928 | error if the argument is not a number. |
| 3317 | @end defun | 2929 | @end defun |
| 3318 | 2930 | ||
| 3319 | @defun minusp number | 2931 | @defun cl-minusp number |
| 3320 | This predicate tests whether @var{number} is negative. It is an | 2932 | This predicate tests whether @var{number} is negative. It is an |
| 3321 | error if the argument is not a number. | 2933 | error if the argument is not a number. |
| 3322 | @end defun | 2934 | @end defun |
| 3323 | 2935 | ||
| 3324 | @defun oddp integer | 2936 | @defun cl-oddp integer |
| 3325 | This predicate tests whether @var{integer} is odd. It is an | 2937 | This predicate tests whether @var{integer} is odd. It is an |
| 3326 | error if the argument is not an integer. | 2938 | error if the argument is not an integer. |
| 3327 | @end defun | 2939 | @end defun |
| 3328 | 2940 | ||
| 3329 | @defun evenp integer | 2941 | @defun cl-evenp integer |
| 3330 | This predicate tests whether @var{integer} is even. It is an | 2942 | This predicate tests whether @var{integer} is even. It is an |
| 3331 | error if the argument is not an integer. | 2943 | error if the argument is not an integer. |
| 3332 | @end defun | 2944 | @end defun |
| 3333 | 2945 | ||
| 3334 | @defun floatp-safe object | 2946 | @defun cl-floatp-safe object |
| 3335 | This predicate tests whether @var{object} is a floating-point | 2947 | This predicate tests whether @var{object} is a floating-point |
| 3336 | number. On systems that support floating-point, this is equivalent | 2948 | number. On systems that support floating-point, this is equivalent |
| 3337 | to @code{floatp}. On other systems, this always returns @code{nil}. | 2949 | to @code{floatp}. On other systems, this always returns @code{nil}. |
| 3338 | @end defun | 2950 | @end defun |
| 3339 | 2951 | ||
| 3340 | @iftex | ||
| 3341 | @secno=3 | ||
| 3342 | @end iftex | ||
| 3343 | |||
| 3344 | @node Numerical Functions | 2952 | @node Numerical Functions |
| 3345 | @section Numerical Functions | 2953 | @section Numerical Functions |
| 3346 | 2954 | ||
| 3347 | @noindent | 2955 | @noindent |
| 3348 | These functions perform various arithmetic operations on numbers. | 2956 | These functions perform various arithmetic operations on numbers. |
| 3349 | 2957 | ||
| 3350 | @defun gcd &rest integers | 2958 | @defun cl-gcd &rest integers |
| 3351 | This function returns the Greatest Common Divisor of the arguments. | 2959 | This function returns the Greatest Common Divisor of the arguments. |
| 3352 | For one argument, it returns the absolute value of that argument. | 2960 | For one argument, it returns the absolute value of that argument. |
| 3353 | For zero arguments, it returns zero. | 2961 | For zero arguments, it returns zero. |
| 3354 | @end defun | 2962 | @end defun |
| 3355 | 2963 | ||
| 3356 | @defun lcm &rest integers | 2964 | @defun cl-lcm &rest integers |
| 3357 | This function returns the Least Common Multiple of the arguments. | 2965 | This function returns the Least Common Multiple of the arguments. |
| 3358 | For one argument, it returns the absolute value of that argument. | 2966 | For one argument, it returns the absolute value of that argument. |
| 3359 | For zero arguments, it returns one. | 2967 | For zero arguments, it returns one. |
| 3360 | @end defun | 2968 | @end defun |
| 3361 | 2969 | ||
| 3362 | @defun isqrt integer | 2970 | @defun cl-isqrt integer |
| 3363 | This function computes the ``integer square root'' of its integer | 2971 | This function computes the ``integer square root'' of its integer |
| 3364 | argument, i.e., the greatest integer less than or equal to the true | 2972 | argument, i.e., the greatest integer less than or equal to the true |
| 3365 | square root of the argument. | 2973 | square root of the argument. |
| 3366 | @end defun | 2974 | @end defun |
| 3367 | 2975 | ||
| 3368 | @defun floor* number &optional divisor | 2976 | @defun cl-floor number &optional divisor |
| 3369 | This function implements the Common Lisp @code{floor} function. | 2977 | With one argument, @code{cl-floor} returns a list of two numbers: |
| 3370 | It is called @code{floor*} to avoid name conflicts with the | ||
| 3371 | simpler @code{floor} function built-in to Emacs. | ||
| 3372 | |||
| 3373 | With one argument, @code{floor*} returns a list of two numbers: | ||
| 3374 | The argument rounded down (toward minus infinity) to an integer, | 2978 | The argument rounded down (toward minus infinity) to an integer, |
| 3375 | and the ``remainder'' which would have to be added back to the | 2979 | and the ``remainder'' which would have to be added back to the |
| 3376 | first return value to yield the argument again. If the argument | 2980 | first return value to yield the argument again. If the argument |
| @@ -3379,37 +2983,37 @@ If the argument is a floating-point number, the first | |||
| 3379 | result is a Lisp integer and the second is a Lisp float between | 2983 | result is a Lisp integer and the second is a Lisp float between |
| 3380 | 0 (inclusive) and 1 (exclusive). | 2984 | 0 (inclusive) and 1 (exclusive). |
| 3381 | 2985 | ||
| 3382 | With two arguments, @code{floor*} divides @var{number} by | 2986 | With two arguments, @code{cl-floor} divides @var{number} by |
| 3383 | @var{divisor}, and returns the floor of the quotient and the | 2987 | @var{divisor}, and returns the floor of the quotient and the |
| 3384 | corresponding remainder as a list of two numbers. If | 2988 | corresponding remainder as a list of two numbers. If |
| 3385 | @code{(floor* @var{x} @var{y})} returns @code{(@var{q} @var{r})}, | 2989 | @code{(cl-floor @var{x} @var{y})} returns @code{(@var{q} @var{r})}, |
| 3386 | then @code{@var{q}*@var{y} + @var{r} = @var{x}}, with @var{r} | 2990 | then @code{@var{q}*@var{y} + @var{r} = @var{x}}, with @var{r} |
| 3387 | between 0 (inclusive) and @var{r} (exclusive). Also, note | 2991 | between 0 (inclusive) and @var{r} (exclusive). Also, note |
| 3388 | that @code{(floor* @var{x})} is exactly equivalent to | 2992 | that @code{(cl-floor @var{x})} is exactly equivalent to |
| 3389 | @code{(floor* @var{x} 1)}. | 2993 | @code{(cl-floor @var{x} 1)}. |
| 3390 | 2994 | ||
| 3391 | This function is entirely compatible with Common Lisp's @code{floor} | 2995 | This function is entirely compatible with Common Lisp's @code{floor} |
| 3392 | function, except that it returns the two results in a list since | 2996 | function, except that it returns the two results in a list since |
| 3393 | Emacs Lisp does not support multiple-valued functions. | 2997 | Emacs Lisp does not support multiple-valued functions. |
| 3394 | @end defun | 2998 | @end defun |
| 3395 | 2999 | ||
| 3396 | @defun ceiling* number &optional divisor | 3000 | @defun cl-ceiling number &optional divisor |
| 3397 | This function implements the Common Lisp @code{ceiling} function, | 3001 | This function implements the Common Lisp @code{ceiling} function, |
| 3398 | which is analogous to @code{floor} except that it rounds the | 3002 | which is analogous to @code{floor} except that it rounds the |
| 3399 | argument or quotient of the arguments up toward plus infinity. | 3003 | argument or quotient of the arguments up toward plus infinity. |
| 3400 | The remainder will be between 0 and minus @var{r}. | 3004 | The remainder will be between 0 and minus @var{r}. |
| 3401 | @end defun | 3005 | @end defun |
| 3402 | 3006 | ||
| 3403 | @defun truncate* number &optional divisor | 3007 | @defun cl-truncate number &optional divisor |
| 3404 | This function implements the Common Lisp @code{truncate} function, | 3008 | This function implements the Common Lisp @code{truncate} function, |
| 3405 | which is analogous to @code{floor} except that it rounds the | 3009 | which is analogous to @code{floor} except that it rounds the |
| 3406 | argument or quotient of the arguments toward zero. Thus it is | 3010 | argument or quotient of the arguments toward zero. Thus it is |
| 3407 | equivalent to @code{floor*} if the argument or quotient is | 3011 | equivalent to @code{cl-floor} if the argument or quotient is |
| 3408 | positive, or to @code{ceiling*} otherwise. The remainder has | 3012 | positive, or to @code{cl-ceiling} otherwise. The remainder has |
| 3409 | the same sign as @var{number}. | 3013 | the same sign as @var{number}. |
| 3410 | @end defun | 3014 | @end defun |
| 3411 | 3015 | ||
| 3412 | @defun round* number &optional divisor | 3016 | @defun cl-round number &optional divisor |
| 3413 | This function implements the Common Lisp @code{round} function, | 3017 | This function implements the Common Lisp @code{round} function, |
| 3414 | which is analogous to @code{floor} except that it rounds the | 3018 | which is analogous to @code{floor} except that it rounds the |
| 3415 | argument or quotient of the arguments to the nearest integer. | 3019 | argument or quotient of the arguments to the nearest integer. |
| @@ -3417,26 +3021,16 @@ In the case of a tie (the argument or quotient is exactly | |||
| 3417 | halfway between two integers), it rounds to the even integer. | 3021 | halfway between two integers), it rounds to the even integer. |
| 3418 | @end defun | 3022 | @end defun |
| 3419 | 3023 | ||
| 3420 | @defun mod* number divisor | 3024 | @defun cl-mod number divisor |
| 3421 | This function returns the same value as the second return value | 3025 | This function returns the same value as the second return value |
| 3422 | of @code{floor}. | 3026 | of @code{cl-floor}. |
| 3423 | @end defun | 3027 | @end defun |
| 3424 | 3028 | ||
| 3425 | @defun rem* number divisor | 3029 | @defun cl-rem number divisor |
| 3426 | This function returns the same value as the second return value | 3030 | This function returns the same value as the second return value |
| 3427 | of @code{truncate}. | 3031 | of @code{cl-truncate}. |
| 3428 | @end defun | 3032 | @end defun |
| 3429 | 3033 | ||
| 3430 | These definitions are compatible with those in the Quiroz | ||
| 3431 | @file{cl.el} package, except that this package appends @samp{*} | ||
| 3432 | to certain function names to avoid conflicts with existing | ||
| 3433 | Emacs functions, and that the mechanism for returning | ||
| 3434 | multiple values is different. | ||
| 3435 | |||
| 3436 | @iftex | ||
| 3437 | @secno=8 | ||
| 3438 | @end iftex | ||
| 3439 | |||
| 3440 | @node Random Numbers | 3034 | @node Random Numbers |
| 3441 | @section Random Numbers | 3035 | @section Random Numbers |
| 3442 | 3036 | ||
| @@ -3447,32 +3041,32 @@ algorithm, which is much more likely to give statistically clean | |||
| 3447 | random numbers than the simple generators supplied by many | 3041 | random numbers than the simple generators supplied by many |
| 3448 | operating systems. | 3042 | operating systems. |
| 3449 | 3043 | ||
| 3450 | @defun random* number &optional state | 3044 | @defun cl-random number &optional state |
| 3451 | This function returns a random nonnegative number less than | 3045 | This function returns a random nonnegative number less than |
| 3452 | @var{number}, and of the same type (either integer or floating-point). | 3046 | @var{number}, and of the same type (either integer or floating-point). |
| 3453 | The @var{state} argument should be a @code{random-state} object | 3047 | The @var{state} argument should be a @code{random-state} object |
| 3454 | which holds the state of the random number generator. The | 3048 | which holds the state of the random number generator. The |
| 3455 | function modifies this state object as a side effect. If | 3049 | function modifies this state object as a side effect. If |
| 3456 | @var{state} is omitted, it defaults to the variable | 3050 | @var{state} is omitted, it defaults to the variable |
| 3457 | @code{*random-state*}, which contains a pre-initialized | 3051 | @code{cl--random-state}, which contains a pre-initialized |
| 3458 | @code{random-state} object. | 3052 | @code{random-state} object. |
| 3459 | @end defun | 3053 | @end defun |
| 3460 | 3054 | ||
| 3461 | @defvar *random-state* | 3055 | @defvar cl--random-state |
| 3462 | This variable contains the system ``default'' @code{random-state} | 3056 | This variable contains the system ``default'' @code{random-state} |
| 3463 | object, used for calls to @code{random*} that do not specify an | 3057 | object, used for calls to @code{cl-random} that do not specify an |
| 3464 | alternative state object. Since any number of programs in the | 3058 | alternative state object. Since any number of programs in the |
| 3465 | Emacs process may be accessing @code{*random-state*} in interleaved | 3059 | Emacs process may be accessing @code{cl--random-state} in interleaved |
| 3466 | fashion, the sequence generated from this variable will be | 3060 | fashion, the sequence generated from this variable will be |
| 3467 | irreproducible for all intents and purposes. | 3061 | irreproducible for all intents and purposes. |
| 3468 | @end defvar | 3062 | @end defvar |
| 3469 | 3063 | ||
| 3470 | @defun make-random-state &optional state | 3064 | @defun cl-make-random-state &optional state |
| 3471 | This function creates or copies a @code{random-state} object. | 3065 | This function creates or copies a @code{random-state} object. |
| 3472 | If @var{state} is omitted or @code{nil}, it returns a new copy of | 3066 | If @var{state} is omitted or @code{nil}, it returns a new copy of |
| 3473 | @code{*random-state*}. This is a copy in the sense that future | 3067 | @code{cl--random-state}. This is a copy in the sense that future |
| 3474 | sequences of calls to @code{(random* @var{n})} and | 3068 | sequences of calls to @code{(cl-random @var{n})} and |
| 3475 | @code{(random* @var{n} @var{s})} (where @var{s} is the new | 3069 | @code{(cl-random @var{n} @var{s})} (where @var{s} is the new |
| 3476 | random-state object) will return identical sequences of random | 3070 | random-state object) will return identical sequences of random |
| 3477 | numbers. | 3071 | numbers. |
| 3478 | 3072 | ||
| @@ -3487,13 +3081,13 @@ different sequence of random numbers. | |||
| 3487 | It is valid to print a @code{random-state} object to a buffer or | 3081 | It is valid to print a @code{random-state} object to a buffer or |
| 3488 | file and later read it back with @code{read}. If a program wishes | 3082 | file and later read it back with @code{read}. If a program wishes |
| 3489 | to use a sequence of pseudo-random numbers which can be reproduced | 3083 | to use a sequence of pseudo-random numbers which can be reproduced |
| 3490 | later for debugging, it can call @code{(make-random-state t)} to | 3084 | later for debugging, it can call @code{(cl-make-random-state t)} to |
| 3491 | get a new sequence, then print this sequence to a file. When the | 3085 | get a new sequence, then print this sequence to a file. When the |
| 3492 | program is later rerun, it can read the original run's random-state | 3086 | program is later rerun, it can read the original run's random-state |
| 3493 | from the file. | 3087 | from the file. |
| 3494 | @end defun | 3088 | @end defun |
| 3495 | 3089 | ||
| 3496 | @defun random-state-p object | 3090 | @defun cl-random-state-p object |
| 3497 | This predicate returns @code{t} if @var{object} is a | 3091 | This predicate returns @code{t} if @var{object} is a |
| 3498 | @code{random-state} object, or @code{nil} otherwise. | 3092 | @code{random-state} object, or @code{nil} otherwise. |
| 3499 | @end defun | 3093 | @end defun |
| @@ -3512,7 +3106,7 @@ function that must be called before the parameters can be used. | |||
| 3512 | 3106 | ||
| 3513 | @defun cl-float-limits | 3107 | @defun cl-float-limits |
| 3514 | This function makes sure that the Common Lisp floating-point parameters | 3108 | This function makes sure that the Common Lisp floating-point parameters |
| 3515 | like @code{most-positive-float} have been initialized. Until it is | 3109 | like @code{cl-most-positive-float} have been initialized. Until it is |
| 3516 | called, these parameters will be @code{nil}. If this version of Emacs | 3110 | called, these parameters will be @code{nil}. If this version of Emacs |
| 3517 | does not support floats, the parameters will remain @code{nil}. If the | 3111 | does not support floats, the parameters will remain @code{nil}. If the |
| 3518 | parameters have already been initialized, the function returns | 3112 | parameters have already been initialized, the function returns |
| @@ -3530,50 +3124,50 @@ precisions, it has families of constants like | |||
| 3530 | floating-point precision, so this package omits the precision word | 3124 | floating-point precision, so this package omits the precision word |
| 3531 | from the constants' names. | 3125 | from the constants' names. |
| 3532 | 3126 | ||
| 3533 | @defvar most-positive-float | 3127 | @defvar cl-most-positive-float |
| 3534 | This constant equals the largest value a Lisp float can hold. | 3128 | This constant equals the largest value a Lisp float can hold. |
| 3535 | For those systems whose arithmetic supports infinities, this is | 3129 | For those systems whose arithmetic supports infinities, this is |
| 3536 | the largest @emph{finite} value. For IEEE machines, the value | 3130 | the largest @emph{finite} value. For IEEE machines, the value |
| 3537 | is approximately @code{1.79e+308}. | 3131 | is approximately @code{1.79e+308}. |
| 3538 | @end defvar | 3132 | @end defvar |
| 3539 | 3133 | ||
| 3540 | @defvar most-negative-float | 3134 | @defvar cl-most-negative-float |
| 3541 | This constant equals the most-negative value a Lisp float can hold. | 3135 | This constant equals the most-negative value a Lisp float can hold. |
| 3542 | (It is assumed to be equal to @code{(- most-positive-float)}.) | 3136 | (It is assumed to be equal to @code{(- cl-most-positive-float)}.) |
| 3543 | @end defvar | 3137 | @end defvar |
| 3544 | 3138 | ||
| 3545 | @defvar least-positive-float | 3139 | @defvar cl-least-positive-float |
| 3546 | This constant equals the smallest Lisp float value greater than zero. | 3140 | This constant equals the smallest Lisp float value greater than zero. |
| 3547 | For IEEE machines, it is about @code{4.94e-324} if denormals are | 3141 | For IEEE machines, it is about @code{4.94e-324} if denormals are |
| 3548 | supported or @code{2.22e-308} if not. | 3142 | supported or @code{2.22e-308} if not. |
| 3549 | @end defvar | 3143 | @end defvar |
| 3550 | 3144 | ||
| 3551 | @defvar least-positive-normalized-float | 3145 | @defvar cl-least-positive-normalized-float |
| 3552 | This constant equals the smallest @emph{normalized} Lisp float greater | 3146 | This constant equals the smallest @emph{normalized} Lisp float greater |
| 3553 | than zero, i.e., the smallest value for which IEEE denormalization | 3147 | than zero, i.e., the smallest value for which IEEE denormalization |
| 3554 | will not result in a loss of precision. For IEEE machines, this | 3148 | will not result in a loss of precision. For IEEE machines, this |
| 3555 | value is about @code{2.22e-308}. For machines that do not support | 3149 | value is about @code{2.22e-308}. For machines that do not support |
| 3556 | the concept of denormalization and gradual underflow, this constant | 3150 | the concept of denormalization and gradual underflow, this constant |
| 3557 | will always equal @code{least-positive-float}. | 3151 | will always equal @code{cl-least-positive-float}. |
| 3558 | @end defvar | 3152 | @end defvar |
| 3559 | 3153 | ||
| 3560 | @defvar least-negative-float | 3154 | @defvar cl-least-negative-float |
| 3561 | This constant is the negative counterpart of @code{least-positive-float}. | 3155 | This constant is the negative counterpart of @code{cl-least-positive-float}. |
| 3562 | @end defvar | 3156 | @end defvar |
| 3563 | 3157 | ||
| 3564 | @defvar least-negative-normalized-float | 3158 | @defvar cl-least-negative-normalized-float |
| 3565 | This constant is the negative counterpart of | 3159 | This constant is the negative counterpart of |
| 3566 | @code{least-positive-normalized-float}. | 3160 | @code{cl-least-positive-normalized-float}. |
| 3567 | @end defvar | 3161 | @end defvar |
| 3568 | 3162 | ||
| 3569 | @defvar float-epsilon | 3163 | @defvar cl-float-epsilon |
| 3570 | This constant is the smallest positive Lisp float that can be added | 3164 | This constant is the smallest positive Lisp float that can be added |
| 3571 | to 1.0 to produce a distinct value. Adding a smaller number to 1.0 | 3165 | to 1.0 to produce a distinct value. Adding a smaller number to 1.0 |
| 3572 | will yield 1.0 again due to roundoff. For IEEE machines, epsilon | 3166 | will yield 1.0 again due to roundoff. For IEEE machines, epsilon |
| 3573 | is about @code{2.22e-16}. | 3167 | is about @code{2.22e-16}. |
| 3574 | @end defvar | 3168 | @end defvar |
| 3575 | 3169 | ||
| 3576 | @defvar float-negative-epsilon | 3170 | @defvar cl-float-negative-epsilon |
| 3577 | This is the smallest positive value that can be subtracted from | 3171 | This is the smallest positive value that can be subtracted from |
| 3578 | 1.0 to produce a distinct value. For IEEE machines, it is about | 3172 | 1.0 to produce a distinct value. For IEEE machines, it is about |
| 3579 | @code{1.11e-16}. | 3173 | @code{1.11e-16}. |
| @@ -3590,10 +3184,10 @@ Emacs Lisp includes a few of these, notably @code{elt} and | |||
| 3590 | 3184 | ||
| 3591 | @menu | 3185 | @menu |
| 3592 | * Sequence Basics:: Arguments shared by all sequence functions. | 3186 | * Sequence Basics:: Arguments shared by all sequence functions. |
| 3593 | * Mapping over Sequences:: @code{mapcar*}, @code{mapcan}, @code{map}, @code{every}, etc. | 3187 | * Mapping over Sequences:: @code{cl-mapcar}, @code{cl-mapcan}, @code{cl-map}, @code{cl-every}, etc. |
| 3594 | * Sequence Functions:: @code{subseq}, @code{remove*}, @code{substitute}, etc. | 3188 | * Sequence Functions:: @code{cl-subseq}, @code{cl-remove}, @code{cl-substitute}, etc. |
| 3595 | * Searching Sequences:: @code{find}, @code{position}, @code{count}, @code{search}, etc. | 3189 | * Searching Sequences:: @code{cl-find}, @code{cl-position}, @code{cl-count}, @code{cl-search}, etc. |
| 3596 | * Sorting Sequences:: @code{sort*}, @code{stable-sort}, @code{merge}. | 3190 | * Sorting Sequences:: @code{cl-sort}, @code{cl-stable-sort}, @code{cl-merge}. |
| 3597 | @end menu | 3191 | @end menu |
| 3598 | 3192 | ||
| 3599 | @node Sequence Basics | 3193 | @node Sequence Basics |
| @@ -3607,7 +3201,7 @@ may appear in any order. | |||
| 3607 | The @code{:key} argument should be passed either @code{nil}, or a | 3201 | The @code{:key} argument should be passed either @code{nil}, or a |
| 3608 | function of one argument. This key function is used as a filter | 3202 | function of one argument. This key function is used as a filter |
| 3609 | through which the elements of the sequence are seen; for example, | 3203 | through which the elements of the sequence are seen; for example, |
| 3610 | @code{(find x y :key 'car)} is similar to @code{(assoc* x y)}: | 3204 | @code{(cl-find x y :key 'car)} is similar to @code{(cl-assoc x y)}: |
| 3611 | It searches for an element of the list whose @code{car} equals | 3205 | It searches for an element of the list whose @code{car} equals |
| 3612 | @code{x}, rather than for an element which equals @code{x} itself. | 3206 | @code{x}, rather than for an element which equals @code{x} itself. |
| 3613 | If @code{:key} is omitted or @code{nil}, the filter is effectively | 3207 | If @code{:key} is omitted or @code{nil}, the filter is effectively |
| @@ -3632,7 +3226,7 @@ and sequence elements match if the predicate returns true on them | |||
| 3632 | (or false in the case of @code{-if-not}). For example: | 3226 | (or false in the case of @code{-if-not}). For example: |
| 3633 | 3227 | ||
| 3634 | @example | 3228 | @example |
| 3635 | (remove* 0 seq :test '=) @equiv{} (remove-if 'zerop seq) | 3229 | (cl-remove 0 seq :test '=) @equiv{} (cl-remove-if 'zerop seq) |
| 3636 | @end example | 3230 | @end example |
| 3637 | 3231 | ||
| 3638 | @noindent | 3232 | @noindent |
| @@ -3662,14 +3256,14 @@ are called on various elements. Therefore, it is a bad idea to depend | |||
| 3662 | on side effects of these functions. For example, @code{:from-end} | 3256 | on side effects of these functions. For example, @code{:from-end} |
| 3663 | may cause the sequence to be scanned actually in reverse, or it may | 3257 | may cause the sequence to be scanned actually in reverse, or it may |
| 3664 | be scanned forwards but computing a result ``as if'' it were scanned | 3258 | be scanned forwards but computing a result ``as if'' it were scanned |
| 3665 | backwards. (Some functions, like @code{mapcar*} and @code{every}, | 3259 | backwards. (Some functions, like @code{cl-mapcar} and @code{cl-every}, |
| 3666 | @emph{do} specify exactly the order in which the function is called | 3260 | @emph{do} specify exactly the order in which the function is called |
| 3667 | so side effects are perfectly acceptable in those cases.) | 3261 | so side effects are perfectly acceptable in those cases.) |
| 3668 | 3262 | ||
| 3669 | Strings may contain ``text properties'' as well | 3263 | Strings may contain ``text properties'' as well |
| 3670 | as character data. Except as noted, it is undefined whether or | 3264 | as character data. Except as noted, it is undefined whether or |
| 3671 | not text properties are preserved by sequence functions. For | 3265 | not text properties are preserved by sequence functions. For |
| 3672 | example, @code{(remove* ?A @var{str})} may or may not preserve | 3266 | example, @code{(cl-remove ?A @var{str})} may or may not preserve |
| 3673 | the properties of the characters copied from @var{str} into the | 3267 | the properties of the characters copied from @var{str} into the |
| 3674 | result. | 3268 | result. |
| 3675 | 3269 | ||
| @@ -3681,7 +3275,7 @@ These functions ``map'' the function you specify over the elements | |||
| 3681 | of lists or arrays. They are all variations on the theme of the | 3275 | of lists or arrays. They are all variations on the theme of the |
| 3682 | built-in function @code{mapcar}. | 3276 | built-in function @code{mapcar}. |
| 3683 | 3277 | ||
| 3684 | @defun mapcar* function seq &rest more-seqs | 3278 | @defun cl-mapcar function seq &rest more-seqs |
| 3685 | This function calls @var{function} on successive parallel sets of | 3279 | This function calls @var{function} on successive parallel sets of |
| 3686 | elements from its argument sequences. Given a single @var{seq} | 3280 | elements from its argument sequences. Given a single @var{seq} |
| 3687 | argument it is equivalent to @code{mapcar}; given @var{n} sequences, | 3281 | argument it is equivalent to @code{mapcar}; given @var{n} sequences, |
| @@ -3694,86 +3288,89 @@ is always a list. | |||
| 3694 | 3288 | ||
| 3695 | Common Lisp's @code{mapcar} accepts multiple arguments but works | 3289 | Common Lisp's @code{mapcar} accepts multiple arguments but works |
| 3696 | only on lists; Emacs Lisp's @code{mapcar} accepts a single sequence | 3290 | only on lists; Emacs Lisp's @code{mapcar} accepts a single sequence |
| 3697 | argument. This package's @code{mapcar*} works as a compatible | 3291 | argument. This package's @code{cl-mapcar} works as a compatible |
| 3698 | superset of both. | 3292 | superset of both. |
| 3699 | @end defun | 3293 | @end defun |
| 3700 | 3294 | ||
| 3701 | @defun map result-type function seq &rest more-seqs | 3295 | @defun cl-map result-type function seq &rest more-seqs |
| 3702 | This function maps @var{function} over the argument sequences, | 3296 | This function maps @var{function} over the argument sequences, |
| 3703 | just like @code{mapcar*}, but it returns a sequence of type | 3297 | just like @code{cl-mapcar}, but it returns a sequence of type |
| 3704 | @var{result-type} rather than a list. @var{result-type} must | 3298 | @var{result-type} rather than a list. @var{result-type} must |
| 3705 | be one of the following symbols: @code{vector}, @code{string}, | 3299 | be one of the following symbols: @code{vector}, @code{string}, |
| 3706 | @code{list} (in which case the effect is the same as for | 3300 | @code{list} (in which case the effect is the same as for |
| 3707 | @code{mapcar*}), or @code{nil} (in which case the results are | 3301 | @code{cl-mapcar}), or @code{nil} (in which case the results are |
| 3708 | thrown away and @code{map} returns @code{nil}). | 3302 | thrown away and @code{cl-map} returns @code{nil}). |
| 3709 | @end defun | 3303 | @end defun |
| 3710 | 3304 | ||
| 3711 | @defun maplist function list &rest more-lists | 3305 | @defun cl-maplist function list &rest more-lists |
| 3712 | This function calls @var{function} on each of its argument lists, | 3306 | This function calls @var{function} on each of its argument lists, |
| 3713 | then on the @code{cdr}s of those lists, and so on, until the | 3307 | then on the @code{cdr}s of those lists, and so on, until the |
| 3714 | shortest list runs out. The results are returned in the form | 3308 | shortest list runs out. The results are returned in the form |
| 3715 | of a list. Thus, @code{maplist} is like @code{mapcar*} except | 3309 | of a list. Thus, @code{cl-maplist} is like @code{cl-mapcar} except |
| 3716 | that it passes in the list pointers themselves rather than the | 3310 | that it passes in the list pointers themselves rather than the |
| 3717 | @code{car}s of the advancing pointers. | 3311 | @code{car}s of the advancing pointers. |
| 3718 | @end defun | 3312 | @end defun |
| 3719 | 3313 | ||
| 3720 | @defun cl-mapc function seq &rest more-seqs | 3314 | @defun cl-mapc function seq &rest more-seqs |
| 3721 | This function is like @code{mapcar*}, except that the values returned | 3315 | This function is like @code{cl-mapcar}, except that the values returned |
| 3722 | by @var{function} are ignored and thrown away rather than being | 3316 | by @var{function} are ignored and thrown away rather than being |
| 3723 | collected into a list. The return value of @code{cl-mapc} is @var{seq}, | 3317 | collected into a list. The return value of @code{cl-mapc} is @var{seq}, |
| 3724 | the first sequence. This function is more general than the Emacs | 3318 | the first sequence. This function is more general than the Emacs |
| 3725 | primitive @code{mapc}. | 3319 | primitive @code{mapc}. (Note that this function is called |
| 3320 | @code{cl-mapc} even in @file{cl.el}, rather than @code{map*} as you | ||
| 3321 | might expect.) | ||
| 3322 | @c http://debbugs.gnu.org/6575 | ||
| 3726 | @end defun | 3323 | @end defun |
| 3727 | 3324 | ||
| 3728 | @defun mapl function list &rest more-lists | 3325 | @defun cl-mapl function list &rest more-lists |
| 3729 | This function is like @code{maplist}, except that it throws away | 3326 | This function is like @code{cl-maplist}, except that it throws away |
| 3730 | the values returned by @var{function}. | 3327 | the values returned by @var{function}. |
| 3731 | @end defun | 3328 | @end defun |
| 3732 | 3329 | ||
| 3733 | @defun mapcan function seq &rest more-seqs | 3330 | @defun cl-mapcan function seq &rest more-seqs |
| 3734 | This function is like @code{mapcar*}, except that it concatenates | 3331 | This function is like @code{cl-mapcar}, except that it concatenates |
| 3735 | the return values (which must be lists) using @code{nconc}, | 3332 | the return values (which must be lists) using @code{nconc}, |
| 3736 | rather than simply collecting them into a list. | 3333 | rather than simply collecting them into a list. |
| 3737 | @end defun | 3334 | @end defun |
| 3738 | 3335 | ||
| 3739 | @defun mapcon function list &rest more-lists | 3336 | @defun cl-mapcon function list &rest more-lists |
| 3740 | This function is like @code{maplist}, except that it concatenates | 3337 | This function is like @code{cl-maplist}, except that it concatenates |
| 3741 | the return values using @code{nconc}. | 3338 | the return values using @code{nconc}. |
| 3742 | @end defun | 3339 | @end defun |
| 3743 | 3340 | ||
| 3744 | @defun some predicate seq &rest more-seqs | 3341 | @defun cl-some predicate seq &rest more-seqs |
| 3745 | This function calls @var{predicate} on each element of @var{seq} | 3342 | This function calls @var{predicate} on each element of @var{seq} |
| 3746 | in turn; if @var{predicate} returns a non-@code{nil} value, | 3343 | in turn; if @var{predicate} returns a non-@code{nil} value, |
| 3747 | @code{some} returns that value, otherwise it returns @code{nil}. | 3344 | @code{some} returns that value, otherwise it returns @code{nil}. |
| 3748 | Given several sequence arguments, it steps through the sequences | 3345 | Given several sequence arguments, it steps through the sequences |
| 3749 | in parallel until the shortest one runs out, just as in | 3346 | in parallel until the shortest one runs out, just as in |
| 3750 | @code{mapcar*}. You can rely on the left-to-right order in which | 3347 | @code{cl-mapcar}. You can rely on the left-to-right order in which |
| 3751 | the elements are visited, and on the fact that mapping stops | 3348 | the elements are visited, and on the fact that mapping stops |
| 3752 | immediately as soon as @var{predicate} returns non-@code{nil}. | 3349 | immediately as soon as @var{predicate} returns non-@code{nil}. |
| 3753 | @end defun | 3350 | @end defun |
| 3754 | 3351 | ||
| 3755 | @defun every predicate seq &rest more-seqs | 3352 | @defun cl-every predicate seq &rest more-seqs |
| 3756 | This function calls @var{predicate} on each element of the sequence(s) | 3353 | This function calls @var{predicate} on each element of the sequence(s) |
| 3757 | in turn; it returns @code{nil} as soon as @var{predicate} returns | 3354 | in turn; it returns @code{nil} as soon as @var{predicate} returns |
| 3758 | @code{nil} for any element, or @code{t} if the predicate was true | 3355 | @code{nil} for any element, or @code{t} if the predicate was true |
| 3759 | for all elements. | 3356 | for all elements. |
| 3760 | @end defun | 3357 | @end defun |
| 3761 | 3358 | ||
| 3762 | @defun notany predicate seq &rest more-seqs | 3359 | @defun cl-notany predicate seq &rest more-seqs |
| 3763 | This function calls @var{predicate} on each element of the sequence(s) | 3360 | This function calls @var{predicate} on each element of the sequence(s) |
| 3764 | in turn; it returns @code{nil} as soon as @var{predicate} returns | 3361 | in turn; it returns @code{nil} as soon as @var{predicate} returns |
| 3765 | a non-@code{nil} value for any element, or @code{t} if the predicate | 3362 | a non-@code{nil} value for any element, or @code{t} if the predicate |
| 3766 | was @code{nil} for all elements. | 3363 | was @code{nil} for all elements. |
| 3767 | @end defun | 3364 | @end defun |
| 3768 | 3365 | ||
| 3769 | @defun notevery predicate seq &rest more-seqs | 3366 | @defun cl-notevery predicate seq &rest more-seqs |
| 3770 | This function calls @var{predicate} on each element of the sequence(s) | 3367 | This function calls @var{predicate} on each element of the sequence(s) |
| 3771 | in turn; it returns a non-@code{nil} value as soon as @var{predicate} | 3368 | in turn; it returns a non-@code{nil} value as soon as @var{predicate} |
| 3772 | returns @code{nil} for any element, or @code{t} if the predicate was | 3369 | returns @code{nil} for any element, or @code{t} if the predicate was |
| 3773 | true for all elements. | 3370 | true for all elements. |
| 3774 | @end defun | 3371 | @end defun |
| 3775 | 3372 | ||
| 3776 | @defun reduce function seq @t{&key :from-end :start :end :initial-value :key} | 3373 | @defun cl-reduce function seq @t{&key :from-end :start :end :initial-value :key} |
| 3777 | This function combines the elements of @var{seq} using an associative | 3374 | This function combines the elements of @var{seq} using an associative |
| 3778 | binary operation. Suppose @var{function} is @code{*} and @var{seq} is | 3375 | binary operation. Suppose @var{function} is @code{*} and @var{seq} is |
| 3779 | the list @code{(2 3 4 5)}. The first two elements of the list are | 3376 | the list @code{(2 3 4 5)}. The first two elements of the list are |
| @@ -3781,16 +3378,16 @@ combined with @code{(* 2 3) = 6}; this is combined with the next | |||
| 3781 | element, @code{(* 6 4) = 24}, and that is combined with the final | 3378 | element, @code{(* 6 4) = 24}, and that is combined with the final |
| 3782 | element: @code{(* 24 5) = 120}. Note that the @code{*} function happens | 3379 | element: @code{(* 24 5) = 120}. Note that the @code{*} function happens |
| 3783 | to be self-reducing, so that @code{(* 2 3 4 5)} has the same effect as | 3380 | to be self-reducing, so that @code{(* 2 3 4 5)} has the same effect as |
| 3784 | an explicit call to @code{reduce}. | 3381 | an explicit call to @code{cl-reduce}. |
| 3785 | 3382 | ||
| 3786 | If @code{:from-end} is true, the reduction is right-associative instead | 3383 | If @code{:from-end} is true, the reduction is right-associative instead |
| 3787 | of left-associative: | 3384 | of left-associative: |
| 3788 | 3385 | ||
| 3789 | @example | 3386 | @example |
| 3790 | (reduce '- '(1 2 3 4)) | 3387 | (cl-reduce '- '(1 2 3 4)) |
| 3791 | @equiv{} (- (- (- 1 2) 3) 4) @result{} -8 | 3388 | @equiv{} (- (- (- 1 2) 3) 4) @result{} -8 |
| 3792 | (reduce '- '(1 2 3 4) :from-end t) | 3389 | (cl-reduce '- '(1 2 3 4) :from-end t) |
| 3793 | @equiv{} (- 1 (- 2 (- 3 4))) @result{} -2 | 3390 | @equiv{} (- 1 (- 2 (- 3 4))) @result{} -2 |
| 3794 | @end example | 3391 | @end example |
| 3795 | 3392 | ||
| 3796 | If @code{:key} is specified, it is a function of one argument which | 3393 | If @code{:key} is specified, it is a function of one argument which |
| @@ -3807,7 +3404,7 @@ If the sequence is empty (and there is no initial value), then | |||
| 3807 | @end defun | 3404 | @end defun |
| 3808 | 3405 | ||
| 3809 | All of these mapping operations can be expressed conveniently in | 3406 | All of these mapping operations can be expressed conveniently in |
| 3810 | terms of the @code{loop} macro. In compiled code, @code{loop} will | 3407 | terms of the @code{cl-loop} macro. In compiled code, @code{cl-loop} will |
| 3811 | be faster since it generates the loop as in-line code with no | 3408 | be faster since it generates the loop as in-line code with no |
| 3812 | function calls. | 3409 | function calls. |
| 3813 | 3410 | ||
| @@ -3818,7 +3415,7 @@ function calls. | |||
| 3818 | This section describes a number of Common Lisp functions for | 3415 | This section describes a number of Common Lisp functions for |
| 3819 | operating on sequences. | 3416 | operating on sequences. |
| 3820 | 3417 | ||
| 3821 | @defun subseq sequence start &optional end | 3418 | @defun cl-subseq sequence start &optional end |
| 3822 | This function returns a given subsequence of the argument | 3419 | This function returns a given subsequence of the argument |
| 3823 | @var{sequence}, which may be a list, string, or vector. | 3420 | @var{sequence}, which may be a list, string, or vector. |
| 3824 | The indices @var{start} and @var{end} must be in range, and | 3421 | The indices @var{start} and @var{end} must be in range, and |
| @@ -3830,30 +3427,30 @@ with @var{sequence}. | |||
| 3830 | As an extension to Common Lisp, @var{start} and/or @var{end} | 3427 | As an extension to Common Lisp, @var{start} and/or @var{end} |
| 3831 | may be negative, in which case they represent a distance back | 3428 | may be negative, in which case they represent a distance back |
| 3832 | from the end of the sequence. This is for compatibility with | 3429 | from the end of the sequence. This is for compatibility with |
| 3833 | Emacs's @code{substring} function. Note that @code{subseq} is | 3430 | Emacs's @code{substring} function. Note that @code{cl-subseq} is |
| 3834 | the @emph{only} sequence function that allows negative | 3431 | the @emph{only} sequence function that allows negative |
| 3835 | @var{start} and @var{end}. | 3432 | @var{start} and @var{end}. |
| 3836 | 3433 | ||
| 3837 | You can use @code{setf} on a @code{subseq} form to replace a | 3434 | You can use @code{setf} on a @code{cl-subseq} form to replace a |
| 3838 | specified range of elements with elements from another sequence. | 3435 | specified range of elements with elements from another sequence. |
| 3839 | The replacement is done as if by @code{replace}, described below. | 3436 | The replacement is done as if by @code{cl-replace}, described below. |
| 3840 | @end defun | 3437 | @end defun |
| 3841 | 3438 | ||
| 3842 | @defun concatenate result-type &rest seqs | 3439 | @defun cl-concatenate result-type &rest seqs |
| 3843 | This function concatenates the argument sequences together to | 3440 | This function concatenates the argument sequences together to |
| 3844 | form a result sequence of type @var{result-type}, one of the | 3441 | form a result sequence of type @var{result-type}, one of the |
| 3845 | symbols @code{vector}, @code{string}, or @code{list}. The | 3442 | symbols @code{vector}, @code{string}, or @code{list}. The |
| 3846 | arguments are always copied, even in cases such as | 3443 | arguments are always copied, even in cases such as |
| 3847 | @code{(concatenate 'list '(1 2 3))} where the result is | 3444 | @code{(cl-concatenate 'list '(1 2 3))} where the result is |
| 3848 | identical to an argument. | 3445 | identical to an argument. |
| 3849 | @end defun | 3446 | @end defun |
| 3850 | 3447 | ||
| 3851 | @defun fill seq item @t{&key :start :end} | 3448 | @defun cl-fill seq item @t{&key :start :end} |
| 3852 | This function fills the elements of the sequence (or the specified | 3449 | This function fills the elements of the sequence (or the specified |
| 3853 | part of the sequence) with the value @var{item}. | 3450 | part of the sequence) with the value @var{item}. |
| 3854 | @end defun | 3451 | @end defun |
| 3855 | 3452 | ||
| 3856 | @defun replace seq1 seq2 @t{&key :start1 :end1 :start2 :end2} | 3453 | @defun cl-replace seq1 seq2 @t{&key :start1 :end1 :start2 :end2} |
| 3857 | This function copies part of @var{seq2} into part of @var{seq1}. | 3454 | This function copies part of @var{seq2} into part of @var{seq1}. |
| 3858 | The sequence @var{seq1} is not stretched or resized; the amount | 3455 | The sequence @var{seq1} is not stretched or resized; the amount |
| 3859 | of data copied is simply the shorter of the source and destination | 3456 | of data copied is simply the shorter of the source and destination |
| @@ -3867,7 +3464,7 @@ start and end arguments specify overlapping regions, the effect | |||
| 3867 | is undefined. | 3464 | is undefined. |
| 3868 | @end defun | 3465 | @end defun |
| 3869 | 3466 | ||
| 3870 | @defun remove* item seq @t{&key :test :test-not :key :count :start :end :from-end} | 3467 | @defun cl-remove item seq @t{&key :test :test-not :key :count :start :end :from-end} |
| 3871 | This returns a copy of @var{seq} with all elements matching | 3468 | This returns a copy of @var{seq} with all elements matching |
| 3872 | @var{item} removed. The result may share storage with or be | 3469 | @var{item} removed. The result may share storage with or be |
| 3873 | @code{eq} to @var{seq} in some circumstances, but the original | 3470 | @code{eq} to @var{seq} in some circumstances, but the original |
| @@ -3884,25 +3481,25 @@ end of the sequence rather than the beginning (this matters only | |||
| 3884 | if @var{count} was also specified). | 3481 | if @var{count} was also specified). |
| 3885 | @end defun | 3482 | @end defun |
| 3886 | 3483 | ||
| 3887 | @defun delete* item seq @t{&key :test :test-not :key :count :start :end :from-end} | 3484 | @defun cl-delete item seq @t{&key :test :test-not :key :count :start :end :from-end} |
| 3888 | This deletes all elements of @var{seq} which match @var{item}. | 3485 | This deletes all elements of @var{seq} which match @var{item}. |
| 3889 | It is a destructive operation. Since Emacs Lisp does not support | 3486 | It is a destructive operation. Since Emacs Lisp does not support |
| 3890 | stretchable strings or vectors, this is the same as @code{remove*} | 3487 | stretchable strings or vectors, this is the same as @code{cl-remove} |
| 3891 | for those sequence types. On lists, @code{remove*} will copy the | 3488 | for those sequence types. On lists, @code{cl-remove} will copy the |
| 3892 | list if necessary to preserve the original list, whereas | 3489 | list if necessary to preserve the original list, whereas |
| 3893 | @code{delete*} will splice out parts of the argument list. | 3490 | @code{cl-delete} will splice out parts of the argument list. |
| 3894 | Compare @code{append} and @code{nconc}, which are analogous | 3491 | Compare @code{append} and @code{nconc}, which are analogous |
| 3895 | non-destructive and destructive list operations in Emacs Lisp. | 3492 | non-destructive and destructive list operations in Emacs Lisp. |
| 3896 | @end defun | 3493 | @end defun |
| 3897 | 3494 | ||
| 3898 | @findex remove-if | 3495 | @findex cl-remove-if |
| 3899 | @findex remove-if-not | 3496 | @findex cl-remove-if-not |
| 3900 | @findex delete-if | 3497 | @findex cl-delete-if |
| 3901 | @findex delete-if-not | 3498 | @findex cl-delete-if-not |
| 3902 | The predicate-oriented functions @code{remove-if}, @code{remove-if-not}, | 3499 | The predicate-oriented functions @code{cl-remove-if}, @code{cl-remove-if-not}, |
| 3903 | @code{delete-if}, and @code{delete-if-not} are defined similarly. | 3500 | @code{cl-delete-if}, and @code{cl-delete-if-not} are defined similarly. |
| 3904 | 3501 | ||
| 3905 | @defun remove-duplicates seq @t{&key :test :test-not :key :start :end :from-end} | 3502 | @defun cl-remove-duplicates seq @t{&key :test :test-not :key :start :end :from-end} |
| 3906 | This function returns a copy of @var{seq} with duplicate elements | 3503 | This function returns a copy of @var{seq} with duplicate elements |
| 3907 | removed. Specifically, if two elements from the sequence match | 3504 | removed. Specifically, if two elements from the sequence match |
| 3908 | according to the @code{:test}, @code{:test-not}, and @code{:key} | 3505 | according to the @code{:test}, @code{:test-not}, and @code{:key} |
| @@ -3912,40 +3509,41 @@ is true, the leftmost one is retained instead. If @code{:start} or | |||
| 3912 | examined or removed. | 3509 | examined or removed. |
| 3913 | @end defun | 3510 | @end defun |
| 3914 | 3511 | ||
| 3915 | @defun delete-duplicates seq @t{&key :test :test-not :key :start :end :from-end} | 3512 | @defun cl-delete-duplicates seq @t{&key :test :test-not :key :start :end :from-end} |
| 3916 | This function deletes duplicate elements from @var{seq}. It is | 3513 | This function deletes duplicate elements from @var{seq}. It is |
| 3917 | a destructive version of @code{remove-duplicates}. | 3514 | a destructive version of @code{cl-remove-duplicates}. |
| 3918 | @end defun | 3515 | @end defun |
| 3919 | 3516 | ||
| 3920 | @defun substitute new old seq @t{&key :test :test-not :key :count :start :end :from-end} | 3517 | @defun cl-substitute new old seq @t{&key :test :test-not :key :count :start :end :from-end} |
| 3921 | This function returns a copy of @var{seq}, with all elements | 3518 | This function returns a copy of @var{seq}, with all elements |
| 3922 | matching @var{old} replaced with @var{new}. The @code{:count}, | 3519 | matching @var{old} replaced with @var{new}. The @code{:count}, |
| 3923 | @code{:start}, @code{:end}, and @code{:from-end} arguments may be | 3520 | @code{:start}, @code{:end}, and @code{:from-end} arguments may be |
| 3924 | used to limit the number of substitutions made. | 3521 | used to limit the number of substitutions made. |
| 3925 | @end defun | 3522 | @end defun |
| 3926 | 3523 | ||
| 3927 | @defun nsubstitute new old seq @t{&key :test :test-not :key :count :start :end :from-end} | 3524 | @defun cl-nsubstitute new old seq @t{&key :test :test-not :key :count :start :end :from-end} |
| 3928 | This is a destructive version of @code{substitute}; it performs | 3525 | This is a destructive version of @code{cl-substitute}; it performs |
| 3929 | the substitution using @code{setcar} or @code{aset} rather than | 3526 | the substitution using @code{setcar} or @code{aset} rather than |
| 3930 | by returning a changed copy of the sequence. | 3527 | by returning a changed copy of the sequence. |
| 3931 | @end defun | 3528 | @end defun |
| 3932 | 3529 | ||
| 3933 | @findex substitute-if | 3530 | @findex cl-substitute-if |
| 3934 | @findex substitute-if-not | 3531 | @findex cl-substitute-if-not |
| 3935 | @findex nsubstitute-if | 3532 | @findex cl-nsubstitute-if |
| 3936 | @findex nsubstitute-if-not | 3533 | @findex cl-nsubstitute-if-not |
| 3937 | The @code{substitute-if}, @code{substitute-if-not}, @code{nsubstitute-if}, | 3534 | The functions @code{cl-substitute-if}, @code{cl-substitute-if-not}, |
| 3938 | and @code{nsubstitute-if-not} functions are defined similarly. For | 3535 | @code{cl-nsubstitute-if}, and @code{cl-nsubstitute-if-not} are defined |
| 3939 | these, a @var{predicate} is given in place of the @var{old} argument. | 3536 | similarly. For these, a @var{predicate} is given in place of the |
| 3537 | @var{old} argument. | ||
| 3940 | 3538 | ||
| 3941 | @node Searching Sequences | 3539 | @node Searching Sequences |
| 3942 | @section Searching Sequences | 3540 | @section Searching Sequences |
| 3943 | 3541 | ||
| 3944 | @noindent | 3542 | @noindent |
| 3945 | These functions search for elements or subsequences in a sequence. | 3543 | These functions search for elements or subsequences in a sequence. |
| 3946 | (See also @code{member*} and @code{assoc*}; @pxref{Lists}.) | 3544 | (See also @code{cl-member} and @code{cl-assoc}; @pxref{Lists}.) |
| 3947 | 3545 | ||
| 3948 | @defun find item seq @t{&key :test :test-not :key :start :end :from-end} | 3546 | @defun cl-find item seq @t{&key :test :test-not :key :start :end :from-end} |
| 3949 | This function searches @var{seq} for an element matching @var{item}. | 3547 | This function searches @var{seq} for an element matching @var{item}. |
| 3950 | If it finds a match, it returns the matching element. Otherwise, | 3548 | If it finds a match, it returns the matching element. Otherwise, |
| 3951 | it returns @code{nil}. It returns the leftmost match, unless | 3549 | it returns @code{nil}. It returns the leftmost match, unless |
| @@ -3954,30 +3552,30 @@ match. The @code{:start} and @code{:end} arguments may be used to | |||
| 3954 | limit the range of elements that are searched. | 3552 | limit the range of elements that are searched. |
| 3955 | @end defun | 3553 | @end defun |
| 3956 | 3554 | ||
| 3957 | @defun position item seq @t{&key :test :test-not :key :start :end :from-end} | 3555 | @defun cl-position item seq @t{&key :test :test-not :key :start :end :from-end} |
| 3958 | This function is like @code{find}, except that it returns the | 3556 | This function is like @code{cl-find}, except that it returns the |
| 3959 | integer position in the sequence of the matching item rather than | 3557 | integer position in the sequence of the matching item rather than |
| 3960 | the item itself. The position is relative to the start of the | 3558 | the item itself. The position is relative to the start of the |
| 3961 | sequence as a whole, even if @code{:start} is non-zero. The function | 3559 | sequence as a whole, even if @code{:start} is non-zero. The function |
| 3962 | returns @code{nil} if no matching element was found. | 3560 | returns @code{nil} if no matching element was found. |
| 3963 | @end defun | 3561 | @end defun |
| 3964 | 3562 | ||
| 3965 | @defun count item seq @t{&key :test :test-not :key :start :end} | 3563 | @defun cl-count item seq @t{&key :test :test-not :key :start :end} |
| 3966 | This function returns the number of elements of @var{seq} which | 3564 | This function returns the number of elements of @var{seq} which |
| 3967 | match @var{item}. The result is always a nonnegative integer. | 3565 | match @var{item}. The result is always a nonnegative integer. |
| 3968 | @end defun | 3566 | @end defun |
| 3969 | 3567 | ||
| 3970 | @findex find-if | 3568 | @findex cl-find-if |
| 3971 | @findex find-if-not | 3569 | @findex cl-find-if-not |
| 3972 | @findex position-if | 3570 | @findex cl-position-if |
| 3973 | @findex position-if-not | 3571 | @findex cl-position-if-not |
| 3974 | @findex count-if | 3572 | @findex cl-count-if |
| 3975 | @findex count-if-not | 3573 | @findex cl-count-if-not |
| 3976 | The @code{find-if}, @code{find-if-not}, @code{position-if}, | 3574 | The @code{cl-find-if}, @code{cl-find-if-not}, @code{cl-position-if}, |
| 3977 | @code{position-if-not}, @code{count-if}, and @code{count-if-not} | 3575 | @code{cl-position-if-not}, @code{cl-count-if}, and @code{cl-count-if-not} |
| 3978 | functions are defined similarly. | 3576 | functions are defined similarly. |
| 3979 | 3577 | ||
| 3980 | @defun mismatch seq1 seq2 @t{&key :test :test-not :key :start1 :end1 :start2 :end2 :from-end} | 3578 | @defun cl-mismatch seq1 seq2 @t{&key :test :test-not :key :start1 :end1 :start2 :end2 :from-end} |
| 3981 | This function compares the specified parts of @var{seq1} and | 3579 | This function compares the specified parts of @var{seq1} and |
| 3982 | @var{seq2}. If they are the same length and the corresponding | 3580 | @var{seq2}. If they are the same length and the corresponding |
| 3983 | elements match (according to @code{:test}, @code{:test-not}, | 3581 | elements match (according to @code{:test}, @code{:test-not}, |
| @@ -3992,11 +3590,11 @@ to left starting at @code{(1- @var{end1})} and @code{(1- @var{end2})}. | |||
| 3992 | If the sequences differ, then one plus the index of the rightmost | 3590 | If the sequences differ, then one plus the index of the rightmost |
| 3993 | difference (relative to @var{seq1}) is returned. | 3591 | difference (relative to @var{seq1}) is returned. |
| 3994 | 3592 | ||
| 3995 | An interesting example is @code{(mismatch str1 str2 :key 'upcase)}, | 3593 | An interesting example is @code{(cl-mismatch str1 str2 :key 'upcase)}, |
| 3996 | which compares two strings case-insensitively. | 3594 | which compares two strings case-insensitively. |
| 3997 | @end defun | 3595 | @end defun |
| 3998 | 3596 | ||
| 3999 | @defun search seq1 seq2 @t{&key :test :test-not :key :from-end :start1 :end1 :start2 :end2} | 3597 | @defun cl-search seq1 seq2 @t{&key :test :test-not :key :from-end :start1 :end1 :start2 :end2} |
| 4000 | This function searches @var{seq2} for a subsequence that matches | 3598 | This function searches @var{seq2} for a subsequence that matches |
| 4001 | @var{seq1} (or part of it specified by @code{:start1} and | 3599 | @var{seq1} (or part of it specified by @code{:start1} and |
| 4002 | @code{:end1}.) Only matches which fall entirely within the region | 3600 | @code{:end1}.) Only matches which fall entirely within the region |
| @@ -4010,7 +3608,7 @@ function finds the @emph{rightmost} matching subsequence. | |||
| 4010 | @node Sorting Sequences | 3608 | @node Sorting Sequences |
| 4011 | @section Sorting Sequences | 3609 | @section Sorting Sequences |
| 4012 | 3610 | ||
| 4013 | @defun sort* seq predicate @t{&key :key} | 3611 | @defun clsort seq predicate @t{&key :key} |
| 4014 | This function sorts @var{seq} into increasing order as determined | 3612 | This function sorts @var{seq} into increasing order as determined |
| 4015 | by using @var{predicate} to compare pairs of elements. @var{predicate} | 3613 | by using @var{predicate} to compare pairs of elements. @var{predicate} |
| 4016 | should return true (non-@code{nil}) if and only if its first argument | 3614 | should return true (non-@code{nil}) if and only if its first argument |
| @@ -4025,7 +3623,7 @@ accepts a @code{:key} argument which is used to preprocess data | |||
| 4025 | fed to the @var{predicate} function. For example, | 3623 | fed to the @var{predicate} function. For example, |
| 4026 | 3624 | ||
| 4027 | @example | 3625 | @example |
| 4028 | (setq data (sort* data 'string-lessp :key 'downcase)) | 3626 | (setq data (cl-sort data 'string-lessp :key 'downcase)) |
| 4029 | @end example | 3627 | @end example |
| 4030 | 3628 | ||
| 4031 | @noindent | 3629 | @noindent |
| @@ -4035,25 +3633,25 @@ would be useful for sorting association lists. It should only be a | |||
| 4035 | simple accessor though, it's used heavily in the current | 3633 | simple accessor though, it's used heavily in the current |
| 4036 | implementation. | 3634 | implementation. |
| 4037 | 3635 | ||
| 4038 | The @code{sort*} function is destructive; it sorts lists by actually | 3636 | The @code{cl-sort} function is destructive; it sorts lists by actually |
| 4039 | rearranging the @code{cdr} pointers in suitable fashion. | 3637 | rearranging the @code{cdr} pointers in suitable fashion. |
| 4040 | @end defun | 3638 | @end defun |
| 4041 | 3639 | ||
| 4042 | @defun stable-sort seq predicate @t{&key :key} | 3640 | @defun cl-stable-sort seq predicate @t{&key :key} |
| 4043 | This function sorts @var{seq} @dfn{stably}, meaning two elements | 3641 | This function sorts @var{seq} @dfn{stably}, meaning two elements |
| 4044 | which are equal in terms of @var{predicate} are guaranteed not to | 3642 | which are equal in terms of @var{predicate} are guaranteed not to |
| 4045 | be rearranged out of their original order by the sort. | 3643 | be rearranged out of their original order by the sort. |
| 4046 | 3644 | ||
| 4047 | In practice, @code{sort*} and @code{stable-sort} are equivalent | 3645 | In practice, @code{cl-sort} and @code{cl-stable-sort} are equivalent |
| 4048 | in Emacs Lisp because the underlying @code{sort} function is | 3646 | in Emacs Lisp because the underlying @code{sort} function is |
| 4049 | stable by default. However, this package reserves the right to | 3647 | stable by default. However, this package reserves the right to |
| 4050 | use non-stable methods for @code{sort*} in the future. | 3648 | use non-stable methods for @code{cl-sort} in the future. |
| 4051 | @end defun | 3649 | @end defun |
| 4052 | 3650 | ||
| 4053 | @defun merge type seq1 seq2 predicate @t{&key :key} | 3651 | @defun cl-merge type seq1 seq2 predicate @t{&key :key} |
| 4054 | This function merges two sequences @var{seq1} and @var{seq2} by | 3652 | This function merges two sequences @var{seq1} and @var{seq2} by |
| 4055 | interleaving their elements. The result sequence, of type @var{type} | 3653 | interleaving their elements. The result sequence, of type @var{type} |
| 4056 | (in the sense of @code{concatenate}), has length equal to the sum | 3654 | (in the sense of @code{cl-concatenate}), has length equal to the sum |
| 4057 | of the lengths of the two input sequences. The sequences may be | 3655 | of the lengths of the two input sequences. The sequences may be |
| 4058 | modified destructively. Order of elements within @var{seq1} and | 3656 | modified destructively. Order of elements within @var{seq1} and |
| 4059 | @var{seq2} is preserved in the interleaving; elements of the two | 3657 | @var{seq2} is preserved in the interleaving; elements of the two |
| @@ -4073,10 +3671,10 @@ a merged sequence which is (stably) sorted according to | |||
| 4073 | The functions described here operate on lists. | 3671 | The functions described here operate on lists. |
| 4074 | 3672 | ||
| 4075 | @menu | 3673 | @menu |
| 4076 | * List Functions:: @code{caddr}, @code{first}, @code{list*}, etc. | 3674 | * List Functions:: @code{cl-caddr}, @code{cl-first}, @code{cl-list*}, etc. |
| 4077 | * Substitution of Expressions:: @code{subst}, @code{sublis}, etc. | 3675 | * Substitution of Expressions:: @code{cl-subst}, @code{cl-sublis}, etc. |
| 4078 | * Lists as Sets:: @code{member*}, @code{adjoin}, @code{union}, etc. | 3676 | * Lists as Sets:: @code{cl-member}, @code{cl-adjoin}, @code{cl-union}, etc. |
| 4079 | * Association Lists:: @code{assoc*}, @code{rassoc*}, @code{acons}, @code{pairlis}. | 3677 | * Association Lists:: @code{cl-assoc}, @code{cl-rassoc}, @code{cl-acons}, @code{cl-pairlis}. |
| 4080 | @end menu | 3678 | @end menu |
| 4081 | 3679 | ||
| 4082 | @node List Functions | 3680 | @node List Functions |
| @@ -4086,7 +3684,7 @@ The functions described here operate on lists. | |||
| 4086 | This section describes a number of simple operations on lists, | 3684 | This section describes a number of simple operations on lists, |
| 4087 | i.e., chains of cons cells. | 3685 | i.e., chains of cons cells. |
| 4088 | 3686 | ||
| 4089 | @defun caddr x | 3687 | @defun cl-caddr x |
| 4090 | This function is equivalent to @code{(car (cdr (cdr @var{x})))}. | 3688 | This function is equivalent to @code{(car (cdr (cdr @var{x})))}. |
| 4091 | Likewise, this package defines all 28 @code{c@var{xxx}r} functions | 3689 | Likewise, this package defines all 28 @code{c@var{xxx}r} functions |
| 4092 | where @var{xxx} is up to four @samp{a}s and/or @samp{d}s. | 3690 | where @var{xxx} is up to four @samp{a}s and/or @samp{d}s. |
| @@ -4094,24 +3692,24 @@ All of these functions are @code{setf}-able, and calls to them | |||
| 4094 | are expanded inline by the byte-compiler for maximum efficiency. | 3692 | are expanded inline by the byte-compiler for maximum efficiency. |
| 4095 | @end defun | 3693 | @end defun |
| 4096 | 3694 | ||
| 4097 | @defun first x | 3695 | @defun cl-first x |
| 4098 | This function is a synonym for @code{(car @var{x})}. Likewise, | 3696 | This function is a synonym for @code{(car @var{x})}. Likewise, |
| 4099 | the functions @code{second}, @code{third}, @dots{}, through | 3697 | the functions @code{cl-second}, @code{cl-third}, @dots{}, through |
| 4100 | @code{tenth} return the given element of the list @var{x}. | 3698 | @code{cl-tenth} return the given element of the list @var{x}. |
| 4101 | @end defun | 3699 | @end defun |
| 4102 | 3700 | ||
| 4103 | @defun rest x | 3701 | @defun cl-rest x |
| 4104 | This function is a synonym for @code{(cdr @var{x})}. | 3702 | This function is a synonym for @code{(cdr @var{x})}. |
| 4105 | @end defun | 3703 | @end defun |
| 4106 | 3704 | ||
| 4107 | @defun endp x | 3705 | @defun cl-endp x |
| 4108 | Common Lisp defines this function to act like @code{null}, but | 3706 | Common Lisp defines this function to act like @code{null}, but |
| 4109 | signaling an error if @code{x} is neither a @code{nil} nor a | 3707 | signaling an error if @code{x} is neither a @code{nil} nor a |
| 4110 | cons cell. This package simply defines @code{endp} as a synonym | 3708 | cons cell. This package simply defines @code{cl-endp} as a synonym |
| 4111 | for @code{null}. | 3709 | for @code{null}. |
| 4112 | @end defun | 3710 | @end defun |
| 4113 | 3711 | ||
| 4114 | @defun list-length x | 3712 | @defun cl-list-length x |
| 4115 | This function returns the length of list @var{x}, exactly like | 3713 | This function returns the length of list @var{x}, exactly like |
| 4116 | @code{(length @var{x})}, except that if @var{x} is a circular | 3714 | @code{(length @var{x})}, except that if @var{x} is a circular |
| 4117 | list (where the cdr-chain forms a loop rather than terminating | 3715 | list (where the cdr-chain forms a loop rather than terminating |
| @@ -4119,38 +3717,35 @@ with @code{nil}), this function returns @code{nil}. (The regular | |||
| 4119 | @code{length} function would get stuck if given a circular list.) | 3717 | @code{length} function would get stuck if given a circular list.) |
| 4120 | @end defun | 3718 | @end defun |
| 4121 | 3719 | ||
| 4122 | @defun list* arg &rest others | 3720 | @defun cl-list* arg &rest others |
| 4123 | This function constructs a list of its arguments. The final | 3721 | This function constructs a list of its arguments. The final |
| 4124 | argument becomes the @code{cdr} of the last cell constructed. | 3722 | argument becomes the @code{cdr} of the last cell constructed. |
| 4125 | Thus, @code{(list* @var{a} @var{b} @var{c})} is equivalent to | 3723 | Thus, @code{(cl-list* @var{a} @var{b} @var{c})} is equivalent to |
| 4126 | @code{(cons @var{a} (cons @var{b} @var{c}))}, and | 3724 | @code{(cons @var{a} (cons @var{b} @var{c}))}, and |
| 4127 | @code{(list* @var{a} @var{b} nil)} is equivalent to | 3725 | @code{(cl-list* @var{a} @var{b} nil)} is equivalent to |
| 4128 | @code{(list @var{a} @var{b})}. | 3726 | @code{(list @var{a} @var{b})}. |
| 4129 | |||
| 4130 | (Note that this function really is called @code{list*} in Common | ||
| 4131 | Lisp; it is not a name invented for this package like @code{member*} | ||
| 4132 | or @code{defun*}.) | ||
| 4133 | @end defun | 3727 | @end defun |
| 4134 | 3728 | ||
| 4135 | @defun ldiff list sublist | 3729 | @defun cl-ldiff list sublist |
| 4136 | If @var{sublist} is a sublist of @var{list}, i.e., is @code{eq} to | 3730 | If @var{sublist} is a sublist of @var{list}, i.e., is @code{eq} to |
| 4137 | one of the cons cells of @var{list}, then this function returns | 3731 | one of the cons cells of @var{list}, then this function returns |
| 4138 | a copy of the part of @var{list} up to but not including | 3732 | a copy of the part of @var{list} up to but not including |
| 4139 | @var{sublist}. For example, @code{(ldiff x (cddr x))} returns | 3733 | @var{sublist}. For example, @code{(cl-ldiff x (cddr x))} returns |
| 4140 | the first two elements of the list @code{x}. The result is a | 3734 | the first two elements of the list @code{x}. The result is a |
| 4141 | copy; the original @var{list} is not modified. If @var{sublist} | 3735 | copy; the original @var{list} is not modified. If @var{sublist} |
| 4142 | is not a sublist of @var{list}, a copy of the entire @var{list} | 3736 | is not a sublist of @var{list}, a copy of the entire @var{list} |
| 4143 | is returned. | 3737 | is returned. |
| 4144 | @end defun | 3738 | @end defun |
| 4145 | 3739 | ||
| 4146 | @defun copy-list list | 3740 | @defun cl-copy-list list |
| 4147 | This function returns a copy of the list @var{list}. It copies | 3741 | This function returns a copy of the list @var{list}. It copies |
| 4148 | dotted lists like @code{(1 2 . 3)} correctly. | 3742 | dotted lists like @code{(1 2 . 3)} correctly. |
| 4149 | @end defun | 3743 | @end defun |
| 4150 | 3744 | ||
| 4151 | @defun copy-tree x &optional vecp | 3745 | @defun copy-tree x &optional vecp |
| 4152 | This function returns a copy of the tree of cons cells @var{x}. | 3746 | This function returns a copy of the tree of cons cells @var{x}. |
| 4153 | Unlike @code{copy-sequence} (and its alias @code{copy-list}), | 3747 | @c FIXME? cl-copy-list is not an alias of copy-sequence. |
| 3748 | Unlike @code{copy-sequence} (and its alias @code{cl-copy-list}), | ||
| 4154 | which copies only along the @code{cdr} direction, this function | 3749 | which copies only along the @code{cdr} direction, this function |
| 4155 | copies (recursively) along both the @code{car} and the @code{cdr} | 3750 | copies (recursively) along both the @code{car} and the @code{cdr} |
| 4156 | directions. If @var{x} is not a cons cell, the function simply | 3751 | directions. If @var{x} is not a cons cell, the function simply |
| @@ -4159,7 +3754,7 @@ is true, this function copies vectors (recursively) as well as | |||
| 4159 | cons cells. | 3754 | cons cells. |
| 4160 | @end defun | 3755 | @end defun |
| 4161 | 3756 | ||
| 4162 | @defun tree-equal x y @t{&key :test :test-not :key} | 3757 | @defun cl-tree-equal x y @t{&key :test :test-not :key} |
| 4163 | This function compares two trees of cons cells. If @var{x} and | 3758 | This function compares two trees of cons cells. If @var{x} and |
| 4164 | @var{y} are both cons cells, their @code{car}s and @code{cdr}s are | 3759 | @var{y} are both cons cells, their @code{car}s and @code{cdr}s are |
| 4165 | compared recursively. If neither @var{x} nor @var{y} is a cons | 3760 | compared recursively. If neither @var{x} nor @var{y} is a cons |
| @@ -4168,19 +3763,15 @@ specified test. The @code{:key} function, if specified, is | |||
| 4168 | applied to the elements of both trees. @xref{Sequences}. | 3763 | applied to the elements of both trees. @xref{Sequences}. |
| 4169 | @end defun | 3764 | @end defun |
| 4170 | 3765 | ||
| 4171 | @iftex | ||
| 4172 | @secno=3 | ||
| 4173 | @end iftex | ||
| 4174 | |||
| 4175 | @node Substitution of Expressions | 3766 | @node Substitution of Expressions |
| 4176 | @section Substitution of Expressions | 3767 | @section Substitution of Expressions |
| 4177 | 3768 | ||
| 4178 | @noindent | 3769 | @noindent |
| 4179 | These functions substitute elements throughout a tree of cons | 3770 | These functions substitute elements throughout a tree of cons |
| 4180 | cells. (@xref{Sequence Functions}, for the @code{substitute} | 3771 | cells. (@xref{Sequence Functions}, for the @code{cl-substitute} |
| 4181 | function, which works on just the top-level elements of a list.) | 3772 | function, which works on just the top-level elements of a list.) |
| 4182 | 3773 | ||
| 4183 | @defun subst new old tree @t{&key :test :test-not :key} | 3774 | @defun cl-subst new old tree @t{&key :test :test-not :key} |
| 4184 | This function substitutes occurrences of @var{old} with @var{new} | 3775 | This function substitutes occurrences of @var{old} with @var{new} |
| 4185 | in @var{tree}, a tree of cons cells. It returns a substituted | 3776 | in @var{tree}, a tree of cons cells. It returns a substituted |
| 4186 | tree, which will be a copy except that it may share storage with | 3777 | tree, which will be a copy except that it may share storage with |
| @@ -4195,21 +3786,21 @@ The @code{:key} function is applied to the elements of the tree | |||
| 4195 | but not to @var{old}. | 3786 | but not to @var{old}. |
| 4196 | @end defun | 3787 | @end defun |
| 4197 | 3788 | ||
| 4198 | @defun nsubst new old tree @t{&key :test :test-not :key} | 3789 | @defun cl-nsubst new old tree @t{&key :test :test-not :key} |
| 4199 | This function is like @code{subst}, except that it works by | 3790 | This function is like @code{cl-subst}, except that it works by |
| 4200 | destructive modification (by @code{setcar} or @code{setcdr}) | 3791 | destructive modification (by @code{setcar} or @code{setcdr}) |
| 4201 | rather than copying. | 3792 | rather than copying. |
| 4202 | @end defun | 3793 | @end defun |
| 4203 | 3794 | ||
| 4204 | @findex subst-if | 3795 | @findex cl-subst-if |
| 4205 | @findex subst-if-not | 3796 | @findex cl-subst-if-not |
| 4206 | @findex nsubst-if | 3797 | @findex cl-nsubst-if |
| 4207 | @findex nsubst-if-not | 3798 | @findex cl-nsubst-if-not |
| 4208 | The @code{subst-if}, @code{subst-if-not}, @code{nsubst-if}, and | 3799 | The @code{cl-subst-if}, @code{cl-subst-if-not}, @code{cl-nsubst-if}, and |
| 4209 | @code{nsubst-if-not} functions are defined similarly. | 3800 | @code{cl-nsubst-if-not} functions are defined similarly. |
| 4210 | 3801 | ||
| 4211 | @defun sublis alist tree @t{&key :test :test-not :key} | 3802 | @defun cl-sublis alist tree @t{&key :test :test-not :key} |
| 4212 | This function is like @code{subst}, except that it takes an | 3803 | This function is like @code{cl-subst}, except that it takes an |
| 4213 | association list @var{alist} of @var{old}-@var{new} pairs. | 3804 | association list @var{alist} of @var{old}-@var{new} pairs. |
| 4214 | Each element of the tree (after applying the @code{:key} | 3805 | Each element of the tree (after applying the @code{:key} |
| 4215 | function, if any), is compared with the @code{car}s of | 3806 | function, if any), is compared with the @code{car}s of |
| @@ -4217,8 +3808,8 @@ function, if any), is compared with the @code{car}s of | |||
| 4217 | @code{cdr}. | 3808 | @code{cdr}. |
| 4218 | @end defun | 3809 | @end defun |
| 4219 | 3810 | ||
| 4220 | @defun nsublis alist tree @t{&key :test :test-not :key} | 3811 | @defun cl-nsublis alist tree @t{&key :test :test-not :key} |
| 4221 | This is a destructive version of @code{sublis}. | 3812 | This is a destructive version of @code{cl-sublis}. |
| 4222 | @end defun | 3813 | @end defun |
| 4223 | 3814 | ||
| 4224 | @node Lists as Sets | 3815 | @node Lists as Sets |
| @@ -4228,7 +3819,7 @@ This is a destructive version of @code{sublis}. | |||
| 4228 | These functions perform operations on lists which represent sets | 3819 | These functions perform operations on lists which represent sets |
| 4229 | of elements. | 3820 | of elements. |
| 4230 | 3821 | ||
| 4231 | @defun member* item list @t{&key :test :test-not :key} | 3822 | @defun cl-member item list @t{&key :test :test-not :key} |
| 4232 | This function searches @var{list} for an element matching @var{item}. | 3823 | This function searches @var{list} for an element matching @var{item}. |
| 4233 | If a match is found, it returns the cons cell whose @code{car} was | 3824 | If a match is found, it returns the cons cell whose @code{car} was |
| 4234 | the matching element. Otherwise, it returns @code{nil}. Elements | 3825 | the matching element. Otherwise, it returns @code{nil}. Elements |
| @@ -4236,34 +3827,33 @@ are compared by @code{eql} by default; you can use the @code{:test}, | |||
| 4236 | @code{:test-not}, and @code{:key} arguments to modify this behavior. | 3827 | @code{:test-not}, and @code{:key} arguments to modify this behavior. |
| 4237 | @xref{Sequences}. | 3828 | @xref{Sequences}. |
| 4238 | 3829 | ||
| 4239 | Note that this function's name is suffixed by @samp{*} to avoid | 3830 | The standard Emacs lisp function @code{member} uses @code{equal} for |
| 4240 | the incompatible @code{member} function defined in Emacs. | 3831 | comparisons; it is equivalent to @code{(cl-member @var{item} @var{list} |
| 4241 | (That function uses @code{equal} for comparisons; it is equivalent | 3832 | :test 'equal)}. |
| 4242 | to @code{(member* @var{item} @var{list} :test 'equal)}.) | ||
| 4243 | @end defun | 3833 | @end defun |
| 4244 | 3834 | ||
| 4245 | @findex member-if | 3835 | @findex cl-member-if |
| 4246 | @findex member-if-not | 3836 | @findex cl-member-if-not |
| 4247 | The @code{member-if} and @code{member-if-not} functions | 3837 | The @code{cl-member-if} and @code{cl-member-if-not} functions |
| 4248 | analogously search for elements which satisfy a given predicate. | 3838 | analogously search for elements which satisfy a given predicate. |
| 4249 | 3839 | ||
| 4250 | @defun tailp sublist list | 3840 | @defun cl-tailp sublist list |
| 4251 | This function returns @code{t} if @var{sublist} is a sublist of | 3841 | This function returns @code{t} if @var{sublist} is a sublist of |
| 4252 | @var{list}, i.e., if @var{sublist} is @code{eql} to @var{list} or to | 3842 | @var{list}, i.e., if @var{sublist} is @code{eql} to @var{list} or to |
| 4253 | any of its @code{cdr}s. | 3843 | any of its @code{cdr}s. |
| 4254 | @end defun | 3844 | @end defun |
| 4255 | 3845 | ||
| 4256 | @defun adjoin item list @t{&key :test :test-not :key} | 3846 | @defun cl-adjoin item list @t{&key :test :test-not :key} |
| 4257 | This function conses @var{item} onto the front of @var{list}, | 3847 | This function conses @var{item} onto the front of @var{list}, |
| 4258 | like @code{(cons @var{item} @var{list})}, but only if @var{item} | 3848 | like @code{(cons @var{item} @var{list})}, but only if @var{item} |
| 4259 | is not already present on the list (as determined by @code{member*}). | 3849 | is not already present on the list (as determined by @code{cl-member}). |
| 4260 | If a @code{:key} argument is specified, it is applied to | 3850 | If a @code{:key} argument is specified, it is applied to |
| 4261 | @var{item} as well as to the elements of @var{list} during | 3851 | @var{item} as well as to the elements of @var{list} during |
| 4262 | the search, on the reasoning that @var{item} is ``about'' to | 3852 | the search, on the reasoning that @var{item} is ``about'' to |
| 4263 | become part of the list. | 3853 | become part of the list. |
| 4264 | @end defun | 3854 | @end defun |
| 4265 | 3855 | ||
| 4266 | @defun union list1 list2 @t{&key :test :test-not :key} | 3856 | @defun cl-union list1 list2 @t{&key :test :test-not :key} |
| 4267 | This function combines two lists which represent sets of items, | 3857 | This function combines two lists which represent sets of items, |
| 4268 | returning a list that represents the union of those two sets. | 3858 | returning a list that represents the union of those two sets. |
| 4269 | The result list will contain all items which appear in @var{list1} | 3859 | The result list will contain all items which appear in @var{list1} |
| @@ -4275,46 +3865,46 @@ result list. The order of elements in the result list is also | |||
| 4275 | undefined. | 3865 | undefined. |
| 4276 | @end defun | 3866 | @end defun |
| 4277 | 3867 | ||
| 4278 | @defun nunion list1 list2 @t{&key :test :test-not :key} | 3868 | @defun cl-nunion list1 list2 @t{&key :test :test-not :key} |
| 4279 | This is a destructive version of @code{union}; rather than copying, | 3869 | This is a destructive version of @code{cl-union}; rather than copying, |
| 4280 | it tries to reuse the storage of the argument lists if possible. | 3870 | it tries to reuse the storage of the argument lists if possible. |
| 4281 | @end defun | 3871 | @end defun |
| 4282 | 3872 | ||
| 4283 | @defun intersection list1 list2 @t{&key :test :test-not :key} | 3873 | @defun cl-intersection list1 list2 @t{&key :test :test-not :key} |
| 4284 | This function computes the intersection of the sets represented | 3874 | This function computes the intersection of the sets represented |
| 4285 | by @var{list1} and @var{list2}. It returns the list of items | 3875 | by @var{list1} and @var{list2}. It returns the list of items |
| 4286 | which appear in both @var{list1} and @var{list2}. | 3876 | which appear in both @var{list1} and @var{list2}. |
| 4287 | @end defun | 3877 | @end defun |
| 4288 | 3878 | ||
| 4289 | @defun nintersection list1 list2 @t{&key :test :test-not :key} | 3879 | @defun cl-nintersection list1 list2 @t{&key :test :test-not :key} |
| 4290 | This is a destructive version of @code{intersection}. It | 3880 | This is a destructive version of @code{cl-intersection}. It |
| 4291 | tries to reuse storage of @var{list1} rather than copying. | 3881 | tries to reuse storage of @var{list1} rather than copying. |
| 4292 | It does @emph{not} reuse the storage of @var{list2}. | 3882 | It does @emph{not} reuse the storage of @var{list2}. |
| 4293 | @end defun | 3883 | @end defun |
| 4294 | 3884 | ||
| 4295 | @defun set-difference list1 list2 @t{&key :test :test-not :key} | 3885 | @defun cl-set-difference list1 list2 @t{&key :test :test-not :key} |
| 4296 | This function computes the ``set difference'' of @var{list1} | 3886 | This function computes the ``set difference'' of @var{list1} |
| 4297 | and @var{list2}, i.e., the set of elements that appear in | 3887 | and @var{list2}, i.e., the set of elements that appear in |
| 4298 | @var{list1} but @emph{not} in @var{list2}. | 3888 | @var{list1} but @emph{not} in @var{list2}. |
| 4299 | @end defun | 3889 | @end defun |
| 4300 | 3890 | ||
| 4301 | @defun nset-difference list1 list2 @t{&key :test :test-not :key} | 3891 | @defun cl-nset-difference list1 list2 @t{&key :test :test-not :key} |
| 4302 | This is a destructive @code{set-difference}, which will try | 3892 | This is a destructive @code{cl-set-difference}, which will try |
| 4303 | to reuse @var{list1} if possible. | 3893 | to reuse @var{list1} if possible. |
| 4304 | @end defun | 3894 | @end defun |
| 4305 | 3895 | ||
| 4306 | @defun set-exclusive-or list1 list2 @t{&key :test :test-not :key} | 3896 | @defun cl-set-exclusive-or list1 list2 @t{&key :test :test-not :key} |
| 4307 | This function computes the ``set exclusive or'' of @var{list1} | 3897 | This function computes the ``set exclusive or'' of @var{list1} |
| 4308 | and @var{list2}, i.e., the set of elements that appear in | 3898 | and @var{list2}, i.e., the set of elements that appear in |
| 4309 | exactly one of @var{list1} and @var{list2}. | 3899 | exactly one of @var{list1} and @var{list2}. |
| 4310 | @end defun | 3900 | @end defun |
| 4311 | 3901 | ||
| 4312 | @defun nset-exclusive-or list1 list2 @t{&key :test :test-not :key} | 3902 | @defun cl-nset-exclusive-or list1 list2 @t{&key :test :test-not :key} |
| 4313 | This is a destructive @code{set-exclusive-or}, which will try | 3903 | This is a destructive @code{cl-set-exclusive-or}, which will try |
| 4314 | to reuse @var{list1} and @var{list2} if possible. | 3904 | to reuse @var{list1} and @var{list2} if possible. |
| 4315 | @end defun | 3905 | @end defun |
| 4316 | 3906 | ||
| 4317 | @defun subsetp list1 list2 @t{&key :test :test-not :key} | 3907 | @defun cl-subsetp list1 list2 @t{&key :test :test-not :key} |
| 4318 | This function checks whether @var{list1} represents a subset | 3908 | This function checks whether @var{list1} represents a subset |
| 4319 | of @var{list2}, i.e., whether every element of @var{list1} | 3909 | of @var{list2}, i.e., whether every element of @var{list1} |
| 4320 | also appears in @var{list2}. | 3910 | also appears in @var{list2}. |
| @@ -4328,7 +3918,7 @@ An @dfn{association list} is a list representing a mapping from | |||
| 4328 | one set of values to another; any list whose elements are cons | 3918 | one set of values to another; any list whose elements are cons |
| 4329 | cells is an association list. | 3919 | cells is an association list. |
| 4330 | 3920 | ||
| 4331 | @defun assoc* item a-list @t{&key :test :test-not :key} | 3921 | @defun cl-assoc item a-list @t{&key :test :test-not :key} |
| 4332 | This function searches the association list @var{a-list} for an | 3922 | This function searches the association list @var{a-list} for an |
| 4333 | element whose @code{car} matches (in the sense of @code{:test}, | 3923 | element whose @code{car} matches (in the sense of @code{:test}, |
| 4334 | @code{:test-not}, and @code{:key}, or by comparison with @code{eql}) | 3924 | @code{:test-not}, and @code{:key}, or by comparison with @code{eql}) |
| @@ -4340,27 +3930,27 @@ are not cons cells. (This corresponds to the behavior of | |||
| 4340 | elements of @var{a-list} to be an error.) | 3930 | elements of @var{a-list} to be an error.) |
| 4341 | @end defun | 3931 | @end defun |
| 4342 | 3932 | ||
| 4343 | @defun rassoc* item a-list @t{&key :test :test-not :key} | 3933 | @defun cl-rassoc item a-list @t{&key :test :test-not :key} |
| 4344 | This function searches for an element whose @code{cdr} matches | 3934 | This function searches for an element whose @code{cdr} matches |
| 4345 | @var{item}. If @var{a-list} represents a mapping, this applies | 3935 | @var{item}. If @var{a-list} represents a mapping, this applies |
| 4346 | the inverse of the mapping to @var{item}. | 3936 | the inverse of the mapping to @var{item}. |
| 4347 | @end defun | 3937 | @end defun |
| 4348 | 3938 | ||
| 4349 | @findex assoc-if | 3939 | @findex cl-assoc-if |
| 4350 | @findex assoc-if-not | 3940 | @findex cl-assoc-if-not |
| 4351 | @findex rassoc-if | 3941 | @findex cl-rassoc-if |
| 4352 | @findex rassoc-if-not | 3942 | @findex cl-rassoc-if-not |
| 4353 | The @code{assoc-if}, @code{assoc-if-not}, @code{rassoc-if}, | 3943 | The @code{cl-assoc-if}, @code{cl-assoc-if-not}, @code{cl-rassoc-if}, |
| 4354 | and @code{rassoc-if-not} functions are defined similarly. | 3944 | and @code{cl-rassoc-if-not} functions are defined similarly. |
| 4355 | 3945 | ||
| 4356 | Two simple functions for constructing association lists are: | 3946 | Two simple functions for constructing association lists are: |
| 4357 | 3947 | ||
| 4358 | @defun acons key value alist | 3948 | @defun cl-acons key value alist |
| 4359 | This is equivalent to @code{(cons (cons @var{key} @var{value}) @var{alist})}. | 3949 | This is equivalent to @code{(cons (cons @var{key} @var{value}) @var{alist})}. |
| 4360 | @end defun | 3950 | @end defun |
| 4361 | 3951 | ||
| 4362 | @defun pairlis keys values &optional alist | 3952 | @defun cl-pairlis keys values &optional alist |
| 4363 | This is equivalent to @code{(nconc (mapcar* 'cons @var{keys} @var{values}) | 3953 | This is equivalent to @code{(nconc (cl-mapcar 'cons @var{keys} @var{values}) |
| 4364 | @var{alist})}. | 3954 | @var{alist})}. |
| 4365 | @end defun | 3955 | @end defun |
| 4366 | 3956 | ||
| @@ -4382,15 +3972,15 @@ system provides no way to create new distinct types, this package | |||
| 4382 | implements structures as vectors (or lists upon request) with a | 3972 | implements structures as vectors (or lists upon request) with a |
| 4383 | special ``tag'' symbol to identify them. | 3973 | special ``tag'' symbol to identify them. |
| 4384 | 3974 | ||
| 4385 | @defspec defstruct name slots@dots{} | 3975 | @defmac cl-defstruct name slots@dots{} |
| 4386 | The @code{defstruct} form defines a new structure type called | 3976 | The @code{cl-defstruct} form defines a new structure type called |
| 4387 | @var{name}, with the specified @var{slots}. (The @var{slots} | 3977 | @var{name}, with the specified @var{slots}. (The @var{slots} |
| 4388 | may begin with a string which documents the structure type.) | 3978 | may begin with a string which documents the structure type.) |
| 4389 | In the simplest case, @var{name} and each of the @var{slots} | 3979 | In the simplest case, @var{name} and each of the @var{slots} |
| 4390 | are symbols. For example, | 3980 | are symbols. For example, |
| 4391 | 3981 | ||
| 4392 | @example | 3982 | @example |
| 4393 | (defstruct person name age sex) | 3983 | (cl-defstruct person name age sex) |
| 4394 | @end example | 3984 | @end example |
| 4395 | 3985 | ||
| 4396 | @noindent | 3986 | @noindent |
| @@ -4401,14 +3991,14 @@ and @code{(person-sex @var{p})}. You can also change these slots by | |||
| 4401 | using @code{setf} on any of these place forms: | 3991 | using @code{setf} on any of these place forms: |
| 4402 | 3992 | ||
| 4403 | @example | 3993 | @example |
| 4404 | (incf (person-age birthday-boy)) | 3994 | (cl-incf (person-age birthday-boy)) |
| 4405 | @end example | 3995 | @end example |
| 4406 | 3996 | ||
| 4407 | You can create a new @code{person} by calling @code{make-person}, | 3997 | You can create a new @code{person} by calling @code{make-person}, |
| 4408 | which takes keyword arguments @code{:name}, @code{:age}, and | 3998 | which takes keyword arguments @code{:name}, @code{:age}, and |
| 4409 | @code{:sex} to specify the initial values of these slots in the | 3999 | @code{:sex} to specify the initial values of these slots in the |
| 4410 | new object. (Omitting any of these arguments leaves the corresponding | 4000 | new object. (Omitting any of these arguments leaves the corresponding |
| 4411 | slot ``undefined,'' according to the Common Lisp standard; in Emacs | 4001 | slot ``undefined'', according to the Common Lisp standard; in Emacs |
| 4412 | Lisp, such uninitialized slots are filled with @code{nil}.) | 4002 | Lisp, such uninitialized slots are filled with @code{nil}.) |
| 4413 | 4003 | ||
| 4414 | Given a @code{person}, @code{(copy-person @var{p})} makes a new | 4004 | Given a @code{person}, @code{(copy-person @var{p})} makes a new |
| @@ -4465,10 +4055,10 @@ the slot's value is determined when the object is created and does | |||
| 4465 | not change afterward. | 4055 | not change afterward. |
| 4466 | 4056 | ||
| 4467 | @example | 4057 | @example |
| 4468 | (defstruct person | 4058 | (cl-defstruct person |
| 4469 | (name nil :read-only t) | 4059 | (name nil :read-only t) |
| 4470 | age | 4060 | age |
| 4471 | (sex 'unknown)) | 4061 | (sex 'unknown)) |
| 4472 | @end example | 4062 | @end example |
| 4473 | 4063 | ||
| 4474 | Any slot options other than @code{:read-only} are ignored. | 4064 | Any slot options other than @code{:read-only} are ignored. |
| @@ -4480,19 +4070,15 @@ by arguments. (By contrast, slot options are key-value pairs not | |||
| 4480 | enclosed in lists.) | 4070 | enclosed in lists.) |
| 4481 | 4071 | ||
| 4482 | @example | 4072 | @example |
| 4483 | (defstruct (person (:constructor create-person) | 4073 | (cl-defstruct (person (:constructor create-person) |
| 4484 | (:type list) | 4074 | (:type list) |
| 4485 | :named) | 4075 | :named) |
| 4486 | name age sex) | 4076 | name age sex) |
| 4487 | @end example | 4077 | @end example |
| 4488 | 4078 | ||
| 4489 | The following structure options are recognized. | 4079 | The following structure options are recognized. |
| 4490 | 4080 | ||
| 4491 | @table @code | 4081 | @table @code |
| 4492 | @iftex | ||
| 4493 | @itemmax=0 in | ||
| 4494 | @advance@leftskip-.5@tableindent | ||
| 4495 | @end iftex | ||
| 4496 | @item :conc-name | 4082 | @item :conc-name |
| 4497 | The argument is a symbol whose print name is used as the prefix for | 4083 | The argument is a symbol whose print name is used as the prefix for |
| 4498 | the names of slot accessor functions. The default is the name of | 4084 | the names of slot accessor functions. The default is the name of |
| @@ -4529,21 +4115,22 @@ as well unless you disable it with a simple-format @code{:constructor} | |||
| 4529 | option. | 4115 | option. |
| 4530 | 4116 | ||
| 4531 | @example | 4117 | @example |
| 4532 | (defstruct | 4118 | (cl-defstruct |
| 4533 | (person | 4119 | (person |
| 4534 | (:constructor nil) ; no default constructor | 4120 | (:constructor nil) ; no default constructor |
| 4535 | (:constructor new-person (name sex &optional (age 0))) | 4121 | (:constructor new-person |
| 4536 | (:constructor new-hound (&key (name "Rover") | 4122 | (name sex &optional (age 0))) |
| 4537 | (dog-years 0) | 4123 | (:constructor new-hound (&key (name "Rover") |
| 4538 | &aux (age (* 7 dog-years)) | 4124 | (dog-years 0) |
| 4539 | (sex 'canine)))) | 4125 | &aux (age (* 7 dog-years)) |
| 4540 | name age sex) | 4126 | (sex 'canine)))) |
| 4127 | name age sex) | ||
| 4541 | @end example | 4128 | @end example |
| 4542 | 4129 | ||
| 4543 | The first constructor here takes its arguments positionally rather | 4130 | The first constructor here takes its arguments positionally rather |
| 4544 | than by keyword. (In official Common Lisp terminology, constructors | 4131 | than by keyword. (In official Common Lisp terminology, constructors |
| 4545 | that work By Order of Arguments instead of by keyword are called | 4132 | that work By Order of Arguments instead of by keyword are called |
| 4546 | ``BOA constructors.'' No, I'm not making this up.) For example, | 4133 | ``BOA constructors''. No, I'm not making this up.) For example, |
| 4547 | @code{(new-person "Jane" 'female)} generates a person whose slots | 4134 | @code{(new-person "Jane" 'female)} generates a person whose slots |
| 4548 | are @code{"Jane"}, 0, and @code{female}, respectively. | 4135 | are @code{"Jane"}, 0, and @code{female}, respectively. |
| 4549 | 4136 | ||
| @@ -4569,14 +4156,14 @@ ever generated.) | |||
| 4569 | 4156 | ||
| 4570 | In true Common Lisp, @code{typep} is always able to recognize a | 4157 | In true Common Lisp, @code{typep} is always able to recognize a |
| 4571 | structure object even if @code{:predicate} was used. In this | 4158 | structure object even if @code{:predicate} was used. In this |
| 4572 | package, @code{typep} simply looks for a function called | 4159 | package, @code{cl-typep} simply looks for a function called |
| 4573 | @code{@var{typename}-p}, so it will work for structure types | 4160 | @code{@var{typename}-p}, so it will work for structure types |
| 4574 | only if they used the default predicate name. | 4161 | only if they used the default predicate name. |
| 4575 | 4162 | ||
| 4576 | @item :include | 4163 | @item :include |
| 4577 | This option implements a very limited form of C++-style inheritance. | 4164 | This option implements a very limited form of C++-style inheritance. |
| 4578 | The argument is the name of another structure type previously | 4165 | The argument is the name of another structure type previously |
| 4579 | created with @code{defstruct}. The effect is to cause the new | 4166 | created with @code{cl-defstruct}. The effect is to cause the new |
| 4580 | structure type to inherit all of the included structure's slots | 4167 | structure type to inherit all of the included structure's slots |
| 4581 | (plus, of course, any new slots described by this struct's slot | 4168 | (plus, of course, any new slots described by this struct's slot |
| 4582 | descriptors). The new structure is considered a ``specialization'' | 4169 | descriptors). The new structure is considered a ``specialization'' |
| @@ -4589,12 +4176,12 @@ slot descriptors for slots in the included structure, possibly with | |||
| 4589 | modified default values. Borrowing an example from Steele: | 4176 | modified default values. Borrowing an example from Steele: |
| 4590 | 4177 | ||
| 4591 | @example | 4178 | @example |
| 4592 | (defstruct person name (age 0) sex) | 4179 | (cl-defstruct person name (age 0) sex) |
| 4593 | @result{} person | 4180 | @result{} person |
| 4594 | (defstruct (astronaut (:include person (age 45))) | 4181 | (cl-defstruct (astronaut (:include person (age 45))) |
| 4595 | helmet-size | 4182 | helmet-size |
| 4596 | (favorite-beverage 'tang)) | 4183 | (favorite-beverage 'tang)) |
| 4597 | @result{} astronaut | 4184 | @result{} astronaut |
| 4598 | 4185 | ||
| 4599 | (setq joe (make-person :name "Joe")) | 4186 | (setq joe (make-person :name "Joe")) |
| 4600 | @result{} [cl-struct-person "Joe" 0 nil] | 4187 | @result{} [cl-struct-person "Joe" 0 nil] |
| @@ -4650,9 +4237,9 @@ use named vectors. Therefore, @code{:named} is only useful in | |||
| 4650 | conjunction with @code{:type}. | 4237 | conjunction with @code{:type}. |
| 4651 | 4238 | ||
| 4652 | @example | 4239 | @example |
| 4653 | (defstruct (person1) name age sex) | 4240 | (cl-defstruct (person1) name age sex) |
| 4654 | (defstruct (person2 (:type list) :named) name age sex) | 4241 | (cl-defstruct (person2 (:type list) :named) name age sex) |
| 4655 | (defstruct (person3 (:type list)) name age sex) | 4242 | (cl-defstruct (person3 (:type list)) name age sex) |
| 4656 | 4243 | ||
| 4657 | (setq p1 (make-person1)) | 4244 | (setq p1 (make-person1)) |
| 4658 | @result{} [cl-struct-person1 nil nil nil] | 4245 | @result{} [cl-struct-person1 nil nil nil] |
| @@ -4669,7 +4256,7 @@ conjunction with @code{:type}. | |||
| 4669 | @result{} error: function person3-p undefined | 4256 | @result{} error: function person3-p undefined |
| 4670 | @end example | 4257 | @end example |
| 4671 | 4258 | ||
| 4672 | Since unnamed structures don't have tags, @code{defstruct} is not | 4259 | Since unnamed structures don't have tags, @code{cl-defstruct} is not |
| 4673 | able to make a useful predicate for recognizing them. Also, | 4260 | able to make a useful predicate for recognizing them. Also, |
| 4674 | accessors like @code{person3-name} will be generated but they | 4261 | accessors like @code{person3-name} will be generated but they |
| 4675 | will not be able to do any type checking. The @code{person3-name} | 4262 | will not be able to do any type checking. The @code{person3-name} |
| @@ -4689,9 +4276,9 @@ the type @code{:include}s another type, then @code{:initial-offset} | |||
| 4689 | specifies a number of slots to be skipped between the last slot | 4276 | specifies a number of slots to be skipped between the last slot |
| 4690 | of the included type and the first new slot. | 4277 | of the included type and the first new slot. |
| 4691 | @end table | 4278 | @end table |
| 4692 | @end defspec | 4279 | @end defmac |
| 4693 | 4280 | ||
| 4694 | Except as noted, the @code{defstruct} facility of this package is | 4281 | Except as noted, the @code{cl-defstruct} facility of this package is |
| 4695 | entirely compatible with that of Common Lisp. | 4282 | entirely compatible with that of Common Lisp. |
| 4696 | 4283 | ||
| 4697 | @node Assertions | 4284 | @node Assertions |
| @@ -4708,10 +4295,10 @@ If the optimization property @code{speed} has been set to 3, and | |||
| 4708 | away the following assertions. Because assertions might be optimized | 4295 | away the following assertions. Because assertions might be optimized |
| 4709 | away, it is a bad idea for them to include side-effects. | 4296 | away, it is a bad idea for them to include side-effects. |
| 4710 | 4297 | ||
| 4711 | @defspec assert test-form [show-args string args@dots{}] | 4298 | @defmac cl-assert test-form [show-args string args@dots{}] |
| 4712 | This form verifies that @var{test-form} is true (i.e., evaluates to | 4299 | This form verifies that @var{test-form} is true (i.e., evaluates to |
| 4713 | a non-@code{nil} value). If so, it returns @code{nil}. If the test | 4300 | a non-@code{nil} value). If so, it returns @code{nil}. If the test |
| 4714 | is not satisfied, @code{assert} signals an error. | 4301 | is not satisfied, @code{cl-assert} signals an error. |
| 4715 | 4302 | ||
| 4716 | A default error message will be supplied which includes @var{test-form}. | 4303 | A default error message will be supplied which includes @var{test-form}. |
| 4717 | You can specify a different error message by including a @var{string} | 4304 | You can specify a different error message by including a @var{string} |
| @@ -4724,7 +4311,7 @@ will also include all non-constant arguments of the top-level | |||
| 4724 | @var{form}. For example: | 4311 | @var{form}. For example: |
| 4725 | 4312 | ||
| 4726 | @example | 4313 | @example |
| 4727 | (assert (> x 10) t "x is too small: %d") | 4314 | (cl-assert (> x 10) t "x is too small: %d") |
| 4728 | @end example | 4315 | @end example |
| 4729 | 4316 | ||
| 4730 | This usage of @var{show-args} is an extension to Common Lisp. In | 4317 | This usage of @var{show-args} is an extension to Common Lisp. In |
| @@ -4732,18 +4319,18 @@ true Common Lisp, the second argument gives a list of @var{places} | |||
| 4732 | which can be @code{setf}'d by the user before continuing from the | 4319 | which can be @code{setf}'d by the user before continuing from the |
| 4733 | error. Since Emacs Lisp does not support continuable errors, it | 4320 | error. Since Emacs Lisp does not support continuable errors, it |
| 4734 | makes no sense to specify @var{places}. | 4321 | makes no sense to specify @var{places}. |
| 4735 | @end defspec | 4322 | @end defmac |
| 4736 | 4323 | ||
| 4737 | @defspec check-type form type [string] | 4324 | @defmac cl-check-type form type [string] |
| 4738 | This form verifies that @var{form} evaluates to a value of type | 4325 | This form verifies that @var{form} evaluates to a value of type |
| 4739 | @var{type}. If so, it returns @code{nil}. If not, @code{check-type} | 4326 | @var{type}. If so, it returns @code{nil}. If not, @code{cl-check-type} |
| 4740 | signals a @code{wrong-type-argument} error. The default error message | 4327 | signals a @code{wrong-type-argument} error. The default error message |
| 4741 | lists the erroneous value along with @var{type} and @var{form} | 4328 | lists the erroneous value along with @var{type} and @var{form} |
| 4742 | themselves. If @var{string} is specified, it is included in the | 4329 | themselves. If @var{string} is specified, it is included in the |
| 4743 | error message in place of @var{type}. For example: | 4330 | error message in place of @var{type}. For example: |
| 4744 | 4331 | ||
| 4745 | @example | 4332 | @example |
| 4746 | (check-type x (integer 1 *) "a positive integer") | 4333 | (cl-check-type x (integer 1 *) "a positive integer") |
| 4747 | @end example | 4334 | @end example |
| 4748 | 4335 | ||
| 4749 | @xref{Type Predicates}, for a description of the type specifiers | 4336 | @xref{Type Predicates}, for a description of the type specifiers |
| @@ -4753,18 +4340,7 @@ Note that in Common Lisp, the first argument to @code{check-type} | |||
| 4753 | must be a @var{place} suitable for use by @code{setf}, because | 4340 | must be a @var{place} suitable for use by @code{setf}, because |
| 4754 | @code{check-type} signals a continuable error that allows the | 4341 | @code{check-type} signals a continuable error that allows the |
| 4755 | user to modify @var{place}. | 4342 | user to modify @var{place}. |
| 4756 | @end defspec | 4343 | @end defmac |
| 4757 | |||
| 4758 | The following error-related macro is also defined: | ||
| 4759 | |||
| 4760 | @defspec ignore-errors forms@dots{} | ||
| 4761 | This executes @var{forms} exactly like a @code{progn}, except that | ||
| 4762 | errors are ignored during the @var{forms}. More precisely, if | ||
| 4763 | an error is signaled then @code{ignore-errors} immediately | ||
| 4764 | aborts execution of the @var{forms} and returns @code{nil}. | ||
| 4765 | If the @var{forms} complete successfully, @code{ignore-errors} | ||
| 4766 | returns the result of the last @var{form}. | ||
| 4767 | @end defspec | ||
| 4768 | 4344 | ||
| 4769 | @node Efficiency Concerns | 4345 | @node Efficiency Concerns |
| 4770 | @appendix Efficiency Concerns | 4346 | @appendix Efficiency Concerns |
| @@ -4772,38 +4348,35 @@ returns the result of the last @var{form}. | |||
| 4772 | @appendixsec Macros | 4348 | @appendixsec Macros |
| 4773 | 4349 | ||
| 4774 | @noindent | 4350 | @noindent |
| 4775 | Many of the advanced features of this package, such as @code{defun*}, | 4351 | Many of the advanced features of this package, such as @code{cl-defun}, |
| 4776 | @code{loop}, and @code{setf}, are implemented as Lisp macros. In | 4352 | @code{cl-loop}, etc., are implemented as Lisp macros. In |
| 4777 | byte-compiled code, these complex notations will be expanded into | 4353 | byte-compiled code, these complex notations will be expanded into |
| 4778 | equivalent Lisp code which is simple and efficient. For example, | 4354 | equivalent Lisp code which is simple and efficient. For example, |
| 4779 | the forms | 4355 | the form |
| 4780 | 4356 | ||
| 4781 | @example | 4357 | @example |
| 4782 | (incf i n) | 4358 | (cl-incf i n) |
| 4783 | (push x (car p)) | ||
| 4784 | @end example | 4359 | @end example |
| 4785 | 4360 | ||
| 4786 | @noindent | 4361 | @noindent |
| 4787 | are expanded at compile-time to the Lisp forms | 4362 | is expanded at compile-time to the Lisp form |
| 4788 | 4363 | ||
| 4789 | @example | 4364 | @example |
| 4790 | (setq i (+ i n)) | 4365 | (setq i (+ i n)) |
| 4791 | (setcar p (cons x (car p))) | ||
| 4792 | @end example | 4366 | @end example |
| 4793 | 4367 | ||
| 4794 | @noindent | 4368 | @noindent |
| 4795 | which are the most efficient ways of doing these respective operations | 4369 | which is the most efficient ways of doing this operation |
| 4796 | in Lisp. Thus, there is no performance penalty for using the more | 4370 | in Lisp. Thus, there is no performance penalty for using the more |
| 4797 | readable @code{incf} and @code{push} forms in your compiled code. | 4371 | readable @code{cl-incf} form in your compiled code. |
| 4798 | 4372 | ||
| 4799 | @emph{Interpreted} code, on the other hand, must expand these macros | 4373 | @emph{Interpreted} code, on the other hand, must expand these macros |
| 4800 | every time they are executed. For this reason it is strongly | 4374 | every time they are executed. For this reason it is strongly |
| 4801 | recommended that code making heavy use of macros be compiled. | 4375 | recommended that code making heavy use of macros be compiled. |
| 4802 | (The features labeled ``Special Form'' instead of ``Function'' in | 4376 | A loop using @code{cl-incf} a hundred times will execute considerably |
| 4803 | this manual are macros.) A loop using @code{incf} a hundred times | 4377 | faster if compiled, and will also garbage-collect less because the |
| 4804 | will execute considerably faster if compiled, and will also | 4378 | macro expansion will not have to be generated, used, and thrown away a |
| 4805 | garbage-collect less because the macro expansion will not have | 4379 | hundred times. |
| 4806 | to be generated, used, and thrown away a hundred times. | ||
| 4807 | 4380 | ||
| 4808 | You can find out how a macro expands by using the | 4381 | You can find out how a macro expands by using the |
| 4809 | @code{cl-prettyexpand} function. | 4382 | @code{cl-prettyexpand} function. |
| @@ -4813,10 +4386,10 @@ This function takes a single Lisp form as an argument and inserts | |||
| 4813 | a nicely formatted copy of it in the current buffer (which must be | 4386 | a nicely formatted copy of it in the current buffer (which must be |
| 4814 | in Lisp mode so that indentation works properly). It also expands | 4387 | in Lisp mode so that indentation works properly). It also expands |
| 4815 | all Lisp macros which appear in the form. The easiest way to use | 4388 | all Lisp macros which appear in the form. The easiest way to use |
| 4816 | this function is to go to the @code{*scratch*} buffer and type, say, | 4389 | this function is to go to the @file{*scratch*} buffer and type, say, |
| 4817 | 4390 | ||
| 4818 | @example | 4391 | @example |
| 4819 | (cl-prettyexpand '(loop for x below 10 collect x)) | 4392 | (cl-prettyexpand '(cl-loop for x below 10 collect x)) |
| 4820 | @end example | 4393 | @end example |
| 4821 | 4394 | ||
| 4822 | @noindent | 4395 | @noindent |
| @@ -4824,36 +4397,36 @@ and type @kbd{C-x C-e} immediately after the closing parenthesis; | |||
| 4824 | the expansion | 4397 | the expansion |
| 4825 | 4398 | ||
| 4826 | @example | 4399 | @example |
| 4827 | (block nil | 4400 | (cl-block nil |
| 4828 | (let* ((x 0) | 4401 | (let* ((x 0) |
| 4829 | (G1004 nil)) | 4402 | (G1004 nil)) |
| 4830 | (while (< x 10) | 4403 | (while (< x 10) |
| 4831 | (setq G1004 (cons x G1004)) | 4404 | (setq G1004 (cons x G1004)) |
| 4832 | (setq x (+ x 1))) | 4405 | (setq x (+ x 1))) |
| 4833 | (nreverse G1004))) | 4406 | (nreverse G1004))) |
| 4834 | @end example | 4407 | @end example |
| 4835 | 4408 | ||
| 4836 | @noindent | 4409 | @noindent |
| 4837 | will be inserted into the buffer. (The @code{block} macro is | 4410 | will be inserted into the buffer. (The @code{cl-block} macro is |
| 4838 | expanded differently in the interpreter and compiler, so | 4411 | expanded differently in the interpreter and compiler, so |
| 4839 | @code{cl-prettyexpand} just leaves it alone. The temporary | 4412 | @code{cl-prettyexpand} just leaves it alone. The temporary |
| 4840 | variable @code{G1004} was created by @code{gensym}.) | 4413 | variable @code{G1004} was created by @code{cl-gensym}.) |
| 4841 | 4414 | ||
| 4842 | If the optional argument @var{full} is true, then @emph{all} | 4415 | If the optional argument @var{full} is true, then @emph{all} |
| 4843 | macros are expanded, including @code{block}, @code{eval-when}, | 4416 | macros are expanded, including @code{cl-block}, @code{cl-eval-when}, |
| 4844 | and compiler macros. Expansion is done as if @var{form} were | 4417 | and compiler macros. Expansion is done as if @var{form} were |
| 4845 | a top-level form in a file being compiled. For example, | 4418 | a top-level form in a file being compiled. For example, |
| 4846 | 4419 | ||
| 4847 | @example | 4420 | @example |
| 4848 | (cl-prettyexpand '(pushnew 'x list)) | 4421 | (cl-prettyexpand '(cl-pushnew 'x list)) |
| 4849 | @print{} (setq list (adjoin 'x list)) | 4422 | @print{} (setq list (cl-adjoin 'x list)) |
| 4850 | (cl-prettyexpand '(pushnew 'x list) t) | 4423 | (cl-prettyexpand '(cl-pushnew 'x list) t) |
| 4851 | @print{} (setq list (if (memq 'x list) list (cons 'x list))) | 4424 | @print{} (setq list (if (memq 'x list) list (cons 'x list))) |
| 4852 | (cl-prettyexpand '(caddr (member* 'a list)) t) | 4425 | (cl-prettyexpand '(caddr (cl-member 'a list)) t) |
| 4853 | @print{} (car (cdr (cdr (memq 'a list)))) | 4426 | @print{} (car (cdr (cdr (memq 'a list)))) |
| 4854 | @end example | 4427 | @end example |
| 4855 | 4428 | ||
| 4856 | Note that @code{adjoin}, @code{caddr}, and @code{member*} all | 4429 | Note that @code{cl-adjoin}, @code{cl-caddr}, and @code{cl-member} all |
| 4857 | have built-in compiler macros to optimize them in common cases. | 4430 | have built-in compiler macros to optimize them in common cases. |
| 4858 | @end defun | 4431 | @end defun |
| 4859 | 4432 | ||
| @@ -4875,22 +4448,22 @@ phrase ``it is an error if'' to indicate a situation which is not | |||
| 4875 | supposed to arise in complying programs; implementations are strongly | 4448 | supposed to arise in complying programs; implementations are strongly |
| 4876 | encouraged but not required to signal an error in these situations. | 4449 | encouraged but not required to signal an error in these situations. |
| 4877 | This package sometimes omits such error checking in the interest of | 4450 | This package sometimes omits such error checking in the interest of |
| 4878 | compactness and efficiency. For example, @code{do} variable | 4451 | compactness and efficiency. For example, @code{cl-do} variable |
| 4879 | specifiers are supposed to be lists of one, two, or three forms; | 4452 | specifiers are supposed to be lists of one, two, or three forms; |
| 4880 | extra forms are ignored by this package rather than signaling a | 4453 | extra forms are ignored by this package rather than signaling a |
| 4881 | syntax error. The @code{endp} function is simply a synonym for | 4454 | syntax error. The @code{cl-endp} function is simply a synonym for |
| 4882 | @code{null} in this package. Functions taking keyword arguments | 4455 | @code{null} in this package. Functions taking keyword arguments |
| 4883 | will accept an odd number of arguments, treating the trailing | 4456 | will accept an odd number of arguments, treating the trailing |
| 4884 | keyword as if it were followed by the value @code{nil}. | 4457 | keyword as if it were followed by the value @code{nil}. |
| 4885 | 4458 | ||
| 4886 | Argument lists (as processed by @code{defun*} and friends) | 4459 | Argument lists (as processed by @code{cl-defun} and friends) |
| 4887 | @emph{are} checked rigorously except for the minor point just | 4460 | @emph{are} checked rigorously except for the minor point just |
| 4888 | mentioned; in particular, keyword arguments are checked for | 4461 | mentioned; in particular, keyword arguments are checked for |
| 4889 | validity, and @code{&allow-other-keys} and @code{:allow-other-keys} | 4462 | validity, and @code{&allow-other-keys} and @code{:allow-other-keys} |
| 4890 | are fully implemented. Keyword validity checking is slightly | 4463 | are fully implemented. Keyword validity checking is slightly |
| 4891 | time consuming (though not too bad in byte-compiled code); | 4464 | time consuming (though not too bad in byte-compiled code); |
| 4892 | you can use @code{&allow-other-keys} to omit this check. Functions | 4465 | you can use @code{&allow-other-keys} to omit this check. Functions |
| 4893 | defined in this package such as @code{find} and @code{member*} | 4466 | defined in this package such as @code{cl-find} and @code{cl-member} |
| 4894 | do check their keyword arguments for validity. | 4467 | do check their keyword arguments for validity. |
| 4895 | 4468 | ||
| 4896 | @ifinfo | 4469 | @ifinfo |
| @@ -4904,10 +4477,10 @@ do check their keyword arguments for validity. | |||
| 4904 | Use of the optimizing Emacs compiler is highly recommended; many of the Common | 4477 | Use of the optimizing Emacs compiler is highly recommended; many of the Common |
| 4905 | Lisp macros emit | 4478 | Lisp macros emit |
| 4906 | code which can be improved by optimization. In particular, | 4479 | code which can be improved by optimization. In particular, |
| 4907 | @code{block}s (whether explicit or implicit in constructs like | 4480 | @code{cl-block}s (whether explicit or implicit in constructs like |
| 4908 | @code{defun*} and @code{loop}) carry a fair run-time penalty; the | 4481 | @code{cl-defun} and @code{cl-loop}) carry a fair run-time penalty; the |
| 4909 | optimizing compiler removes @code{block}s which are not actually | 4482 | optimizing compiler removes @code{cl-block}s which are not actually |
| 4910 | referenced by @code{return} or @code{return-from} inside the block. | 4483 | referenced by @code{cl-return} or @code{cl-return-from} inside the block. |
| 4911 | 4484 | ||
| 4912 | @node Common Lisp Compatibility | 4485 | @node Common Lisp Compatibility |
| 4913 | @appendix Common Lisp Compatibility | 4486 | @appendix Common Lisp Compatibility |
| @@ -4916,42 +4489,38 @@ referenced by @code{return} or @code{return-from} inside the block. | |||
| 4916 | Following is a list of all known incompatibilities between this | 4489 | Following is a list of all known incompatibilities between this |
| 4917 | package and Common Lisp as documented in Steele (2nd edition). | 4490 | package and Common Lisp as documented in Steele (2nd edition). |
| 4918 | 4491 | ||
| 4919 | Certain function names, such as @code{member}, @code{assoc}, and | 4492 | The word @code{cl-defun} is required instead of @code{defun} in order |
| 4920 | @code{floor}, were already taken by (incompatible) Emacs Lisp | ||
| 4921 | functions; this package appends @samp{*} to the names of its | ||
| 4922 | Common Lisp versions of these functions. | ||
| 4923 | |||
| 4924 | The word @code{defun*} is required instead of @code{defun} in order | ||
| 4925 | to use extended Common Lisp argument lists in a function. Likewise, | 4493 | to use extended Common Lisp argument lists in a function. Likewise, |
| 4926 | @code{defmacro*} and @code{function*} are versions of those forms | 4494 | @code{cl-defmacro} and @code{cl-function} are versions of those forms |
| 4927 | which understand full-featured argument lists. The @code{&whole} | 4495 | which understand full-featured argument lists. The @code{&whole} |
| 4928 | keyword does not work in @code{defmacro} argument lists (except | 4496 | keyword does not work in @code{defmacro} argument lists (except |
| 4929 | inside recursive argument lists). | 4497 | inside recursive argument lists). |
| 4930 | 4498 | ||
| 4931 | The @code{equal} predicate does not distinguish | 4499 | The @code{equal} predicate does not distinguish |
| 4932 | between IEEE floating-point plus and minus zero. The @code{equalp} | 4500 | between IEEE floating-point plus and minus zero. The @code{cl-equalp} |
| 4933 | predicate has several differences with Common Lisp; @pxref{Predicates}. | 4501 | predicate has several differences with Common Lisp; @pxref{Predicates}. |
| 4934 | 4502 | ||
| 4503 | @c FIXME no longer provided by cl. | ||
| 4935 | The @code{setf} mechanism is entirely compatible, except that | 4504 | The @code{setf} mechanism is entirely compatible, except that |
| 4936 | setf-methods return a list of five values rather than five | 4505 | setf-methods return a list of five values rather than five |
| 4937 | values directly. Also, the new ``@code{setf} function'' concept | 4506 | values directly. Also, the new ``@code{setf} function'' concept |
| 4938 | (typified by @code{(defun (setf foo) @dots{})}) is not implemented. | 4507 | (typified by @code{(defun (setf foo) @dots{})}) is not implemented. |
| 4939 | 4508 | ||
| 4940 | The @code{do-all-symbols} form is the same as @code{do-symbols} | 4509 | The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols} |
| 4941 | with no @var{obarray} argument. In Common Lisp, this form would | 4510 | with no @var{obarray} argument. In Common Lisp, this form would |
| 4942 | iterate over all symbols in all packages. Since Emacs obarrays | 4511 | iterate over all symbols in all packages. Since Emacs obarrays |
| 4943 | are not a first-class package mechanism, there is no way for | 4512 | are not a first-class package mechanism, there is no way for |
| 4944 | @code{do-all-symbols} to locate any but the default obarray. | 4513 | @code{cl-do-all-symbols} to locate any but the default obarray. |
| 4945 | 4514 | ||
| 4946 | The @code{loop} macro is complete except that @code{loop-finish} | 4515 | The @code{cl-loop} macro is complete except that @code{loop-finish} |
| 4947 | and type specifiers are unimplemented. | 4516 | and type specifiers are unimplemented. |
| 4948 | 4517 | ||
| 4949 | The multiple-value return facility treats lists as multiple | 4518 | The multiple-value return facility treats lists as multiple |
| 4950 | values, since Emacs Lisp cannot support multiple return values | 4519 | values, since Emacs Lisp cannot support multiple return values |
| 4951 | directly. The macros will be compatible with Common Lisp if | 4520 | directly. The macros will be compatible with Common Lisp if |
| 4952 | @code{values} or @code{values-list} is always used to return to | 4521 | @code{cl-values} or @code{cl-values-list} is always used to return to |
| 4953 | a @code{multiple-value-bind} or other multiple-value receiver; | 4522 | a @code{cl-multiple-value-bind} or other multiple-value receiver; |
| 4954 | if @code{values} is used without @code{multiple-value-@dots{}} | 4523 | if @code{cl-values} is used without @code{cl-multiple-value-@dots{}} |
| 4955 | or vice-versa the effect will be different from Common Lisp. | 4524 | or vice-versa the effect will be different from Common Lisp. |
| 4956 | 4525 | ||
| 4957 | Many Common Lisp declarations are ignored, and others match | 4526 | Many Common Lisp declarations are ignored, and others match |
| @@ -4960,117 +4529,16 @@ example, local @code{special} declarations, which are purely | |||
| 4960 | advisory in Emacs Lisp, do not rigorously obey the scoping rules | 4529 | advisory in Emacs Lisp, do not rigorously obey the scoping rules |
| 4961 | set down in Steele's book. | 4530 | set down in Steele's book. |
| 4962 | 4531 | ||
| 4963 | The variable @code{*gensym-counter*} starts out with a pseudo-random | 4532 | The variable @code{cl--gensym-counter} starts out with a pseudo-random |
| 4964 | value rather than with zero. This is to cope with the fact that | 4533 | value rather than with zero. This is to cope with the fact that |
| 4965 | generated symbols become interned when they are written to and | 4534 | generated symbols become interned when they are written to and |
| 4966 | loaded back from a file. | 4535 | loaded back from a file. |
| 4967 | 4536 | ||
| 4968 | The @code{defstruct} facility is compatible, except that structures | 4537 | The @code{cl-defstruct} facility is compatible, except that structures |
| 4969 | are of type @code{:type vector :named} by default rather than some | 4538 | are of type @code{:type vector :named} by default rather than some |
| 4970 | special, distinct type. Also, the @code{:type} slot option is ignored. | 4539 | special, distinct type. Also, the @code{:type} slot option is ignored. |
| 4971 | 4540 | ||
| 4972 | The second argument of @code{check-type} is treated differently. | 4541 | The second argument of @code{cl-check-type} is treated differently. |
| 4973 | |||
| 4974 | @node Old CL Compatibility | ||
| 4975 | @appendix Old CL Compatibility | ||
| 4976 | |||
| 4977 | @noindent | ||
| 4978 | Following is a list of all known incompatibilities between this package | ||
| 4979 | and the older Quiroz @file{cl.el} package. | ||
| 4980 | |||
| 4981 | This package's emulation of multiple return values in functions is | ||
| 4982 | incompatible with that of the older package. That package attempted | ||
| 4983 | to come as close as possible to true Common Lisp multiple return | ||
| 4984 | values; unfortunately, it could not be 100% reliable and so was prone | ||
| 4985 | to occasional surprises if used freely. This package uses a simpler | ||
| 4986 | method, namely replacing multiple values with lists of values, which | ||
| 4987 | is more predictable though more noticeably different from Common Lisp. | ||
| 4988 | |||
| 4989 | The @code{defkeyword} form and @code{keywordp} function are not | ||
| 4990 | implemented in this package. | ||
| 4991 | |||
| 4992 | The @code{member}, @code{floor}, @code{ceiling}, @code{truncate}, | ||
| 4993 | @code{round}, @code{mod}, and @code{rem} functions are suffixed | ||
| 4994 | by @samp{*} in this package to avoid collision with existing | ||
| 4995 | functions in Emacs. The older package simply | ||
| 4996 | redefined these functions, overwriting the built-in meanings and | ||
| 4997 | causing serious portability problems. (Some more | ||
| 4998 | recent versions of the Quiroz package changed the names to | ||
| 4999 | @code{cl-member}, etc.; this package defines the latter names as | ||
| 5000 | aliases for @code{member*}, etc.) | ||
| 5001 | |||
| 5002 | Certain functions in the old package which were buggy or inconsistent | ||
| 5003 | with the Common Lisp standard are incompatible with the conforming | ||
| 5004 | versions in this package. For example, @code{eql} and @code{member} | ||
| 5005 | were synonyms for @code{eq} and @code{memq} in that package, @code{setf} | ||
| 5006 | failed to preserve correct order of evaluation of its arguments, etc. | ||
| 5007 | |||
| 5008 | Finally, unlike the older package, this package is careful to | ||
| 5009 | prefix all of its internal names with @code{cl-}. Except for a | ||
| 5010 | few functions which are explicitly defined as additional features | ||
| 5011 | (such as @code{floatp-safe} and @code{letf}), this package does not | ||
| 5012 | export any non-@samp{cl-} symbols which are not also part of Common | ||
| 5013 | Lisp. | ||
| 5014 | |||
| 5015 | @ifinfo | ||
| 5016 | @example | ||
| 5017 | |||
| 5018 | @end example | ||
| 5019 | @end ifinfo | ||
| 5020 | @appendixsec The @code{cl-compat} package | ||
| 5021 | |||
| 5022 | @noindent | ||
| 5023 | The @code{CL} package includes emulations of some features of the | ||
| 5024 | old @file{cl.el}, in the form of a compatibility package | ||
| 5025 | @code{cl-compat}. This file is obsolete and may be removed in future, | ||
| 5026 | so it should not be used in new code. | ||
| 5027 | |||
| 5028 | The old package defined a number of internal routines without | ||
| 5029 | @code{cl-} prefixes or other annotations. Call to these routines | ||
| 5030 | may have crept into existing Lisp code. @code{cl-compat} | ||
| 5031 | provides emulations of the following internal routines: | ||
| 5032 | @code{pair-with-newsyms}, @code{zip-lists}, @code{unzip-lists}, | ||
| 5033 | @code{reassemble-arglists}, @code{duplicate-symbols-p}, | ||
| 5034 | @code{safe-idiv}. | ||
| 5035 | |||
| 5036 | Some @code{setf} forms translated into calls to internal | ||
| 5037 | functions that user code might call directly. The functions | ||
| 5038 | @code{setnth}, @code{setnthcdr}, and @code{setelt} fall in | ||
| 5039 | this category; they are defined by @code{cl-compat}, but the | ||
| 5040 | best fix is to change to use @code{setf} properly. | ||
| 5041 | |||
| 5042 | The @code{cl-compat} file defines the keyword functions | ||
| 5043 | @code{keywordp}, @code{keyword-of}, and @code{defkeyword}, | ||
| 5044 | which are not defined by the new @code{CL} package because the | ||
| 5045 | use of keywords as data is discouraged. | ||
| 5046 | |||
| 5047 | The @code{build-klist} mechanism for parsing keyword arguments | ||
| 5048 | is emulated by @code{cl-compat}; the @code{with-keyword-args} | ||
| 5049 | macro is not, however, and in any case it's best to change to | ||
| 5050 | use the more natural keyword argument processing offered by | ||
| 5051 | @code{defun*}. | ||
| 5052 | |||
| 5053 | Multiple return values are treated differently by the two | ||
| 5054 | Common Lisp packages. The old package's method was more | ||
| 5055 | compatible with true Common Lisp, though it used heuristics | ||
| 5056 | that caused it to report spurious multiple return values in | ||
| 5057 | certain cases. The @code{cl-compat} package defines a set | ||
| 5058 | of multiple-value macros that are compatible with the old | ||
| 5059 | CL package; again, they are heuristic in nature, but they | ||
| 5060 | are guaranteed to work in any case where the old package's | ||
| 5061 | macros worked. To avoid name collision with the ``official'' | ||
| 5062 | multiple-value facilities, the ones in @code{cl-compat} have | ||
| 5063 | capitalized names: @code{Values}, @code{Values-list}, | ||
| 5064 | @code{Multiple-value-bind}, etc. | ||
| 5065 | |||
| 5066 | The functions @code{cl-floor}, @code{cl-ceiling}, @code{cl-truncate}, | ||
| 5067 | and @code{cl-round} are defined by @code{cl-compat} to use the | ||
| 5068 | old-style multiple-value mechanism, just as they did in the old | ||
| 5069 | package. The newer @code{floor*} and friends return their two | ||
| 5070 | results in a list rather than as multiple values. Note that | ||
| 5071 | older versions of the old package used the unadorned names | ||
| 5072 | @code{floor}, @code{ceiling}, etc.; @code{cl-compat} cannot use | ||
| 5073 | these names because they conflict with Emacs built-ins. | ||
| 5074 | 4542 | ||
| 5075 | @node Porting Common Lisp | 4543 | @node Porting Common Lisp |
| 5076 | @appendix Porting Common Lisp | 4544 | @appendix Porting Common Lisp |
| @@ -5100,19 +4568,17 @@ this convention, calls to Lisp builtins like @code{if} and | |||
| 5100 | 4568 | ||
| 5101 | @item | 4569 | @item |
| 5102 | Lexical scoping. In Common Lisp, function arguments and @code{let} | 4570 | Lexical scoping. In Common Lisp, function arguments and @code{let} |
| 5103 | bindings apply only to references physically within their bodies | 4571 | bindings apply only to references physically within their bodies (or |
| 5104 | (or within macro expansions in their bodies). Emacs Lisp, by | 4572 | within macro expansions in their bodies). Traditionally, Emacs Lisp |
| 5105 | contrast, uses @dfn{dynamic scoping} wherein a binding to a | 4573 | uses @dfn{dynamic scoping} wherein a binding to a variable is visible |
| 5106 | variable is visible even inside functions called from the body. | 4574 | even inside functions called from the body. |
| 5107 | 4575 | @xref{Dynamic Binding,,,elisp,GNU Emacs Lisp Reference Manual}. | |
| 5108 | Variables in Common Lisp can be made dynamically scoped by | 4576 | Lexical binding is available since Emacs 24.1, so be sure to set |
| 5109 | declaring them @code{special} or using @code{defvar}. In Emacs | 4577 | @code{lexical-binding} to @code{t} if you need to emulate this aspect |
| 5110 | Lisp it is as if all variables were declared @code{special}. | 4578 | of Common Lisp. @xref{Lexical Binding,,,elisp,GNU Emacs Lisp Reference Manual}. |
| 5111 | 4579 | ||
| 5112 | Often you can use code that was written for lexical scoping | 4580 | Here is an example of a Common Lisp code fragment that would fail in |
| 5113 | even in a dynamically scoped Lisp, but not always. Here is | 4581 | Emacs Lisp if @code{lexical-binding} were set to @code{nil}: |
| 5114 | an example of a Common Lisp code fragment that would fail in | ||
| 5115 | Emacs Lisp: | ||
| 5116 | 4582 | ||
| 5117 | @example | 4583 | @example |
| 5118 | (defun map-odd-elements (func list) | 4584 | (defun map-odd-elements (func list) |
| @@ -5125,20 +4591,16 @@ Emacs Lisp: | |||
| 5125 | @end example | 4591 | @end example |
| 5126 | 4592 | ||
| 5127 | @noindent | 4593 | @noindent |
| 5128 | In Common Lisp, the two functions' usages of @code{x} are completely | 4594 | With lexical binding, the two functions' usages of @code{x} are |
| 5129 | independent. In Emacs Lisp, the binding to @code{x} made by | 4595 | completely independent. With dynamic binding, the binding to @code{x} |
| 5130 | @code{add-odd-elements} will have been hidden by the binding | 4596 | made by @code{add-odd-elements} will have been hidden by the binding |
| 5131 | in @code{map-odd-elements} by the time the @code{(+ a x)} function | 4597 | in @code{map-odd-elements} by the time the @code{(+ a x)} function is |
| 5132 | is called. | 4598 | called. |
| 5133 | |||
| 5134 | (This package avoids such problems in its own mapping functions | ||
| 5135 | by using names like @code{cl-x} instead of @code{x} internally; | ||
| 5136 | as long as you don't use the @code{cl-} prefix for your own | ||
| 5137 | variables no collision can occur.) | ||
| 5138 | 4599 | ||
| 5139 | @xref{Lexical Bindings}, for a description of the @code{lexical-let} | 4600 | Internally, this package uses lexical binding so that such problems do |
| 5140 | form which establishes a Common Lisp-style lexical binding, and some | 4601 | not occur. @xref{Lexical Bindings}, for a description of the obsolete |
| 5141 | examples of how it differs from Emacs's regular @code{let}. | 4602 | @code{lexical-let} form that emulates a Common Lisp-style lexical |
| 4603 | binding when dynamic binding is in use. | ||
| 5142 | 4604 | ||
| 5143 | @item | 4605 | @item |
| 5144 | Reader macros. Common Lisp includes a second type of macro that | 4606 | Reader macros. Common Lisp includes a second type of macro that |
| @@ -5178,7 +4640,7 @@ Lisp, they are totally distinct in Emacs Lisp. Common Lisp | |||
| 5178 | programs which refer to a symbol by the full name sometimes | 4640 | programs which refer to a symbol by the full name sometimes |
| 5179 | and the short name other times will not port cleanly to Emacs. | 4641 | and the short name other times will not port cleanly to Emacs. |
| 5180 | 4642 | ||
| 5181 | Emacs Lisp does have a concept of ``obarrays,'' which are | 4643 | Emacs Lisp does have a concept of ``obarrays'', which are |
| 5182 | package-like collections of symbols, but this feature is not | 4644 | package-like collections of symbols, but this feature is not |
| 5183 | strong enough to be used as a true package mechanism. | 4645 | strong enough to be used as a true package mechanism. |
| 5184 | 4646 | ||
| @@ -5198,10 +4660,10 @@ codes provide such features as paragraph filling, case | |||
| 5198 | conversion, and even loops and conditionals. | 4660 | conversion, and even loops and conditionals. |
| 5199 | 4661 | ||
| 5200 | While it would have been possible to implement most of Common | 4662 | While it would have been possible to implement most of Common |
| 5201 | Lisp @code{format} in this package (under the name @code{format*}, | 4663 | Lisp @code{format} in this package (under the name @code{cl-format}, |
| 5202 | of course), it was not deemed worthwhile. It would have required | 4664 | of course), it was not deemed worthwhile. It would have required |
| 5203 | a huge amount of code to implement even a decent subset of | 4665 | a huge amount of code to implement even a decent subset of |
| 5204 | @code{format*}, yet the functionality it would provide over | 4666 | @code{cl-format}, yet the functionality it would provide over |
| 5205 | Emacs Lisp's @code{format} would rarely be useful. | 4667 | Emacs Lisp's @code{format} would rarely be useful. |
| 5206 | 4668 | ||
| 5207 | @item | 4669 | @item |
| @@ -5267,8 +4729,8 @@ where a more iteratively-minded programmer might write one of | |||
| 5267 | these forms: | 4729 | these forms: |
| 5268 | 4730 | ||
| 5269 | @example | 4731 | @example |
| 5270 | (let ((total 0)) (dolist (x my-list) (incf total x)) total) | 4732 | (let ((total 0)) (dolist (x my-list) (cl-incf total x)) total) |
| 5271 | (loop for x in my-list sum x) | 4733 | (cl-loop for x in my-list sum x) |
| 5272 | @end example | 4734 | @end example |
| 5273 | 4735 | ||
| 5274 | While this would be mainly a stylistic choice in most Common Lisps, | 4736 | While this would be mainly a stylistic choice in most Common Lisps, |
| @@ -5278,6 +4740,373 @@ note that the current Emacs Lisp compiler does not optimize tail | |||
| 5278 | recursion. | 4740 | recursion. |
| 5279 | @end itemize | 4741 | @end itemize |
| 5280 | 4742 | ||
| 4743 | @node Obsolete Features | ||
| 4744 | @appendix Obsolete Features | ||
| 4745 | |||
| 4746 | This section describes some features of the package that are obsolete | ||
| 4747 | and should not be used in new code. They are either only provided by | ||
| 4748 | the old @file{cl.el} entry point, not by the newer @file{cl-lib.el}; | ||
| 4749 | or where versions with a @samp{cl-} prefix do exist they do not behave | ||
| 4750 | in exactly the same way. | ||
| 4751 | |||
| 4752 | @menu | ||
| 4753 | * Lexical Bindings:: An approximation of lexical binding. | ||
| 4754 | * Obsolete Lexical Macros:: Obsolete macros using lexical-let. | ||
| 4755 | * Obsolete Setf Customization:: Obsolete ways to customize setf. | ||
| 4756 | @end menu | ||
| 4757 | |||
| 4758 | @node Lexical Bindings | ||
| 4759 | @appendixsec Lexical Bindings | ||
| 4760 | |||
| 4761 | The following macros are extensions to Common Lisp, where all bindings | ||
| 4762 | are lexical unless declared otherwise. These features are likewise | ||
| 4763 | obsolete since the introduction of true lexical binding in Emacs 24.1. | ||
| 4764 | |||
| 4765 | @defmac lexical-let (bindings@dots{}) forms@dots{} | ||
| 4766 | This form is exactly like @code{let} except that the bindings it | ||
| 4767 | establishes are purely lexical. | ||
| 4768 | @end defmac | ||
| 4769 | |||
| 4770 | @c FIXME remove this and refer to elisp manual. | ||
| 4771 | @c Maybe merge some stuff from here to there? | ||
| 4772 | @noindent | ||
| 4773 | Lexical bindings are similar to local variables in a language like C: | ||
| 4774 | Only the code physically within the body of the @code{lexical-let} | ||
| 4775 | (after macro expansion) may refer to the bound variables. | ||
| 4776 | |||
| 4777 | @example | ||
| 4778 | (setq a 5) | ||
| 4779 | (defun foo (b) (+ a b)) | ||
| 4780 | (let ((a 2)) (foo a)) | ||
| 4781 | @result{} 4 | ||
| 4782 | (lexical-let ((a 2)) (foo a)) | ||
| 4783 | @result{} 7 | ||
| 4784 | @end example | ||
| 4785 | |||
| 4786 | @noindent | ||
| 4787 | In this example, a regular @code{let} binding of @code{a} actually | ||
| 4788 | makes a temporary change to the global variable @code{a}, so @code{foo} | ||
| 4789 | is able to see the binding of @code{a} to 2. But @code{lexical-let} | ||
| 4790 | actually creates a distinct local variable @code{a} for use within its | ||
| 4791 | body, without any effect on the global variable of the same name. | ||
| 4792 | |||
| 4793 | The most important use of lexical bindings is to create @dfn{closures}. | ||
| 4794 | A closure is a function object that refers to an outside lexical | ||
| 4795 | variable (@pxref{Closures,,,elisp,GNU Emacs Lisp Reference Manual}). | ||
| 4796 | For example: | ||
| 4797 | |||
| 4798 | @example | ||
| 4799 | (defun make-adder (n) | ||
| 4800 | (lexical-let ((n n)) | ||
| 4801 | (function (lambda (m) (+ n m))))) | ||
| 4802 | (setq add17 (make-adder 17)) | ||
| 4803 | (funcall add17 4) | ||
| 4804 | @result{} 21 | ||
| 4805 | @end example | ||
| 4806 | |||
| 4807 | @noindent | ||
| 4808 | The call @code{(make-adder 17)} returns a function object which adds | ||
| 4809 | 17 to its argument. If @code{let} had been used instead of | ||
| 4810 | @code{lexical-let}, the function object would have referred to the | ||
| 4811 | global @code{n}, which would have been bound to 17 only during the | ||
| 4812 | call to @code{make-adder} itself. | ||
| 4813 | |||
| 4814 | @example | ||
| 4815 | (defun make-counter () | ||
| 4816 | (lexical-let ((n 0)) | ||
| 4817 | (cl-function (lambda (&optional (m 1)) (cl-incf n m))))) | ||
| 4818 | (setq count-1 (make-counter)) | ||
| 4819 | (funcall count-1 3) | ||
| 4820 | @result{} 3 | ||
| 4821 | (funcall count-1 14) | ||
| 4822 | @result{} 17 | ||
| 4823 | (setq count-2 (make-counter)) | ||
| 4824 | (funcall count-2 5) | ||
| 4825 | @result{} 5 | ||
| 4826 | (funcall count-1 2) | ||
| 4827 | @result{} 19 | ||
| 4828 | (funcall count-2) | ||
| 4829 | @result{} 6 | ||
| 4830 | @end example | ||
| 4831 | |||
| 4832 | @noindent | ||
| 4833 | Here we see that each call to @code{make-counter} creates a distinct | ||
| 4834 | local variable @code{n}, which serves as a private counter for the | ||
| 4835 | function object that is returned. | ||
| 4836 | |||
| 4837 | Closed-over lexical variables persist until the last reference to | ||
| 4838 | them goes away, just like all other Lisp objects. For example, | ||
| 4839 | @code{count-2} refers to a function object which refers to an | ||
| 4840 | instance of the variable @code{n}; this is the only reference | ||
| 4841 | to that variable, so after @code{(setq count-2 nil)} the garbage | ||
| 4842 | collector would be able to delete this instance of @code{n}. | ||
| 4843 | Of course, if a @code{lexical-let} does not actually create any | ||
| 4844 | closures, then the lexical variables are free as soon as the | ||
| 4845 | @code{lexical-let} returns. | ||
| 4846 | |||
| 4847 | Many closures are used only during the extent of the bindings they | ||
| 4848 | refer to; these are known as ``downward funargs'' in Lisp parlance. | ||
| 4849 | When a closure is used in this way, regular Emacs Lisp dynamic | ||
| 4850 | bindings suffice and will be more efficient than @code{lexical-let} | ||
| 4851 | closures: | ||
| 4852 | |||
| 4853 | @example | ||
| 4854 | (defun add-to-list (x list) | ||
| 4855 | (mapcar (lambda (y) (+ x y))) list) | ||
| 4856 | (add-to-list 7 '(1 2 5)) | ||
| 4857 | @result{} (8 9 12) | ||
| 4858 | @end example | ||
| 4859 | |||
| 4860 | @noindent | ||
| 4861 | Since this lambda is only used while @code{x} is still bound, | ||
| 4862 | it is not necessary to make a true closure out of it. | ||
| 4863 | |||
| 4864 | You can use @code{defun} or @code{flet} inside a @code{lexical-let} | ||
| 4865 | to create a named closure. If several closures are created in the | ||
| 4866 | body of a single @code{lexical-let}, they all close over the same | ||
| 4867 | instance of the lexical variable. | ||
| 4868 | |||
| 4869 | @defmac lexical-let* (bindings@dots{}) forms@dots{} | ||
| 4870 | This form is just like @code{lexical-let}, except that the bindings | ||
| 4871 | are made sequentially in the manner of @code{let*}. | ||
| 4872 | @end defmac | ||
| 4873 | |||
| 4874 | @node Obsolete Lexical Macros | ||
| 4875 | @appendixsec Macros Defined Using Lexical-Let | ||
| 4876 | |||
| 4877 | The following macros are defined using @code{lexical-let}. | ||
| 4878 | They are replaced by versions with a @samp{cl-} prefix that use true | ||
| 4879 | lexical binding (and hence rely on @code{lexical-binding} being set to | ||
| 4880 | @code{t} in code using them). | ||
| 4881 | |||
| 4882 | @defmac flet (bindings@dots{}) forms@dots{} | ||
| 4883 | Replaced by @code{cl-flet} (@pxref{Function Bindings}) | ||
| 4884 | or @code{cl-letf} (@pxref{Modify Macros}). | ||
| 4885 | @end defmac | ||
| 4886 | |||
| 4887 | @defmac labels (bindings@dots{}) forms@dots{} | ||
| 4888 | Replaced by @code{cl-labels} (@pxref{Function Bindings}). | ||
| 4889 | @end defmac | ||
| 4890 | |||
| 4891 | @defmac letf (bindings@dots{}) forms@dots{} | ||
| 4892 | This macro is almost exactly the same as @code{cl-letf}, which | ||
| 4893 | replaces it (@pxref{Modify Macros}). The only difference is in | ||
| 4894 | details that relate to some deprecated usage of @code{symbol-function} | ||
| 4895 | in place forms. | ||
| 4896 | @end defmac | ||
| 4897 | |||
| 4898 | @node Obsolete Setf Customization | ||
| 4899 | @appendixsec Obsolete Ways to Customize Setf | ||
| 4900 | |||
| 4901 | Common Lisp defines three macros, @code{define-modify-macro}, | ||
| 4902 | @code{defsetf}, and @code{define-setf-method}, that allow the | ||
| 4903 | user to extend generalized variables in various ways. | ||
| 4904 | In Emacs, these are obsolete, replaced by various features of | ||
| 4905 | @file{gv.el} in Emacs 24.3. | ||
| 4906 | @c FIXME details. | ||
| 4907 | |||
| 4908 | @defmac define-modify-macro name arglist function [doc-string] | ||
| 4909 | This macro defines a ``read-modify-write'' macro similar to | ||
| 4910 | @code{cl-incf} and @code{cl-decf}. The macro @var{name} is defined | ||
| 4911 | to take a @var{place} argument followed by additional arguments | ||
| 4912 | described by @var{arglist}. The call | ||
| 4913 | |||
| 4914 | @example | ||
| 4915 | (@var{name} @var{place} @var{args}...) | ||
| 4916 | @end example | ||
| 4917 | |||
| 4918 | @noindent | ||
| 4919 | will be expanded to | ||
| 4920 | |||
| 4921 | @example | ||
| 4922 | (cl-callf @var{func} @var{place} @var{args}...) | ||
| 4923 | @end example | ||
| 4924 | |||
| 4925 | @noindent | ||
| 4926 | which in turn is roughly equivalent to | ||
| 4927 | |||
| 4928 | @example | ||
| 4929 | (setf @var{place} (@var{func} @var{place} @var{args}...)) | ||
| 4930 | @end example | ||
| 4931 | |||
| 4932 | For example: | ||
| 4933 | |||
| 4934 | @example | ||
| 4935 | (define-modify-macro cl-incf (&optional (n 1)) +) | ||
| 4936 | (define-modify-macro cl-concatf (&rest args) concat) | ||
| 4937 | @end example | ||
| 4938 | |||
| 4939 | Note that @code{&key} is not allowed in @var{arglist}, but | ||
| 4940 | @code{&rest} is sufficient to pass keywords on to the function. | ||
| 4941 | |||
| 4942 | Most of the modify macros defined by Common Lisp do not exactly | ||
| 4943 | follow the pattern of @code{define-modify-macro}. For example, | ||
| 4944 | @code{push} takes its arguments in the wrong order, and @code{pop} | ||
| 4945 | is completely irregular. You can define these macros ``by hand'' | ||
| 4946 | using @code{get-setf-method}, or consult the source | ||
| 4947 | to see how to use the internal @code{setf} building blocks. | ||
| 4948 | @end defmac | ||
| 4949 | |||
| 4950 | @defmac defsetf access-fn update-fn | ||
| 4951 | This is the simpler of two @code{defsetf} forms. Where | ||
| 4952 | @var{access-fn} is the name of a function which accesses a place, | ||
| 4953 | this declares @var{update-fn} to be the corresponding store | ||
| 4954 | function. From now on, | ||
| 4955 | |||
| 4956 | @example | ||
| 4957 | (setf (@var{access-fn} @var{arg1} @var{arg2} @var{arg3}) @var{value}) | ||
| 4958 | @end example | ||
| 4959 | |||
| 4960 | @noindent | ||
| 4961 | will be expanded to | ||
| 4962 | |||
| 4963 | @example | ||
| 4964 | (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} @var{value}) | ||
| 4965 | @end example | ||
| 4966 | |||
| 4967 | @noindent | ||
| 4968 | The @var{update-fn} is required to be either a true function, or | ||
| 4969 | a macro which evaluates its arguments in a function-like way. Also, | ||
| 4970 | the @var{update-fn} is expected to return @var{value} as its result. | ||
| 4971 | Otherwise, the above expansion would not obey the rules for the way | ||
| 4972 | @code{setf} is supposed to behave. | ||
| 4973 | |||
| 4974 | As a special (non-Common-Lisp) extension, a third argument of @code{t} | ||
| 4975 | to @code{defsetf} says that the @code{update-fn}'s return value is | ||
| 4976 | not suitable, so that the above @code{setf} should be expanded to | ||
| 4977 | something more like | ||
| 4978 | |||
| 4979 | @example | ||
| 4980 | (let ((temp @var{value})) | ||
| 4981 | (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} temp) | ||
| 4982 | temp) | ||
| 4983 | @end example | ||
| 4984 | |||
| 4985 | Some examples of the use of @code{defsetf}, drawn from the standard | ||
| 4986 | suite of setf methods, are: | ||
| 4987 | |||
| 4988 | @example | ||
| 4989 | (defsetf car setcar) | ||
| 4990 | (defsetf symbol-value set) | ||
| 4991 | (defsetf buffer-name rename-buffer t) | ||
| 4992 | @end example | ||
| 4993 | @end defmac | ||
| 4994 | |||
| 4995 | @defmac defsetf access-fn arglist (store-var) forms@dots{} | ||
| 4996 | This is the second, more complex, form of @code{defsetf}. It is | ||
| 4997 | rather like @code{defmacro} except for the additional @var{store-var} | ||
| 4998 | argument. The @var{forms} should return a Lisp form which stores | ||
| 4999 | the value of @var{store-var} into the generalized variable formed | ||
| 5000 | by a call to @var{access-fn} with arguments described by @var{arglist}. | ||
| 5001 | The @var{forms} may begin with a string which documents the @code{setf} | ||
| 5002 | method (analogous to the doc string that appears at the front of a | ||
| 5003 | function). | ||
| 5004 | |||
| 5005 | For example, the simple form of @code{defsetf} is shorthand for | ||
| 5006 | |||
| 5007 | @example | ||
| 5008 | (defsetf @var{access-fn} (&rest args) (store) | ||
| 5009 | (append '(@var{update-fn}) args (list store))) | ||
| 5010 | @end example | ||
| 5011 | |||
| 5012 | The Lisp form that is returned can access the arguments from | ||
| 5013 | @var{arglist} and @var{store-var} in an unrestricted fashion; | ||
| 5014 | macros like @code{setf} and @code{cl-incf} which invoke this | ||
| 5015 | setf-method will insert temporary variables as needed to make | ||
| 5016 | sure the apparent order of evaluation is preserved. | ||
| 5017 | |||
| 5018 | Another example drawn from the standard package: | ||
| 5019 | |||
| 5020 | @example | ||
| 5021 | (defsetf nth (n x) (store) | ||
| 5022 | (list 'setcar (list 'nthcdr n x) store)) | ||
| 5023 | @end example | ||
| 5024 | @end defmac | ||
| 5025 | |||
| 5026 | @defmac define-setf-method access-fn arglist forms@dots{} | ||
| 5027 | This is the most general way to create new place forms. When | ||
| 5028 | a @code{setf} to @var{access-fn} with arguments described by | ||
| 5029 | @var{arglist} is expanded, the @var{forms} are evaluated and | ||
| 5030 | must return a list of five items: | ||
| 5031 | |||
| 5032 | @enumerate | ||
| 5033 | @item | ||
| 5034 | A list of @dfn{temporary variables}. | ||
| 5035 | |||
| 5036 | @item | ||
| 5037 | A list of @dfn{value forms} corresponding to the temporary variables | ||
| 5038 | above. The temporary variables will be bound to these value forms | ||
| 5039 | as the first step of any operation on the generalized variable. | ||
| 5040 | |||
| 5041 | @item | ||
| 5042 | A list of exactly one @dfn{store variable} (generally obtained | ||
| 5043 | from a call to @code{gensym}). | ||
| 5044 | |||
| 5045 | @item | ||
| 5046 | A Lisp form which stores the contents of the store variable into | ||
| 5047 | the generalized variable, assuming the temporaries have been | ||
| 5048 | bound as described above. | ||
| 5049 | |||
| 5050 | @item | ||
| 5051 | A Lisp form which accesses the contents of the generalized variable, | ||
| 5052 | assuming the temporaries have been bound. | ||
| 5053 | @end enumerate | ||
| 5054 | |||
| 5055 | This is exactly like the Common Lisp macro of the same name, | ||
| 5056 | except that the method returns a list of five values rather | ||
| 5057 | than the five values themselves, since Emacs Lisp does not | ||
| 5058 | support Common Lisp's notion of multiple return values. | ||
| 5059 | |||
| 5060 | Once again, the @var{forms} may begin with a documentation string. | ||
| 5061 | |||
| 5062 | A setf-method should be maximally conservative with regard to | ||
| 5063 | temporary variables. In the setf-methods generated by | ||
| 5064 | @code{defsetf}, the second return value is simply the list of | ||
| 5065 | arguments in the place form, and the first return value is a | ||
| 5066 | list of a corresponding number of temporary variables generated | ||
| 5067 | by @code{cl-gensym}. Macros like @code{setf} and @code{cl-incf} which | ||
| 5068 | use this setf-method will optimize away most temporaries that | ||
| 5069 | turn out to be unnecessary, so there is little reason for the | ||
| 5070 | setf-method itself to optimize. | ||
| 5071 | @end defmac | ||
| 5072 | |||
| 5073 | @defun get-setf-method place &optional env | ||
| 5074 | This function returns the setf-method for @var{place}, by | ||
| 5075 | invoking the definition previously recorded by @code{defsetf} | ||
| 5076 | or @code{define-setf-method}. The result is a list of five | ||
| 5077 | values as described above. You can use this function to build | ||
| 5078 | your own @code{cl-incf}-like modify macros. (Actually, it is | ||
| 5079 | @c FIXME? | ||
| 5080 | better to use the internal functions @code{cl-setf-do-modify} | ||
| 5081 | and @code{cl-setf-do-store}, which are a bit easier to use and | ||
| 5082 | which also do a number of optimizations; consult the source | ||
| 5083 | code for the @code{cl-incf} function for a simple example.) | ||
| 5084 | |||
| 5085 | The argument @var{env} specifies the ``environment'' to be | ||
| 5086 | passed on to @code{macroexpand} if @code{get-setf-method} should | ||
| 5087 | need to expand a macro in @var{place}. It should come from | ||
| 5088 | an @code{&environment} argument to the macro or setf-method | ||
| 5089 | that called @code{get-setf-method}. | ||
| 5090 | |||
| 5091 | See also the source code for the setf-method for | ||
| 5092 | @c Also @code{apply}, but that is commented out. | ||
| 5093 | @code{substring}, which works by calling @code{get-setf-method} on a | ||
| 5094 | simpler case, then massaging the result. | ||
| 5095 | @end defun | ||
| 5096 | |||
| 5097 | Modern Common Lisp defines a second, independent way to specify | ||
| 5098 | the @code{setf} behavior of a function, namely ``@code{setf} | ||
| 5099 | functions'' whose names are lists @code{(setf @var{name})} | ||
| 5100 | rather than symbols. For example, @code{(defun (setf foo) @dots{})} | ||
| 5101 | defines the function that is used when @code{setf} is applied to | ||
| 5102 | @code{foo}. This package does not currently support @code{setf} | ||
| 5103 | functions. In particular, it is a compile-time error to use | ||
| 5104 | @code{setf} on a form which has not already been @code{defsetf}'d | ||
| 5105 | or otherwise declared; in newer Common Lisps, this would not be | ||
| 5106 | an error since the function @code{(setf @var{func})} might be | ||
| 5107 | defined later. | ||
| 5108 | |||
| 5109 | |||
| 5281 | @node GNU Free Documentation License | 5110 | @node GNU Free Documentation License |
| 5282 | @appendix GNU Free Documentation License | 5111 | @appendix GNU Free Documentation License |
| 5283 | @include doclicense.texi | 5112 | @include doclicense.texi |
diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index 896eba2f1bb..e57fcc8adf1 100644 --- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi | |||
| @@ -1516,16 +1516,16 @@ Here's a bunch of time/date/second/day examples: | |||
| 1516 | @result{} 905595714.0 | 1516 | @result{} 905595714.0 |
| 1517 | 1517 | ||
| 1518 | (seconds-to-time 905595714.0) | 1518 | (seconds-to-time 905595714.0) |
| 1519 | @result{} (13818 19266 0) | 1519 | @result{} (13818 19266 0 0) |
| 1520 | 1520 | ||
| 1521 | (time-to-days '(13818 19266)) | 1521 | (time-to-days '(13818 19266)) |
| 1522 | @result{} 729644 | 1522 | @result{} 729644 |
| 1523 | 1523 | ||
| 1524 | (days-to-time 729644) | 1524 | (days-to-time 729644) |
| 1525 | @result{} (961933 65536) | 1525 | @result{} (961933 512) |
| 1526 | 1526 | ||
| 1527 | (time-since '(13818 19266)) | 1527 | (time-since '(13818 19266)) |
| 1528 | @result{} (0 430) | 1528 | @result{} (6797 9607 984839 247000) |
| 1529 | 1529 | ||
| 1530 | (time-less-p '(13818 19266) '(13818 19145)) | 1530 | (time-less-p '(13818 19266) '(13818 19145)) |
| 1531 | @result{} nil | 1531 | @result{} nil |
| @@ -1546,7 +1546,7 @@ Here's a bunch of time/date/second/day examples: | |||
| 1546 | (time-to-number-of-days | 1546 | (time-to-number-of-days |
| 1547 | (time-since | 1547 | (time-since |
| 1548 | (date-to-time "Mon, 01 Jan 2001 02:22:26 GMT"))) | 1548 | (date-to-time "Mon, 01 Jan 2001 02:22:26 GMT"))) |
| 1549 | @result{} 4.146122685185185 | 1549 | @result{} 4314.095589286675 |
| 1550 | @end example | 1550 | @end example |
| 1551 | 1551 | ||
| 1552 | And finally, we have @code{safe-date-to-time}, which does the same as | 1552 | And finally, we have @code{safe-date-to-time}, which does the same as |
| @@ -1561,7 +1561,7 @@ An RFC822 (or similar) date string. For instance: @code{"Sat Sep 12 | |||
| 1561 | 12:21:54 1998 +0200"}. | 1561 | 12:21:54 1998 +0200"}. |
| 1562 | 1562 | ||
| 1563 | @item time | 1563 | @item time |
| 1564 | An internal Emacs time. For instance: @code{(13818 26466)}. | 1564 | An internal Emacs time. For instance: @code{(13818 26466 0 0)}. |
| 1565 | 1565 | ||
| 1566 | @item seconds | 1566 | @item seconds |
| 1567 | A floating point representation of the internal Emacs time. For | 1567 | A floating point representation of the internal Emacs time. For |
diff --git a/doc/misc/org.texi b/doc/misc/org.texi index 89c99018460..a69dc0fd81f 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi | |||
| @@ -857,7 +857,7 @@ Theory Ltd.} | |||
| 857 | @b{Important:} @i{If you the version of Org that comes with Emacs or as a | 857 | @b{Important:} @i{If you the version of Org that comes with Emacs or as a |
| 858 | XEmacs package, please skip this section and go directly to @ref{Activation}. | 858 | XEmacs package, please skip this section and go directly to @ref{Activation}. |
| 859 | If you downloaded Org as an ELPA package, please read the instructions on the | 859 | If you downloaded Org as an ELPA package, please read the instructions on the |
| 860 | @uref{http://orgmode.org/elpa/, Org ELPA page}. To see what version of Org | 860 | @uref{http://orgmode.org/elpa.html, Org ELPA page}. To see what version of Org |
| 861 | (if any) is part of your Emacs distribution, type @kbd{M-x org-version} (if | 861 | (if any) is part of your Emacs distribution, type @kbd{M-x org-version} (if |
| 862 | your Emacs distribution does not come with Org, this function will not be | 862 | your Emacs distribution does not come with Org, this function will not be |
| 863 | defined).} | 863 | defined).} |
| @@ -964,13 +964,6 @@ on your system). | |||
| 964 | make install-info | 964 | make install-info |
| 965 | @end example | 965 | @end example |
| 966 | 966 | ||
| 967 | Then add the following line to @file{.emacs}. It is needed so that | ||
| 968 | Emacs can autoload functions that are located in files not immediately loaded | ||
| 969 | when Org mode starts. | ||
| 970 | @lisp | ||
| 971 | (require 'org-install) | ||
| 972 | @end lisp | ||
| 973 | |||
| 974 | Do not forget to activate Org as described in the following section. | 967 | Do not forget to activate Org as described in the following section. |
| 975 | @page | 968 | @page |
| 976 | 969 | ||
| @@ -1092,9 +1085,6 @@ shown below. | |||
| 1092 | ;; add latest org-mode to load path | 1085 | ;; add latest org-mode to load path |
| 1093 | (add-to-list 'load-path (expand-file-name "/path/to/org-mode/lisp")) | 1086 | (add-to-list 'load-path (expand-file-name "/path/to/org-mode/lisp")) |
| 1094 | (add-to-list 'load-path (expand-file-name "/path/to/org-mode/contrib/lisp" t)) | 1087 | (add-to-list 'load-path (expand-file-name "/path/to/org-mode/contrib/lisp" t)) |
| 1095 | |||
| 1096 | ;; activate org | ||
| 1097 | (require 'org-install) | ||
| 1098 | @end example | 1088 | @end example |
| 1099 | 1089 | ||
| 1100 | If an error occurs, a backtrace can be very useful (see below on how to | 1090 | If an error occurs, a backtrace can be very useful (see below on how to |
| @@ -3785,7 +3775,7 @@ mostly if more than two TODO states are possible (@pxref{TODO | |||
| 3785 | extensions}). See also @ref{Conflicts}, for a discussion of the interaction | 3775 | extensions}). See also @ref{Conflicts}, for a discussion of the interaction |
| 3786 | with @code{shift-selection-mode}. See also the variable | 3776 | with @code{shift-selection-mode}. See also the variable |
| 3787 | @code{org-treat-S-cursor-todo-selection-as-state-change}. | 3777 | @code{org-treat-S-cursor-todo-selection-as-state-change}. |
| 3788 | @orgcmd{C-c / t,org-show-todo-key} | 3778 | @orgcmd{C-c / t,org-show-todo-tree} |
| 3789 | @cindex sparse tree, for TODO | 3779 | @cindex sparse tree, for TODO |
| 3790 | @vindex org-todo-keywords | 3780 | @vindex org-todo-keywords |
| 3791 | View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds the | 3781 | View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds the |
| @@ -9386,16 +9376,16 @@ so often, shortcuts are provided using the Easy Templates facility | |||
| 9386 | @item C-c ' | 9376 | @item C-c ' |
| 9387 | Edit the source code example at point in its native mode. This works by | 9377 | Edit the source code example at point in its native mode. This works by |
| 9388 | switching to a temporary buffer with the source code. You need to exit by | 9378 | switching to a temporary buffer with the source code. You need to exit by |
| 9389 | pressing @kbd{C-c '} again@footnote{Upon exit, lines starting with @samp{*} | 9379 | pressing @kbd{C-c '} again@footnote{Upon exit, lines starting with @samp{*}, |
| 9390 | or @samp{#} will get a comma prepended, to keep them from being interpreted | 9380 | @samp{,*}, @samp{#+} and @samp{,#+} will get a comma prepended, to keep them |
| 9391 | by Org as outline nodes or special comments. These commas will be stripped | 9381 | from being interpreted by Org as outline nodes or special syntax. These |
| 9392 | for editing with @kbd{C-c '}, and also for export.}. The edited version will | 9382 | commas will be stripped for editing with @kbd{C-c '}, and also for export.}. |
| 9393 | then replace the old version in the Org buffer. Fixed-width regions | 9383 | The edited version will then replace the old version in the Org buffer. |
| 9394 | (where each line starts with a colon followed by a space) will be edited | 9384 | Fixed-width regions (where each line starts with a colon followed by a space) |
| 9395 | using @code{artist-mode}@footnote{You may select a different-mode with the | 9385 | will be edited using @code{artist-mode}@footnote{You may select |
| 9396 | variable @code{org-edit-fixed-width-region-mode}.} to allow creating ASCII | 9386 | a different-mode with the variable @code{org-edit-fixed-width-region-mode}.} |
| 9397 | drawings easily. Using this command in an empty line will create a new | 9387 | to allow creating ASCII drawings easily. Using this command in an empty line |
| 9398 | fixed-width region. | 9388 | will create a new fixed-width region. |
| 9399 | @kindex C-c l | 9389 | @kindex C-c l |
| 9400 | @item C-c l | 9390 | @item C-c l |
| 9401 | Calling @code{org-store-link} while editing a source code example in a | 9391 | Calling @code{org-store-link} while editing a source code example in a |
| @@ -14523,14 +14513,13 @@ Be sure to adjust the paths to fit your system. | |||
| 14523 | # | 14513 | # |
| 14524 | DIR=`pwd` | 14514 | DIR=`pwd` |
| 14525 | FILES="" | 14515 | FILES="" |
| 14526 | ORGINSTALL="~/src/org/lisp/org-install.el" | ||
| 14527 | 14516 | ||
| 14528 | # wrap each argument in the code required to call tangle on it | 14517 | # wrap each argument in the code required to call tangle on it |
| 14529 | for i in $@@; do | 14518 | for i in $@@; do |
| 14530 | FILES="$FILES \"$i\"" | 14519 | FILES="$FILES \"$i\"" |
| 14531 | done | 14520 | done |
| 14532 | 14521 | ||
| 14533 | emacs -Q --batch -l $ORGINSTALL \ | 14522 | emacs -Q --batch \ |
| 14534 | --eval "(progn | 14523 | --eval "(progn |
| 14535 | (add-to-list 'load-path (expand-file-name \"~/src/org/lisp/\")) | 14524 | (add-to-list 'load-path (expand-file-name \"~/src/org/lisp/\")) |
| 14536 | (add-to-list 'load-path (expand-file-name \"~/src/org/contrib/lisp/\" t)) | 14525 | (add-to-list 'load-path (expand-file-name \"~/src/org/contrib/lisp/\" t)) |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 46f99acbb87..a983f76ffd3 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -2918,7 +2918,8 @@ information about remote hosts is kept in the file specified in | |||
| 2918 | @code{tramp-persistency-file-name}. Keep this file. If you are | 2918 | @code{tramp-persistency-file-name}. Keep this file. If you are |
| 2919 | confident that files on remote hosts are not changed out of | 2919 | confident that files on remote hosts are not changed out of |
| 2920 | @value{emacsname}' control, set @code{remote-file-name-inhibit-cache} | 2920 | @value{emacsname}' control, set @code{remote-file-name-inhibit-cache} |
| 2921 | to @code{nil}. | 2921 | to @code{nil}. Set also @code{tramp-completion-reread-directory-timeout} |
| 2922 | to @code{nil}, @ref{Filename completion}. | ||
| 2922 | 2923 | ||
| 2923 | Disable version control. If you access remote files which are not | 2924 | Disable version control. If you access remote files which are not |
| 2924 | under version control, a lot of check operations can be avoided by | 2925 | under version control, a lot of check operations can be avoided by |
diff --git a/etc/ChangeLog b/etc/ChangeLog index 3ebe18b407f..60d4a7aa271 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-10-26 Nicolas Goaziou <n.goaziou@gmail.com> | ||
| 2 | |||
| 3 | * refcards/orgcard.tex: Fix keybindings about | ||
| 4 | `org-show-todo-tree'. | ||
| 5 | |||
| 1 | 2012-10-23 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2012-10-23 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | Fix outdated timestamp documentation in Elisp manual (bug#12706). | 8 | Fix outdated timestamp documentation in Elisp manual (bug#12706). |
| @@ -77,19 +77,10 @@ links between the various manuals. | |||
| 77 | you want them. | 77 | you want them. |
| 78 | 78 | ||
| 79 | --- | 79 | --- |
| 80 | ** On Mac OS X, configure no longer automatically adds the Fink /sw | ||
| 81 | directories to the search path. You must add them yourself if you want them. | ||
| 82 | |||
| 83 | --- | ||
| 84 | ** The standalone scripts rcs-checkin and vcdiff have been removed | 80 | ** The standalone scripts rcs-checkin and vcdiff have been removed |
| 85 | (from the bin and libexec directories, respectively). The former is | 81 | (from the bin and libexec directories, respectively). The former is |
| 86 | no longer relevant, the latter is replaced by lisp (in vc-sccs.el). | 82 | no longer relevant, the latter is replaced by lisp (in vc-sccs.el). |
| 87 | 83 | ||
| 88 | --- | ||
| 89 | ** The native Windows user interface is available for Cygwin. Passing | ||
| 90 | --with-w32 will configure a Cygwin emacs to use the Windows user | ||
| 91 | interface instead of the default, X11. | ||
| 92 | |||
| 93 | 84 | ||
| 94 | * Startup Changes in Emacs 24.3 | 85 | * Startup Changes in Emacs 24.3 |
| 95 | 86 | ||
| @@ -104,26 +95,19 @@ been adding them there, put them somewhere else, eg site-lisp. | |||
| 104 | 95 | ||
| 105 | * Changes in Emacs 24.3 | 96 | * Changes in Emacs 24.3 |
| 106 | 97 | ||
| 107 | ** minibuffer-electric-default-mode can rewrite (default ...) to [...]. | ||
| 108 | Just set minibuffer-eldef-shorten-default to t before enabling the mode. | ||
| 109 | |||
| 110 | +++ | 98 | +++ |
| 111 | ** Most y-or-n prompts now allow you to scroll the selected window. | 99 | ** Most y-or-n prompts now allow you to scroll the selected window. |
| 112 | Typing C-v or M-v at a y-or-n prompt scrolls forward or backward | 100 | Typing C-v or M-v at a y-or-n prompt scrolls forward or backward |
| 113 | respectively, without exiting from the prompt. | 101 | respectively, without exiting from the prompt. |
| 114 | 102 | ||
| 115 | --- | ||
| 116 | ** In minibuffer filename prompts, `C-M-f' and `C-M-b' now move to the | ||
| 117 | next and previous path separator, respectively. | ||
| 118 | |||
| 119 | ** Mode line changes | 103 | ** Mode line changes |
| 120 | --- | 104 | --- |
| 121 | *** New option `mode-line-default-help-echo' specifies the help text | 105 | *** New option `mode-line-default-help-echo' specifies the help text |
| 122 | (shown in a tooltip or in the echo area) for any part of the mode line | 106 | (shown in a tooltip or in the echo area) for any part of the mode line |
| 123 | that does not have its own specialized help text. | 107 | that does not have its own specialized help text. |
| 124 | 108 | +++ | |
| 125 | *** You can now click mouse-3 in the coding system indicator to | 109 | *** You can now click mouse-3 in the coding system indicator to invoke |
| 126 | invokes `set-buffer-file-coding-system'. | 110 | `set-buffer-file-coding-system'. |
| 127 | 111 | ||
| 128 | ** Help changes | 112 | ** Help changes |
| 129 | 113 | ||
| @@ -139,6 +123,14 @@ correctly. To disable this, set `help-enable-auto-load' to nil. | |||
| 139 | even after their associated libraries have been loaded (and the | 123 | even after their associated libraries have been loaded (and the |
| 140 | autoloads have been redefined as functions). | 124 | autoloads have been redefined as functions). |
| 141 | 125 | ||
| 126 | ** Minibuffer changes | ||
| 127 | --- | ||
| 128 | *** In minibuffer filename prompts, `C-M-f' and `C-M-b' now move to the | ||
| 129 | next and previous path separator, respectively. | ||
| 130 | |||
| 131 | *** minibuffer-electric-default-mode can rewrite (default ...) to [...]. | ||
| 132 | Just set minibuffer-eldef-shorten-default to t before enabling the mode. | ||
| 133 | |||
| 142 | ** ImageMagick support, if available, is automatically enabled. | 134 | ** ImageMagick support, if available, is automatically enabled. |
| 143 | It is no longer necessary to call `imagemagick-register-types' | 135 | It is no longer necessary to call `imagemagick-register-types' |
| 144 | explicitly to install ImageMagick image types; that function is called | 136 | explicitly to install ImageMagick image types; that function is called |
| @@ -165,6 +157,7 @@ or expression to evaluate. | |||
| 165 | --- | 157 | --- |
| 166 | *** New option `server-auth-key' specifies a shared server key. | 158 | *** New option `server-auth-key' specifies a shared server key. |
| 167 | 159 | ||
| 160 | +++ | ||
| 168 | ** In the Package Menu, newly-available packages are listed as "new", | 161 | ** In the Package Menu, newly-available packages are listed as "new", |
| 169 | and sorted above the other "available" packages by default. | 162 | and sorted above the other "available" packages by default. |
| 170 | 163 | ||
| @@ -204,9 +197,7 @@ The PCL-CVS commands are still available via the keyboard. | |||
| 204 | --- | 197 | --- |
| 205 | *** New input method `vietnamese-vni'. | 198 | *** New input method `vietnamese-vni'. |
| 206 | 199 | ||
| 207 | ** NextStep/OSX port changes. | 200 | ** Nextstep (GNUstep / Mac OS X) port changes |
| 208 | --- | ||
| 209 | *** OSX 10.4 or newer is required to build Emacs. | ||
| 210 | --- | 201 | --- |
| 211 | *** Fullscreen and frame parameter fullscreen is supported. | 202 | *** Fullscreen and frame parameter fullscreen is supported. |
| 212 | --- | 203 | --- |
| @@ -239,7 +230,7 @@ This applies to both ordinary and regexp Isearch. | |||
| 239 | *** New option `replace-lax-whitespace'. | 230 | *** New option `replace-lax-whitespace'. |
| 240 | If non-nil, `query-replace' uses flexible whitespace matching too. | 231 | If non-nil, `query-replace' uses flexible whitespace matching too. |
| 241 | The default is nil. | 232 | The default is nil. |
| 242 | 233 | +++ | |
| 243 | *** Global `M-s _' starts a symbol (identifier) incremental search, | 234 | *** Global `M-s _' starts a symbol (identifier) incremental search, |
| 244 | and `M-s _' in Isearch toggles symbol search mode. | 235 | and `M-s _' in Isearch toggles symbol search mode. |
| 245 | `M-s c' in Isearch toggles search case-sensitivity. | 236 | `M-s c' in Isearch toggles search case-sensitivity. |
| @@ -273,6 +264,7 @@ append-to-register and M-x prepend-to-register. | |||
| 273 | ** New command `C-x r M-w' (copy-rectangle-as-kill). | 264 | ** New command `C-x r M-w' (copy-rectangle-as-kill). |
| 274 | It copies the region-rectangle as the last rectangle kill. | 265 | It copies the region-rectangle as the last rectangle kill. |
| 275 | 266 | ||
| 267 | +++ | ||
| 276 | ** New option `yank-handled-properties' allows processing of text | 268 | ** New option `yank-handled-properties' allows processing of text |
| 277 | properties on yanked text, in more ways that are more general than | 269 | properties on yanked text, in more ways that are more general than |
| 278 | just removing them, as done by `yank-excluded-properties'. | 270 | just removing them, as done by `yank-excluded-properties'. |
| @@ -331,24 +323,34 @@ The difference is that it relies on the `lexical-binding' machinery (as opposed | |||
| 331 | to the `lexical-let' machinery used previously) to capture definitions in | 323 | to the `lexical-let' machinery used previously) to capture definitions in |
| 332 | closures, so such closures will only work if `lexical-binding' is in use. | 324 | closures, so such closures will only work if `lexical-binding' is in use. |
| 333 | 325 | ||
| 326 | +++ | ||
| 327 | *** `cl-letf' is not exactly like `letf'. | ||
| 328 | The only difference is in details that relate to some deprecated usage | ||
| 329 | of `symbol-function' in place forms. | ||
| 330 | |||
| 331 | +++ | ||
| 334 | *** `progv' was rewritten to use the `let' machinery. | 332 | *** `progv' was rewritten to use the `let' machinery. |
| 335 | A side effect is that vars without corresponding value are bound to nil | 333 | A side effect is that vars without corresponding value are bound to nil |
| 336 | rather than making them unbound. | 334 | rather than making them unbound. |
| 337 | 335 | ||
| 338 | ** Compilation mode | 336 | *** The following methods of extending `setf' are obsolete. |
| 337 | Use gv.el instead (FIXME; details). | ||
| 338 | `define-setf-expander', `defsetf', `define-modify-macro' | ||
| 339 | 339 | ||
| 340 | ** Compilation mode | ||
| 341 | +++ | ||
| 340 | *** New option `compilation-always-kill'. | 342 | *** New option `compilation-always-kill'. |
| 341 | 343 | ||
| 342 | ** Customize | 344 | ** Customize |
| 343 | 345 | --- | |
| 344 | *** `custom-reset-button-menu' now defaults to t. | 346 | *** `custom-reset-button-menu' now defaults to t. |
| 345 | 347 | --- | |
| 346 | *** Non-option variables are never matched in `customize-apropos' and | 348 | *** Non-option variables are never matched in `customize-apropos' and |
| 347 | `customize-apropos-options' (i.e. the prefix argument does nothing for | 349 | `customize-apropos-options' (i.e. the prefix argument does nothing for |
| 348 | these commands now). | 350 | these commands now). |
| 349 | 351 | ||
| 350 | ** Desktop | 352 | ** Desktop |
| 351 | 353 | --- | |
| 352 | *** `desktop-path' no longer includes the "." directory. Desktop | 354 | *** `desktop-path' no longer includes the "." directory. Desktop |
| 353 | files are now located in ~/.emacs.d by default. | 355 | files are now located in ~/.emacs.d by default. |
| 354 | 356 | ||
| @@ -398,26 +400,27 @@ changes in context diffs. | |||
| 398 | whitespace problems introduced by the diff. | 400 | whitespace problems introduced by the diff. |
| 399 | 401 | ||
| 400 | ** Dired | 402 | ** Dired |
| 401 | 403 | +++ | |
| 402 | *** `dired-do-async-shell-command' executes each file sequentially | 404 | *** `dired-do-async-shell-command' executes each file sequentially |
| 403 | if the command ends in `;' (when operating on multiple files). | 405 | if the command ends in `;' (when operating on multiple files). |
| 404 | Otherwise, it executes the command on each file in parallel. | 406 | Otherwise, it executes the command on each file in parallel. |
| 405 | 407 | --- | |
| 406 | *** Typing M-n in the minibuffer of `dired-do-chmod', `dired-do-chgrp', | 408 | *** Typing M-n in the minibuffer of `dired-do-chmod', `dired-do-chgrp', |
| 407 | `dired-do-chown', `dired-do-touch' pulls the file attributes of the | 409 | `dired-do-chown', `dired-do-touch' pulls the file attributes of the |
| 408 | file at point. | 410 | file at point. |
| 409 | 411 | +++ | |
| 410 | *** When the region is active, `m' (`dired-mark'), `u' (`dired-unmark'), | 412 | *** When the region is active, `m' (`dired-mark'), `u' (`dired-unmark'), |
| 411 | `DEL' (`dired-unmark-backward'), `d' (`dired-flag-file-deletion') | 413 | `DEL' (`dired-unmark-backward'), `d' (`dired-flag-file-deletion') |
| 412 | mark/unmark/flag all files in the active region. | 414 | mark/unmark/flag all files in the active region. |
| 413 | 415 | +++ | |
| 414 | *** The minibuffer default for `=' (`dired-diff) has changed. | 416 | *** The minibuffer default for `=' (`dired-diff) has changed. |
| 415 | It is now the backup file for the file at point, if one exists. | 417 | It is now the backup file for the file at point, if one exists. |
| 416 | In Transient Mark mode the default is the file at the active mark. | 418 | In Transient Mark mode the default is the file at the active mark. |
| 417 | 419 | +++ | |
| 418 | *** `M-=' is no longer bound to `dired-backup-diff' in Dired buffers. | 420 | *** `M-=' is no longer bound to `dired-backup-diff' in Dired buffers. |
| 419 | The global binding for `M-=', `count-words-region' is in effect. | 421 | The global binding for `M-=', `count-words-region' is in effect. |
| 420 | 422 | ||
| 423 | --- | ||
| 421 | ** Ediff now uses the same color scheme as Diff mode. | 424 | ** Ediff now uses the same color scheme as Diff mode. |
| 422 | 425 | ||
| 423 | ** erc will look up server/channel names via auth-source and use the | 426 | ** erc will look up server/channel names via auth-source and use the |
| @@ -428,9 +431,9 @@ See `flymake-fringe-indicator-position', `flymake-error-bitmap' and | |||
| 428 | `flymake-warning-bitmap'. | 431 | `flymake-warning-bitmap'. |
| 429 | 432 | ||
| 430 | ** Follow mode | 433 | ** Follow mode |
| 431 | 434 | --- | |
| 432 | *** The obsolete variable `follow-mode-off-hook' has been removed. | 435 | *** The obsolete variable `follow-mode-off-hook' has been removed. |
| 433 | 436 | --- | |
| 434 | *** Follow mode no longer works by using advice. | 437 | *** Follow mode no longer works by using advice. |
| 435 | The option `follow-intercept-processes' has been removed. | 438 | The option `follow-intercept-processes' has been removed. |
| 436 | 439 | ||
| @@ -449,9 +452,9 @@ the FFAP prompt. The default is now '("ftp"). | |||
| 449 | The old binding for `/ M' (filter by used-mode) is now bound to `/ m'. | 452 | The old binding for `/ M' (filter by used-mode) is now bound to `/ m'. |
| 450 | 453 | ||
| 451 | ** Mouse Avoidance mode | 454 | ** Mouse Avoidance mode |
| 452 | 455 | +++ | |
| 453 | The new variable `mouse-avoidance-banish-position' can now be used to | 456 | *** New variable `mouse-avoidance-banish-position' specifies where the |
| 454 | customize Mouse Avoidance mode further. | 457 | `banish' mouse avoidance setting moves the mouse. |
| 455 | 458 | ||
| 456 | +++ | 459 | +++ |
| 457 | ** notifications.el supports now version 1.2 of the Notifications API. | 460 | ** notifications.el supports now version 1.2 of the Notifications API. |
| @@ -603,6 +606,7 @@ and the `attributes' slot is always nil. | |||
| 603 | The `url-retrieve' function now uses this to encode its URL argument, | 606 | The `url-retrieve' function now uses this to encode its URL argument, |
| 604 | in case that is not properly encoded. | 607 | in case that is not properly encoded. |
| 605 | 608 | ||
| 609 | --- | ||
| 606 | ** VHDL mode | 610 | ** VHDL mode |
| 607 | 611 | ||
| 608 | *** The free software compiler GHDL is supported (and now the default). | 612 | *** The free software compiler GHDL is supported (and now the default). |
| @@ -613,7 +617,10 @@ in case that is not properly encoded. | |||
| 613 | 617 | ||
| 614 | *** Accepts \r and \f as whitespace. | 618 | *** Accepts \r and \f as whitespace. |
| 615 | 619 | ||
| 616 | ** which-function-mode now applies to all applicable major modes by default. | 620 | ** Which Function mode |
| 621 | +++ | ||
| 622 | *** `which-func-modes' now defaults to t, so Which Function mode, when | ||
| 623 | enabled, applies to all applicable major modes. | ||
| 617 | 624 | ||
| 618 | --- | 625 | --- |
| 619 | ** winner-mode-hook now runs when the mode is disabled, as well as when it is | 626 | ** winner-mode-hook now runs when the mode is disabled, as well as when it is |
| @@ -673,6 +680,7 @@ gnus-notifications.el, mm-archive.el | |||
| 673 | 680 | ||
| 674 | * Incompatible Lisp Changes in Emacs 24.3 | 681 | * Incompatible Lisp Changes in Emacs 24.3 |
| 675 | 682 | ||
| 683 | +++ | ||
| 676 | ** set-buffer-multibyte now signals an error in narrowed buffers. | 684 | ** set-buffer-multibyte now signals an error in narrowed buffers. |
| 677 | 685 | ||
| 678 | +++ | 686 | +++ |
| @@ -715,6 +723,7 @@ still be supported for Emacs 24.x. | |||
| 715 | Some Lisp symbols have been renamed to avoid problems with spelling | 723 | Some Lisp symbols have been renamed to avoid problems with spelling |
| 716 | that is incorrect or inconsistent with how Emacs normally spells a word. | 724 | that is incorrect or inconsistent with how Emacs normally spells a word. |
| 717 | 725 | ||
| 726 | --- | ||
| 718 | *** Renamed functions | 727 | *** Renamed functions |
| 719 | 728 | ||
| 720 | **** hangul-input-method-inactivate -> hangul-input-method-deactivate | 729 | **** hangul-input-method-inactivate -> hangul-input-method-deactivate |
| @@ -726,22 +735,22 @@ that is incorrect or inconsistent with how Emacs normally spells a word. | |||
| 726 | viper-deactivate-input-method-action | 735 | viper-deactivate-input-method-action |
| 727 | **** ucs-input-inactivate -> ucs-input-deactivate | 736 | **** ucs-input-inactivate -> ucs-input-deactivate |
| 728 | 737 | ||
| 738 | --- | ||
| 729 | *** Renamed hooks | 739 | *** Renamed hooks |
| 730 | The old hooks are still supported for backward compatibility, but they | 740 | The old hooks are still supported for backward compatibility, but they |
| 731 | are deprecated and will be removed eventually. | 741 | are deprecated and will be removed eventually. |
| 732 | |||
| 733 | **** input-method-inactivate-hook -> input-method-deactivate-hook | 742 | **** input-method-inactivate-hook -> input-method-deactivate-hook |
| 734 | **** robin-inactivate-hook -> robin-deactivate-hook | 743 | **** robin-inactivate-hook -> robin-deactivate-hook |
| 735 | **** quail-inactivate-hook -> quail-deactivate-hook | 744 | **** quail-inactivate-hook -> quail-deactivate-hook |
| 736 | 745 | ||
| 746 | --- | ||
| 737 | *** Renamed Lisp variables | 747 | *** Renamed Lisp variables |
| 738 | |||
| 739 | **** follow-deactive-menu -> follow-inactive-menu | 748 | **** follow-deactive-menu -> follow-inactive-menu |
| 740 | **** inactivate-current-input-method-function -> | 749 | **** inactivate-current-input-method-function -> |
| 741 | deactivate-current-input-method-function | 750 | deactivate-current-input-method-function |
| 742 | 751 | ||
| 752 | +++ | ||
| 743 | ** Some obsolete functions, variables, and faces were removed: | 753 | ** Some obsolete functions, variables, and faces were removed: |
| 744 | |||
| 745 | *** `facemenu-unlisted-faces' | 754 | *** `facemenu-unlisted-faces' |
| 746 | *** `rmail-decode-mime-charset' | 755 | *** `rmail-decode-mime-charset' |
| 747 | *** `last-input-char', `last-command-char', `unread-command-char'. | 756 | *** `last-input-char', `last-command-char', `unread-command-char'. |
| @@ -772,9 +781,18 @@ systems), or based on memory allocations. | |||
| 772 | ** CL-style generalized variables are now in core Elisp. | 781 | ** CL-style generalized variables are now in core Elisp. |
| 773 | `setf' is autoloaded; `push' and `pop' accept generalized variables. | 782 | `setf' is autoloaded; `push' and `pop' accept generalized variables. |
| 774 | 783 | ||
| 784 | +++ | ||
| 775 | ** `defun' also accepts a (declare DECLS) form, like `defmacro'. | 785 | ** `defun' also accepts a (declare DECLS) form, like `defmacro'. |
| 776 | The interpretation of the DECLS is determined by `defun-declarations-alist'. | 786 | The interpretation of the DECLS is determined by `defun-declarations-alist'. |
| 777 | 787 | ||
| 788 | ** Minibuffer | ||
| 789 | +++ | ||
| 790 | *** `read-regexp' has a new argument HISTORY; the first argument PROMPT | ||
| 791 | of `read-regexp' accepts a string ending with a colon and space, and its | ||
| 792 | second argument DEFAULTS can be a list of strings accessible via M-n | ||
| 793 | in the minibuffer ahead of other hard-coded useful regexp-related values. | ||
| 794 | More commands use `read-regexp' now to read their regexp arguments. | ||
| 795 | |||
| 778 | ** Completion | 796 | ** Completion |
| 779 | 797 | ||
| 780 | *** New function `completion-table-with-quoting' to handle completion | 798 | *** New function `completion-table-with-quoting' to handle completion |
| @@ -797,14 +815,6 @@ to work out which code is doing something. | |||
| 797 | *** New var `inhibit-debugger', automatically set to prevent accidental | 815 | *** New var `inhibit-debugger', automatically set to prevent accidental |
| 798 | recursive invocations. | 816 | recursive invocations. |
| 799 | 817 | ||
| 800 | ** Minibuffer | ||
| 801 | |||
| 802 | *** `read-regexp' has a new argument HISTORY; the first argument PROMPT | ||
| 803 | of `read-regexp' accepts a string ending with a colon and space, and its | ||
| 804 | second argument DEFAULTS can be a list of strings accessible via M-n | ||
| 805 | in the minibuffer ahead of other hard-coded useful regexp-related values. | ||
| 806 | More commands use `read-regexp' now to read their regexp arguments. | ||
| 807 | |||
| 808 | ** Window changes | 818 | ** Window changes |
| 809 | 819 | ||
| 810 | *** The functions get-lru-window, get-mru-window and get-largest-window | 820 | *** The functions get-lru-window, get-mru-window and get-largest-window |
| @@ -841,11 +851,17 @@ appropriate entries in the `display-buffer-alist' function introduced | |||
| 841 | in Emacs 24.1: | 851 | in Emacs 24.1: |
| 842 | +++ | 852 | +++ |
| 843 | **** `display-buffer-reuse-frames' | 853 | **** `display-buffer-reuse-frames' |
| 854 | +++ | ||
| 844 | **** `special-display-regexps' | 855 | **** `special-display-regexps' |
| 856 | +++ | ||
| 845 | **** `special-display-frame-alist' | 857 | **** `special-display-frame-alist' |
| 858 | +++ | ||
| 846 | **** `special-display-buffer-names' | 859 | **** `special-display-buffer-names' |
| 860 | +++ | ||
| 847 | **** `special-display-function' | 861 | **** `special-display-function' |
| 862 | +++ | ||
| 848 | **** `display-buffer-function' | 863 | **** `display-buffer-function' |
| 864 | --- | ||
| 849 | **** `dired-shrink-to-fit' | 865 | **** `dired-shrink-to-fit' |
| 850 | 866 | ||
| 851 | ** Time | 867 | ** Time |
| @@ -853,7 +869,7 @@ in Emacs 24.1: | |||
| 853 | *** `current-time-string' no longer requires that its argument's year | 869 | *** `current-time-string' no longer requires that its argument's year |
| 854 | must be in the range 1000..9999. It now works with any year supported | 870 | must be in the range 1000..9999. It now works with any year supported |
| 855 | by the underlying C implementation. | 871 | by the underlying C implementation. |
| 856 | --- | 872 | |
| 857 | *** `current-time' now returns extended-format time stamps | 873 | *** `current-time' now returns extended-format time stamps |
| 858 | (HIGH LOW USEC PSEC), where the new PSEC slot specifies picoseconds. | 874 | (HIGH LOW USEC PSEC), where the new PSEC slot specifies picoseconds. |
| 859 | PSEC is typically a multiple of 1000 on current machines. Other | 875 | PSEC is typically a multiple of 1000 on current machines. Other |
| @@ -885,12 +901,15 @@ result in a warning ("Eager macro-expansion skipped due to cycle") | |||
| 885 | describing the cycle. | 901 | describing the cycle. |
| 886 | 902 | ||
| 887 | ** Miscellaneous new functions: | 903 | ** Miscellaneous new functions: |
| 888 | 904 | +++ | |
| 889 | *** `autoloadp' | 905 | *** `autoloadp' |
| 906 | +++ | ||
| 890 | *** `autoload-do-load' | 907 | *** `autoload-do-load' |
| 891 | +++ | 908 | +++ |
| 892 | *** `buffer-narrowed-p' tests if the buffer is narrowed. | 909 | *** `buffer-narrowed-p' tests if the buffer is narrowed. |
| 910 | +++ | ||
| 893 | *** `file-name-base' returns a file name sans directory and extension. | 911 | *** `file-name-base' returns a file name sans directory and extension. |
| 912 | +++ | ||
| 894 | *** `function-get' fetches a function property, following aliases. | 913 | *** `function-get' fetches a function property, following aliases. |
| 895 | +++ | 914 | +++ |
| 896 | *** `posnp' tests if an object is a `posn'. | 915 | *** `posnp' tests if an object is a `posn'. |
| @@ -899,42 +918,63 @@ describing the cycle. | |||
| 899 | *** `system-users' returns the user names on the system. | 918 | *** `system-users' returns the user names on the system. |
| 900 | +++ | 919 | +++ |
| 901 | *** `system-groups' returns the group names on the system. | 920 | *** `system-groups' returns the group names on the system. |
| 921 | +++ | ||
| 902 | *** `tty-top-frame' returns the topmost frame of a text terminal. | 922 | *** `tty-top-frame' returns the topmost frame of a text terminal. |
| 903 | 923 | ||
| 904 | ** New macros `setq-local' and `defvar-local'. | 924 | ** New macros `setq-local' and `defvar-local'. |
| 905 | 925 | ||
| 926 | +++ | ||
| 906 | ** New fringe bitmap `exclamation-mark'. | 927 | ** New fringe bitmap `exclamation-mark'. |
| 907 | 928 | ||
| 908 | ** Face underlining can now use a wave. | 929 | ** Face underlining can now use a wave. |
| 909 | See the "Face Attributes" section of the Elisp manual. | 930 | See the "Face Attributes" section of the Elisp manual. |
| 910 | 931 | ||
| 911 | ** The following functions and variables are obsolete: | 932 | ** The following functions and variables are obsolete: |
| 912 | 933 | --- | |
| 913 | *** `automount-dir-prefix' | 934 | *** `automount-dir-prefix' |
| 935 | +++ | ||
| 914 | *** `buffer-has-markers-at' | 936 | *** `buffer-has-markers-at' |
| 937 | --- | ||
| 915 | *** `macro-declaration-function' (use `macro-declarations-alist') | 938 | *** `macro-declaration-function' (use `macro-declarations-alist') |
| 939 | --- | ||
| 916 | *** `window-system-version' | 940 | *** `window-system-version' |
| 941 | --- | ||
| 917 | *** `dired-pop-to-buffer' (use `dired-mark-pop-up') | 942 | *** `dired-pop-to-buffer' (use `dired-mark-pop-up') |
| 943 | --- | ||
| 918 | *** `query-replace-interactive' | 944 | *** `query-replace-interactive' |
| 945 | --- | ||
| 919 | *** `font-list-limit' (has had no effect since Emacs < 23) | 946 | *** `font-list-limit' (has had no effect since Emacs < 23) |
| 920 | 947 | ||
| 921 | 948 | ||
| 922 | * Changes in Emacs 24.3 on non-free operating systems | 949 | * Changes in Emacs 24.3 on non-free operating systems |
| 923 | 950 | ||
| 924 | +++ | 951 | --- |
| 925 | ** On MS Windows, you can pass --without-libxml2 to configure.bat to omit | 952 | ** Cygwin builds can use the native MS Windows user interface. |
| 926 | support for libxml2, even if its presence is detected. | 953 | Pass --with-w32 to configure. The default remains the X11 interface. |
| 927 | |||
| 928 | ** When invoked with the -nw switch to run on the Windows text-mode terminal, | ||
| 929 | Emacs now supports mouse highlight, help-echo (in the echo area), and | ||
| 930 | `mouse-autoselect-window'. | ||
| 931 | 954 | ||
| 932 | ** Two new functions are available in Cygwin builds: | 955 | ** Two new functions are available in Cygwin builds: |
| 933 | `cygwin-convert-path-from-windows' and `cygwin-convert-path-to-windows'. | 956 | `cygwin-convert-path-from-windows' and `cygwin-convert-path-to-windows'. |
| 934 | These functions allow Lisp code to access the Cygwin file-name mapping | 957 | These functions allow Lisp code to access the Cygwin file-name mapping |
| 935 | machinery to convert between Cygwin and Windows-native file names. | 958 | machinery to convert between Cygwin and Windows-native file names. |
| 936 | 959 | ||
| 960 | ** When invoked with the -nw switch to run on the Windows text-mode terminal, | ||
| 961 | Emacs now supports mouse highlight, help-echo (in the echo area), and | ||
| 962 | `mouse-autoselect-window'. | ||
| 963 | |||
| 964 | +++ | ||
| 937 | ** On MS Windows Vista and later Emacs now supports symbolic links. | 965 | ** On MS Windows Vista and later Emacs now supports symbolic links. |
| 966 | |||
| 967 | +++ | ||
| 968 | ** On MS Windows, you can pass --without-libxml2 to configure.bat to omit | ||
| 969 | support for libxml2, even if its presence is detected. | ||
| 970 | |||
| 971 | --- | ||
| 972 | ** On Mac OS X, the Nextstep port requires OS X 10.4 or later. | ||
| 973 | |||
| 974 | --- | ||
| 975 | ** On Mac OS X, configure no longer automatically adds the Fink /sw | ||
| 976 | directories to the search path. You must add them yourself if you want them. | ||
| 977 | |||
| 938 | 978 | ||
| 939 | * Changes in Emacs 24.2 | 979 | * Changes in Emacs 24.2 |
| 940 | 980 | ||
diff --git a/etc/refcards/orgcard.pdf b/etc/refcards/orgcard.pdf index 2f004418443..720f08d9ded 100644 --- a/etc/refcards/orgcard.pdf +++ b/etc/refcards/orgcard.pdf | |||
| Binary files differ | |||
diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 45b8ef04732..9ce2923e845 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex | |||
| @@ -484,9 +484,9 @@ after ``{\tt :}'', and dictionary words elsewhere. | |||
| 484 | \metax{select next/previous state}{S-LEFT/RIGHT} | 484 | \metax{select next/previous state}{S-LEFT/RIGHT} |
| 485 | \metax{select next/previous set}{C-S-LEFT/RIGHT} | 485 | \metax{select next/previous set}{C-S-LEFT/RIGHT} |
| 486 | \key{toggle ORDERED property}{C-c C-x o} | 486 | \key{toggle ORDERED property}{C-c C-x o} |
| 487 | \key{view TODO items in a sparse tree}{C-c C-v} | ||
| 488 | \key{view 3rd TODO keyword's sparse tree}{C-3 C-c C-v} | ||
| 489 | 487 | ||
| 488 | \key{view TODO items in a sparse tree}{C-c / t} | ||
| 489 | \key{view 3rd TODO keyword's sparse tree}{C-3 C-c / t} | ||
| 490 | \key{set the priority of the current item}{C-c , [ABC]} | 490 | \key{set the priority of the current item}{C-c , [ABC]} |
| 491 | \key{remove priority cookie from current item}{C-c , SPC} | 491 | \key{remove priority cookie from current item}{C-c , SPC} |
| 492 | \key{raise/lower priority of current item}{S-UP/DOWN\notetwo} | 492 | \key{raise/lower priority of current item}{S-UP/DOWN\notetwo} |
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index bc0e5c9a3d2..03cddc6a035 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2012-10-26 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * Makefile.in (uninstall): No INSTALLABLES live in archlibdir. | ||
| 4 | |||
| 5 | * Makefile.in (install, uninstall): Transformations should not be | ||
| 6 | applied to $EXEEXT. | ||
| 7 | |||
| 8 | 2012-10-23 Eli Zaretskii <eliz@gnu.org> | ||
| 9 | |||
| 10 | * makefile.w32-in (lisp2): Add cp51932.el and eucjp-ms.el, to | ||
| 11 | follow src/lisp.mk. | ||
| 12 | |||
| 1 | 2012-10-21 Glenn Morris <rgm@gnu.org> | 13 | 2012-10-21 Glenn Morris <rgm@gnu.org> |
| 2 | 14 | ||
| 3 | * make-docfile.c (scan_lisp_file): Add cp51932.el and eucjp-ms.el. | 15 | * make-docfile.c (scan_lisp_file): Add cp51932.el and eucjp-ms.el. |
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index c5acca28856..d271bb3a4fa 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in | |||
| @@ -244,20 +244,21 @@ install: $(DESTDIR)${archlibdir} | |||
| 244 | @echo "Installing utilities for users to run." | 244 | @echo "Installing utilities for users to run." |
| 245 | umask 022; ${MKDIR_P} $(DESTDIR)${bindir} | 245 | umask 022; ${MKDIR_P} $(DESTDIR)${bindir} |
| 246 | for file in ${INSTALLABLES} ; do \ | 246 | for file in ${INSTALLABLES} ; do \ |
| 247 | $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ | 247 | $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ |
| 248 | done | 248 | done |
| 249 | for file in ${INSTALLABLE_SCRIPTS} ; do \ | 249 | for file in ${INSTALLABLE_SCRIPTS} ; do \ |
| 250 | $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ | 250 | $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ |
| 251 | done | 251 | done |
| 252 | 252 | ||
| 253 | uninstall: | 253 | uninstall: |
| 254 | (cd $(DESTDIR)${bindir}; \ | 254 | for file in ${INSTALLABLES}; do \ |
| 255 | for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \ | 255 | rm -f $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ |
| 256 | done | ||
| 257 | for file in ${INSTALLABLE_SCRIPTS}; do \ | ||
| 256 | rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ | 258 | rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \ |
| 257 | done) | 259 | done |
| 258 | if [ -d $(DESTDIR)${archlibdir} ]; then \ | 260 | if [ -d $(DESTDIR)${archlibdir} ]; then \ |
| 259 | (cd $(DESTDIR)${archlibdir} && \ | 261 | (cd $(DESTDIR)${archlibdir} && rm -f ${UTILITIES} ${SCRIPTS}) \ |
| 260 | rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) \ | ||
| 261 | fi | 262 | fi |
| 262 | 263 | ||
| 263 | mostlyclean: | 264 | mostlyclean: |
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in index 640e8a7c468..f3ab4421fd3 100644 --- a/lib-src/makefile.w32-in +++ b/lib-src/makefile.w32-in | |||
| @@ -229,6 +229,8 @@ lisp2 = \ | |||
| 229 | $(lispsource)language/greek.elc \ | 229 | $(lispsource)language/greek.elc \ |
| 230 | $(lispsource)language/hebrew.elc \ | 230 | $(lispsource)language/hebrew.elc \ |
| 231 | $(lispsource)language/japanese.elc \ | 231 | $(lispsource)language/japanese.elc \ |
| 232 | $(lispsource)international/cp51932.el \ | ||
| 233 | $(lispsource)international/eucjp-ms.el \ | ||
| 232 | $(lispsource)language/korean.elc \ | 234 | $(lispsource)language/korean.elc \ |
| 233 | $(lispsource)language/lao.elc \ | 235 | $(lispsource)language/lao.elc \ |
| 234 | $(lispsource)language/cham.elc \ | 236 | $(lispsource)language/cham.elc \ |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 16c4983d385..bd535894cdf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,206 @@ | |||
| 1 | 2012-10-30 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/cl-extra.el (cl-mapc): Add autoload cookie. Doc fix. | ||
| 4 | |||
| 5 | * emacs-lisp/cl.el (letf): Doc fix. (Bug#12760) | ||
| 6 | |||
| 7 | 2012-10-29 Chong Yidong <cyd@gnu.org> | ||
| 8 | |||
| 9 | * isearch.el (isearch-other-meta-char): Ensure that a reprocessed | ||
| 10 | function key is stored in a keyboard macro (Bug#4894). | ||
| 11 | |||
| 12 | * thingatpt.el (number-at-point): Apply a thing-at-point property. | ||
| 13 | |||
| 14 | 2012-10-29 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 15 | |||
| 16 | * vc/diff-mode.el (diff-context->unified): Don't get confused by "hunk | ||
| 17 | header comments". | ||
| 18 | (diff-unified->context, diff-context->unified) | ||
| 19 | (diff-reverse-direction, diff-fixup-modifs): Use `use-region-p'. | ||
| 20 | |||
| 21 | * emacs-lisp/cl.el (letf): Add missing indent rules (bug#12759). | ||
| 22 | |||
| 23 | * files.el (find-alternate-file): Only ask one question (bug#12487). | ||
| 24 | |||
| 25 | 2012-10-29 Chong Yidong <cyd@gnu.org> | ||
| 26 | |||
| 27 | * vc/vc-hooks.el (vc-file-clearprops): Kill vc-parent-buffer. | ||
| 28 | Suggested by Dan Nicolaescu (Bug#6326). | ||
| 29 | |||
| 30 | * info.el (Info-complete-menu-item): Avoid duplicates (Bug#12705). | ||
| 31 | |||
| 32 | * startup.el (fancy-about-screen): Don't message (Bug#12680). | ||
| 33 | |||
| 34 | * thingatpt.el (thing-at-point): Doc fix (Bug#12691). | ||
| 35 | |||
| 36 | * imenu.el (imenu): Inhibit push-mark message (Bug#12726). | ||
| 37 | |||
| 38 | * face-remap.el (face-remap-add-relative): Handle the case where a | ||
| 39 | face-remapping-alist entry is a cons cell (Bug#12762). | ||
| 40 | |||
| 41 | 2012-10-29 Kevin Ryde <user42@zip.com.au> | ||
| 42 | |||
| 43 | * woman.el (woman-parse-numeric-value): Handle picas correctly | ||
| 44 | (Bug#12639). | ||
| 45 | |||
| 46 | 2012-10-29 Glenn Morris <rgm@gnu.org> | ||
| 47 | |||
| 48 | * emacs-lisp/cl.el (defsetf): Doc fix. | ||
| 49 | |||
| 50 | 2012-10-29 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 51 | |||
| 52 | * progmodes/sh-script.el (sh-font-lock-paren): Also put punctuation | ||
| 53 | syntax to the matching opener, if any (bug#12547). | ||
| 54 | (sh-smie-sh-forward-token, sh-smie-sh-backward-token): Recognize this | ||
| 55 | matching open as a "case-(". | ||
| 56 | (sh-smie-rc-grammar): Add a corresponding rule for it. | ||
| 57 | |||
| 58 | 2012-10-28 Daniel Hackney <dan@haxney.org> | ||
| 59 | |||
| 60 | * emacs-lisp/package.el (package-generate-autoloads): Kill buffer | ||
| 61 | "PKGNAME-autoloads.el" in case we created it. | ||
| 62 | |||
| 63 | 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 64 | |||
| 65 | * minibuffer.el (completion--sifn-requote): Rewrite to handle things | ||
| 66 | like Tramp's "/foo:~bar//baz" -> "/scpc:foo:/baz" mapping (bug#11714). | ||
| 67 | (completion--twq-all): Disable too-strict assertions. | ||
| 68 | |||
| 69 | * tmm.el (tmm-prompt): Use map-keymap (bug#12744). | ||
| 70 | |||
| 71 | 2012-10-27 Eli Zaretskii <eliz@gnu.org> | ||
| 72 | |||
| 73 | * profiler.el (profiler-report-make-entry-part): Fix help-echo | ||
| 74 | text to match the real keybindings. | ||
| 75 | |||
| 76 | 2012-10-27 Juri Linkov <juri@jurta.org> | ||
| 77 | |||
| 78 | * wdired.el (wdired-keep-marker-rename): New defcustom. | ||
| 79 | (wdired-do-renames): Use it instead of `dired-keep-marker-rename'. | ||
| 80 | (Bug#11795) | ||
| 81 | |||
| 82 | * dired.el (dired-keep-marker-rename): Add reference to | ||
| 83 | `wdired-keep-marker-rename' in the docstring. | ||
| 84 | Add default character value ?R to display initially in | ||
| 85 | Customization UI instead of ?@. | ||
| 86 | |||
| 87 | 2012-10-27 Martin Rudalics <rudalics@gmx.at> | ||
| 88 | |||
| 89 | * window.el (display-buffer): In doc-string describe | ||
| 90 | window-height and window-width alist entries. | ||
| 91 | |||
| 92 | * time.el (display-time-world): Restore fit-window-to-buffer | ||
| 93 | behavior. | ||
| 94 | |||
| 95 | 2012-10-27 Chong Yidong <cyd@gnu.org> | ||
| 96 | |||
| 97 | * subr.el (insert-buffer-substring-as-yank): Doc fix. | ||
| 98 | |||
| 99 | 2012-10-26 Jambunathan K <kjambunathan@gmail.com> | ||
| 100 | |||
| 101 | * minibuffer.el (completion-category-overrides): New completion | ||
| 102 | category `bookmark' (bug#11131). | ||
| 103 | |||
| 104 | 2012-10-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 105 | |||
| 106 | * emacs-lisp/advice.el (ad-assemble-advised-definition): | ||
| 107 | Silence bogus compiler warnings for ad-do-it. | ||
| 108 | |||
| 109 | * bookmark.el (bookmark-completing-read): Set the completion category | ||
| 110 | to `bookmark' (bug#11131). | ||
| 111 | |||
| 112 | 2012-10-26 Bastien <bzg@altern.org> | ||
| 113 | Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 114 | |||
| 115 | * face-remap.el: Use lexical-binding. | ||
| 116 | (text-scale-adjust): Improve docstring. Use itself for the temporary | ||
| 117 | overlay-map bindings, so as to repeat the "Use..." message each time. | ||
| 118 | |||
| 119 | 2012-10-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 120 | |||
| 121 | * emacs-lisp/macroexp.el (macroexp--expand-all): | ||
| 122 | Obey byte-compile-warning-enabled-p (bug#12486). | ||
| 123 | |||
| 124 | * vc/diff-mode.el (diff-end-of-hunk): Also skip potential "no LF at eol". | ||
| 125 | (diff-refine-hunk): Similarly, handle the "no LF at eol" (bug#12584). | ||
| 126 | |||
| 127 | 2012-10-26 Martin Rudalics <rudalics@gmx.at> | ||
| 128 | |||
| 129 | * mouse.el (mouse-drag-line): Move last form into preceding when | ||
| 130 | clause (Bug#12731). | ||
| 131 | |||
| 132 | * help.el (resize-temp-buffer-window): Fix doc-string. | ||
| 133 | |||
| 134 | 2012-10-25 David Engster <deng@randomsample.de> | ||
| 135 | |||
| 136 | * emacs-lisp/eieio.el (eieio-update-lisp-imenu-expression): | ||
| 137 | Remove. This feature is already integrated in imenu. | ||
| 138 | |||
| 139 | * emacs-lisp/eieio-opt.el: Remove require for `button' since it is | ||
| 140 | always loaded. Require `speedbar' unconditionally. | ||
| 141 | |||
| 142 | 2012-10-25 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 143 | |||
| 144 | * dired.el (dired-get-marked-files): Allow ! on . and .. (bug#12725). | ||
| 145 | |||
| 146 | * minibuffer.el (minibuffer-force-complete): Fix thinko. | ||
| 147 | |||
| 148 | * net/ldap.el (ldap-search-internal): The official ldif format starts | ||
| 149 | with a "version: 1" header (bug#12724). | ||
| 150 | |||
| 151 | * emacs-lisp/package.el (package-installed-p): Warn if not ready | ||
| 152 | (bug#12721). | ||
| 153 | |||
| 154 | 2012-10-25 Glenn Morris <rgm@gnu.org> | ||
| 155 | |||
| 156 | * emacs-lisp/cl-macs.el (cl-progv): Doc fix. | ||
| 157 | |||
| 158 | 2012-10-24 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 159 | |||
| 160 | * minibuffer.el (minibuffer-force-complete): Use one more marker | ||
| 161 | for the temporary-overlay-map command (bug#12619). | ||
| 162 | |||
| 163 | 2012-10-24 Chong Yidong <cyd@gnu.org> | ||
| 164 | |||
| 165 | * time.el (display-time-world-mode): Derive from special-mode. | ||
| 166 | (display-time-world): Use display-buffer (Bug#12708). | ||
| 167 | (display-time-world-mode-map): Variable deleted. | ||
| 168 | (display-time-world-display): Wrap the final delete-char inside | ||
| 169 | inhibit-read-only. | ||
| 170 | |||
| 171 | 2012-10-24 Chong Yidong <cyd@gnu.org> | ||
| 172 | |||
| 173 | * dired.el (dired-mark, dired-unmark, dired-flag-file-deletion): | ||
| 174 | Doc fix. | ||
| 175 | |||
| 176 | * emacs-lisp/easymenu.el (easy-menu-define): Doc fix (Bug#12628). | ||
| 177 | |||
| 178 | 2012-10-24 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 179 | |||
| 180 | * minibuffer.el (completion--all-sorted-completions-location): New var. | ||
| 181 | (completion--cache-all-sorted-completions) | ||
| 182 | (completion--flush-all-sorted-completions): Use it. | ||
| 183 | (completion-in-region, completion-in-region--postch) | ||
| 184 | (completion-at-point, completion-help-at-point): Use markers in | ||
| 185 | completion-in-region--data (bug#12619). | ||
| 186 | |||
| 187 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 188 | |||
| 189 | * progmodes/compile.el (compilation-start): Try to handle common | ||
| 190 | quoting of `cd' argument (bug#12640). | ||
| 191 | |||
| 192 | * vc/diff-mode.el (diff-hunk): `save-excursion' while refining | ||
| 193 | (bug#12671). | ||
| 194 | |||
| 195 | 2012-10-23 Glenn Morris <rgm@gnu.org> | ||
| 196 | |||
| 197 | * progmodes/gud.el (gud-menu-map): | ||
| 198 | Check gdb-active-process is bound. (Bug#12358) | ||
| 199 | |||
| 1 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> | 200 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 201 | ||
| 202 | * repeat.el (repeat): Set real-this-command (bug#12232). | ||
| 203 | |||
| 3 | * htmlfontify.el (hfy-post-html-hook): | 204 | * htmlfontify.el (hfy-post-html-hook): |
| 4 | * filesets.el (filesets-cache-fill-content-hook): | 205 | * filesets.el (filesets-cache-fill-content-hook): |
| 5 | * arc-mode.el (archive-extract-hook): | 206 | * arc-mode.el (archive-extract-hook): |
| @@ -146,7 +347,7 @@ | |||
| 146 | Recover input meta mode when the new coding system doesn not use 8-bit. | 347 | Recover input meta mode when the new coding system doesn not use 8-bit. |
| 147 | Supply TERMINAL arg to set-input-meta-mode. | 348 | Supply TERMINAL arg to set-input-meta-mode. |
| 148 | 349 | ||
| 149 | 2012-10-17 Michael Heerdegen <michael_heerdegen@web.de> (tiny change) | 350 | 2012-10-17 Michael Heerdegen <michael_heerdegen@web.de> |
| 150 | 351 | ||
| 151 | * wdired.el (wdired-old-marks): New variable. | 352 | * wdired.el (wdired-old-marks): New variable. |
| 152 | (wdired-change-to-wdired-mode): Locally set wdired-old-marks. | 353 | (wdired-change-to-wdired-mode): Locally set wdired-old-marks. |
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 838e5a5ec00..78ca6f22c8e 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el | |||
| @@ -433,7 +433,11 @@ the empty string." | |||
| 433 | ": "))) | 433 | ": "))) |
| 434 | (str | 434 | (str |
| 435 | (completing-read prompt | 435 | (completing-read prompt |
| 436 | bookmark-alist | 436 | (lambda (string pred action) |
| 437 | (if (eq action 'metadata) | ||
| 438 | '(metadata (category . bookmark)) | ||
| 439 | (complete-with-action | ||
| 440 | action bookmark-alist string pred))) | ||
| 437 | nil | 441 | nil |
| 438 | 0 | 442 | 0 |
| 439 | nil | 443 | nil |
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 7656248cac5..6f2669e9fee 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog | |||
| @@ -1,3 +1,36 @@ | |||
| 1 | 2012-10-25 David Engster <deng@randomsample.de> | ||
| 2 | |||
| 3 | * semantic/analyze.el (semantic-analyze-dereference-alias): New | ||
| 4 | function to dereference aliases. | ||
| 5 | (semantic-analyze-current-context-default): Use it. | ||
| 6 | |||
| 7 | * semantic/grammar.el (semantic-grammar-create-package): | ||
| 8 | * srecode/compile.el (srecode-compile-templates): Throw a proper | ||
| 9 | error if semantic-mode is not enabled (bug#9968). | ||
| 10 | |||
| 11 | Compiler warning fixes: | ||
| 12 | |||
| 13 | * semantic.el (semantic-elapsed-time): Make it a defsubst. | ||
| 14 | |||
| 15 | * srecode/dictionary.el (srecode-adebug-dictionary): Remove | ||
| 16 | require for `semantic'. | ||
| 17 | |||
| 18 | * srecode/map.el: | ||
| 19 | * srecode/insert.el: Declare functions from `data-debug'. | ||
| 20 | |||
| 21 | * semantic/grammar.el: Require `help-fns'. Declare functions from | ||
| 22 | `eldoc', which is required in function body. | ||
| 23 | |||
| 24 | * srecode/java.el: | ||
| 25 | * semantic/texi.el: | ||
| 26 | * semantic/grammar-wy.el: | ||
| 27 | * semantic/db-file.el: | ||
| 28 | * semantic/db-el.el: | ||
| 29 | * semantic/chart.el: Fix requires. | ||
| 30 | |||
| 31 | * ede/locate.el: Remove useless requires. Declare functions | ||
| 32 | instead and require in functions when needed. | ||
| 33 | |||
| 1 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> | 34 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 35 | ||
| 3 | * semantic/db-file.el (semanticdb-save-database-functions): | 36 | * semantic/db-file.el (semanticdb-save-database-functions): |
diff --git a/lisp/cedet/ede/locate.el b/lisp/cedet/ede/locate.el index c008f5fb945..03227907af4 100644 --- a/lisp/cedet/ede/locate.el +++ b/lisp/cedet/ede/locate.el | |||
| @@ -49,13 +49,7 @@ | |||
| 49 | ;; when it is available. | 49 | ;; when it is available. |
| 50 | 50 | ||
| 51 | (require 'ede) | 51 | (require 'ede) |
| 52 | (eval-when-compile (require 'data-debug) | 52 | (eval-when-compile (require 'locate)) |
| 53 | (require 'eieio-datadebug) | ||
| 54 | (require 'cedet-global) | ||
| 55 | (require 'cedet-idutils) | ||
| 56 | (require 'cedet-cscope)) | ||
| 57 | |||
| 58 | (require 'locate) | ||
| 59 | 53 | ||
| 60 | ;;; Code: | 54 | ;;; Code: |
| 61 | (defcustom ede-locate-setup-options | 55 | (defcustom ede-locate-setup-options |
| @@ -214,6 +208,12 @@ that created this EDE locate object." | |||
| 214 | 208 | ||
| 215 | ;;; GLOBAL | 209 | ;;; GLOBAL |
| 216 | ;; | 210 | ;; |
| 211 | |||
| 212 | (declare-function cedet-gnu-global-version-check "cedet-global") | ||
| 213 | (declare-function cedet-gnu-global-root "cedet-global") | ||
| 214 | (declare-function cedet-gnu-global-expand-filename "cedet-global") | ||
| 215 | (declare-function cedet-gnu-global-create/update-database "cedet-global") | ||
| 216 | |||
| 217 | (defclass ede-locate-global (ede-locate-base) | 217 | (defclass ede-locate-global (ede-locate-base) |
| 218 | () | 218 | () |
| 219 | "EDE Locator using GNU Global. | 219 | "EDE Locator using GNU Global. |
| @@ -260,6 +260,12 @@ that created this EDE locate object." | |||
| 260 | 260 | ||
| 261 | ;;; IDUTILS | 261 | ;;; IDUTILS |
| 262 | ;; | 262 | ;; |
| 263 | |||
| 264 | (declare-function cedet-idutils-version-check "cedet-idutils") | ||
| 265 | (declare-function cedet-idutils-support-for-directory "cedet-idutils") | ||
| 266 | (declare-function cedet-idutils-expand-filename "cedet-idutils") | ||
| 267 | (declare-function cedet-idutils-create/update-database "cedet-idutils") | ||
| 268 | |||
| 263 | (defclass ede-locate-idutils (ede-locate-base) | 269 | (defclass ede-locate-idutils (ede-locate-base) |
| 264 | () | 270 | () |
| 265 | "EDE Locator using IDUtils. | 271 | "EDE Locator using IDUtils. |
| @@ -303,6 +309,12 @@ that created this EDE locate object." | |||
| 303 | 309 | ||
| 304 | ;;; CSCOPE | 310 | ;;; CSCOPE |
| 305 | ;; | 311 | ;; |
| 312 | |||
| 313 | (declare-function cedet-cscope-version-check "cedet-scope") | ||
| 314 | (declare-function cedet-cscope-support-for-directory "cedet-scope") | ||
| 315 | (declare-function cedet-cscope-expand-filename "cedet-cscope") | ||
| 316 | (declare-function cedet-cscope-create/update-database "cedet-cscope") | ||
| 317 | |||
| 306 | (defclass ede-locate-cscope (ede-locate-base) | 318 | (defclass ede-locate-cscope (ede-locate-base) |
| 307 | () | 319 | () |
| 308 | "EDE Locator using Cscope. | 320 | "EDE Locator using Cscope. |
| @@ -315,6 +327,7 @@ file name searching variable `cedet-cscope-file-command'.") | |||
| 315 | ;; Get ourselves initialized. | 327 | ;; Get ourselves initialized. |
| 316 | (call-next-method) | 328 | (call-next-method) |
| 317 | ;; Do the checks. | 329 | ;; Do the checks. |
| 330 | (require 'cedet-cscope) | ||
| 318 | (cedet-cscope-version-check) | 331 | (cedet-cscope-version-check) |
| 319 | (when (not (cedet-cscope-support-for-directory (oref loc root))) | 332 | (when (not (cedet-cscope-support-for-directory (oref loc root))) |
| 320 | (error "Cannot use Cscope in %s" | 333 | (error "Cannot use Cscope in %s" |
| @@ -324,6 +337,7 @@ file name searching variable `cedet-cscope-file-command'.") | |||
| 324 | (defmethod ede-locate-ok-in-project :static ((loc ede-locate-cscope) | 337 | (defmethod ede-locate-ok-in-project :static ((loc ede-locate-cscope) |
| 325 | root) | 338 | root) |
| 326 | "Is it ok to use this project type under ROOT." | 339 | "Is it ok to use this project type under ROOT." |
| 340 | (require 'cedet-cscope) | ||
| 327 | (cedet-cscope-version-check) | 341 | (cedet-cscope-version-check) |
| 328 | (when (cedet-cscope-support-for-directory root) | 342 | (when (cedet-cscope-support-for-directory root) |
| 329 | root)) | 343 | root)) |
| @@ -334,11 +348,13 @@ file name searching variable `cedet-cscope-file-command'.") | |||
| 334 | Searches are done under the current root of the EDE project | 348 | Searches are done under the current root of the EDE project |
| 335 | that created this EDE locate object." | 349 | that created this EDE locate object." |
| 336 | (let ((default-directory (oref loc root))) | 350 | (let ((default-directory (oref loc root))) |
| 351 | (require 'cedet-cscope) | ||
| 337 | (cedet-cscope-expand-filename filesubstring))) | 352 | (cedet-cscope-expand-filename filesubstring))) |
| 338 | 353 | ||
| 339 | (defmethod ede-locate-create/update-root-database :STATIC | 354 | (defmethod ede-locate-create/update-root-database :STATIC |
| 340 | ((loc ede-locate-cscope) root) | 355 | ((loc ede-locate-cscope) root) |
| 341 | "Create or update the GNU Global database for the current project." | 356 | "Create or update the GNU Global database for the current project." |
| 357 | (require 'cedet-cscope) | ||
| 342 | (cedet-cscope-create/update-database root)) | 358 | (cedet-cscope-create/update-database root)) |
| 343 | 359 | ||
| 344 | (provide 'ede/locate) | 360 | (provide 'ede/locate) |
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index 373864a43d5..01d3206f662 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el | |||
| @@ -382,7 +382,7 @@ to use Semantic, and `semantic-init-hook' is run." | |||
| 382 | "When non-nil, activate the interactive parsing debugger. | 382 | "When non-nil, activate the interactive parsing debugger. |
| 383 | Do not set this yourself. Call `semantic-debug'.") | 383 | Do not set this yourself. Call `semantic-debug'.") |
| 384 | 384 | ||
| 385 | (defun semantic-elapsed-time (start end) | 385 | (defsubst semantic-elapsed-time (start end) |
| 386 | "Copied from elp.el. Was `elp-elapsed-time'. | 386 | "Copied from elp.el. Was `elp-elapsed-time'. |
| 387 | Arguments START and END bound the time being calculated." | 387 | Arguments START and END bound the time being calculated." |
| 388 | (float-time (time-subtract end start))) | 388 | (float-time (time-subtract end start))) |
diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el index 63acc555343..d03c72a5983 100644 --- a/lisp/cedet/semantic/analyze.el +++ b/lisp/cedet/semantic/analyze.el | |||
| @@ -527,7 +527,7 @@ Returns an object based on symbol `semantic-analyze-context'." | |||
| 527 | (function nil) | 527 | (function nil) |
| 528 | (fntag nil) | 528 | (fntag nil) |
| 529 | arg fntagend argtag | 529 | arg fntagend argtag |
| 530 | assign asstag | 530 | assign asstag newseq |
| 531 | ) | 531 | ) |
| 532 | 532 | ||
| 533 | ;; Pattern for Analysis: | 533 | ;; Pattern for Analysis: |
| @@ -601,16 +601,26 @@ Returns an object based on symbol `semantic-analyze-context'." | |||
| 601 | 601 | ||
| 602 | (if debug-on-error | 602 | (if debug-on-error |
| 603 | (catch 'unfindable | 603 | (catch 'unfindable |
| 604 | ;; If debug on error is on, allow debugging in this fcn. | ||
| 605 | (setq prefix (semantic-analyze-find-tag-sequence | 604 | (setq prefix (semantic-analyze-find-tag-sequence |
| 606 | prefix scope 'prefixtypes 'unfindable))) | 605 | prefix scope 'prefixtypes 'unfindable)) |
| 606 | ;; If there's an alias, dereference it and analyze | ||
| 607 | ;; sequence again. | ||
| 608 | (when (setq newseq | ||
| 609 | (semantic-analyze-dereference-alias prefix)) | ||
| 610 | (setq prefix (semantic-analyze-find-tag-sequence | ||
| 611 | newseq scope 'prefixtypes 'unfindable)))) | ||
| 607 | ;; Debug on error is off. Capture errors and move on | 612 | ;; Debug on error is off. Capture errors and move on |
| 608 | (condition-case err | 613 | (condition-case err |
| 609 | ;; NOTE: This line is duplicated in | 614 | ;; NOTE: This line is duplicated in |
| 610 | ;; semantic-analyzer-debug-global-symbol | 615 | ;; semantic-analyzer-debug-global-symbol |
| 611 | ;; You will need to update both places. | 616 | ;; You will need to update both places. |
| 612 | (setq prefix (semantic-analyze-find-tag-sequence | 617 | (progn |
| 613 | prefix scope 'prefixtypes)) | 618 | (setq prefix (semantic-analyze-find-tag-sequence |
| 619 | prefix scope 'prefixtypes)) | ||
| 620 | (when (setq newseq | ||
| 621 | (semantic-analyze-dereference-alias prefix)) | ||
| 622 | (setq prefix (semantic-analyze-find-tag-sequence | ||
| 623 | newseq scope 'prefixtypes)))) | ||
| 614 | (error (semantic-analyze-push-error err)))) | 624 | (error (semantic-analyze-push-error err)))) |
| 615 | ) | 625 | ) |
| 616 | 626 | ||
| @@ -679,6 +689,20 @@ Returns an object based on symbol `semantic-analyze-context'." | |||
| 679 | ;; Return our context. | 689 | ;; Return our context. |
| 680 | context-return)) | 690 | context-return)) |
| 681 | 691 | ||
| 692 | (defun semantic-analyze-dereference-alias (taglist) | ||
| 693 | "Dereference first tag in TAGLIST if it is an alias. | ||
| 694 | Returns a sequence of names which can then be fed again into | ||
| 695 | `semantic-analyze-find-tag-sequence'. | ||
| 696 | Returns nil if no alias was found." | ||
| 697 | (when (eq (semantic-tag-get-attribute (car taglist) :kind) 'alias) | ||
| 698 | (let ((tagname | ||
| 699 | (semantic-analyze-split-name | ||
| 700 | (semantic-tag-name | ||
| 701 | (car (semantic-tag-get-attribute (car taglist) :members)))))) | ||
| 702 | (append (if (listp tagname) | ||
| 703 | tagname | ||
| 704 | (list tagname)) | ||
| 705 | (cdr taglist))))) | ||
| 682 | 706 | ||
| 683 | (defun semantic-adebug-analyze (&optional ctxt) | 707 | (defun semantic-adebug-analyze (&optional ctxt) |
| 684 | "Perform `semantic-analyze-current-context'. | 708 | "Perform `semantic-analyze-current-context'. |
diff --git a/lisp/cedet/semantic/chart.el b/lisp/cedet/semantic/chart.el index c6b13475862..2c6f7344acf 100644 --- a/lisp/cedet/semantic/chart.el +++ b/lisp/cedet/semantic/chart.el | |||
| @@ -26,12 +26,9 @@ | |||
| 26 | ;; the output of the semantic parser. | 26 | ;; the output of the semantic parser. |
| 27 | ;; | 27 | ;; |
| 28 | 28 | ||
| 29 | (require 'semantic) | ||
| 30 | (require 'chart) | 29 | (require 'chart) |
| 31 | (require 'semantic/db) | 30 | (require 'semantic/db) |
| 32 | (require 'semantic/tag) | 31 | (require 'semantic/find) |
| 33 | |||
| 34 | (eval-when-compile (require 'semantic/find)) | ||
| 35 | 32 | ||
| 36 | ;;; Code: | 33 | ;;; Code: |
| 37 | 34 | ||
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el index 281479045ea..dbb3bfae34d 100644 --- a/lisp/cedet/semantic/db-el.el +++ b/lisp/cedet/semantic/db-el.el | |||
| @@ -31,12 +31,7 @@ | |||
| 31 | ;; | 31 | ;; |
| 32 | 32 | ||
| 33 | (require 'semantic/db) | 33 | (require 'semantic/db) |
| 34 | 34 | (require 'eieio-opt) | |
| 35 | (eval-when-compile | ||
| 36 | ;; For generic function searching. | ||
| 37 | (require 'eieio) | ||
| 38 | (require 'eieio-opt) | ||
| 39 | (require 'eieio-base)) | ||
| 40 | 35 | ||
| 41 | (declare-function semantic-elisp-desymbolify "semantic/bovine/el") | 36 | (declare-function semantic-elisp-desymbolify "semantic/bovine/el") |
| 42 | (declare-function semantic-tag-similar-p "semantic/tag-ls") | 37 | (declare-function semantic-tag-similar-p "semantic/tag-ls") |
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el index 4f8e93dc391..905c62a89dd 100644 --- a/lisp/cedet/semantic/db-file.el +++ b/lisp/cedet/semantic/db-file.el | |||
| @@ -25,12 +25,9 @@ | |||
| 25 | ;; A set of semanticdb classes for persistently saving caches on disk. | 25 | ;; A set of semanticdb classes for persistently saving caches on disk. |
| 26 | ;; | 26 | ;; |
| 27 | 27 | ||
| 28 | (require 'semantic) | ||
| 29 | (require 'semantic/db) | 28 | (require 'semantic/db) |
| 30 | (require 'cedet-files) | 29 | (require 'cedet-files) |
| 31 | 30 | (require 'data-debug) | |
| 32 | (eval-when-compile | ||
| 33 | (require 'data-debug)) | ||
| 34 | 31 | ||
| 35 | (defvar semanticdb-file-version semantic-version | 32 | (defvar semanticdb-file-version semantic-version |
| 36 | "Version of semanticdb we are writing files to disk with.") | 33 | "Version of semanticdb we are writing files to disk with.") |
diff --git a/lisp/cedet/semantic/grammar-wy.el b/lisp/cedet/semantic/grammar-wy.el index 8a33c8c8a1a..a926f636b4b 100644 --- a/lisp/cedet/semantic/grammar-wy.el +++ b/lisp/cedet/semantic/grammar-wy.el | |||
| @@ -23,9 +23,8 @@ | |||
| 23 | 23 | ||
| 24 | ;;; Code: | 24 | ;;; Code: |
| 25 | 25 | ||
| 26 | (require 'semantic/lex) | 26 | (require 'semantic) |
| 27 | (eval-when-compile (require 'semantic/bovine)) | 27 | |
| 28 | |||
| 29 | ;;; Prologue | 28 | ;;; Prologue |
| 30 | ;; | 29 | ;; |
| 31 | (defvar semantic-grammar-lex-c-char-re) | 30 | (defvar semantic-grammar-lex-c-char-re) |
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index b85396a79ae..c0e7b8f9038 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | (require 'semantic/format) | 35 | (require 'semantic/format) |
| 36 | (require 'semantic/grammar-wy) | 36 | (require 'semantic/grammar-wy) |
| 37 | (require 'semantic/idle) | 37 | (require 'semantic/idle) |
| 38 | (require 'help-fns) | ||
| 38 | 39 | ||
| 39 | (declare-function semantic-momentary-highlight-tag "semantic/decorate") | 40 | (declare-function semantic-momentary-highlight-tag "semantic/decorate") |
| 40 | (declare-function semantic-analyze-context "semantic/analyze") | 41 | (declare-function semantic-analyze-context "semantic/analyze") |
| @@ -47,6 +48,9 @@ | |||
| 47 | (require 'semantic/find) | 48 | (require 'semantic/find) |
| 48 | (require 'semantic/db)) | 49 | (require 'semantic/db)) |
| 49 | 50 | ||
| 51 | (declare-function semantic-grammar-wy--install-parser | ||
| 52 | "semantic/gram-wy-fallback") | ||
| 53 | |||
| 50 | 54 | ||
| 51 | ;;;; | 55 | ;;;; |
| 52 | ;;;; Set up lexer | 56 | ;;;; Set up lexer |
| @@ -825,6 +829,8 @@ Does nothing if the Lisp code seems up to date. | |||
| 825 | If optional argument FORCE is non-nil, unconditionally re-generate the | 829 | If optional argument FORCE is non-nil, unconditionally re-generate the |
| 826 | Lisp code." | 830 | Lisp code." |
| 827 | (interactive "P") | 831 | (interactive "P") |
| 832 | (unless (semantic-active-p) | ||
| 833 | (error "You have to activate semantic-mode to create a package.")) | ||
| 828 | (setq force (or force current-prefix-arg)) | 834 | (setq force (or force current-prefix-arg)) |
| 829 | (semantic-fetch-tags) | 835 | (semantic-fetch-tags) |
| 830 | (let* ( | 836 | (let* ( |
| @@ -1636,6 +1642,12 @@ Select the buffer containing the tag's definition, and move point there." | |||
| 1636 | ) | 1642 | ) |
| 1637 | "Association of syntax elements, and the corresponding help.") | 1643 | "Association of syntax elements, and the corresponding help.") |
| 1638 | 1644 | ||
| 1645 | (declare-function eldoc-function-argstring "eldoc") | ||
| 1646 | (declare-function eldoc-docstring-format-sym-doc "eldoc") | ||
| 1647 | (declare-function eldoc-last-data-store "eldoc") | ||
| 1648 | (declare-function eldoc-get-fnsym-args-string "eldoc") | ||
| 1649 | (declare-function eldoc-get-var-docstring "eldoc") | ||
| 1650 | |||
| 1639 | (defun semantic-grammar-eldoc-get-macro-docstring (macro expander) | 1651 | (defun semantic-grammar-eldoc-get-macro-docstring (macro expander) |
| 1640 | "Return a one-line docstring for the given grammar MACRO. | 1652 | "Return a one-line docstring for the given grammar MACRO. |
| 1641 | EXPANDER is the name of the function that expands MACRO." | 1653 | EXPANDER is the name of the function that expands MACRO." |
diff --git a/lisp/cedet/semantic/texi.el b/lisp/cedet/semantic/texi.el index 9380940282f..d79e71bb265 100644 --- a/lisp/cedet/semantic/texi.el +++ b/lisp/cedet/semantic/texi.el | |||
| @@ -26,17 +26,11 @@ | |||
| 26 | ;; parser plug-in is the function `semantic-texi-parse-region' that | 26 | ;; parser plug-in is the function `semantic-texi-parse-region' that |
| 27 | ;; overrides `semantic-parse-region'. | 27 | ;; overrides `semantic-parse-region'. |
| 28 | 28 | ||
| 29 | (require 'semantic) | 29 | (require 'semantic/db-find) |
| 30 | (require 'semantic/format) | 30 | (require 'semantic/format) |
| 31 | (require 'semantic/ctxt) | ||
| 31 | (require 'texinfo) | 32 | (require 'texinfo) |
| 32 | 33 | ||
| 33 | (eval-when-compile | ||
| 34 | (require 'semantic/db) | ||
| 35 | (require 'semantic/db-find) | ||
| 36 | (require 'semantic/ctxt) | ||
| 37 | (require 'semantic/find) | ||
| 38 | (require 'semantic/doc)) | ||
| 39 | |||
| 40 | (defvar ede-minor-mode) | 34 | (defvar ede-minor-mode) |
| 41 | (declare-function lookup-words "ispell") | 35 | (declare-function lookup-words "ispell") |
| 42 | (declare-function ede-current-project "ede") | 36 | (declare-function ede-current-project "ede") |
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el index 8a1291f8d72..8457e35abe5 100644 --- a/lisp/cedet/srecode/compile.el +++ b/lisp/cedet/srecode/compile.el | |||
| @@ -199,6 +199,8 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use." | |||
| 199 | (defun srecode-compile-templates () | 199 | (defun srecode-compile-templates () |
| 200 | "Compile a semantic recode template file into a mode-local variable." | 200 | "Compile a semantic recode template file into a mode-local variable." |
| 201 | (interactive) | 201 | (interactive) |
| 202 | (unless (semantic-active-p) | ||
| 203 | (error "You have to activate semantic-mode to compile SRecode templates.")) | ||
| 202 | (require 'srecode/insert) | 204 | (require 'srecode/insert) |
| 203 | (message "Compiling template %s..." | 205 | (message "Compiling template %s..." |
| 204 | (file-name-nondirectory (buffer-file-name))) | 206 | (file-name-nondirectory (buffer-file-name))) |
diff --git a/lisp/cedet/srecode/dictionary.el b/lisp/cedet/srecode/dictionary.el index 6262383c397..2b6bbb51eaa 100644 --- a/lisp/cedet/srecode/dictionary.el +++ b/lisp/cedet/srecode/dictionary.el | |||
| @@ -604,7 +604,6 @@ STATE is the current compiler state." | |||
| 604 | "Run data-debug on this mode's dictionary." | 604 | "Run data-debug on this mode's dictionary." |
| 605 | (interactive) | 605 | (interactive) |
| 606 | (require 'eieio-datadebug) | 606 | (require 'eieio-datadebug) |
| 607 | (require 'semantic) | ||
| 608 | (require 'srecode/find) | 607 | (require 'srecode/find) |
| 609 | (let* ((modesym major-mode) | 608 | (let* ((modesym major-mode) |
| 610 | (start (current-time)) | 609 | (start (current-time)) |
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el index 726aa41cffd..f099c0ca6eb 100644 --- a/lisp/cedet/srecode/insert.el +++ b/lisp/cedet/srecode/insert.el | |||
| @@ -195,6 +195,10 @@ Buffer based features related to change hooks is handled one level up." | |||
| 195 | ;; area. Return value is not important. | 195 | ;; area. Return value is not important. |
| 196 | )) | 196 | )) |
| 197 | 197 | ||
| 198 | (declare-function data-debug-new-buffer "data-debug") | ||
| 199 | (declare-function data-debug-insert-stuff-list "data-debug") | ||
| 200 | (declare-function data-debug-insert-thing dictionary "data-debug") | ||
| 201 | |||
| 198 | (defun srecode-insert-show-error-report (dictionary format &rest args) | 202 | (defun srecode-insert-show-error-report (dictionary format &rest args) |
| 199 | "Display an error report based on DICTIONARY, FORMAT and ARGS. | 203 | "Display an error report based on DICTIONARY, FORMAT and ARGS. |
| 200 | This is intended to diagnose problems with failed template | 204 | This is intended to diagnose problems with failed template |
diff --git a/lisp/cedet/srecode/java.el b/lisp/cedet/srecode/java.el index 3635a39d383..43e9273da76 100644 --- a/lisp/cedet/srecode/java.el +++ b/lisp/cedet/srecode/java.el | |||
| @@ -26,10 +26,7 @@ | |||
| 26 | ;;; Code: | 26 | ;;; Code: |
| 27 | 27 | ||
| 28 | (require 'srecode/dictionary) | 28 | (require 'srecode/dictionary) |
| 29 | (require 'semantic/tag) | 29 | (require 'semantic/find) |
| 30 | |||
| 31 | (eval-when-compile | ||
| 32 | (require 'semantic/find)) | ||
| 33 | 30 | ||
| 34 | ;;;###autoload | 31 | ;;;###autoload |
| 35 | (defun srecode-semantic-handle-:java (dict) | 32 | (defun srecode-semantic-handle-:java (dict) |
diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el index d6613ee1b02..7fb5c16a1f3 100644 --- a/lisp/cedet/srecode/map.el +++ b/lisp/cedet/srecode/map.el | |||
| @@ -215,7 +215,8 @@ Optional argument RESET forces a reset of the current map." | |||
| 215 | ;; Eventually, I want to return many maps to search through. | 215 | ;; Eventually, I want to return many maps to search through. |
| 216 | (list srecode-current-map))) | 216 | (list srecode-current-map))) |
| 217 | 217 | ||
| 218 | (eval-when-compile (require 'data-debug)) | 218 | (declare-function data-debug-new-buffer "data-debug") |
| 219 | (declare-function data-debug-insert-stuff-list "data-debug") | ||
| 219 | 220 | ||
| 220 | (defun srecode-adebug-maps () | 221 | (defun srecode-adebug-maps () |
| 221 | "Run ADEBUG on the output of `srecode-get-maps'." | 222 | "Run ADEBUG on the output of `srecode-get-maps'." |
diff --git a/lisp/dired.el b/lisp/dired.el index a4bc16caebf..5f7ee48a810 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -137,9 +137,12 @@ A value of t means move to first file." | |||
| 137 | "Controls marking of renamed files. | 137 | "Controls marking of renamed files. |
| 138 | If t, files keep their previous marks when they are renamed. | 138 | If t, files keep their previous marks when they are renamed. |
| 139 | If a character, renamed files (whether previously marked or not) | 139 | If a character, renamed files (whether previously marked or not) |
| 140 | are afterward marked with that character." | 140 | are afterward marked with that character. |
| 141 | This option affects only files renamed by `dired-do-rename' and | ||
| 142 | `dired-do-rename-regexp'. See `wdired-keep-marker-rename' | ||
| 143 | if you want to do the same for files renamed in WDired mode." | ||
| 141 | :type '(choice (const :tag "Keep" t) | 144 | :type '(choice (const :tag "Keep" t) |
| 142 | (character :tag "Mark")) | 145 | (character :tag "Mark" :value ?R)) |
| 143 | :group 'dired-mark) | 146 | :group 'dired-mark) |
| 144 | 147 | ||
| 145 | (defcustom dired-keep-marker-copy ?C | 148 | (defcustom dired-keep-marker-copy ?C |
| @@ -620,7 +623,7 @@ Don't use that together with FILTER." | |||
| 620 | (let* ((all-of-them | 623 | (let* ((all-of-them |
| 621 | (save-excursion | 624 | (save-excursion |
| 622 | (dired-map-over-marks | 625 | (dired-map-over-marks |
| 623 | (dired-get-filename localp) | 626 | (dired-get-filename localp 'no-error-if-not-filep) |
| 624 | arg nil distinguish-one-marked))) | 627 | arg nil distinguish-one-marked))) |
| 625 | result) | 628 | result) |
| 626 | (if (not filter) | 629 | (if (not filter) |
| @@ -3107,10 +3110,11 @@ argument or confirmation)." | |||
| 3107 | (forward-line 1)))) | 3110 | (forward-line 1)))) |
| 3108 | 3111 | ||
| 3109 | (defun dired-mark (arg) | 3112 | (defun dired-mark (arg) |
| 3110 | "Mark the current (or next ARG) files. | 3113 | "Mark the file at point in the Dired buffer. |
| 3114 | If the region is active, mark all files in the region. | ||
| 3115 | Otherwise, with a prefix arg, mark files on the next ARG lines. | ||
| 3116 | |||
| 3111 | If on a subdir headerline, mark all its files except `.' and `..'. | 3117 | If on a subdir headerline, mark all its files except `.' and `..'. |
| 3112 | If the region is active in Transient Mark mode, mark all files | ||
| 3113 | in the active region. | ||
| 3114 | 3118 | ||
| 3115 | Use \\[dired-unmark-all-files] to remove all marks | 3119 | Use \\[dired-unmark-all-files] to remove all marks |
| 3116 | and \\[dired-unmark] on a subdir to remove the marks in | 3120 | and \\[dired-unmark] on a subdir to remove the marks in |
| @@ -3136,7 +3140,10 @@ this subdir." | |||
| 3136 | (function (lambda () (delete-char 1) (insert dired-marker-char)))))))) | 3140 | (function (lambda () (delete-char 1) (insert dired-marker-char)))))))) |
| 3137 | 3141 | ||
| 3138 | (defun dired-unmark (arg) | 3142 | (defun dired-unmark (arg) |
| 3139 | "Unmark the current (or next ARG) files. | 3143 | "Unmark the file at point in the Dired buffer. |
| 3144 | If the region is active, unmark all files in the region. | ||
| 3145 | Otherwise, with a prefix arg, unmark files on the next ARG lines. | ||
| 3146 | |||
| 3140 | If looking at a subdir, unmark all its files except `.' and `..'. | 3147 | If looking at a subdir, unmark all its files except `.' and `..'. |
| 3141 | If the region is active in Transient Mark mode, unmark all files | 3148 | If the region is active in Transient Mark mode, unmark all files |
| 3142 | in the active region." | 3149 | in the active region." |
| @@ -3146,7 +3153,9 @@ in the active region." | |||
| 3146 | 3153 | ||
| 3147 | (defun dired-flag-file-deletion (arg) | 3154 | (defun dired-flag-file-deletion (arg) |
| 3148 | "In Dired, flag the current line's file for deletion. | 3155 | "In Dired, flag the current line's file for deletion. |
| 3149 | With prefix arg, repeat over several lines. | 3156 | If the region is active, flag all files in the region. |
| 3157 | Otherwise, with a prefix arg, flag files on the next ARG lines. | ||
| 3158 | |||
| 3150 | If on a subdir headerline, flag all its files except `.' and `..'. | 3159 | If on a subdir headerline, flag all its files except `.' and `..'. |
| 3151 | If the region is active in Transient Mark mode, flag all files | 3160 | If the region is active in Transient Mark mode, flag all files |
| 3152 | in the active region." | 3161 | in the active region." |
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 007871aa3a6..bd85238e23e 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el | |||
| @@ -2897,8 +2897,11 @@ definition, INTERACTIVE if non-nil is the interactive form to be used, | |||
| 2897 | ORIG is a form that calls the body of the original unadvised function, | 2897 | ORIG is a form that calls the body of the original unadvised function, |
| 2898 | and BEFORES, AROUNDS and AFTERS are the lists of advices with which ORIG | 2898 | and BEFORES, AROUNDS and AFTERS are the lists of advices with which ORIG |
| 2899 | should be modified. The assembled function will be returned." | 2899 | should be modified. The assembled function will be returned." |
| 2900 | 2900 | ;; The ad-do-it call should always have the right number of arguments, | |
| 2901 | (let (before-forms around-form around-form-protected after-forms definition) | 2901 | ;; but the compiler might signal a bogus warning because it checks the call |
| 2902 | ;; against the advertised calling convention. | ||
| 2903 | (let ((around-form `(setq ad-return-value (with-no-warnings ,orig))) | ||
| 2904 | before-forms around-form-protected after-forms definition) | ||
| 2902 | (dolist (advice befores) | 2905 | (dolist (advice befores) |
| 2903 | (cond ((and (ad-advice-protected advice) | 2906 | (cond ((and (ad-advice-protected advice) |
| 2904 | before-forms) | 2907 | before-forms) |
| @@ -2911,7 +2914,6 @@ should be modified. The assembled function will be returned." | |||
| 2911 | (append before-forms | 2914 | (append before-forms |
| 2912 | (ad-body-forms (ad-advice-definition advice))))))) | 2915 | (ad-body-forms (ad-advice-definition advice))))))) |
| 2913 | 2916 | ||
| 2914 | (setq around-form `(setq ad-return-value ,orig)) | ||
| 2915 | (dolist (advice (reverse arounds)) | 2917 | (dolist (advice (reverse arounds)) |
| 2916 | ;; If any of the around advices is protected then we | 2918 | ;; If any of the around advices is protected then we |
| 2917 | ;; protect the complete around advice onion: | 2919 | ;; protect the complete around advice onion: |
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 6250edc8792..ffa42e97221 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -286,7 +286,7 @@ DEFUNINFO is the return value of `checkdoc-defun-info'. ENDPOINT is the | |||
| 286 | location of end of the documentation string.") | 286 | location of end of the documentation string.") |
| 287 | 287 | ||
| 288 | (define-obsolete-variable-alias 'checkdoc-comment-style-hooks | 288 | (define-obsolete-variable-alias 'checkdoc-comment-style-hooks |
| 289 | checkdoc-comment-style-functions "24.3") | 289 | 'checkdoc-comment-style-functions "24.3") |
| 290 | (defvar checkdoc-comment-style-functions nil | 290 | (defvar checkdoc-comment-style-functions nil |
| 291 | "Hook run after the standard comment style check is completed. | 291 | "Hook run after the standard comment style check is completed. |
| 292 | Must return nil if no errors are found, or a string describing the | 292 | Must return nil if no errors are found, or a string describing the |
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 913ebf2015f..c72e3342648 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el | |||
| @@ -149,8 +149,9 @@ the elements themselves. | |||
| 149 | (setq cl-list (cdr cl-list))) | 149 | (setq cl-list (cdr cl-list))) |
| 150 | (nreverse cl-res)))) | 150 | (nreverse cl-res)))) |
| 151 | 151 | ||
| 152 | ;;;###autoload | ||
| 152 | (defun cl-mapc (cl-func cl-seq &rest cl-rest) | 153 | (defun cl-mapc (cl-func cl-seq &rest cl-rest) |
| 153 | "Like `mapcar', but does not accumulate values returned by the function. | 154 | "Like `cl-mapcar', but does not accumulate values returned by the function. |
| 154 | \n(fn FUNCTION SEQUENCE...)" | 155 | \n(fn FUNCTION SEQUENCE...)" |
| 155 | (if cl-rest | 156 | (if cl-rest |
| 156 | (progn (apply 'cl-map nil cl-func cl-seq cl-rest) | 157 | (progn (apply 'cl-map nil cl-func cl-seq cl-rest) |
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index d05fbc42060..5ad6e37a5a1 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el | |||
| @@ -10,8 +10,8 @@ | |||
| 10 | ;;;;;; cl-truncate cl-ceiling cl-floor cl-isqrt cl-lcm cl-gcd cl--set-frame-visible-p | 10 | ;;;;;; cl-truncate cl-ceiling cl-floor cl-isqrt cl-lcm cl-gcd cl--set-frame-visible-p |
| 11 | ;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively | 11 | ;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively |
| 12 | ;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan | 12 | ;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan |
| 13 | ;;;;;; cl-mapl cl-maplist cl-map cl--mapcar-many cl-equalp cl-coerce) | 13 | ;;;;;; cl-mapl cl-mapc cl-maplist cl-map cl--mapcar-many cl-equalp |
| 14 | ;;;;;; "cl-extra" "cl-extra.el" "1572ae52fa4fbd9c4bf89b49a068a865") | 14 | ;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "7d7f65d8a05e954a919fe2555b68fb05") |
| 15 | ;;; Generated autoloads from cl-extra.el | 15 | ;;; Generated autoloads from cl-extra.el |
| 16 | 16 | ||
| 17 | (autoload 'cl-coerce "cl-extra" "\ | 17 | (autoload 'cl-coerce "cl-extra" "\ |
| @@ -46,6 +46,11 @@ the elements themselves. | |||
| 46 | 46 | ||
| 47 | \(fn FUNCTION LIST...)" nil nil) | 47 | \(fn FUNCTION LIST...)" nil nil) |
| 48 | 48 | ||
| 49 | (autoload 'cl-mapc "cl-extra" "\ | ||
| 50 | Like `cl-mapcar', but does not accumulate values returned by the function. | ||
| 51 | |||
| 52 | \(fn FUNCTION SEQUENCE...)" nil nil) | ||
| 53 | |||
| 49 | (autoload 'cl-mapl "cl-extra" "\ | 54 | (autoload 'cl-mapl "cl-extra" "\ |
| 50 | Like `cl-maplist', but does not accumulate values returned by the function. | 55 | Like `cl-maplist', but does not accumulate values returned by the function. |
| 51 | 56 | ||
| @@ -260,7 +265,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value. | |||
| 260 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when | 265 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when |
| 261 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp | 266 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp |
| 262 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) | 267 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) |
| 263 | ;;;;;; "cl-macs" "cl-macs.el" "885919e79dbcd11081cfb2e039b470c7") | 268 | ;;;;;; "cl-macs" "cl-macs.el" "366e9efa4e3e7a81b2253e503611b23a") |
| 264 | ;;; Generated autoloads from cl-macs.el | 269 | ;;; Generated autoloads from cl-macs.el |
| 265 | 270 | ||
| 266 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ | 271 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ |
| @@ -485,7 +490,7 @@ before assigning any symbols SYM to the corresponding values. | |||
| 485 | Bind SYMBOLS to VALUES dynamically in BODY. | 490 | Bind SYMBOLS to VALUES dynamically in BODY. |
| 486 | The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. | 491 | The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. |
| 487 | Each symbol in the first list is bound to the corresponding value in the | 492 | Each symbol in the first list is bound to the corresponding value in the |
| 488 | second list (or made unbound if VALUES is shorter than SYMBOLS); then the | 493 | second list (or to nil if VALUES is shorter than SYMBOLS); then the |
| 489 | BODY forms are executed and their result is returned. This is much like | 494 | BODY forms are executed and their result is returned. This is much like |
| 490 | a `let' form, except that the list of symbols can be computed at run-time. | 495 | a `let' form, except that the list of symbols can be computed at run-time. |
| 491 | 496 | ||
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 592c33d21c5..a448973c1bb 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -1603,7 +1603,7 @@ before assigning any symbols SYM to the corresponding values. | |||
| 1603 | "Bind SYMBOLS to VALUES dynamically in BODY. | 1603 | "Bind SYMBOLS to VALUES dynamically in BODY. |
| 1604 | The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. | 1604 | The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. |
| 1605 | Each symbol in the first list is bound to the corresponding value in the | 1605 | Each symbol in the first list is bound to the corresponding value in the |
| 1606 | second list (or made unbound if VALUES is shorter than SYMBOLS); then the | 1606 | second list (or to nil if VALUES is shorter than SYMBOLS); then the |
| 1607 | BODY forms are executed and their result is returned. This is much like | 1607 | BODY forms are executed and their result is returned. This is much like |
| 1608 | a `let' form, except that the list of symbols can be computed at run-time." | 1608 | a `let' form, except that the list of symbols can be computed at run-time." |
| 1609 | (declare (indent 2) (debug (form form body))) | 1609 | (declare (indent 2) (debug (form form body))) |
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 34beed0d9ef..d3ef83961e2 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el | |||
| @@ -511,7 +511,10 @@ rather than relying on `lexical-binding'." | |||
| 511 | 511 | ||
| 512 | (defmacro letf (bindings &rest body) | 512 | (defmacro letf (bindings &rest body) |
| 513 | "Dynamically scoped let-style bindings for places. | 513 | "Dynamically scoped let-style bindings for places. |
| 514 | Like `cl-letf', but with some extra backward compatibility." | 514 | For more details, see `cl-letf'. This macro behaves like that one |
| 515 | in almost every respect (apart from details that relate to some | ||
| 516 | deprecated usage of `symbol-function' in place forms)." ; bug#12760 | ||
| 517 | (declare (indent 1) (debug cl-letf)) | ||
| 515 | ;; Like cl-letf, but with special handling of symbol-function. | 518 | ;; Like cl-letf, but with special handling of symbol-function. |
| 516 | `(cl-letf ,(mapcar (lambda (x) (if (eq (car-safe (car x)) 'symbol-function) | 519 | `(cl-letf ,(mapcar (lambda (x) (if (eq (car-safe (car x)) 'symbol-function) |
| 517 | `((cl--symbol-function ,@(cdar x)) ,@(cdr x)) | 520 | `((cl--symbol-function ,@(cdar x)) ,@(cdr x)) |
| @@ -568,9 +571,9 @@ well for simple place forms. In the simple `defsetf' form, `setf's of | |||
| 568 | the form (setf (NAME ARGS...) VAL) are transformed to function or macro | 571 | the form (setf (NAME ARGS...) VAL) are transformed to function or macro |
| 569 | calls of the form (FUNC ARGS... VAL). Example: | 572 | calls of the form (FUNC ARGS... VAL). Example: |
| 570 | 573 | ||
| 571 | (cl-defsetf aref aset) | 574 | (defsetf aref aset) |
| 572 | 575 | ||
| 573 | Alternate form: (cl-defsetf NAME ARGLIST (STORE) BODY...). | 576 | Alternate form: (defsetf NAME ARGLIST (STORE) BODY...). |
| 574 | Here, the above `setf' call is expanded by binding the argument forms ARGS | 577 | Here, the above `setf' call is expanded by binding the argument forms ARGS |
| 575 | according to ARGLIST, binding the value form VAL to STORE, then executing | 578 | according to ARGLIST, binding the value form VAL to STORE, then executing |
| 576 | BODY, which must return a Lisp form that does the necessary `setf' operation. | 579 | BODY, which must return a Lisp form that does the necessary `setf' operation. |
| @@ -578,7 +581,7 @@ Actually, ARGLIST and STORE may be bound to temporary variables which are | |||
| 578 | introduced automatically to preserve proper execution order of the arguments. | 581 | introduced automatically to preserve proper execution order of the arguments. |
| 579 | Example: | 582 | Example: |
| 580 | 583 | ||
| 581 | (cl-defsetf nth (n x) (v) `(setcar (nthcdr ,n ,x) ,v)) | 584 | (defsetf nth (n x) (v) `(setcar (nthcdr ,n ,x) ,v)) |
| 582 | 585 | ||
| 583 | \(fn NAME [FUNC | ARGLIST (STORE) BODY...])" | 586 | \(fn NAME [FUNC | ARGLIST (STORE) BODY...])" |
| 584 | (declare (debug | 587 | (declare (debug |
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 939fab78942..26a1fce2309 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el | |||
| @@ -44,110 +44,101 @@ menus, turn this variable off, otherwise it is probably better to keep it on.") | |||
| 44 | 44 | ||
| 45 | ;;;###autoload | 45 | ;;;###autoload |
| 46 | (defmacro easy-menu-define (symbol maps doc menu) | 46 | (defmacro easy-menu-define (symbol maps doc menu) |
| 47 | "Define a menu bar submenu in maps MAPS, according to MENU. | 47 | "Define a pop-up menu and/or menu bar menu specified by MENU. |
| 48 | If SYMBOL is non-nil, define SYMBOL as a function to pop up the | ||
| 49 | submenu defined by MENU, with DOC as its doc string. | ||
| 48 | 50 | ||
| 49 | If SYMBOL is non-nil, store the menu keymap in the value of SYMBOL, | 51 | MAPS, if non-nil, should be a keymap or a list of keymaps; add |
| 50 | and define SYMBOL as a function to pop up the menu, with DOC as its doc string. | 52 | the submenu defined by MENU to the keymap or each of the keymaps, |
| 51 | If SYMBOL is nil, just store the menu keymap into MAPS. | 53 | as a top-level menu bar item. |
| 52 | 54 | ||
| 53 | The first element of MENU must be a string. It is the menu bar item name. | 55 | The first element of MENU must be a string. It is the menu bar |
| 54 | It may be followed by the following keyword argument pairs | 56 | item name. It may be followed by the following keyword argument |
| 57 | pairs: | ||
| 55 | 58 | ||
| 56 | :filter FUNCTION | 59 | :filter FUNCTION |
| 60 | FUNCTION must be a function which, if called with one | ||
| 61 | argument---the list of the other menu items---returns the | ||
| 62 | items to actually display. | ||
| 57 | 63 | ||
| 58 | FUNCTION is a function with one argument, the rest of menu items. | 64 | :visible INCLUDE |
| 59 | It returns the remaining items of the displayed menu. | 65 | INCLUDE is an expression. The menu is visible if the |
| 66 | expression evaluates to a non-nil value. `:included' is an | ||
| 67 | alias for `:visible'. | ||
| 60 | 68 | ||
| 61 | :visible INCLUDE | 69 | :active ENABLE |
| 70 | ENABLE is an expression. The menu is enabled for selection | ||
| 71 | if the expression evaluates to a non-nil value. `:enable' is | ||
| 72 | an alias for `:active'. | ||
| 62 | 73 | ||
| 63 | INCLUDE is an expression; this menu is only visible if this | 74 | The rest of the elements in MENU are menu items. |
| 64 | expression has a non-nil value. `:included' is an alias for `:visible'. | 75 | A menu item can be a vector of three elements: |
| 65 | 76 | ||
| 66 | :active ENABLE | 77 | [NAME CALLBACK ENABLE] |
| 67 | |||
| 68 | ENABLE is an expression; the menu is enabled for selection whenever | ||
| 69 | this expression's value is non-nil. `:enable' is an alias for `:active'. | ||
| 70 | |||
| 71 | The rest of the elements in MENU, are menu items. | ||
| 72 | |||
| 73 | A menu item is usually a vector of three elements: [NAME CALLBACK ENABLE] | ||
| 74 | 78 | ||
| 75 | NAME is a string--the menu item name. | 79 | NAME is a string--the menu item name. |
| 76 | 80 | ||
| 77 | CALLBACK is a command to run when the item is chosen, | 81 | CALLBACK is a command to run when the item is chosen, or an |
| 78 | or a list to evaluate when the item is chosen. | 82 | expression to evaluate when the item is chosen. |
| 79 | 83 | ||
| 80 | ENABLE is an expression; the item is enabled for selection | 84 | ENABLE is an expression; the item is enabled for selection if the |
| 81 | whenever this expression's value is non-nil. | 85 | expression evaluates to a non-nil value. |
| 82 | 86 | ||
| 83 | Alternatively, a menu item may have the form: | 87 | Alternatively, a menu item may have the form: |
| 84 | 88 | ||
| 85 | [ NAME CALLBACK [ KEYWORD ARG ] ... ] | 89 | [ NAME CALLBACK [ KEYWORD ARG ]... ] |
| 86 | |||
| 87 | Where KEYWORD is one of the symbols defined below. | ||
| 88 | |||
| 89 | :keys KEYS | ||
| 90 | |||
| 91 | KEYS is a string; a complex keyboard equivalent to this menu item. | ||
| 92 | This is normally not needed because keyboard equivalents are usually | ||
| 93 | computed automatically. | ||
| 94 | KEYS is expanded with `substitute-command-keys' before it is used. | ||
| 95 | |||
| 96 | :key-sequence KEYS | ||
| 97 | |||
| 98 | KEYS is nil, a string or a vector; nil or a keyboard equivalent to this | ||
| 99 | menu item. | ||
| 100 | This is a hint that will considerably speed up Emacs's first display of | ||
| 101 | a menu. Use `:key-sequence nil' when you know that this menu item has no | ||
| 102 | keyboard equivalent. | ||
| 103 | |||
| 104 | :active ENABLE | ||
| 105 | |||
| 106 | ENABLE is an expression; the item is enabled for selection whenever | ||
| 107 | this expression's value is non-nil. `:enable' is an alias for `:active'. | ||
| 108 | |||
| 109 | :visible INCLUDE | ||
| 110 | |||
| 111 | INCLUDE is an expression; this item is only visible if this | ||
| 112 | expression has a non-nil value. `:included' is an alias for `:visible'. | ||
| 113 | |||
| 114 | :label FORM | ||
| 115 | 90 | ||
| 116 | FORM is an expression that will be dynamically evaluated and whose | 91 | where NAME and CALLBACK have the same meanings as above, and each |
| 117 | value will be used for the menu entry's text label (the default is NAME). | 92 | optional KEYWORD and ARG pair should be one of the following: |
| 118 | 93 | ||
| 119 | :suffix FORM | 94 | :keys KEYS |
| 95 | KEYS is a string; a keyboard equivalent to the menu item. | ||
| 96 | This is normally not needed because keyboard equivalents are | ||
| 97 | usually computed automatically. KEYS is expanded with | ||
| 98 | `substitute-command-keys' before it is used. | ||
| 120 | 99 | ||
| 121 | FORM is an expression that will be dynamically evaluated and whose | 100 | :key-sequence KEYS |
| 122 | value will be concatenated to the menu entry's label. | 101 | KEYS is a hint for speeding up Emacs's first display of the |
| 102 | menu. It should be nil if you know that the menu item has no | ||
| 103 | keyboard equivalent; otherwise it should be a string or | ||
| 104 | vector specifying a keyboard equivalent for the menu item. | ||
| 123 | 105 | ||
| 124 | :style STYLE | 106 | :active ENABLE |
| 107 | ENABLE is an expression; the item is enabled for selection | ||
| 108 | whenever this expression's value is non-nil. `:enable' is an | ||
| 109 | alias for `:active'. | ||
| 125 | 110 | ||
| 126 | STYLE is a symbol describing the type of menu item. The following are | 111 | :visible INCLUDE |
| 127 | defined: | 112 | INCLUDE is an expression; this item is only visible if this |
| 113 | expression has a non-nil value. `:included' is an alias for | ||
| 114 | `:visible'. | ||
| 128 | 115 | ||
| 129 | toggle: A checkbox. | 116 | :label FORM |
| 130 | Prepend the name with `(*) ' or `( ) ' depending on if selected or not. | 117 | FORM is an expression that is dynamically evaluated and whose |
| 131 | radio: A radio button. | 118 | value serves as the menu item's label (the default is NAME). |
| 132 | Prepend the name with `[X] ' or `[ ] ' depending on if selected or not. | ||
| 133 | button: Surround the name with `[' and `]'. Use this for an item in the | ||
| 134 | menu bar itself. | ||
| 135 | anything else means an ordinary menu item. | ||
| 136 | 119 | ||
| 137 | :selected SELECTED | 120 | :suffix FORM |
| 121 | FORM is an expression that is dynamically evaluated and whose | ||
| 122 | value is concatenated with the menu entry's label. | ||
| 138 | 123 | ||
| 139 | SELECTED is an expression; the checkbox or radio button is selected | 124 | :style STYLE |
| 140 | whenever this expression's value is non-nil. | 125 | STYLE is a symbol describing the type of menu item; it should |
| 126 | be `toggle' (a checkbox), or `radio' (a radio button), or any | ||
| 127 | other value (meaning an ordinary menu item). | ||
| 141 | 128 | ||
| 142 | :help HELP | 129 | :selected SELECTED |
| 130 | SELECTED is an expression; the checkbox or radio button is | ||
| 131 | selected whenever the expression's value is non-nil. | ||
| 143 | 132 | ||
| 144 | HELP is a string, the help to display for the menu item. | 133 | :help HELP |
| 134 | HELP is a string, the help to display for the menu item. | ||
| 145 | 135 | ||
| 146 | A menu item can be a string. Then that string appears in the menu as | 136 | Alternatively, a menu item can be a string. Then that string |
| 147 | unselectable text. A string consisting solely of hyphens is displayed | 137 | appears in the menu as unselectable text. A string consisting |
| 148 | as a solid horizontal line. | 138 | solely of dashes is displayed as a menu separator. |
| 149 | 139 | ||
| 150 | A menu item can be a list with the same format as MENU. This is a submenu." | 140 | Alternatively, a menu item can be a list with the same format as |
| 141 | MENU. This is a submenu." | ||
| 151 | (declare (indent defun) (debug (symbolp body))) | 142 | (declare (indent defun) (debug (symbolp body))) |
| 152 | `(progn | 143 | `(progn |
| 153 | ,(if symbol `(defvar ,symbol nil ,doc)) | 144 | ,(if symbol `(defvar ,symbol nil ,doc)) |
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el index 64b240b9d5d..c8bdd7758fa 100644 --- a/lisp/emacs-lisp/eieio-opt.el +++ b/lisp/emacs-lisp/eieio-opt.el | |||
| @@ -29,9 +29,9 @@ | |||
| 29 | ;; | 29 | ;; |
| 30 | 30 | ||
| 31 | (require 'eieio) | 31 | (require 'eieio) |
| 32 | (require 'button) | ||
| 33 | (require 'help-mode) | ||
| 34 | (require 'find-func) | 32 | (require 'find-func) |
| 33 | (require 'speedbar) | ||
| 34 | (require 'help-mode) | ||
| 35 | 35 | ||
| 36 | ;;; Code: | 36 | ;;; Code: |
| 37 | ;;;###autoload | 37 | ;;;###autoload |
| @@ -710,10 +710,6 @@ Arguments UNUSED are not used." | |||
| 710 | 710 | ||
| 711 | ;;; SPEEDBAR SUPPORT | 711 | ;;; SPEEDBAR SUPPORT |
| 712 | ;; | 712 | ;; |
| 713 | (eval-when-compile | ||
| 714 | (condition-case nil | ||
| 715 | (require 'speedbar) | ||
| 716 | (error (message "Error loading speedbar... ignored")))) | ||
| 717 | 713 | ||
| 718 | (defvar eieio-class-speedbar-key-map nil | 714 | (defvar eieio-class-speedbar-key-map nil |
| 719 | "Keymap used when working with a project in speedbar.") | 715 | "Keymap used when working with a project in speedbar.") |
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 608134bd54f..3f7b49bde25 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el | |||
| @@ -3049,29 +3049,6 @@ Optional argument NOESCAPE is passed to `prin1-to-string' when appropriate." | |||
| 3049 | ) | 3049 | ) |
| 3050 | ) | 3050 | ) |
| 3051 | 3051 | ||
| 3052 | ;;; Interfacing with imenu in emacs lisp mode | ||
| 3053 | ;; (Only if the expression is defined) | ||
| 3054 | ;; | ||
| 3055 | (if (eval-when-compile (boundp 'lisp-imenu-generic-expression)) | ||
| 3056 | (progn | ||
| 3057 | |||
| 3058 | (defun eieio-update-lisp-imenu-expression () | ||
| 3059 | "Examine `lisp-imenu-generic-expression' and modify it to find `defmethod'." | ||
| 3060 | (let ((exp lisp-imenu-generic-expression)) | ||
| 3061 | (while exp | ||
| 3062 | ;; it's of the form '( ( title expr indx ) ... ) | ||
| 3063 | (let* ((subcar (cdr (car exp))) | ||
| 3064 | (substr (car subcar))) | ||
| 3065 | (if (and (not (string-match "|method\\\\" substr)) | ||
| 3066 | (string-match "|advice\\\\" substr)) | ||
| 3067 | (setcar subcar | ||
| 3068 | (replace-match "|advice\\|method\\" t t substr 0)))) | ||
| 3069 | (setq exp (cdr exp))))) | ||
| 3070 | |||
| 3071 | (eieio-update-lisp-imenu-expression) | ||
| 3072 | |||
| 3073 | )) | ||
| 3074 | |||
| 3075 | ;;; Autoloading some external symbols, and hooking into the help system | 3052 | ;;; Autoloading some external symbols, and hooking into the help system |
| 3076 | ;; | 3053 | ;; |
| 3077 | 3054 | ||
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index cab693fecac..2a3730745c6 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el | |||
| @@ -154,11 +154,16 @@ Assumes the caller has bound `macroexpand-all-environment'." | |||
| 154 | (if (and (not (eq form new-form)) ;It was a macro call. | 154 | (if (and (not (eq form new-form)) ;It was a macro call. |
| 155 | (car-safe form) | 155 | (car-safe form) |
| 156 | (symbolp (car form)) | 156 | (symbolp (car form)) |
| 157 | (get (car form) 'byte-obsolete-info)) | 157 | (get (car form) 'byte-obsolete-info) |
| 158 | (or (not (fboundp 'byte-compile-warning-enabled-p)) | ||
| 159 | (byte-compile-warning-enabled-p 'obsolete))) | ||
| 158 | (let* ((fun (car form)) | 160 | (let* ((fun (car form)) |
| 159 | (obsolete (get fun 'byte-obsolete-info))) | 161 | (obsolete (get fun 'byte-obsolete-info))) |
| 160 | (macroexp--warn-and-return | 162 | (macroexp--warn-and-return |
| 161 | (macroexp--obsolete-warning fun obsolete "macro") | 163 | (macroexp--obsolete-warning |
| 164 | fun obsolete | ||
| 165 | (if (symbolp (symbol-function fun)) | ||
| 166 | "alias" "macro")) | ||
| 162 | new-form)) | 167 | new-form)) |
| 163 | new-form))) | 168 | new-form))) |
| 164 | (pcase form | 169 | (pcase form |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 28d166271fb..6629410a1f1 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -590,7 +590,9 @@ EXTRA-PROPERTIES is currently unused." | |||
| 590 | (version-control 'never)) | 590 | (version-control 'never)) |
| 591 | (unless (fboundp 'autoload-ensure-default-file) | 591 | (unless (fboundp 'autoload-ensure-default-file) |
| 592 | (package-autoload-ensure-default-file generated-autoload-file)) | 592 | (package-autoload-ensure-default-file generated-autoload-file)) |
| 593 | (update-directory-autoloads pkg-dir))) | 593 | (update-directory-autoloads pkg-dir) |
| 594 | (let ((buf (find-buffer-visiting generated-autoload-file))) | ||
| 595 | (when buf (kill-buffer buf))))) | ||
| 594 | 596 | ||
| 595 | (defvar tar-parse-info) | 597 | (defvar tar-parse-info) |
| 596 | (declare-function tar-untar-buffer "tar-mode" ()) | 598 | (declare-function tar-untar-buffer "tar-mode" ()) |
| @@ -728,6 +730,7 @@ It will move point to somewhere in the headers." | |||
| 728 | (defun package-installed-p (package &optional min-version) | 730 | (defun package-installed-p (package &optional min-version) |
| 729 | "Return true if PACKAGE, of MIN-VERSION or newer, is installed. | 731 | "Return true if PACKAGE, of MIN-VERSION or newer, is installed. |
| 730 | MIN-VERSION should be a version list." | 732 | MIN-VERSION should be a version list." |
| 733 | (unless package--initialized (error "package.el is not yet initialized!")) | ||
| 731 | (let ((pkg-desc (assq package package-alist))) | 734 | (let ((pkg-desc (assq package package-alist))) |
| 732 | (if pkg-desc | 735 | (if pkg-desc |
| 733 | (version-list-<= min-version | 736 | (version-list-<= min-version |
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index bb8dadbbfcd..13dbba769a4 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * erc-backend.el: Only require `erc' during compilation (bug#12740). | ||
| 4 | |||
| 1 | 2012-10-18 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2012-10-18 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * erc-backend.el: Require `erc' instead of autoloading its macros | 7 | * erc-backend.el: Require `erc' instead of autoloading its macros |
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 858a6bd8e82..90b96d7c763 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el | |||
| @@ -102,8 +102,7 @@ | |||
| 102 | ;; There's a fairly strong mutual dependency between erc.el and erc-backend.el. | 102 | ;; There's a fairly strong mutual dependency between erc.el and erc-backend.el. |
| 103 | ;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the | 103 | ;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the |
| 104 | ;; reverse is true: | 104 | ;; reverse is true: |
| 105 | (provide 'erc-backend) | 105 | (eval-when-compile (provide 'erc-backend) (require 'erc)) |
| 106 | (require 'erc) | ||
| 107 | 106 | ||
| 108 | ;;;; Variables and options | 107 | ;;;; Variables and options |
| 109 | 108 | ||
diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 09503d7c154..903c12a787e 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; face-remap.el --- Functions for managing `face-remapping-alist' | 1 | ;;; face-remap.el --- Functions for managing `face-remapping-alist' -*- lexical-binding: t -*- |
| 2 | ;; | 2 | ;; |
| 3 | ;; Copyright (C) 2008-2012 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | ;; | 4 | ;; |
| @@ -132,7 +132,10 @@ other than the normal definition of FACE via `face-remap-set-base'." | |||
| 132 | (when (null entry) | 132 | (when (null entry) |
| 133 | (setq entry (list face face)) ; explicitly merge with global def | 133 | (setq entry (list face face)) ; explicitly merge with global def |
| 134 | (push entry face-remapping-alist)) | 134 | (push entry face-remapping-alist)) |
| 135 | (setcdr entry (face-remap-order (cons specs (cdr entry)))) | 135 | (let ((faces (cdr entry))) |
| 136 | (if (symbolp faces) | ||
| 137 | (setq faces (list faces))) | ||
| 138 | (setcdr entry (face-remap-order (cons specs faces)))) | ||
| 136 | (cons face specs))) | 139 | (cons face specs))) |
| 137 | 140 | ||
| 138 | (defun face-remap-remove-relative (cookie) | 141 | (defun face-remap-remove-relative (cookie) |
| @@ -285,7 +288,9 @@ See `text-scale-increase' for more details." | |||
| 285 | ;;;###autoload (define-key ctl-x-map [(control ?0)] 'text-scale-adjust) | 288 | ;;;###autoload (define-key ctl-x-map [(control ?0)] 'text-scale-adjust) |
| 286 | ;;;###autoload | 289 | ;;;###autoload |
| 287 | (defun text-scale-adjust (inc) | 290 | (defun text-scale-adjust (inc) |
| 288 | "Increase or decrease the height of the default face in the current buffer. | 291 | "Adjust the height of the default face by INC. |
| 292 | |||
| 293 | INC may be passed as a numeric prefix argument. | ||
| 289 | 294 | ||
| 290 | The actual adjustment made depends on the final component of the | 295 | The actual adjustment made depends on the final component of the |
| 291 | key-binding used to invoke the command, with all modifiers removed: | 296 | key-binding used to invoke the command, with all modifiers removed: |
| @@ -294,9 +299,11 @@ key-binding used to invoke the command, with all modifiers removed: | |||
| 294 | - Decrease the default face height by one step | 299 | - Decrease the default face height by one step |
| 295 | 0 Reset the default face height to the global default | 300 | 0 Reset the default face height to the global default |
| 296 | 301 | ||
| 297 | Then, continue to read input events and further adjust the face | 302 | When adjusting with `+' or `-', continue to read input events and |
| 298 | height as long as the input event read (with all modifiers removed) | 303 | further adjust the face height as long as the input event read |
| 299 | is one of the above. | 304 | \(with all modifiers removed) is `+' or `-'. |
| 305 | |||
| 306 | When adjusting with `0', immediately finish. | ||
| 300 | 307 | ||
| 301 | Each step scales the height of the default face by the variable | 308 | Each step scales the height of the default face by the variable |
| 302 | `text-scale-mode-step' (a negative number of steps decreases the | 309 | `text-scale-mode-step' (a negative number of steps decreases the |
| @@ -309,8 +316,7 @@ even when it is bound in a non-top-level keymap. For binding in | |||
| 309 | a top-level keymap, `text-scale-increase' or | 316 | a top-level keymap, `text-scale-increase' or |
| 310 | `text-scale-decrease' may be more appropriate." | 317 | `text-scale-decrease' may be more appropriate." |
| 311 | (interactive "p") | 318 | (interactive "p") |
| 312 | (let ((first t) | 319 | (let ((ev last-command-event) |
| 313 | (ev last-command-event) | ||
| 314 | (echo-keystrokes nil)) | 320 | (echo-keystrokes nil)) |
| 315 | (let* ((base (event-basic-type ev)) | 321 | (let* ((base (event-basic-type ev)) |
| 316 | (step | 322 | (step |
| @@ -320,19 +326,15 @@ a top-level keymap, `text-scale-increase' or | |||
| 320 | (?0 0) | 326 | (?0 0) |
| 321 | (t inc)))) | 327 | (t inc)))) |
| 322 | (text-scale-increase step) | 328 | (text-scale-increase step) |
| 323 | ;; FIXME: do it after every "iteration of the loop". | 329 | ;; (unless (zerop step) |
| 324 | (message "+,-,0 for further adjustment: ") | 330 | (message "Use +,-,0 for further adjustment") |
| 325 | (set-temporary-overlay-map | 331 | (set-temporary-overlay-map |
| 326 | (let ((map (make-sparse-keymap))) | 332 | (let ((map (make-sparse-keymap))) |
| 327 | (dolist (mods '(() (control))) | 333 | (dolist (mods '(() (control))) |
| 328 | (define-key map (vector (append mods '(?-))) 'text-scale-decrease) | 334 | (dolist (key '(?- ?+ ?= ?0)) ;; = is often unshifted +. |
| 329 | (define-key map (vector (append mods '(?+))) 'text-scale-increase) | 335 | (define-key map (vector (append mods (list key))) |
| 330 | ;; = is unshifted + on most keyboards. | 336 | (lambda () (interactive) (text-scale-adjust (abs inc)))))) |
| 331 | (define-key map (vector (append mods '(?=))) 'text-scale-increase) | 337 | map))))) ;; ) |
| 332 | (define-key map (vector (append mods '(?0))) | ||
| 333 | (lambda () (interactive) (text-scale-increase 0)))) | ||
| 334 | map) | ||
| 335 | t)))) | ||
| 336 | 338 | ||
| 337 | 339 | ||
| 338 | ;; ---------------------------------------------------------------- | 340 | ;; ---------------------------------------------------------------- |
diff --git a/lisp/files.el b/lisp/files.el index e030aff0ae2..26c5c683b3d 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1537,12 +1537,9 @@ killed." | |||
| 1537 | t))) | 1537 | t))) |
| 1538 | (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) | 1538 | (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) |
| 1539 | (error "Aborted")) | 1539 | (error "Aborted")) |
| 1540 | (when (and (buffer-modified-p) buffer-file-name) | 1540 | (and (buffer-modified-p) buffer-file-name |
| 1541 | (if (yes-or-no-p (format "Buffer %s is modified; save it first? " | 1541 | (not (yes-or-no-p "Kill and replace the buffer without saving it? ")) |
| 1542 | (buffer-name))) | 1542 | (error "Aborted")) |
| 1543 | (save-buffer) | ||
| 1544 | (unless (yes-or-no-p "Kill and replace the buffer without saving it? ") | ||
| 1545 | (error "Aborted")))) | ||
| 1546 | (let ((obuf (current-buffer)) | 1543 | (let ((obuf (current-buffer)) |
| 1547 | (ofile buffer-file-name) | 1544 | (ofile buffer-file-name) |
| 1548 | (onum buffer-file-number) | 1545 | (onum buffer-file-number) |
diff --git a/lisp/help.el b/lisp/help.el index 0df9c607f69..449818207b3 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -1012,8 +1012,8 @@ WINDOW can be any live window and defaults to the selected one. | |||
| 1012 | 1012 | ||
| 1013 | Do not make WINDOW higher than `temp-buffer-max-height' nor | 1013 | Do not make WINDOW higher than `temp-buffer-max-height' nor |
| 1014 | smaller than `window-min-height'. Do nothing if WINDOW is not | 1014 | smaller than `window-min-height'. Do nothing if WINDOW is not |
| 1015 | vertically combined or some of its contents are scrolled out of | 1015 | vertically combined, some of its contents are scrolled out of |
| 1016 | view." | 1016 | view, or WINDOW was not created by `display-buffer'." |
| 1017 | (setq window (window-normalize-window window t)) | 1017 | (setq window (window-normalize-window window t)) |
| 1018 | (let ((buffer-name (buffer-name (window-buffer window)))) | 1018 | (let ((buffer-name (buffer-name (window-buffer window)))) |
| 1019 | (let ((height (if (functionp temp-buffer-max-height) | 1019 | (let ((height (if (functionp temp-buffer-max-height) |
| @@ -1022,11 +1022,12 @@ view." | |||
| 1022 | temp-buffer-max-height)) | 1022 | temp-buffer-max-height)) |
| 1023 | (quit-cadr (cadr (window-parameter window 'quit-restore)))) | 1023 | (quit-cadr (cadr (window-parameter window 'quit-restore)))) |
| 1024 | (cond | 1024 | (cond |
| 1025 | ;; Don't resize WINDOW if it showed another buffer before. | 1025 | ;; Resize WINDOW iff it was split off by `display-buffer'. |
| 1026 | ((and (eq quit-cadr 'window) | 1026 | ((and (eq quit-cadr 'window) |
| 1027 | (pos-visible-in-window-p (point-min) window) | 1027 | (pos-visible-in-window-p (point-min) window) |
| 1028 | (window-combined-p window)) | 1028 | (window-combined-p window)) |
| 1029 | (fit-window-to-buffer window height)) | 1029 | (fit-window-to-buffer window height)) |
| 1030 | ;; Resize FRAME iff it was created by `display-buffer'. | ||
| 1030 | ((and fit-frame-to-buffer | 1031 | ((and fit-frame-to-buffer |
| 1031 | (eq quit-cadr 'frame) | 1032 | (eq quit-cadr 'frame) |
| 1032 | (eq window (frame-root-window window))) | 1033 | (eq window (frame-root-window window))) |
diff --git a/lisp/imenu.el b/lisp/imenu.el index 47a2f1e3b40..4686d1cf538 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -1018,7 +1018,7 @@ for more information." | |||
| 1018 | (if (stringp index-item) | 1018 | (if (stringp index-item) |
| 1019 | (setq index-item (assoc index-item (imenu--make-index-alist)))) | 1019 | (setq index-item (assoc index-item (imenu--make-index-alist)))) |
| 1020 | (when index-item | 1020 | (when index-item |
| 1021 | (push-mark) | 1021 | (push-mark nil t) |
| 1022 | (let* ((is-special-item (listp (cdr index-item))) | 1022 | (let* ((is-special-item (listp (cdr index-item))) |
| 1023 | (function | 1023 | (function |
| 1024 | (if is-special-item | 1024 | (if is-special-item |
diff --git a/lisp/info.el b/lisp/info.el index 5862e5e850f..36ffa806f04 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -2646,6 +2646,7 @@ Because of ambiguities, this should be concatenated with something like | |||
| 2646 | (while (re-search-forward pattern nil t) | 2646 | (while (re-search-forward pattern nil t) |
| 2647 | (push (match-string-no-properties 1) | 2647 | (push (match-string-no-properties 1) |
| 2648 | completions)) | 2648 | completions)) |
| 2649 | (setq completions (delete-dups completions)) | ||
| 2649 | ;; Check subsequent nodes if applicable. | 2650 | ;; Check subsequent nodes if applicable. |
| 2650 | (or (and Info-complete-next-re | 2651 | (or (and Info-complete-next-re |
| 2651 | (setq nextnode (Info-extract-pointer "next" t)) | 2652 | (setq nextnode (Info-extract-pointer "next" t)) |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 37993767013..0bfda880d93 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -2149,7 +2149,8 @@ Isearch mode." | |||
| 2149 | (setq prefix-arg arg) | 2149 | (setq prefix-arg arg) |
| 2150 | (apply 'isearch-unread keylist)) | 2150 | (apply 'isearch-unread keylist)) |
| 2151 | (setq keylist | 2151 | (setq keylist |
| 2152 | (listify-key-sequence (lookup-key local-function-key-map key))) | 2152 | (listify-key-sequence |
| 2153 | (lookup-key local-function-key-map key))) | ||
| 2153 | (while keylist | 2154 | (while keylist |
| 2154 | (setq key (car keylist)) | 2155 | (setq key (car keylist)) |
| 2155 | ;; If KEY is a printing char, we handle it here | 2156 | ;; If KEY is a printing char, we handle it here |
| @@ -2158,6 +2159,9 @@ Isearch mode." | |||
| 2158 | (if (and (integerp key) | 2159 | (if (and (integerp key) |
| 2159 | (>= key ?\s) (/= key 127) (< key 256)) | 2160 | (>= key ?\s) (/= key 127) (< key 256)) |
| 2160 | (progn | 2161 | (progn |
| 2162 | ;; Ensure that the processed char is recorded in | ||
| 2163 | ;; the keyboard macro, if any (Bug#4894) | ||
| 2164 | (store-kbd-macro-event key) | ||
| 2161 | (isearch-process-search-char key) | 2165 | (isearch-process-search-char key) |
| 2162 | (setq keylist (cdr keylist))) | 2166 | (setq keylist (cdr keylist))) |
| 2163 | ;; As the remaining keys in KEYLIST can't be handled | 2167 | ;; As the remaining keys in KEYLIST can't be handled |
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index f865a0269d4..38347f23f7d 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -378,6 +378,8 @@ Note: TABLE needs to be a proper completion table which obeys predicates." | |||
| 378 | ;; that `concat' and `unquote' commute (which tends to be the case). | 378 | ;; that `concat' and `unquote' commute (which tends to be the case). |
| 379 | ;; And we ask `requote' to do the work of mapping from unquoted positions | 379 | ;; And we ask `requote' to do the work of mapping from unquoted positions |
| 380 | ;; back to quoted positions. | 380 | ;; back to quoted positions. |
| 381 | ;; FIXME: For some forms of "quoting" such as the truncation behavior of | ||
| 382 | ;; substitute-in-file-name, it would be desirable not to requote completely. | ||
| 381 | "Return a new completion table operating on quoted text. | 383 | "Return a new completion table operating on quoted text. |
| 382 | TABLE operates on the unquoted text. | 384 | TABLE operates on the unquoted text. |
| 383 | UNQUOTE is a function that takes a string and returns a new unquoted string. | 385 | UNQUOTE is a function that takes a string and returns a new unquoted string. |
| @@ -527,10 +529,12 @@ for use at QPOS." | |||
| 527 | (`(,qfullpos . ,qfun) | 529 | (`(,qfullpos . ,qfun) |
| 528 | (funcall requote (+ boundary (length prefix)) string)) | 530 | (funcall requote (+ boundary (length prefix)) string)) |
| 529 | (qfullprefix (substring string 0 qfullpos)) | 531 | (qfullprefix (substring string 0 qfullpos)) |
| 530 | (_ (cl-assert (completion--string-equal-p | 532 | ;; FIXME: This assertion can be wrong, e.g. in Cygwin, where |
| 531 | (funcall unquote qfullprefix) | 533 | ;; (unquote "c:\bin") => "/usr/bin" but (unquote "c:\") => "/". |
| 532 | (concat (substring ustring 0 boundary) prefix)) | 534 | ;;(cl-assert (completion--string-equal-p |
| 533 | t)) | 535 | ;; (funcall unquote qfullprefix) |
| 536 | ;; (concat (substring ustring 0 boundary) prefix)) | ||
| 537 | ;; t)) | ||
| 534 | (qboundary (car (funcall requote boundary string))) | 538 | (qboundary (car (funcall requote boundary string))) |
| 535 | (_ (cl-assert (<= qboundary qfullpos))) | 539 | (_ (cl-assert (<= qboundary qfullpos))) |
| 536 | ;; FIXME: this split/quote/concat business messes up the carefully | 540 | ;; FIXME: this split/quote/concat business messes up the carefully |
| @@ -559,14 +563,16 @@ for use at QPOS." | |||
| 559 | (let* ((new (substring completion (length prefix))) | 563 | (let* ((new (substring completion (length prefix))) |
| 560 | (qnew (funcall qfun new)) | 564 | (qnew (funcall qfun new)) |
| 561 | (qcompletion (concat qprefix qnew))) | 565 | (qcompletion (concat qprefix qnew))) |
| 562 | (cl-assert | 566 | ;; FIXME: Similarly here, Cygwin's mapping trips this |
| 563 | (completion--string-equal-p | 567 | ;; assertion. |
| 564 | (funcall unquote | 568 | ;;(cl-assert |
| 565 | (concat (substring string 0 qboundary) | 569 | ;; (completion--string-equal-p |
| 566 | qcompletion)) | 570 | ;; (funcall unquote |
| 567 | (concat (substring ustring 0 boundary) | 571 | ;; (concat (substring string 0 qboundary) |
| 568 | completion)) | 572 | ;; qcompletion)) |
| 569 | t) | 573 | ;; (concat (substring ustring 0 boundary) |
| 574 | ;; completion)) | ||
| 575 | ;; t) | ||
| 570 | qcompletion)) | 576 | qcompletion)) |
| 571 | completions) | 577 | completions) |
| 572 | qboundary)))) | 578 | qboundary)))) |
| @@ -743,6 +749,7 @@ completing buffer and file names, respectively." | |||
| 743 | (const buffer) | 749 | (const buffer) |
| 744 | (const file) | 750 | (const file) |
| 745 | (const unicode-name) | 751 | (const unicode-name) |
| 752 | (const bookmark) | ||
| 746 | symbol) | 753 | symbol) |
| 747 | :value-type | 754 | :value-type |
| 748 | (set :tag "Properties to override" | 755 | (set :tag "Properties to override" |
| @@ -871,6 +878,7 @@ completion candidates than this number." | |||
| 871 | 878 | ||
| 872 | (defvar completion-all-sorted-completions nil) | 879 | (defvar completion-all-sorted-completions nil) |
| 873 | (make-variable-buffer-local 'completion-all-sorted-completions) | 880 | (make-variable-buffer-local 'completion-all-sorted-completions) |
| 881 | (defvar-local completion--all-sorted-completions-location nil) | ||
| 874 | (defvar completion-cycling nil) | 882 | (defvar completion-cycling nil) |
| 875 | 883 | ||
| 876 | (defvar completion-fail-discreetly nil | 884 | (defvar completion-fail-discreetly nil |
| @@ -1048,14 +1056,19 @@ scroll the window of possible completions." | |||
| 1048 | 1056 | ||
| 1049 | (defun completion--cache-all-sorted-completions (comps) | 1057 | (defun completion--cache-all-sorted-completions (comps) |
| 1050 | (add-hook 'after-change-functions | 1058 | (add-hook 'after-change-functions |
| 1051 | 'completion--flush-all-sorted-completions nil t) | 1059 | 'completion--flush-all-sorted-completions nil t) |
| 1060 | (setq completion--all-sorted-completions-location | ||
| 1061 | (cons (copy-marker (field-beginning)) (copy-marker (field-end)))) | ||
| 1052 | (setq completion-all-sorted-completions comps)) | 1062 | (setq completion-all-sorted-completions comps)) |
| 1053 | 1063 | ||
| 1054 | (defun completion--flush-all-sorted-completions (&rest _ignore) | 1064 | (defun completion--flush-all-sorted-completions (&optional start end _len) |
| 1055 | (remove-hook 'after-change-functions | 1065 | (unless (and start end |
| 1056 | 'completion--flush-all-sorted-completions t) | 1066 | (or (> start (cdr completion--all-sorted-completions-location)) |
| 1057 | (setq completion-cycling nil) | 1067 | (< end (car completion--all-sorted-completions-location)))) |
| 1058 | (setq completion-all-sorted-completions nil)) | 1068 | (remove-hook 'after-change-functions |
| 1069 | 'completion--flush-all-sorted-completions t) | ||
| 1070 | (setq completion-cycling nil) | ||
| 1071 | (setq completion-all-sorted-completions nil))) | ||
| 1059 | 1072 | ||
| 1060 | (defun completion--metadata (string base md-at-point table pred) | 1073 | (defun completion--metadata (string base md-at-point table pred) |
| 1061 | ;; Like completion-metadata, but for the specific case of getting the | 1074 | ;; Like completion-metadata, but for the specific case of getting the |
| @@ -1108,7 +1121,7 @@ Repeated uses step through the possible completions." | |||
| 1108 | ;; FIXME: Need to deal with the extra-size issue here as well. | 1121 | ;; FIXME: Need to deal with the extra-size issue here as well. |
| 1109 | ;; FIXME: ~/src/emacs/t<M-TAB>/lisp/minibuffer.el completes to | 1122 | ;; FIXME: ~/src/emacs/t<M-TAB>/lisp/minibuffer.el completes to |
| 1110 | ;; ~/src/emacs/trunk/ and throws away lisp/minibuffer.el. | 1123 | ;; ~/src/emacs/trunk/ and throws away lisp/minibuffer.el. |
| 1111 | (let* ((start (field-beginning)) | 1124 | (let* ((start (copy-marker (field-beginning))) |
| 1112 | (end (field-end)) | 1125 | (end (field-end)) |
| 1113 | ;; (md (completion--field-metadata start)) | 1126 | ;; (md (completion--field-metadata start)) |
| 1114 | (all (completion-all-sorted-completions)) | 1127 | (all (completion-all-sorted-completions)) |
| @@ -1118,10 +1131,10 @@ Repeated uses step through the possible completions." | |||
| 1118 | (completion--message | 1131 | (completion--message |
| 1119 | (if all "No more completions" "No completions"))) | 1132 | (if all "No more completions" "No completions"))) |
| 1120 | ((not (consp (cdr all))) | 1133 | ((not (consp (cdr all))) |
| 1121 | (let ((mod (equal (car all) (buffer-substring-no-properties base end)))) | 1134 | (let ((done (equal (car all) (buffer-substring-no-properties base end)))) |
| 1122 | (if mod (completion--replace base end (car all))) | 1135 | (unless done (completion--replace base end (car all))) |
| 1123 | (completion--done (buffer-substring-no-properties start (point)) | 1136 | (completion--done (buffer-substring-no-properties start (point)) |
| 1124 | 'finished (unless mod "Sole completion")))) | 1137 | 'finished (when done "Sole completion")))) |
| 1125 | (t | 1138 | (t |
| 1126 | (completion--replace base end (car all)) | 1139 | (completion--replace base end (car all)) |
| 1127 | (completion--done (buffer-substring-no-properties start (point)) 'sole) | 1140 | (completion--done (buffer-substring-no-properties start (point)) 'sole) |
| @@ -1758,7 +1771,10 @@ exit." | |||
| 1758 | (when completion-in-region-mode-predicate | 1771 | (when completion-in-region-mode-predicate |
| 1759 | (completion-in-region-mode 1) | 1772 | (completion-in-region-mode 1) |
| 1760 | (setq completion-in-region--data | 1773 | (setq completion-in-region--data |
| 1761 | (list (current-buffer) start end collection))) | 1774 | (list (if (markerp start) start (copy-marker start)) |
| 1775 | (copy-marker end) collection))) | ||
| 1776 | ;; FIXME: `minibuffer-complete' should call `completion-in-region' rather | ||
| 1777 | ;; than the other way around! | ||
| 1762 | (unwind-protect | 1778 | (unwind-protect |
| 1763 | (call-interactively 'minibuffer-complete) | 1779 | (call-interactively 'minibuffer-complete) |
| 1764 | (delete-overlay ol))))) | 1780 | (delete-overlay ol))))) |
| @@ -1782,12 +1798,12 @@ exit." | |||
| 1782 | (or unread-command-events ;Don't pop down the completions in the middle of | 1798 | (or unread-command-events ;Don't pop down the completions in the middle of |
| 1783 | ;mouse-drag-region/mouse-set-point. | 1799 | ;mouse-drag-region/mouse-set-point. |
| 1784 | (and completion-in-region--data | 1800 | (and completion-in-region--data |
| 1785 | (and (eq (car completion-in-region--data) | 1801 | (and (eq (marker-buffer (nth 0 completion-in-region--data)) |
| 1786 | (current-buffer)) | 1802 | (current-buffer)) |
| 1787 | (>= (point) (nth 1 completion-in-region--data)) | 1803 | (>= (point) (nth 0 completion-in-region--data)) |
| 1788 | (<= (point) | 1804 | (<= (point) |
| 1789 | (save-excursion | 1805 | (save-excursion |
| 1790 | (goto-char (nth 2 completion-in-region--data)) | 1806 | (goto-char (nth 1 completion-in-region--data)) |
| 1791 | (line-end-position))) | 1807 | (line-end-position))) |
| 1792 | (funcall completion-in-region-mode--predicate))) | 1808 | (funcall completion-in-region-mode--predicate))) |
| 1793 | (completion-in-region-mode -1))) | 1809 | (completion-in-region-mode -1))) |
| @@ -1892,17 +1908,19 @@ The completion method is determined by `completion-at-point-functions'." | |||
| 1892 | (let ((res (run-hook-wrapped 'completion-at-point-functions | 1908 | (let ((res (run-hook-wrapped 'completion-at-point-functions |
| 1893 | #'completion--capf-wrapper 'all))) | 1909 | #'completion--capf-wrapper 'all))) |
| 1894 | (pcase res | 1910 | (pcase res |
| 1895 | (`(,_ . ,(and (pred functionp) f)) (funcall f)) | 1911 | (`(,_ . ,(and (pred functionp) f)) (funcall f)) |
| 1896 | (`(,hookfun . (,start ,end ,collection . ,plist)) | 1912 | (`(,hookfun . (,start ,end ,collection . ,plist)) |
| 1897 | (let* ((completion-extra-properties plist) | 1913 | (unless (markerp start) (setq start (copy-marker start))) |
| 1898 | (completion-in-region-mode-predicate | 1914 | (let* ((completion-extra-properties plist) |
| 1899 | (lambda () | 1915 | (completion-in-region-mode-predicate |
| 1900 | ;; We're still in the same completion field. | 1916 | (lambda () |
| 1901 | (eq (car-safe (funcall hookfun)) start)))) | 1917 | ;; We're still in the same completion field. |
| 1902 | (completion-in-region start end collection | 1918 | (let ((newstart (car-safe (funcall hookfun)))) |
| 1903 | (plist-get plist :predicate)))) | 1919 | (and newstart (= newstart start)))))) |
| 1904 | ;; Maybe completion already happened and the function returned t. | 1920 | (completion-in-region start end collection |
| 1905 | (_ (cdr res))))) | 1921 | (plist-get plist :predicate)))) |
| 1922 | ;; Maybe completion already happened and the function returned t. | ||
| 1923 | (_ (cdr res))))) | ||
| 1906 | 1924 | ||
| 1907 | (defun completion-help-at-point () | 1925 | (defun completion-help-at-point () |
| 1908 | "Display the completions on the text around point. | 1926 | "Display the completions on the text around point. |
| @@ -1914,32 +1932,34 @@ The completion method is determined by `completion-at-point-functions'." | |||
| 1914 | (pcase res | 1932 | (pcase res |
| 1915 | (`(,_ . ,(and (pred functionp) f)) | 1933 | (`(,_ . ,(and (pred functionp) f)) |
| 1916 | (message "Don't know how to show completions for %S" f)) | 1934 | (message "Don't know how to show completions for %S" f)) |
| 1917 | (`(,hookfun . (,start ,end ,collection . ,plist)) | 1935 | (`(,hookfun . (,start ,end ,collection . ,plist)) |
| 1918 | (let* ((minibuffer-completion-table collection) | 1936 | (unless (markerp start) (setq start (copy-marker start))) |
| 1919 | (minibuffer-completion-predicate (plist-get plist :predicate)) | 1937 | (let* ((minibuffer-completion-table collection) |
| 1920 | (completion-extra-properties plist) | 1938 | (minibuffer-completion-predicate (plist-get plist :predicate)) |
| 1921 | (completion-in-region-mode-predicate | 1939 | (completion-extra-properties plist) |
| 1922 | (lambda () | 1940 | (completion-in-region-mode-predicate |
| 1923 | ;; We're still in the same completion field. | 1941 | (lambda () |
| 1924 | (eq (car-safe (funcall hookfun)) start))) | 1942 | ;; We're still in the same completion field. |
| 1925 | (ol (make-overlay start end nil nil t))) | 1943 | (let ((newstart (car-safe (funcall hookfun)))) |
| 1926 | ;; FIXME: We should somehow (ab)use completion-in-region-function or | 1944 | (and newstart (= newstart start))))) |
| 1927 | ;; introduce a corresponding hook (plus another for word-completion, | 1945 | (ol (make-overlay start end nil nil t))) |
| 1928 | ;; and another for force-completion, maybe?). | 1946 | ;; FIXME: We should somehow (ab)use completion-in-region-function or |
| 1929 | (overlay-put ol 'field 'completion) | 1947 | ;; introduce a corresponding hook (plus another for word-completion, |
| 1930 | (overlay-put ol 'priority 100) | 1948 | ;; and another for force-completion, maybe?). |
| 1931 | (completion-in-region-mode 1) | 1949 | (overlay-put ol 'field 'completion) |
| 1932 | (setq completion-in-region--data | 1950 | (overlay-put ol 'priority 100) |
| 1933 | (list (current-buffer) start end collection)) | 1951 | (completion-in-region-mode 1) |
| 1934 | (unwind-protect | 1952 | (setq completion-in-region--data |
| 1935 | (call-interactively 'minibuffer-completion-help) | 1953 | (list start (copy-marker end) collection)) |
| 1936 | (delete-overlay ol)))) | 1954 | (unwind-protect |
| 1937 | (`(,hookfun . ,_) | 1955 | (call-interactively 'minibuffer-completion-help) |
| 1938 | ;; The hook function already performed completion :-( | 1956 | (delete-overlay ol)))) |
| 1939 | ;; Not much we can do at this point. | 1957 | (`(,hookfun . ,_) |
| 1940 | (message "%s already performed completion!" hookfun) | 1958 | ;; The hook function already performed completion :-( |
| 1941 | nil) | 1959 | ;; Not much we can do at this point. |
| 1942 | (_ (message "Nothing to complete at point"))))) | 1960 | (message "%s already performed completion!" hookfun) |
| 1961 | nil) | ||
| 1962 | (_ (message "Nothing to complete at point"))))) | ||
| 1943 | 1963 | ||
| 1944 | ;;; Key bindings. | 1964 | ;;; Key bindings. |
| 1945 | 1965 | ||
| @@ -2147,53 +2167,49 @@ same as `substitute-in-file-name'." | |||
| 2147 | "use the regular PRED argument" "23.2") | 2167 | "use the regular PRED argument" "23.2") |
| 2148 | 2168 | ||
| 2149 | (defun completion--sifn-requote (upos qstr) | 2169 | (defun completion--sifn-requote (upos qstr) |
| 2150 | ;; We're looking for `qupos' such that: | 2170 | ;; We're looking for `qpos' such that: |
| 2151 | ;; (equal (substring (substitute-in-file-name qstr) 0 upos) | 2171 | ;; (equal (substring (substitute-in-file-name qstr) 0 upos) |
| 2152 | ;; (substitute-in-file-name (substring qstr 0 qupos))) | 2172 | ;; (substitute-in-file-name (substring qstr 0 qpos))) |
| 2153 | ;; Big problem here: we have to reverse engineer substitute-in-file-name to | 2173 | ;; Big problem here: we have to reverse engineer substitute-in-file-name to |
| 2154 | ;; find the position corresponding to UPOS in QSTR, but | 2174 | ;; find the position corresponding to UPOS in QSTR, but |
| 2155 | ;; substitute-in-file-name can do anything, depending on file-name-handlers. | 2175 | ;; substitute-in-file-name can do anything, depending on file-name-handlers. |
| 2176 | ;; substitute-in-file-name does the following kind of things: | ||
| 2177 | ;; - expand env-var references. | ||
| 2178 | ;; - turn backslashes into slashes. | ||
| 2179 | ;; - truncate some prefix of the input. | ||
| 2180 | ;; - rewrite some prefix. | ||
| 2181 | ;; Some of these operations are written in external libraries and we'd rather | ||
| 2182 | ;; not hard code any assumptions here about what they actually do. IOW, we | ||
| 2183 | ;; want to treat substitute-in-file-name as a black box, as much as possible. | ||
| 2156 | ;; Kind of like in rfn-eshadow-update-overlay, only worse. | 2184 | ;; Kind of like in rfn-eshadow-update-overlay, only worse. |
| 2157 | ;; FIXME: example of thing we do not handle: Tramp's makes | 2185 | ;; Example of things we need to handle: |
| 2158 | ;; (substitute-in-file-name "/foo:~/bar//baz") -> "/scpc:foo:/baz". | 2186 | ;; - Tramp (substitute-in-file-name "/foo:~/bar//baz") => "/scpc:foo:/baz". |
| 2159 | ;; FIXME: One way to try and handle "all" cases is to require | 2187 | ;; - Cygwin (substitute-in-file-name "C:\bin") => "/usr/bin" |
| 2160 | ;; substitute-in-file-name to preserve text-properties, so we could | 2188 | ;; (substitute-in-file-name "C:\") => "/" |
| 2161 | ;; apply text-properties to the input string and then look for them in | 2189 | ;; (substitute-in-file-name "C:\bi") => "/bi" |
| 2162 | ;; the output to understand what comes from where. | 2190 | (let* ((ustr (substitute-in-file-name qstr)) |
| 2163 | (let ((qpos 0)) | 2191 | (uprefix (substring ustr 0 upos)) |
| 2164 | ;; Handle substitute-in-file-name's truncation behavior. | 2192 | qprefix) |
| 2165 | (let (tpos) | 2193 | ;; Main assumption: nothing after qpos should affect the text before upos, |
| 2166 | (while (and (string-match "[\\/][~/\\]" qstr qpos) | 2194 | ;; so we can work our way backward from the end of qstr, one character |
| 2167 | ;; Hopefully our regexp covers all truncation cases. | 2195 | ;; at a time. |
| 2168 | ;; Also let's make sure sifn indeed truncates here. | 2196 | ;; Second assumptions: If qpos is far from the end this can be a bit slow, |
| 2197 | ;; so we speed it up by doing a first loop that skips a word at a time. | ||
| 2198 | ;; This word-sized loop is careful not to cut in the middle of env-vars. | ||
| 2199 | (while (let ((boundary (string-match "\\(\\$+{?\\)?\\w+\\W*\\'" qstr))) | ||
| 2200 | (and boundary | ||
| 2169 | (progn | 2201 | (progn |
| 2170 | (setq tpos (1+ (match-beginning 0))) | 2202 | (setq qprefix (substring qstr 0 boundary)) |
| 2171 | (equal (substitute-in-file-name qstr) | 2203 | (string-prefix-p uprefix |
| 2172 | (substitute-in-file-name (substring qstr tpos))))) | 2204 | (substitute-in-file-name qprefix))))) |
| 2173 | (setq qpos tpos))) | 2205 | (setq qstr qprefix)) |
| 2174 | ;; `upos' is relative to the position corresponding to `qpos' in | 2206 | (let ((qpos (length qstr))) |
| 2175 | ;; (substitute-in-file-name qstr), so as qpos moves forward, upos | 2207 | (while (and (> qpos 0) |
| 2176 | ;; gets smaller. | 2208 | (string-prefix-p uprefix |
| 2177 | (while (and (> upos 0) | 2209 | (substitute-in-file-name |
| 2178 | (string-match "\\$\\(\\$\\|\\([[:alnum:]_]+\\|{[^}]*}\\)\\)?" | 2210 | (substring qstr 0 (1- qpos))))) |
| 2179 | qstr qpos)) | 2211 | (setq qpos (1- qpos))) |
| 2180 | (cond | 2212 | (cons qpos #'minibuffer--double-dollars)))) |
| 2181 | ((>= (- (match-beginning 0) qpos) upos) ; UPOS is before current match. | ||
| 2182 | (setq qpos (+ qpos upos)) | ||
| 2183 | (setq upos 0)) | ||
| 2184 | ((not (match-end 1)) ;A sole $: probably an error. | ||
| 2185 | (setq upos (- upos (- (match-end 0) qpos))) | ||
| 2186 | (setq qpos (match-end 0))) | ||
| 2187 | (t | ||
| 2188 | (setq upos (- upos (- (match-beginning 0) qpos))) | ||
| 2189 | (setq qpos (match-end 0)) | ||
| 2190 | (setq upos (- upos (length (substitute-in-file-name | ||
| 2191 | (match-string 0 qstr)))))))) | ||
| 2192 | ;; If `upos' is negative, it's because it's within the expansion of an | ||
| 2193 | ;; envvar, i.e. there is no exactly matching qpos, so we just use the next | ||
| 2194 | ;; available qpos right after the envvar. | ||
| 2195 | (cons (if (>= upos 0) (+ qpos upos) qpos) | ||
| 2196 | #'minibuffer--double-dollars))) | ||
| 2197 | 2213 | ||
| 2198 | (defalias 'completion--file-name-table | 2214 | (defalias 'completion--file-name-table |
| 2199 | (completion-table-with-quoting #'completion-file-name-table | 2215 | (completion-table-with-quoting #'completion-file-name-table |
diff --git a/lisp/mouse.el b/lisp/mouse.el index fa5c69281de..61d70404bd6 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -517,8 +517,8 @@ must be one of the symbols `header', `mode', or `vertical'." | |||
| 517 | ;; If mouse-2 has never been done by the user, it doesn't have | 517 | ;; If mouse-2 has never been done by the user, it doesn't have |
| 518 | ;; the necessary property to be interpreted correctly. | 518 | ;; the necessary property to be interpreted correctly. |
| 519 | (put 'mouse-2 'event-kind 'mouse-click) | 519 | (put 'mouse-2 'event-kind 'mouse-click) |
| 520 | (setcar event 'mouse-2)) | 520 | (setcar event 'mouse-2) |
| 521 | (push event unread-command-events))) | 521 | (push event unread-command-events)))) |
| 522 | 522 | ||
| 523 | (defun mouse-drag-mode-line (start-event) | 523 | (defun mouse-drag-mode-line (start-event) |
| 524 | "Change the height of a window by dragging on the mode line." | 524 | "Change the height of a window by dragging on the mode line." |
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index eb696798b6f..6ef713de93d 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el | |||
| @@ -604,6 +604,7 @@ an alist of attribute/value pairs." | |||
| 604 | ;; Skip error message when retrieving attribute list | 604 | ;; Skip error message when retrieving attribute list |
| 605 | (if (looking-at "Size limit exceeded") | 605 | (if (looking-at "Size limit exceeded") |
| 606 | (forward-line 1)) | 606 | (forward-line 1)) |
| 607 | (if (looking-at "version:") (forward-line 1)) ;bug#12724. | ||
| 607 | (while (progn | 608 | (while (progn |
| 608 | (skip-chars-forward " \t\n") | 609 | (skip-chars-forward " \t\n") |
| 609 | (not (eobp))) | 610 | (not (eobp))) |
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index ef40c9316cf..9bf731fb6b2 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog | |||
| @@ -1,3 +1,300 @@ | |||
| 1 | 2012-10-26 Achim Gratz <stromeko@stromeko.de> | ||
| 2 | |||
| 3 | * ob-ditaa.el: Needs to (require 'org-compat) for | ||
| 4 | org-find-library-dir. | ||
| 5 | |||
| 6 | * org.el: Remove utf-8 codepoints in docstrings, bytecode doesn't | ||
| 7 | work when loaded from compressed files. | ||
| 8 | |||
| 9 | * org-compat.el: Make sure that file-name-directory is getting a | ||
| 10 | stringp. This avoids a possible " (wrong-type-argument stringp | ||
| 11 | nil)" error when the library in question does not exist. | ||
| 12 | |||
| 13 | * org-odt.el: Replace arc-mode.el by arc-mode. | ||
| 14 | |||
| 15 | * org.el: Replace org-macs.el by org-macs. | ||
| 16 | |||
| 17 | * org-install.el: Provide an empty file that prints a warning | ||
| 18 | about an outdated configuration. | ||
| 19 | |||
| 20 | 2012-10-26 Bastien Guerry <bzg@gnu.org> | ||
| 21 | |||
| 22 | * org-latex.el (org-export-as-latex): Remove obsolete argument | ||
| 23 | `hidden'. Also fix the docstring: using 'string as the value | ||
| 24 | for `to-buffer' outputs a string with no LaTeX header. | ||
| 25 | (org-export-as-latex-batch) | ||
| 26 | (org-export-as-latex-to-buffer, org-export-region-as-latex) | ||
| 27 | (org-export-as-pdf): Don't use the obsoleted argument. | ||
| 28 | |||
| 29 | * ob-haskell.el (org-export-as-latex): Don't use the obsoleted | ||
| 30 | argument `hidden'. | ||
| 31 | |||
| 32 | * org.el (org-refile): Run within `with-demoted-errors' so | ||
| 33 | that a corrupted bookmark file does not stop the refile | ||
| 34 | process. | ||
| 35 | |||
| 36 | * org-capture.el (org-capture-bookmark-last-stored-position): | ||
| 37 | Ditto for the capture process. | ||
| 38 | |||
| 39 | * org-src.el (org-edit-src-exit): Fix bug when saving an empty | ||
| 40 | source buffer. | ||
| 41 | |||
| 42 | * org-lparse.el (org-lparse): Fix bug by returning the output | ||
| 43 | of `org-do-lparse'. | ||
| 44 | |||
| 45 | * org.el (org-refile-check-position): Throw an error when the | ||
| 46 | refile target is the current buffer and is not a file. | ||
| 47 | (org-agenda-file-to-front, org-remove-file): Throw an error | ||
| 48 | when the current buffer is not a file. | ||
| 49 | (org-check-agenda-file): Enhance the message. | ||
| 50 | (org-element-type): Autoload. | ||
| 51 | (org-element-context, org-element-paragraph-parser): Don't | ||
| 52 | declare as these two functions are not used in org.el. | ||
| 53 | |||
| 54 | * org-lparse.el (browse-url-file-url): Declare. | ||
| 55 | |||
| 56 | * org.el (org-refile-check-position): Fix typo in docstring. | ||
| 57 | |||
| 58 | * org-clock.el (org-clock-modeline-total): Make obsolete. | ||
| 59 | (org-clock-mode-line-total): Rename from | ||
| 60 | `org-clock-modeline-total'. | ||
| 61 | (org-clock-get-sum-start): Fix references to | ||
| 62 | `org-clock-modeline-total'. | ||
| 63 | |||
| 64 | * org-faces.el (org-agenda-filter-tags) | ||
| 65 | (org-agenda-filter-category, mode-line): Use the 'mode-line | ||
| 66 | face instead of the obsolete 'modeline. | ||
| 67 | |||
| 68 | * org-odt.el (org-odt-styles-dir): Try more directories. | ||
| 69 | Don't throw an error, just send a message. | ||
| 70 | |||
| 71 | * org-odt.el (org-odt-lib-dir, org-odt-data-dir) | ||
| 72 | (org-odt-schema-dir-list, org-odt-styles-dir-list): Delete. | ||
| 73 | (org-export-odt-schema-dir, org-odt-styles-dir): Infer the | ||
| 74 | correct directories without requiring other variables. | ||
| 75 | |||
| 76 | * org-fixup.el (org-make-org-version, org-make-autoloads): | ||
| 77 | Don't define `org-odt-data-dir' in org-version.el. | ||
| 78 | |||
| 79 | * org-loaddefs.el: New file. | ||
| 80 | |||
| 81 | * org.el ("org-loaddefs.el"): Don't throw an error if the file | ||
| 82 | cannot be fund. | ||
| 83 | (org-version): Use org-loaddefs.el instead of org-install.el. | ||
| 84 | |||
| 85 | * org.el: Don't dynamically autoload already autoloaded | ||
| 86 | functions. | ||
| 87 | (org-clock-update-time-maybe): Move to org-clock.el. | ||
| 88 | |||
| 89 | * org-exp.el (org-insert-export-options-template): Remove | ||
| 90 | autoload cookie. | ||
| 91 | |||
| 92 | * org-clock.el (org-resolve-clocks, org-clock-in) | ||
| 93 | (org-clock-out, org-clock-cancel, org-clock-goto) | ||
| 94 | (org-clock-sum, org-clock-display, org-clock-report) | ||
| 95 | (org-dblock-write:clocktable): Add autoload cookie. | ||
| 96 | (org-clock-update-time-maybe): Moved from org.el. | ||
| 97 | |||
| 98 | * org-beamer.el (org-beamer-sectioning, org-beamer-mode): Ditto. | ||
| 99 | |||
| 100 | * org-ascii.el (org-export-ascii-preprocess): Ditto. | ||
| 101 | |||
| 102 | * org-archive.el (org-archive-subtree) | ||
| 103 | (org-archive-to-archive-sibling, org-toggle-archive-tag): Add | ||
| 104 | autoload cookie. | ||
| 105 | |||
| 106 | * org-colview.el (org-columns, org-dblock-write:columnview) | ||
| 107 | (org-insert-columns-dblock, org-agenda-columns): Ditto. | ||
| 108 | |||
| 109 | * org-table.el (org-table-create-with-table.el) | ||
| 110 | (org-table-create-or-convert-from-region, org-table-create) | ||
| 111 | (org-table-convert-region, org-table-import) | ||
| 112 | (org-table-export, org-table-align) | ||
| 113 | (org-table-justify-field-maybe, org-table-next-field) | ||
| 114 | (org-table-previous-field, org-table-next-row) | ||
| 115 | (org-table-copy-down, org-table-field-info) | ||
| 116 | (org-table-current-dline, org-table-goto-column) | ||
| 117 | (org-table-insert-column, org-table-delete-column) | ||
| 118 | (org-table-move-column-right, org-table-move-column-left) | ||
| 119 | (org-table-move-column, org-table-move-row-down) | ||
| 120 | (org-table-move-row-up, org-table-move-row) | ||
| 121 | (org-table-insert-row, org-table-insert-hline) | ||
| 122 | (org-table-hline-and-move, org-table-kill-row) | ||
| 123 | (org-table-sort-lines, org-table-cut-region) | ||
| 124 | (org-table-copy-region, org-table-paste-rectangle) | ||
| 125 | (org-table-convert, org-table-wrap-region) | ||
| 126 | (org-table-edit-field, org-table-sum) | ||
| 127 | (org-table-get-stored-formulas) | ||
| 128 | (org-table-maybe-eval-formula) | ||
| 129 | (org-table-rotate-recalc-marks) | ||
| 130 | (org-table-maybe-recalculate-line, org-table-eval-formula) | ||
| 131 | (org-table-recalculate, org-table-iterate) | ||
| 132 | (org-table-edit-formulas) | ||
| 133 | (org-table-toggle-coordinate-overlays) | ||
| 134 | (org-table-toggle-formula-debugger, orgtbl-to-generic) | ||
| 135 | (orgtbl-to-tsv, orgtbl-to-csv, orgtbl-to-latex) | ||
| 136 | (orgtbl-to-html, orgtbl-to-texinfo, orgtbl-to-orgtbl): Ditto. | ||
| 137 | |||
| 138 | * org.el (turn-on-orgtbl): Moved here from org-table.el. | ||
| 139 | (org-clock-persistence-insinuate): Moved here from org-clock.el. | ||
| 140 | (org-update-all-dblocks, org-map-entries) | ||
| 141 | (org-require-autoloaded-modules, org-forward-element) | ||
| 142 | (org-backward-element, org-up-element) | ||
| 143 | (org-element-greater-elements, org-drag-element-backward) | ||
| 144 | (org-drag-element-forward, org-mark-element) | ||
| 145 | (org-narrow-to-element, org-transpose-element) | ||
| 146 | (org-unindent-buffer): Don't autoload. | ||
| 147 | |||
| 148 | * org-clock.el (org-clock-get-clocktable): Rename from | ||
| 149 | `org-get-clocktable'. | ||
| 150 | (org-clock-persistence-insinuate): Move to org.el. | ||
| 151 | |||
| 152 | * org-capture.el: Do no set `generated-autoload-file' locally. | ||
| 153 | Minor code clean up. | ||
| 154 | |||
| 155 | * org-agenda.el (org-agenda-list): Use | ||
| 156 | `org-clock-get-clocktable'. Do no set | ||
| 157 | `generated-autoload-file' locally. | ||
| 158 | |||
| 159 | * org-table.el (org-table-iterate-buffer-tables): Minor | ||
| 160 | reformatting. | ||
| 161 | (turn-on-orgtbl): Move to org.el. | ||
| 162 | |||
| 163 | * org-html.el (org-export-htmlize-generate-css): Don't autoload. | ||
| 164 | |||
| 165 | * org-timer.el (org-timer-pause-or-continue, org-timer-stop): | ||
| 166 | Ditto. | ||
| 167 | |||
| 168 | * ob-tangle.el (org-babel-tangle-lang-exts): Ditto. | ||
| 169 | |||
| 170 | * ob-lob.el (org-babel-lob-ingest): Ditto. | ||
| 171 | |||
| 172 | * org-id.el (org-id-copy) | ||
| 173 | (org-id-get-with-outline-path-completion) | ||
| 174 | (org-id-get-with-outline-drilling): Ditto. | ||
| 175 | |||
| 176 | * org-lparse.el (org-lparse-and-open, org-lparse-batch) | ||
| 177 | (org-lparse-to-buffer, org-replace-region-by) | ||
| 178 | (org-lparse-region): Ditto. | ||
| 179 | |||
| 180 | * org-mobile.el (org-mobile-create-sumo-agenda): Ditto. | ||
| 181 | |||
| 182 | * org.el (org-cycle): Fix misplaced autoload cookie. | ||
| 183 | |||
| 184 | * org-agenda.el (org-agenda-get-timestamps): Check if the item | ||
| 185 | is an habit when formatting it with `org-agenda-format-item'. | ||
| 186 | (org-agenda-get-blocks): Fix bug: don't assume the item is an | ||
| 187 | habit when formatting with `org-agenda-format-item'. | ||
| 188 | |||
| 189 | * org.el (org-calendar-agenda-action-key): Delete an option. | ||
| 190 | (org-mode-map): Delete its keybinding. | ||
| 191 | (org-agenda-action-marker, org-mark-entry-for-agenda-action): | ||
| 192 | Delete. | ||
| 193 | |||
| 194 | * org-agenda.el (org-agenda-diary-entry): Don't prevent from | ||
| 195 | being used outside of Org agendas, as it can be used in | ||
| 196 | calendar buffers too. | ||
| 197 | |||
| 198 | 2012-10-26 Caio Tiago Oliveira <asrail@gmail.com> (tiny change) | ||
| 199 | |||
| 200 | * ob-scala.el (org-babel-scala-wrapper-method): Use a Scala | ||
| 201 | block enclosing the submitted code. | ||
| 202 | |||
| 203 | 2012-10-26 Myles English <mylesenglish@gmail.com> (tiny change) | ||
| 204 | |||
| 205 | * org-clock.el (org-clock-in): Moved the call to | ||
| 206 | org-clock-in-prepare-hook until the task's properties | ||
| 207 | can be accessed. | ||
| 208 | |||
| 209 | 2012-10-26 Nicolas Goaziou <n.goaziou@gmail.com> | ||
| 210 | |||
| 211 | * org.el (org-auto-fill-function): Make sure `adaptive-fill-mode' | ||
| 212 | mode is nil when pre-computed `fill-prefix' is the empty string. | ||
| 213 | Otherwise filling functions from fill.el think it has to be computed | ||
| 214 | again and overwrite it. | ||
| 215 | |||
| 216 | * org.el: Make `org-closest-date' aware of hours repeaters. | ||
| 217 | |||
| 218 | * org.el (org-end-of-line): Do not call `end-of-visual-line' when | ||
| 219 | moving to the end of line. Also improve behaviour on elements that | ||
| 220 | can be hidden. | ||
| 221 | |||
| 222 | * org.el (org-sparse-tree): Allow to call `org-show-todo-tree' | ||
| 223 | with an argument. | ||
| 224 | |||
| 225 | * org-element.el (org-element--get-next-object-candidates): Fix | ||
| 226 | parsing of objects of the same type in a single paragraph. | ||
| 227 | |||
| 228 | * org-element.el (org-element-sub/superscript-successor): Fix | ||
| 229 | parsing of sub/superscript at beginning of item. | ||
| 230 | (org-element-latex-or-entity-successor): Fix parsing of latex | ||
| 231 | fragments at beginning of item. | ||
| 232 | |||
| 233 | * org-agenda.el (org-agenda-later): Fix function when span is | ||
| 234 | a number and an argument was provided. Also fix typo in docstring. | ||
| 235 | |||
| 236 | * org.el (org-read-date-analyze): Fix analyzing for dates like | ||
| 237 | "29.03 16:40". | ||
| 238 | |||
| 239 | * org-element.el (org-element-center-block-parser) | ||
| 240 | (org-element-drawer-parser, , org-element-footnote-definition-parser) | ||
| 241 | (org-element-inlinetask-parser, org-element-plain-list-parser) | ||
| 242 | (org-element-quote-block-parser, org-element-special-block-parser) | ||
| 243 | (org-element-babel-call-parser, org-element-clock-parser) | ||
| 244 | (org-element-comment-parser, org-element-comment-block-parser) | ||
| 245 | (org-element-example-block-parser, org-element-export-block-parser) | ||
| 246 | (org-element-fixed-width-parser, org-element-horizontal-rule-parser) | ||
| 247 | (org-element-keyword-parser, org-element-latex-environment-parser) | ||
| 248 | (org-element-paragraph-parser, org-element-planning-parser) | ||
| 249 | (org-element-property-drawer-parser, org-element-src-block-parser) | ||
| 250 | (org-element-table-parser) | ||
| 251 | (org-element-verse-block-parserorg-element-dynamic-block-parser): | ||
| 252 | Make sure element never ends at the end of a blank non-empty line. | ||
| 253 | |||
| 254 | * org-element.el (org-element-context) | ||
| 255 | (org-element--get-next-object-candidates): Fix `org-element-context'. | ||
| 256 | In particular, the restrictions for an object may be different from | ||
| 257 | those of its container (i.e. table rows and table cells). | ||
| 258 | |||
| 259 | * org-element.el (org-element-example-block-parser) | ||
| 260 | (org-element-src-block-parser): Store value of example-blocks and | ||
| 261 | src-blocks unescaped. | ||
| 262 | (org-element-example-block-interpreter) | ||
| 263 | (org-element-src-block-interpreter): Escape value again when storing | ||
| 264 | it. | ||
| 265 | |||
| 266 | * org-src.el (org-escape-code-in-string) | ||
| 267 | (org-unescape-code-in-string, org-escape-code-in-region) | ||
| 268 | (org-unescape-code-in-region): New functions. | ||
| 269 | (org-edit-src-code, org-edit-src-exit): Use new functions. | ||
| 270 | |||
| 271 | * org.el (org-strip-protective-commas): Removed function. | ||
| 272 | |||
| 273 | * org-exp.el (org-export-select-backend-specific-text): Use new | ||
| 274 | function. | ||
| 275 | |||
| 276 | * ob.el (org-babel-parse-src-block-match) | ||
| 277 | (org-babel-parse-inline-src-block-match, org-babel-insert-result): | ||
| 278 | Always escape produced blocks, independently on the language of the | ||
| 279 | block, if any. Use new functions. | ||
| 280 | |||
| 281 | * org-element.el (org-element-paragraph-parser): Fix regexp | ||
| 282 | starting a block. | ||
| 283 | |||
| 284 | * org-element.el (org-element-center-block-parser): | ||
| 285 | (org-element-drawer-parser, org-element-dynamic-block-parser) | ||
| 286 | (org-element-example-block-parser, org-element-export-block-parser) | ||
| 287 | (org-element-latex-environment-parser, org-element-paragraph-parser) | ||
| 288 | (org-element-property-drawer-parser, org-element-src-block-parser) | ||
| 289 | (org-element-verse-block-parser): Use stricter regexps for boundaries | ||
| 290 | of elements. | ||
| 291 | |||
| 292 | 2012-10-26 Toby S. Cubitt <tsc25@cantab.net> | ||
| 293 | |||
| 294 | * org-agenda.el (org-agenda-get-sexps): Reset `extra' to nil at | ||
| 295 | beginning of re-search-forward loop, otherwise next iteration picks up | ||
| 296 | `extra' value from previous entry. | ||
| 297 | |||
| 1 | 2012-09-30 Abdó Roig-Maranges <abdo.roig@gmail.com> | 298 | 2012-09-30 Abdó Roig-Maranges <abdo.roig@gmail.com> |
| 2 | 299 | ||
| 3 | * org-html.el (org-export-html-preprocess) | 300 | * org-html.el (org-export-html-preprocess) |
diff --git a/lisp/org/ob-ditaa.el b/lisp/org/ob-ditaa.el index ae7794b659c..7c545c47437 100644 --- a/lisp/org/ob-ditaa.el +++ b/lisp/org/ob-ditaa.el | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | 40 | ||
| 41 | ;;; Code: | 41 | ;;; Code: |
| 42 | (require 'ob) | 42 | (require 'ob) |
| 43 | (require 'org-compat) | ||
| 43 | 44 | ||
| 44 | (defvar org-ditaa-jar-path) ;; provided by org-exp-blocks | 45 | (defvar org-ditaa-jar-path) ;; provided by org-exp-blocks |
| 45 | 46 | ||
diff --git a/lisp/org/ob-haskell.el b/lisp/org/ob-haskell.el index 1588f99f1e4..03972efeec1 100644 --- a/lisp/org/ob-haskell.el +++ b/lisp/org/ob-haskell.el | |||
| @@ -147,6 +147,8 @@ specifying a variable of the same value." | |||
| 147 | (format "%S" var))) | 147 | (format "%S" var))) |
| 148 | 148 | ||
| 149 | (defvar org-src-preserve-indentation) | 149 | (defvar org-src-preserve-indentation) |
| 150 | (declare-function org-export-as-latex "org-latex" | ||
| 151 | (arg &optional ext-plist to-buffer body-only pub-dir)) | ||
| 150 | (defun org-babel-haskell-export-to-lhs (&optional arg) | 152 | (defun org-babel-haskell-export-to-lhs (&optional arg) |
| 151 | "Export to a .lhs file with all haskell code blocks escaped. | 153 | "Export to a .lhs file with all haskell code blocks escaped. |
| 152 | When called with a prefix argument the resulting | 154 | When called with a prefix argument the resulting |
diff --git a/lisp/org/ob-io.el b/lisp/org/ob-io.el index 20648266056..881f35afbda 100644 --- a/lisp/org/ob-io.el +++ b/lisp/org/ob-io.el | |||
| @@ -38,12 +38,12 @@ | |||
| 38 | (require 'ob-eval) | 38 | (require 'ob-eval) |
| 39 | (eval-when-compile (require 'cl)) | 39 | (eval-when-compile (require 'cl)) |
| 40 | 40 | ||
| 41 | (defvar org-babel-tangle-lang-exts) ;; Autoloaded | ||
| 41 | (add-to-list 'org-babel-tangle-lang-exts '("io" . "io")) | 42 | (add-to-list 'org-babel-tangle-lang-exts '("io" . "io")) |
| 42 | (defvar org-babel-default-header-args:io '()) | 43 | (defvar org-babel-default-header-args:io '()) |
| 43 | (defvar org-babel-io-command "io" | 44 | (defvar org-babel-io-command "io" |
| 44 | "Name of the command to use for executing Io code.") | 45 | "Name of the command to use for executing Io code.") |
| 45 | 46 | ||
| 46 | |||
| 47 | (defun org-babel-execute:io (body params) | 47 | (defun org-babel-execute:io (body params) |
| 48 | "Execute a block of Io code with org-babel. This function is | 48 | "Execute a block of Io code with org-babel. This function is |
| 49 | called by `org-babel-execute-src-block'" | 49 | called by `org-babel-execute-src-block'" |
diff --git a/lisp/org/ob-keys.el b/lisp/org/ob-keys.el index 759bef3905f..3e3f496ff35 100644 --- a/lisp/org/ob-keys.el +++ b/lisp/org/ob-keys.el | |||
| @@ -98,6 +98,8 @@ a-list placed behind the generic `org-babel-key-prefix'.") | |||
| 98 | 98 | ||
| 99 | (provide 'ob-keys) | 99 | (provide 'ob-keys) |
| 100 | 100 | ||
| 101 | 101 | ;; Local variables: | |
| 102 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 103 | ;; End: | ||
| 102 | 104 | ||
| 103 | ;;; ob-keys.el ends here | 105 | ;;; ob-keys.el ends here |
diff --git a/lisp/org/ob-lob.el b/lisp/org/ob-lob.el index 6aafe34dcd3..8b5f14d0252 100644 --- a/lisp/org/ob-lob.el +++ b/lisp/org/ob-lob.el | |||
| @@ -45,7 +45,6 @@ To add files to this list use the `org-babel-lob-ingest' command." | |||
| 45 | (defvar org-babel-default-lob-header-args '((:exports . "results")) | 45 | (defvar org-babel-default-lob-header-args '((:exports . "results")) |
| 46 | "Default header arguments to use when exporting #+lob/call lines.") | 46 | "Default header arguments to use when exporting #+lob/call lines.") |
| 47 | 47 | ||
| 48 | ;;;###autoload | ||
| 49 | (defun org-babel-lob-ingest (&optional file) | 48 | (defun org-babel-lob-ingest (&optional file) |
| 50 | "Add all named source-blocks defined in FILE to | 49 | "Add all named source-blocks defined in FILE to |
| 51 | `org-babel-library-of-babel'." | 50 | `org-babel-library-of-babel'." |
| @@ -143,6 +142,8 @@ if so then run the appropriate source block from the Library." | |||
| 143 | 142 | ||
| 144 | (provide 'ob-lob) | 143 | (provide 'ob-lob) |
| 145 | 144 | ||
| 146 | 145 | ;; Local variables: | |
| 146 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 147 | ;; End: | ||
| 147 | 148 | ||
| 148 | ;;; ob-lob.el ends here | 149 | ;;; ob-lob.el ends here |
diff --git a/lisp/org/ob-picolisp.el b/lisp/org/ob-picolisp.el index dd0704fc14e..025993c5847 100644 --- a/lisp/org/ob-picolisp.el +++ b/lisp/org/ob-picolisp.el | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | (eval-when-compile (require 'cl)) | 60 | (eval-when-compile (require 'cl)) |
| 61 | 61 | ||
| 62 | (declare-function run-picolisp "ext:inferior-picolisp" (cmd)) | 62 | (declare-function run-picolisp "ext:inferior-picolisp" (cmd)) |
| 63 | (defvar org-babel-tangle-lang-exts) ;; Autoloaded | ||
| 63 | 64 | ||
| 64 | ;; optionally define a file extension for this language | 65 | ;; optionally define a file extension for this language |
| 65 | (add-to-list 'org-babel-tangle-lang-exts '("picolisp" . "l")) | 66 | (add-to-list 'org-babel-tangle-lang-exts '("picolisp" . "l")) |
diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el index 79861f1b78a..af4ee6a1a4d 100644 --- a/lisp/org/ob-ref.el +++ b/lisp/org/ob-ref.el | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | (declare-function org-at-item-p "org-list" ()) | 59 | (declare-function org-at-item-p "org-list" ()) |
| 60 | (declare-function org-narrow-to-subtree "org" ()) | 60 | (declare-function org-narrow-to-subtree "org" ()) |
| 61 | (declare-function org-id-find-id-in-file "org-id" (id file &optional markerp)) | 61 | (declare-function org-id-find-id-in-file "org-id" (id file &optional markerp)) |
| 62 | (declare-function org-id-find-id-file "org-id" (id)) | ||
| 62 | (declare-function org-show-context "org" (&optional key)) | 63 | (declare-function org-show-context "org" (&optional key)) |
| 63 | (declare-function org-pop-to-buffer-same-window | 64 | (declare-function org-pop-to-buffer-same-window |
| 64 | "org-compat" (&optional buffer-or-name norecord label)) | 65 | "org-compat" (&optional buffer-or-name norecord label)) |
diff --git a/lisp/org/ob-scala.el b/lisp/org/ob-scala.el index b5eb18484b9..ea3c3f28112 100644 --- a/lisp/org/ob-scala.el +++ b/lisp/org/ob-scala.el | |||
| @@ -36,12 +36,12 @@ | |||
| 36 | (require 'ob-eval) | 36 | (require 'ob-eval) |
| 37 | (eval-when-compile (require 'cl)) | 37 | (eval-when-compile (require 'cl)) |
| 38 | 38 | ||
| 39 | (defvar org-babel-tangle-lang-exts) ;; Autoloaded | ||
| 39 | (add-to-list 'org-babel-tangle-lang-exts '("scala" . "scala")) | 40 | (add-to-list 'org-babel-tangle-lang-exts '("scala" . "scala")) |
| 40 | (defvar org-babel-default-header-args:scala '()) | 41 | (defvar org-babel-default-header-args:scala '()) |
| 41 | (defvar org-babel-scala-command "scala" | 42 | (defvar org-babel-scala-command "scala" |
| 42 | "Name of the command to use for executing Scala code.") | 43 | "Name of the command to use for executing Scala code.") |
| 43 | 44 | ||
| 44 | |||
| 45 | (defun org-babel-execute:scala (body params) | 45 | (defun org-babel-execute:scala (body params) |
| 46 | "Execute a block of Scala code with org-babel. This function is | 46 | "Execute a block of Scala code with org-babel. This function is |
| 47 | called by `org-babel-execute-src-block'" | 47 | called by `org-babel-execute-src-block'" |
| @@ -72,9 +72,17 @@ Emacs-lisp table, otherwise return the results as a string." | |||
| 72 | 72 | ||
| 73 | 73 | ||
| 74 | (defvar org-babel-scala-wrapper-method | 74 | (defvar org-babel-scala-wrapper-method |
| 75 | "( | 75 | |
| 76 | "var str_result :String = null; | ||
| 77 | |||
| 78 | Console.withOut(new java.io.OutputStream() {def write(b: Int){ | ||
| 79 | }}) { | ||
| 80 | str_result = { | ||
| 76 | %s | 81 | %s |
| 77 | ) asString print | 82 | }.toString |
| 83 | } | ||
| 84 | |||
| 85 | print(str_result) | ||
| 78 | ") | 86 | ") |
| 79 | 87 | ||
| 80 | 88 | ||
diff --git a/lisp/org/ob-sql.el b/lisp/org/ob-sql.el index ad7b1e29a93..20a136a80fb 100644 --- a/lisp/org/ob-sql.el +++ b/lisp/org/ob-sql.el | |||
| @@ -47,7 +47,8 @@ | |||
| 47 | (eval-when-compile (require 'cl)) | 47 | (eval-when-compile (require 'cl)) |
| 48 | 48 | ||
| 49 | (declare-function org-table-import "org-table" (file arg)) | 49 | (declare-function org-table-import "org-table" (file arg)) |
| 50 | (declare-function orgtbl-to-csv "org-table" (TABLE PARAMS)) | 50 | (declare-function orgtbl-to-csv "org-table" (table params)) |
| 51 | (declare-function org-table-to-lisp "org-table" (&optional txt)) | ||
| 51 | 52 | ||
| 52 | (defvar org-babel-default-header-args:sql '()) | 53 | (defvar org-babel-default-header-args:sql '()) |
| 53 | 54 | ||
diff --git a/lisp/org/ob-sqlite.el b/lisp/org/ob-sqlite.el index 24a7dd58c2c..b1696d94d3c 100644 --- a/lisp/org/ob-sqlite.el +++ b/lisp/org/ob-sqlite.el | |||
| @@ -33,7 +33,8 @@ | |||
| 33 | (declare-function org-fill-template "org" (template alist)) | 33 | (declare-function org-fill-template "org" (template alist)) |
| 34 | (declare-function org-table-convert-region "org-table" | 34 | (declare-function org-table-convert-region "org-table" |
| 35 | (beg0 end0 &optional separator)) | 35 | (beg0 end0 &optional separator)) |
| 36 | (declare-function orgtbl-to-csv "org-table" (TABLE PARAMS)) | 36 | (declare-function orgtbl-to-csv "org-table" (table params)) |
| 37 | (declare-function org-table-to-lisp "org-table" (&optional txt)) | ||
| 37 | 38 | ||
| 38 | (defvar org-babel-default-header-args:sqlite '()) | 39 | (defvar org-babel-default-header-args:sqlite '()) |
| 39 | 40 | ||
diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el index 7077a1571eb..7e25b2cd1bc 100644 --- a/lisp/org/ob-tangle.el +++ b/lisp/org/ob-tangle.el | |||
| @@ -38,7 +38,6 @@ | |||
| 38 | (declare-function org-babel-update-block-body "org" (new-body)) | 38 | (declare-function org-babel-update-block-body "org" (new-body)) |
| 39 | (declare-function make-directory "files" (dir &optional parents)) | 39 | (declare-function make-directory "files" (dir &optional parents)) |
| 40 | 40 | ||
| 41 | ;;;###autoload | ||
| 42 | (defcustom org-babel-tangle-lang-exts | 41 | (defcustom org-babel-tangle-lang-exts |
| 43 | '(("emacs-lisp" . "el")) | 42 | '(("emacs-lisp" . "el")) |
| 44 | "Alist mapping languages to their file extensions. | 43 | "Alist mapping languages to their file extensions. |
| @@ -514,6 +513,8 @@ which enable the original code blocks to be found." | |||
| 514 | 513 | ||
| 515 | (provide 'ob-tangle) | 514 | (provide 'ob-tangle) |
| 516 | 515 | ||
| 517 | 516 | ;; Local variables: | |
| 517 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 518 | ;; End: | ||
| 518 | 519 | ||
| 519 | ;;; ob-tangle.el ends here | 520 | ;;; ob-tangle.el ends here |
diff --git a/lisp/org/ob.el b/lisp/org/ob.el index f15457d68e2..b06aac11f69 100644 --- a/lisp/org/ob.el +++ b/lisp/org/ob.el | |||
| @@ -39,7 +39,6 @@ | |||
| 39 | (declare-function show-all "outline" ()) | 39 | (declare-function show-all "outline" ()) |
| 40 | (declare-function org-reduce "org" (CL-FUNC CL-SEQ &rest CL-KEYS)) | 40 | (declare-function org-reduce "org" (CL-FUNC CL-SEQ &rest CL-KEYS)) |
| 41 | (declare-function org-mark-ring-push "org" (&optional pos buffer)) | 41 | (declare-function org-mark-ring-push "org" (&optional pos buffer)) |
| 42 | (declare-function org-strip-protective-commas "org" (beg end)) | ||
| 43 | (declare-function tramp-compat-make-temp-file "tramp-compat" | 42 | (declare-function tramp-compat-make-temp-file "tramp-compat" |
| 44 | (filename &optional dir-flag)) | 43 | (filename &optional dir-flag)) |
| 45 | (declare-function tramp-dissect-file-name "tramp" (name &optional nodefault)) | 44 | (declare-function tramp-dissect-file-name "tramp" (name &optional nodefault)) |
| @@ -64,7 +63,6 @@ | |||
| 64 | (declare-function org-cycle "org" (&optional arg)) | 63 | (declare-function org-cycle "org" (&optional arg)) |
| 65 | (declare-function org-uniquify "org" (list)) | 64 | (declare-function org-uniquify "org" (list)) |
| 66 | (declare-function org-current-level "org" ()) | 65 | (declare-function org-current-level "org" ()) |
| 67 | (declare-function org-strip-protective-commas "org" (beg end)) | ||
| 68 | (declare-function org-table-import "org-table" (file arg)) | 66 | (declare-function org-table-import "org-table" (file arg)) |
| 69 | (declare-function org-add-hook "org-compat" | 67 | (declare-function org-add-hook "org-compat" |
| 70 | (hook function &optional append local)) | 68 | (hook function &optional append local)) |
| @@ -87,10 +85,11 @@ | |||
| 87 | (declare-function org-list-struct "org-list" ()) | 85 | (declare-function org-list-struct "org-list" ()) |
| 88 | (declare-function org-list-prevs-alist "org-list" (struct)) | 86 | (declare-function org-list-prevs-alist "org-list" (struct)) |
| 89 | (declare-function org-list-get-list-end "org-list" (item struct prevs)) | 87 | (declare-function org-list-get-list-end "org-list" (item struct prevs)) |
| 90 | (declare-function org-strip-protective-commas "org" (beg end)) | ||
| 91 | (declare-function org-remove-if "org" (predicate seq)) | 88 | (declare-function org-remove-if "org" (predicate seq)) |
| 92 | (declare-function org-completing-read "org" (&rest args)) | 89 | (declare-function org-completing-read "org" (&rest args)) |
| 93 | (declare-function org-add-protective-commas "org-src" (beg end)) | 90 | (declare-function org-escape-code-in-region "org-src" (beg end)) |
| 91 | (declare-function org-unescape-code-in-string "org-src" (s)) | ||
| 92 | (declare-function org-table-to-lisp "org-table" (&optional txt)) | ||
| 94 | 93 | ||
| 95 | (defgroup org-babel nil | 94 | (defgroup org-babel nil |
| 96 | "Code block evaluation and management in `org-mode' documents." | 95 | "Code block evaluation and management in `org-mode' documents." |
| @@ -494,8 +493,8 @@ can not be resolved.") | |||
| 494 | 493 | ||
| 495 | ;;; functions | 494 | ;;; functions |
| 496 | (defvar call-process-region) | 495 | (defvar call-process-region) |
| 497 | ;;;###autoload | ||
| 498 | 496 | ||
| 497 | ;;;###autoload | ||
| 499 | (defun org-babel-execute-src-block (&optional arg info params) | 498 | (defun org-babel-execute-src-block (&optional arg info params) |
| 500 | "Execute the current source code block. | 499 | "Execute the current source code block. |
| 501 | Insert the results of execution into the buffer. Source code | 500 | Insert the results of execution into the buffer. Source code |
| @@ -838,6 +837,7 @@ evaluation mechanisms." | |||
| 838 | (key-binding (or key (read-key-sequence nil)))))) | 837 | (key-binding (or key (read-key-sequence nil)))))) |
| 839 | 838 | ||
| 840 | (defvar org-bracket-link-regexp) | 839 | (defvar org-bracket-link-regexp) |
| 840 | |||
| 841 | ;;;###autoload | 841 | ;;;###autoload |
| 842 | (defun org-babel-open-src-block-result (&optional re-run) | 842 | (defun org-babel-open-src-block-result (&optional re-run) |
| 843 | "If `point' is on a src block then open the results of the | 843 | "If `point' is on a src block then open the results of the |
| @@ -944,6 +944,7 @@ buffer." | |||
| 944 | (def-edebug-spec org-babel-map-inline-src-blocks (form body)) | 944 | (def-edebug-spec org-babel-map-inline-src-blocks (form body)) |
| 945 | 945 | ||
| 946 | (defvar org-babel-lob-one-liner-regexp) | 946 | (defvar org-babel-lob-one-liner-regexp) |
| 947 | |||
| 947 | ;;;###autoload | 948 | ;;;###autoload |
| 948 | (defmacro org-babel-map-call-lines (file &rest body) | 949 | (defmacro org-babel-map-call-lines (file &rest body) |
| 949 | "Evaluate BODY forms on each call line in FILE. | 950 | "Evaluate BODY forms on each call line in FILE. |
| @@ -1241,7 +1242,7 @@ may be specified in the properties of the current outline entry." | |||
| 1241 | ;; get block body less properties, protective commas, and indentation | 1242 | ;; get block body less properties, protective commas, and indentation |
| 1242 | (with-temp-buffer | 1243 | (with-temp-buffer |
| 1243 | (save-match-data | 1244 | (save-match-data |
| 1244 | (insert (org-babel-strip-protective-commas body lang)) | 1245 | (insert (org-unescape-code-in-string body)) |
| 1245 | (unless preserve-indentation (org-do-remove-indentation)) | 1246 | (unless preserve-indentation (org-do-remove-indentation)) |
| 1246 | (buffer-string))) | 1247 | (buffer-string))) |
| 1247 | (org-babel-merge-params | 1248 | (org-babel-merge-params |
| @@ -1258,8 +1259,7 @@ may be specified in the properties of the current outline entry." | |||
| 1258 | (let* ((lang (org-no-properties (match-string 2))) | 1259 | (let* ((lang (org-no-properties (match-string 2))) |
| 1259 | (lang-headers (intern (concat "org-babel-default-header-args:" lang)))) | 1260 | (lang-headers (intern (concat "org-babel-default-header-args:" lang)))) |
| 1260 | (list lang | 1261 | (list lang |
| 1261 | (org-babel-strip-protective-commas | 1262 | (org-unescape-code-in-string (org-no-properties (match-string 5))) |
| 1262 | (org-no-properties (match-string 5)) lang) | ||
| 1263 | (org-babel-merge-params | 1263 | (org-babel-merge-params |
| 1264 | org-babel-default-inline-header-args | 1264 | org-babel-default-inline-header-args |
| 1265 | (org-babel-params-from-properties lang) | 1265 | (org-babel-params-from-properties lang) |
| @@ -1937,10 +1937,10 @@ code ---- the results are extracted in the syntax of the source | |||
| 1937 | ((member "prepend" result-params)))) ; already there | 1937 | ((member "prepend" result-params)))) ; already there |
| 1938 | (setq results-switches | 1938 | (setq results-switches |
| 1939 | (if results-switches (concat " " results-switches) "")) | 1939 | (if results-switches (concat " " results-switches) "")) |
| 1940 | (let ((wrap (lambda (start finish &optional escape) | 1940 | (let ((wrap (lambda (start finish) |
| 1941 | (goto-char end) (insert (concat finish "\n")) | 1941 | (goto-char end) (insert (concat finish "\n")) |
| 1942 | (goto-char beg) (insert (concat start "\n")) | 1942 | (goto-char beg) (insert (concat start "\n")) |
| 1943 | (if escape (org-add-protective-commas (point) end)) | 1943 | (org-escape-code-in-region (point) end) |
| 1944 | (goto-char end) (goto-char (point-at-eol)) | 1944 | (goto-char end) (goto-char (point-at-eol)) |
| 1945 | (setq end (point-marker)))) | 1945 | (setq end (point-marker)))) |
| 1946 | (proper-list-p (lambda (it) (and (listp it) (null (cdr (last it))))))) | 1946 | (proper-list-p (lambda (it) (and (listp it) (null (cdr (last it))))))) |
| @@ -1987,7 +1987,7 @@ code ---- the results are extracted in the syntax of the source | |||
| 1987 | ((member "latex" result-params) | 1987 | ((member "latex" result-params) |
| 1988 | (funcall wrap "#+BEGIN_LaTeX" "#+END_LaTeX")) | 1988 | (funcall wrap "#+BEGIN_LaTeX" "#+END_LaTeX")) |
| 1989 | ((member "org" result-params) | 1989 | ((member "org" result-params) |
| 1990 | (funcall wrap "#+BEGIN_SRC org" "#+END_SRC" 'escape)) | 1990 | (funcall wrap "#+BEGIN_SRC org" "#+END_SRC")) |
| 1991 | ((member "code" result-params) | 1991 | ((member "code" result-params) |
| 1992 | (funcall wrap (format "#+BEGIN_SRC %s%s" (or lang "none") results-switches) | 1992 | (funcall wrap (format "#+BEGIN_SRC %s%s" (or lang "none") results-switches) |
| 1993 | "#+END_SRC")) | 1993 | "#+END_SRC")) |
| @@ -2370,17 +2370,6 @@ block but are passed literally to the \"example-block\"." | |||
| 2370 | (funcall nb-add (buffer-substring index (point-max)))) | 2370 | (funcall nb-add (buffer-substring index (point-max)))) |
| 2371 | new-body)) | 2371 | new-body)) |
| 2372 | 2372 | ||
| 2373 | (defun org-babel-strip-protective-commas (body &optional lang) | ||
| 2374 | "Strip protective commas from bodies of source blocks." | ||
| 2375 | (with-temp-buffer | ||
| 2376 | (insert body) | ||
| 2377 | (if (and lang (string= lang "org")) | ||
| 2378 | (progn (goto-char (point-min)) | ||
| 2379 | (while (re-search-forward "^[ \t]*\\(,\\)" nil t) | ||
| 2380 | (replace-match "" nil nil nil 1))) | ||
| 2381 | (org-strip-protective-commas (point-min) (point-max))) | ||
| 2382 | (buffer-string))) | ||
| 2383 | |||
| 2384 | (defun org-babel-script-escape (str &optional force) | 2373 | (defun org-babel-script-escape (str &optional force) |
| 2385 | "Safely convert tables into elisp lists." | 2374 | "Safely convert tables into elisp lists." |
| 2386 | (let (in-single in-double out) | 2375 | (let (in-single in-double out) |
| @@ -2599,6 +2588,8 @@ of `org-babel-temporary-directory'." | |||
| 2599 | 2588 | ||
| 2600 | (provide 'ob) | 2589 | (provide 'ob) |
| 2601 | 2590 | ||
| 2602 | 2591 | ;; Local variables: | |
| 2592 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 2593 | ;; End: | ||
| 2603 | 2594 | ||
| 2604 | ;;; ob.el ends here | 2595 | ;;; ob.el ends here |
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 32fecde2af0..36f3fcb9974 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el | |||
| @@ -1871,6 +1871,7 @@ When nil, `q' will kill the single agenda buffer." | |||
| 1871 | :version "24.3" | 1871 | :version "24.3" |
| 1872 | :type 'boolean) | 1872 | :type 'boolean) |
| 1873 | 1873 | ||
| 1874 | |||
| 1874 | ;;;###autoload | 1875 | ;;;###autoload |
| 1875 | (defun org-toggle-sticky-agenda (&optional arg) | 1876 | (defun org-toggle-sticky-agenda (&optional arg) |
| 1876 | "Toggle `org-agenda-sticky'." | 1877 | "Toggle `org-agenda-sticky'." |
| @@ -1888,6 +1889,11 @@ When nil, `q' will kill the single agenda buffer." | |||
| 1888 | (message "Sticky agenda was %s" | 1889 | (message "Sticky agenda was %s" |
| 1889 | (if org-agenda-sticky "enabled" "disabled")))))) | 1890 | (if org-agenda-sticky "enabled" "disabled")))))) |
| 1890 | 1891 | ||
| 1892 | (autoload 'org-toggle-sticky-agenda "org-agenda" "\ | ||
| 1893 | Toggle `org-agenda-sticky'. | ||
| 1894 | |||
| 1895 | \(fn &optional ARG)" t nil) | ||
| 1896 | |||
| 1891 | (defvar org-agenda-buffer nil | 1897 | (defvar org-agenda-buffer nil |
| 1892 | "Agenda buffer currently being generated.") | 1898 | "Agenda buffer currently being generated.") |
| 1893 | 1899 | ||
| @@ -2563,6 +2569,43 @@ Pressing `<' twice means to restrict to the current subtree or region | |||
| 2563 | ((equal org-keys "!") (customize-variable 'org-stuck-projects)) | 2569 | ((equal org-keys "!") (customize-variable 'org-stuck-projects)) |
| 2564 | (t (error "Invalid agenda key")))))) | 2570 | (t (error "Invalid agenda key")))))) |
| 2565 | 2571 | ||
| 2572 | (autoload 'org-agenda "org-agenda" "\ | ||
| 2573 | Dispatch agenda commands to collect entries to the agenda buffer. | ||
| 2574 | Prompts for a command to execute. Any prefix arg will be passed | ||
| 2575 | on to the selected command. The default selections are: | ||
| 2576 | |||
| 2577 | a Call `org-agenda-list' to display the agenda for current day or week. | ||
| 2578 | t Call `org-todo-list' to display the global todo list. | ||
| 2579 | T Call `org-todo-list' to display the global todo list, select only | ||
| 2580 | entries with a specific TODO keyword (the user gets a prompt). | ||
| 2581 | m Call `org-tags-view' to display headlines with tags matching | ||
| 2582 | a condition (the user is prompted for the condition). | ||
| 2583 | M Like `m', but select only TODO entries, no ordinary headlines. | ||
| 2584 | L Create a timeline for the current buffer. | ||
| 2585 | e Export views to associated files. | ||
| 2586 | s Search entries for keywords. | ||
| 2587 | S Search entries for keywords, only with TODO keywords. | ||
| 2588 | / Multi occur across all agenda files and also files listed | ||
| 2589 | in `org-agenda-text-search-extra-files'. | ||
| 2590 | < Restrict agenda commands to buffer, subtree, or region. | ||
| 2591 | Press several times to get the desired effect. | ||
| 2592 | > Remove a previous restriction. | ||
| 2593 | # List \"stuck\" projects. | ||
| 2594 | ! Configure what \"stuck\" means. | ||
| 2595 | C Configure custom agenda commands. | ||
| 2596 | |||
| 2597 | More commands can be added by configuring the variable | ||
| 2598 | `org-agenda-custom-commands'. In particular, specific tags and TODO keyword | ||
| 2599 | searches can be pre-defined in this way. | ||
| 2600 | |||
| 2601 | If the current buffer is in Org-mode and visiting a file, you can also | ||
| 2602 | first press `<' once to indicate that the agenda should be temporarily | ||
| 2603 | \(until the next use of \\[org-agenda]) restricted to the current file. | ||
| 2604 | Pressing `<' twice means to restrict to the current subtree or region | ||
| 2605 | \(if active). | ||
| 2606 | |||
| 2607 | \(fn &optional ARG ORG-KEYS RESTRICTION)" t nil) | ||
| 2608 | |||
| 2566 | (defun org-agenda-append-agenda () | 2609 | (defun org-agenda-append-agenda () |
| 2567 | "Append another agenda view to the current one. | 2610 | "Append another agenda view to the current one. |
| 2568 | This function allows interactive building of block agendas. | 2611 | This function allows interactive building of block agendas. |
| @@ -2857,6 +2900,16 @@ before running the agenda command." | |||
| 2857 | (org-agenda nil cmd-key))) | 2900 | (org-agenda nil cmd-key))) |
| 2858 | (set-buffer org-agenda-buffer-name) | 2901 | (set-buffer org-agenda-buffer-name) |
| 2859 | (princ (buffer-string))) | 2902 | (princ (buffer-string))) |
| 2903 | |||
| 2904 | (autoload 'org-batch-agenda "org-agenda" "\ | ||
| 2905 | Run an agenda command in batch mode and send the result to STDOUT. | ||
| 2906 | If CMD-KEY is a string of length 1, it is used as a key in | ||
| 2907 | `org-agenda-custom-commands' and triggers this command. If it is a | ||
| 2908 | longer string it is used as a tags/todo match string. | ||
| 2909 | Parameters are alternating variable names and values that will be bound | ||
| 2910 | before running the agenda command. | ||
| 2911 | |||
| 2912 | \(fn CMD-KEY &rest PARAMETERS)" nil t) | ||
| 2860 | (def-edebug-spec org-batch-agenda (form &rest sexp)) | 2913 | (def-edebug-spec org-batch-agenda (form &rest sexp)) |
| 2861 | 2914 | ||
| 2862 | (defvar org-agenda-info nil) | 2915 | (defvar org-agenda-info nil) |
| @@ -2915,6 +2968,43 @@ agenda-day The day in the agenda where this is listed" | |||
| 2915 | priority-letter priority agenda-day) | 2968 | priority-letter priority agenda-day) |
| 2916 | ",")) | 2969 | ",")) |
| 2917 | (princ "\n"))))) | 2970 | (princ "\n"))))) |
| 2971 | |||
| 2972 | (autoload 'org-batch-agenda-csv "org-agenda" "\ | ||
| 2973 | Run an agenda command in batch mode and send the result to STDOUT. | ||
| 2974 | If CMD-KEY is a string of length 1, it is used as a key in | ||
| 2975 | `org-agenda-custom-commands' and triggers this command. If it is a | ||
| 2976 | longer string it is used as a tags/todo match string. | ||
| 2977 | Parameters are alternating variable names and values that will be bound | ||
| 2978 | before running the agenda command. | ||
| 2979 | |||
| 2980 | The output gives a line for each selected agenda item. Each | ||
| 2981 | item is a list of comma-separated values, like this: | ||
| 2982 | |||
| 2983 | category,head,type,todo,tags,date,time,extra,priority-l,priority-n | ||
| 2984 | |||
| 2985 | category The category of the item | ||
| 2986 | head The headline, without TODO kwd, TAGS and PRIORITY | ||
| 2987 | type The type of the agenda entry, can be | ||
| 2988 | todo selected in TODO match | ||
| 2989 | tagsmatch selected in tags match | ||
| 2990 | diary imported from diary | ||
| 2991 | deadline a deadline on given date | ||
| 2992 | scheduled scheduled on given date | ||
| 2993 | timestamp entry has timestamp on given date | ||
| 2994 | closed entry was closed on given date | ||
| 2995 | upcoming-deadline warning about deadline | ||
| 2996 | past-scheduled forwarded scheduled item | ||
| 2997 | block entry has date block including g. date | ||
| 2998 | todo The todo keyword, if any | ||
| 2999 | tags All tags including inherited ones, separated by colons | ||
| 3000 | date The relevant date, like 2007-2-14 | ||
| 3001 | time The time, like 15:00-16:50 | ||
| 3002 | extra Sting with extra planning info | ||
| 3003 | priority-l The priority letter if any was given | ||
| 3004 | priority-n The computed numerical priority | ||
| 3005 | agenda-day The day in the agenda where this is listed | ||
| 3006 | |||
| 3007 | \(fn CMD-KEY &rest PARAMETERS)" nil t) | ||
| 2918 | (def-edebug-spec org-batch-agenda-csv (form &rest sexp)) | 3008 | (def-edebug-spec org-batch-agenda-csv (form &rest sexp)) |
| 2919 | 3009 | ||
| 2920 | (defun org-fix-agenda-info (props) | 3010 | (defun org-fix-agenda-info (props) |
| @@ -2964,6 +3054,11 @@ This ensures the export commands can easily use it." | |||
| 2964 | (interactive) | 3054 | (interactive) |
| 2965 | (eval (list 'org-batch-store-agenda-views))) | 3055 | (eval (list 'org-batch-store-agenda-views))) |
| 2966 | 3056 | ||
| 3057 | (autoload 'org-store-agenda-views "org-agenda" "\ | ||
| 3058 | |||
| 3059 | |||
| 3060 | \(fn &rest PARAMETERS)" t nil) | ||
| 3061 | |||
| 2967 | ;;;###autoload | 3062 | ;;;###autoload |
| 2968 | (defmacro org-batch-store-agenda-views (&rest parameters) | 3063 | (defmacro org-batch-store-agenda-views (&rest parameters) |
| 2969 | "Run all custom agenda commands that have a file argument." | 3064 | "Run all custom agenda commands that have a file argument." |
| @@ -2998,6 +3093,11 @@ This ensures the export commands can easily use it." | |||
| 2998 | (org-agenda-write (expand-file-name (pop files) dir) nil t bufname))) | 3093 | (org-agenda-write (expand-file-name (pop files) dir) nil t bufname))) |
| 2999 | (and (get-buffer bufname) | 3094 | (and (get-buffer bufname) |
| 3000 | (kill-buffer bufname))))))) | 3095 | (kill-buffer bufname))))))) |
| 3096 | |||
| 3097 | (autoload 'org-batch-store-agenda-views "org-agenda" "\ | ||
| 3098 | Run all custom agenda commands that have a file argument. | ||
| 3099 | |||
| 3100 | \(fn &rest PARAMETERS)" nil t) | ||
| 3001 | (def-edebug-spec org-batch-store-agenda-views (&rest sexp)) | 3101 | (def-edebug-spec org-batch-store-agenda-views (&rest sexp)) |
| 3002 | 3102 | ||
| 3003 | (defvar org-agenda-current-span nil | 3103 | (defvar org-agenda-current-span nil |
| @@ -4002,7 +4102,7 @@ given in `org-agenda-start-on-weekday'." | |||
| 4002 | "" | 4102 | "" |
| 4003 | x)) | 4103 | x)) |
| 4004 | filter "")))) | 4104 | filter "")))) |
| 4005 | (setq tbl (apply 'org-get-clocktable p)) | 4105 | (setq tbl (apply 'org-clock-get-clocktable p)) |
| 4006 | (insert tbl))) | 4106 | (insert tbl))) |
| 4007 | (goto-char (point-min)) | 4107 | (goto-char (point-min)) |
| 4008 | (or org-agenda-multi (org-agenda-fit-window-to-buffer)) | 4108 | (or org-agenda-multi (org-agenda-fit-window-to-buffer)) |
| @@ -4026,6 +4126,20 @@ given in `org-agenda-start-on-weekday'." | |||
| 4026 | (setq buffer-read-only t) | 4126 | (setq buffer-read-only t) |
| 4027 | (message "")))) | 4127 | (message "")))) |
| 4028 | 4128 | ||
| 4129 | (autoload 'org-agenda-list "org-agenda" "\ | ||
| 4130 | Produce a daily/weekly view from all files in variable `org-agenda-files'. | ||
| 4131 | The view will be for the current day or week, but from the overview buffer | ||
| 4132 | you will be able to go to other days/weeks. | ||
| 4133 | |||
| 4134 | With a numeric prefix argument in an interactive call, the agenda will | ||
| 4135 | span ARG days. Lisp programs should instead specify SPAN to change | ||
| 4136 | the number of days. SPAN defaults to `org-agenda-span'. | ||
| 4137 | |||
| 4138 | START-DAY defaults to TODAY, or to the most recent match for the weekday | ||
| 4139 | given in `org-agenda-start-on-weekday'. | ||
| 4140 | |||
| 4141 | \(fn &optional ARG START-DAY SPAN)" t nil) | ||
| 4142 | |||
| 4029 | (defun org-agenda-ndays-to-span (n) | 4143 | (defun org-agenda-ndays-to-span (n) |
| 4030 | "Return a span symbol for a span of N days, or N if none matches." | 4144 | "Return a span symbol for a span of N days, or N if none matches." |
| 4031 | (cond ((symbolp n) n) | 4145 | (cond ((symbolp n) n) |
| @@ -4328,6 +4442,52 @@ in `org-agenda-text-search-extra-files'." | |||
| 4328 | (org-agenda-finalize) | 4442 | (org-agenda-finalize) |
| 4329 | (setq buffer-read-only t)))) | 4443 | (setq buffer-read-only t)))) |
| 4330 | 4444 | ||
| 4445 | (autoload 'org-search-view "org-agenda" "\ | ||
| 4446 | Show all entries that contain a phrase or words or regular expressions. | ||
| 4447 | |||
| 4448 | With optional prefix argument TODO-ONLY, only consider entries that are | ||
| 4449 | TODO entries. The argument STRING can be used to pass a default search | ||
| 4450 | string into this function. If EDIT-AT is non-nil, it means that the | ||
| 4451 | user should get a chance to edit this string, with cursor at position | ||
| 4452 | EDIT-AT. | ||
| 4453 | |||
| 4454 | The search string can be viewed either as a phrase that should be found as | ||
| 4455 | is, or it can be broken into a number of snippets, each of which must match | ||
| 4456 | in a Boolean way to select an entry. The default depends on the variable | ||
| 4457 | `org-agenda-search-view-always-boolean'. | ||
| 4458 | Even if this is turned off (the default) you can always switch to | ||
| 4459 | Boolean search dynamically by preceding the first word with \"+\" or \"-\". | ||
| 4460 | |||
| 4461 | The default is a direct search of the whole phrase, where each space in | ||
| 4462 | the search string can expand to an arbitrary amount of whitespace, | ||
| 4463 | including newlines. | ||
| 4464 | |||
| 4465 | If using a Boolean search, the search string is split on whitespace and | ||
| 4466 | each snippet is searched separately, with logical AND to select an entry. | ||
| 4467 | Words prefixed with a minus must *not* occur in the entry. Words without | ||
| 4468 | a prefix or prefixed with a plus must occur in the entry. Matching is | ||
| 4469 | case-insensitive. Words are enclosed by word delimiters (i.e. they must | ||
| 4470 | match whole words, not parts of a word) if | ||
| 4471 | `org-agenda-search-view-force-full-words' is set (default is nil). | ||
| 4472 | |||
| 4473 | Boolean search snippets enclosed by curly braces are interpreted as | ||
| 4474 | regular expressions that must or (when preceded with \"-\") must not | ||
| 4475 | match in the entry. Snippets enclosed into double quotes will be taken | ||
| 4476 | as a whole, to include whitespace. | ||
| 4477 | |||
| 4478 | - If the search string starts with an asterisk, search only in headlines. | ||
| 4479 | - If (possibly after the leading star) the search string starts with an | ||
| 4480 | exclamation mark, this also means to look at TODO entries only, an effect | ||
| 4481 | that can also be achieved with a prefix argument. | ||
| 4482 | - If (possibly after star and exclamation mark) the search string starts | ||
| 4483 | with a colon, this will mean that the (non-regexp) snippets of the | ||
| 4484 | Boolean search must match as full words. | ||
| 4485 | |||
| 4486 | This command searches the agenda files, and in addition the files listed | ||
| 4487 | in `org-agenda-text-search-extra-files'. | ||
| 4488 | |||
| 4489 | \(fn &optional TODO-ONLY STRING EDIT-AT)" t nil) | ||
| 4490 | |||
| 4331 | ;;; Agenda TODO list | 4491 | ;;; Agenda TODO list |
| 4332 | 4492 | ||
| 4333 | (defvar org-select-this-todo-keyword nil) | 4493 | (defvar org-select-this-todo-keyword nil) |
| @@ -4418,6 +4578,15 @@ for a keyword. A numeric prefix directly selects the Nth keyword in | |||
| 4418 | (org-agenda-finalize) | 4578 | (org-agenda-finalize) |
| 4419 | (setq buffer-read-only t)))) | 4579 | (setq buffer-read-only t)))) |
| 4420 | 4580 | ||
| 4581 | (autoload 'org-todo-list "org-agenda" "\ | ||
| 4582 | Show all (not done) TODO entries from all agenda file in a single list. | ||
| 4583 | The prefix arg can be used to select a specific TODO keyword and limit | ||
| 4584 | the list to these. When using \\[universal-argument], you will be prompted | ||
| 4585 | for a keyword. A numeric prefix directly selects the Nth keyword in | ||
| 4586 | `org-todo-keywords-1'. | ||
| 4587 | |||
| 4588 | \(fn &optional ARG)" t nil) | ||
| 4589 | |||
| 4421 | ;;; Agenda tags match | 4590 | ;;; Agenda tags match |
| 4422 | 4591 | ||
| 4423 | ;;;###autoload | 4592 | ;;;###autoload |
| @@ -4503,6 +4672,12 @@ The prefix arg TODO-ONLY limits the search to TODO entries." | |||
| 4503 | (org-agenda-finalize) | 4672 | (org-agenda-finalize) |
| 4504 | (setq buffer-read-only t)))) | 4673 | (setq buffer-read-only t)))) |
| 4505 | 4674 | ||
| 4675 | (autoload 'org-tags-view "org-agenda" "\ | ||
| 4676 | Show all headlines for all `org-agenda-files' matching a TAGS criterion. | ||
| 4677 | The prefix arg TODO-ONLY limits the search to TODO entries. | ||
| 4678 | |||
| 4679 | \(fn &optional TODO-ONLY MATCH)" t nil) | ||
| 4680 | |||
| 4506 | ;;; Agenda Finding stuck projects | 4681 | ;;; Agenda Finding stuck projects |
| 4507 | 4682 | ||
| 4508 | (defvar org-agenda-skip-regexp nil | 4683 | (defvar org-agenda-skip-regexp nil |
| @@ -4731,6 +4906,14 @@ of what a project is and how to check if it stuck, customize the variable | |||
| 4731 | (setq org-agenda-redo-command | 4906 | (setq org-agenda-redo-command |
| 4732 | `(org-agenda-list-stuck-projects ,current-prefix-arg))))) | 4907 | `(org-agenda-list-stuck-projects ,current-prefix-arg))))) |
| 4733 | 4908 | ||
| 4909 | (autoload 'org-agenda-list-stuck-projects "org-agenda" "\ | ||
| 4910 | Create agenda view for projects that are stuck. | ||
| 4911 | Stuck projects are project that have no next actions. For the definitions | ||
| 4912 | of what a project is and how to check if it stuck, customize the variable | ||
| 4913 | `org-stuck-projects'. | ||
| 4914 | |||
| 4915 | \(fn &rest IGNORE)" t nil) | ||
| 4916 | |||
| 4734 | ;;; Diary integration | 4917 | ;;; Diary integration |
| 4735 | 4918 | ||
| 4736 | (defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param. | 4919 | (defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param. |
| @@ -4909,6 +5092,35 @@ function from a program - use `org-agenda-get-day-entries' instead." | |||
| 4909 | (if results | 5092 | (if results |
| 4910 | (concat (org-agenda-finalize-entries results) "\n")))) | 5093 | (concat (org-agenda-finalize-entries results) "\n")))) |
| 4911 | 5094 | ||
| 5095 | (autoload 'org-diary "org-agenda" "\ | ||
| 5096 | Return diary information from org files. | ||
| 5097 | This function can be used in a \"sexp\" diary entry in the Emacs calendar. | ||
| 5098 | It accesses org files and extracts information from those files to be | ||
| 5099 | listed in the diary. The function accepts arguments specifying what | ||
| 5100 | items should be listed. For a list of arguments allowed here, see the | ||
| 5101 | variable `org-agenda-entry-types'. | ||
| 5102 | |||
| 5103 | The call in the diary file should look like this: | ||
| 5104 | |||
| 5105 | &%%(org-diary) ~/path/to/some/orgfile.org | ||
| 5106 | |||
| 5107 | Use a separate line for each org file to check. Or, if you omit the file name, | ||
| 5108 | all files listed in `org-agenda-files' will be checked automatically: | ||
| 5109 | |||
| 5110 | &%%(org-diary) | ||
| 5111 | |||
| 5112 | If you don't give any arguments (as in the example above), the default | ||
| 5113 | arguments (:deadline :scheduled :timestamp :sexp) are used. | ||
| 5114 | So the example above may also be written as | ||
| 5115 | |||
| 5116 | &%%(org-diary :deadline :timestamp :sexp :scheduled) | ||
| 5117 | |||
| 5118 | The function expects the lisp variables `entry' and `date' to be provided | ||
| 5119 | by the caller, because this is how the calendar works. Don't use this | ||
| 5120 | function from a program - use `org-agenda-get-day-entries' instead. | ||
| 5121 | |||
| 5122 | \(fn &rest ARGS)" nil nil) | ||
| 5123 | |||
| 4912 | ;;; Agenda entry finders | 5124 | ;;; Agenda entry finders |
| 4913 | 5125 | ||
| 4914 | (defun org-agenda-get-day-entries (file date &rest args) | 5126 | (defun org-agenda-get-day-entries (file date &rest args) |
| @@ -5035,7 +5247,6 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', | |||
| 5035 | (>= days n) | 5247 | (>= days n) |
| 5036 | (<= days n)))) | 5248 | (<= days n)))) |
| 5037 | 5249 | ||
| 5038 | ;;;###autoload | ||
| 5039 | (defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item | 5250 | (defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item |
| 5040 | (&optional end) | 5251 | (&optional end) |
| 5041 | "Do we have a reason to ignore this TODO entry because it has a time stamp?" | 5252 | "Do we have a reason to ignore this TODO entry because it has a time stamp?" |
| @@ -5098,6 +5309,11 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', | |||
| 5098 | (match-string 1) org-agenda-todo-ignore-timestamp)) | 5309 | (match-string 1) org-agenda-todo-ignore-timestamp)) |
| 5099 | (t)))))))))) | 5310 | (t)))))))))) |
| 5100 | 5311 | ||
| 5312 | (autoload 'org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item "org-agenda" "\ | ||
| 5313 | Do we have a reason to ignore this TODO entry because it has a time stamp? | ||
| 5314 | |||
| 5315 | \(fn &optional END)" nil nil) | ||
| 5316 | |||
| 5101 | (defconst org-agenda-no-heading-message | 5317 | (defconst org-agenda-no-heading-message |
| 5102 | "No heading for this item in buffer or region.") | 5318 | "No heading for this item in buffer or region.") |
| 5103 | 5319 | ||
| @@ -5133,12 +5349,13 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', | |||
| 5133 | "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) | 5349 | "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) |
| 5134 | marker hdmarker deadlinep scheduledp clockp closedp inactivep | 5350 | marker hdmarker deadlinep scheduledp clockp closedp inactivep |
| 5135 | donep tmp priority category category-pos ee txt timestr tags | 5351 | donep tmp priority category category-pos ee txt timestr tags |
| 5136 | b0 b3 e3 head todo-state end-of-match show-all warntime) | 5352 | b0 b3 e3 head todo-state end-of-match show-all warntime habitp) |
| 5137 | (goto-char (point-min)) | 5353 | (goto-char (point-min)) |
| 5138 | (while (setq end-of-match (re-search-forward regexp nil t)) | 5354 | (while (setq end-of-match (re-search-forward regexp nil t)) |
| 5139 | (setq b0 (match-beginning 0) | 5355 | (setq b0 (match-beginning 0) |
| 5140 | b3 (match-beginning 3) e3 (match-end 3) | 5356 | b3 (match-beginning 3) e3 (match-end 3) |
| 5141 | todo-state (save-match-data (ignore-errors (org-get-todo-state))) | 5357 | todo-state (save-match-data (ignore-errors (org-get-todo-state))) |
| 5358 | habitp (and (functionp 'org-is-habit-p) (save-match-data (org-is-habit-p))) | ||
| 5142 | show-all (or (eq org-agenda-repeating-timestamp-show-all t) | 5359 | show-all (or (eq org-agenda-repeating-timestamp-show-all t) |
| 5143 | (member todo-state | 5360 | (member todo-state |
| 5144 | org-agenda-repeating-timestamp-show-all))) | 5361 | org-agenda-repeating-timestamp-show-all))) |
| @@ -5190,7 +5407,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', | |||
| 5190 | (setq txt (org-agenda-format-item | 5407 | (setq txt (org-agenda-format-item |
| 5191 | (if inactivep org-agenda-inactive-leader nil) | 5408 | (if inactivep org-agenda-inactive-leader nil) |
| 5192 | head category tags timestr | 5409 | head category tags timestr |
| 5193 | remove-re t))) | 5410 | remove-re habitp))) |
| 5194 | (setq priority (org-get-priority txt)) | 5411 | (setq priority (org-get-priority txt)) |
| 5195 | (org-add-props txt props | 5412 | (org-add-props txt props |
| 5196 | 'org-marker marker 'org-hd-marker hdmarker) | 5413 | 'org-marker marker 'org-hd-marker hdmarker) |
| @@ -5237,7 +5454,8 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', | |||
| 5237 | tags (save-excursion (org-backward-heading-same-level 0) | 5454 | tags (save-excursion (org-backward-heading-same-level 0) |
| 5238 | (org-get-tags-at)) | 5455 | (org-get-tags-at)) |
| 5239 | todo-state (org-get-todo-state) | 5456 | todo-state (org-get-todo-state) |
| 5240 | warntime (org-entry-get (point) "APPT_WARNTIME")) | 5457 | warntime (org-entry-get (point) "APPT_WARNTIME") |
| 5458 | extra nil) | ||
| 5241 | 5459 | ||
| 5242 | (dolist (r (if (stringp result) | 5460 | (dolist (r (if (stringp result) |
| 5243 | (list result) | 5461 | (list result) |
| @@ -5848,7 +6066,7 @@ FRACTION is what fraction of the head-warning time has passed." | |||
| 5848 | (concat "<" start-time ">")) | 6066 | (concat "<" start-time ">")) |
| 5849 | ((= d2 d0) | 6067 | ((= d2 d0) |
| 5850 | (concat "<" end-time ">"))) | 6068 | (concat "<" end-time ">"))) |
| 5851 | remove-re t)))) | 6069 | remove-re)))) |
| 5852 | (org-add-props txt props | 6070 | (org-add-props txt props |
| 5853 | 'org-marker marker 'org-hd-marker hdmarker | 6071 | 'org-marker marker 'org-hd-marker hdmarker |
| 5854 | 'type "block" 'date date | 6072 | 'type "block" 'date date |
| @@ -7059,7 +7277,7 @@ Negative selection means regexp must not match for selection of an entry." | |||
| 7059 | (move-beginning-of-line 1))))) | 7277 | (move-beginning-of-line 1))))) |
| 7060 | 7278 | ||
| 7061 | (defun org-agenda-later (arg) | 7279 | (defun org-agenda-later (arg) |
| 7062 | "Go forward in time by thee current span. | 7280 | "Go forward in time by the current span. |
| 7063 | With prefix ARG, go forward that many times the current span." | 7281 | With prefix ARG, go forward that many times the current span." |
| 7064 | (interactive "p") | 7282 | (interactive "p") |
| 7065 | (org-agenda-check-type t 'agenda) | 7283 | (org-agenda-check-type t 'agenda) |
| @@ -7071,7 +7289,7 @@ With prefix ARG, go forward that many times the current span." | |||
| 7071 | greg2) | 7289 | greg2) |
| 7072 | (cond | 7290 | (cond |
| 7073 | ((numberp span) | 7291 | ((numberp span) |
| 7074 | (setq sd (+ span sd))) | 7292 | (setq sd (+ (* span arg) sd))) |
| 7075 | ((eq span 'day) | 7293 | ((eq span 'day) |
| 7076 | (setq sd (+ arg sd))) | 7294 | (setq sd (+ arg sd))) |
| 7077 | ((eq span 'week) | 7295 | ((eq span 'week) |
| @@ -8654,7 +8872,6 @@ When `org-agenda-diary-file' points to a file, | |||
| 8654 | `org-agenda-diary-entry-in-org-file' is called instead to create | 8872 | `org-agenda-diary-entry-in-org-file' is called instead to create |
| 8655 | entries in that Org-mode file." | 8873 | entries in that Org-mode file." |
| 8656 | (interactive) | 8874 | (interactive) |
| 8657 | (org-agenda-check-type t 'agenda 'timeline) | ||
| 8658 | (if (not (eq org-agenda-diary-file 'diary-file)) | 8875 | (if (not (eq org-agenda-diary-file 'diary-file)) |
| 8659 | (org-agenda-diary-entry-in-org-file) | 8876 | (org-agenda-diary-entry-in-org-file) |
| 8660 | (require 'diary-lib) | 8877 | (require 'diary-lib) |
| @@ -8765,6 +8982,12 @@ This is a command that has to be installed in `calendar-mode-map'." | |||
| 8765 | (calendar-cursor-to-date)) | 8982 | (calendar-cursor-to-date)) |
| 8766 | nil)) | 8983 | nil)) |
| 8767 | 8984 | ||
| 8985 | (autoload 'org-calendar-goto-agenda "org-agenda" "\ | ||
| 8986 | Compute the Org-mode agenda for the calendar date displayed at the cursor. | ||
| 8987 | This is a command that has to be installed in `calendar-mode-map'. | ||
| 8988 | |||
| 8989 | \(fn)" t nil) | ||
| 8990 | |||
| 8768 | (defun org-agenda-convert-date () | 8991 | (defun org-agenda-convert-date () |
| 8769 | (interactive) | 8992 | (interactive) |
| 8770 | (org-agenda-check-type t 'agenda 'timeline) | 8993 | (org-agenda-check-type t 'agenda 'timeline) |
| @@ -9207,6 +9430,40 @@ to override `appt-message-warning-time'." | |||
| 9207 | (message "No event to add") | 9430 | (message "No event to add") |
| 9208 | (message "Added %d event%s for today" cnt (if (> cnt 1) "s" ""))))) | 9431 | (message "Added %d event%s for today" cnt (if (> cnt 1) "s" ""))))) |
| 9209 | 9432 | ||
| 9433 | (autoload 'org-agenda-to-appt "org-agenda" "\ | ||
| 9434 | Activate appointments found in `org-agenda-files'. | ||
| 9435 | With a \\[universal-argument] prefix, refresh the list of | ||
| 9436 | appointments. | ||
| 9437 | |||
| 9438 | If FILTER is t, interactively prompt the user for a regular | ||
| 9439 | expression, and filter out entries that don't match it. | ||
| 9440 | |||
| 9441 | If FILTER is a string, use this string as a regular expression | ||
| 9442 | for filtering entries out. | ||
| 9443 | |||
| 9444 | If FILTER is a function, filter out entries against which | ||
| 9445 | calling the function returns nil. This function takes one | ||
| 9446 | argument: an entry from `org-agenda-get-day-entries'. | ||
| 9447 | |||
| 9448 | FILTER can also be an alist with the car of each cell being | ||
| 9449 | either 'headline or 'category. For example: | ||
| 9450 | |||
| 9451 | '((headline \"IMPORTANT\") | ||
| 9452 | (category \"Work\")) | ||
| 9453 | |||
| 9454 | will only add headlines containing IMPORTANT or headlines | ||
| 9455 | belonging to the \"Work\" category. | ||
| 9456 | |||
| 9457 | ARGS are symbols indicating what kind of entries to consider. | ||
| 9458 | By default `org-agenda-to-appt' will use :deadline, :scheduled | ||
| 9459 | and :timestamp entries. See the docstring of `org-diary' for | ||
| 9460 | details and examples. | ||
| 9461 | |||
| 9462 | If an entry as a APPT_WARNTIME property, its value will be used | ||
| 9463 | to override `appt-message-warning-time'. | ||
| 9464 | |||
| 9465 | \(fn &optional REFRESH FILTER &rest ARGS)" t nil) | ||
| 9466 | |||
| 9210 | (defun org-agenda-todayp (date) | 9467 | (defun org-agenda-todayp (date) |
| 9211 | "Does DATE mean today, when considering `org-extend-today-until'?" | 9468 | "Does DATE mean today, when considering `org-extend-today-until'?" |
| 9212 | (let ((today (org-today)) | 9469 | (let ((today (org-today)) |
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el index 29b883824ef..d41a1d38a89 100644 --- a/lisp/org/org-archive.el +++ b/lisp/org/org-archive.el | |||
| @@ -181,6 +181,7 @@ if LOCATION is not given, the value of `org-archive-location' is used." | |||
| 181 | (file-name-nondirectory | 181 | (file-name-nondirectory |
| 182 | (buffer-file-name (buffer-base-buffer)))))) | 182 | (buffer-file-name (buffer-base-buffer)))))) |
| 183 | 183 | ||
| 184 | ;;;###autoload | ||
| 184 | (defun org-archive-subtree (&optional find-done) | 185 | (defun org-archive-subtree (&optional find-done) |
| 185 | "Move the current subtree to the archive. | 186 | "Move the current subtree to the archive. |
| 186 | The archive can be a certain top-level heading in the current file, or in | 187 | The archive can be a certain top-level heading in the current file, or in |
| @@ -369,6 +370,7 @@ this heading." | |||
| 369 | (if (looking-at "^[ \t]*$") | 370 | (if (looking-at "^[ \t]*$") |
| 370 | (outline-next-visible-heading 1)))) | 371 | (outline-next-visible-heading 1)))) |
| 371 | 372 | ||
| 373 | ;;;###autoload | ||
| 372 | (defun org-archive-to-archive-sibling () | 374 | (defun org-archive-to-archive-sibling () |
| 373 | "Archive the current heading by moving it under the archive sibling. | 375 | "Archive the current heading by moving it under the archive sibling. |
| 374 | The archive sibling is a sibling of the heading with the heading name | 376 | The archive sibling is a sibling of the heading with the heading name |
| @@ -483,6 +485,7 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag." | |||
| 483 | (goto-char end))))) | 485 | (goto-char end))))) |
| 484 | (message "%d trees archived" cntarch))) | 486 | (message "%d trees archived" cntarch))) |
| 485 | 487 | ||
| 488 | ;;;###autoload | ||
| 486 | (defun org-toggle-archive-tag (&optional find-done) | 489 | (defun org-toggle-archive-tag (&optional find-done) |
| 487 | "Toggle the archive tag for the current headline. | 490 | "Toggle the archive tag for the current headline. |
| 488 | With prefix ARG, check all children of current headline and offer tagging | 491 | With prefix ARG, check all children of current headline and offer tagging |
| @@ -537,4 +540,8 @@ This command is set with the variable `org-archive-default-command'." | |||
| 537 | 540 | ||
| 538 | (provide 'org-archive) | 541 | (provide 'org-archive) |
| 539 | 542 | ||
| 543 | ;; Local variables: | ||
| 544 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 545 | ;; End: | ||
| 546 | |||
| 540 | ;;; org-archive.el ends here | 547 | ;;; org-archive.el ends here |
diff --git a/lisp/org/org-ascii.el b/lisp/org/org-ascii.el index 655b8db668d..575b830f2c0 100644 --- a/lisp/org/org-ascii.el +++ b/lisp/org/org-ascii.el | |||
| @@ -553,6 +553,7 @@ publishing directory." | |||
| 553 | (kill-buffer (current-buffer))) | 553 | (kill-buffer (current-buffer))) |
| 554 | (current-buffer)))) | 554 | (current-buffer)))) |
| 555 | 555 | ||
| 556 | ;;;###autoload | ||
| 556 | (defun org-export-ascii-preprocess (parameters) | 557 | (defun org-export-ascii-preprocess (parameters) |
| 557 | "Do extra work for ASCII export." | 558 | "Do extra work for ASCII export." |
| 558 | ;; | 559 | ;; |
| @@ -726,4 +727,8 @@ publishing directory." | |||
| 726 | 727 | ||
| 727 | (provide 'org-ascii) | 728 | (provide 'org-ascii) |
| 728 | 729 | ||
| 730 | ;; Local variables: | ||
| 731 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 732 | ;; End: | ||
| 733 | |||
| 729 | ;;; org-ascii.el ends here | 734 | ;;; org-ascii.el ends here |
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el index e02d7e07a4c..25bd6e89d97 100644 --- a/lisp/org/org-attach.el +++ b/lisp/org/org-attach.el | |||
| @@ -451,4 +451,8 @@ prefix." | |||
| 451 | 451 | ||
| 452 | (provide 'org-attach) | 452 | (provide 'org-attach) |
| 453 | 453 | ||
| 454 | ;; Local variables: | ||
| 455 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 456 | ;; End: | ||
| 457 | |||
| 454 | ;;; org-attach.el ends here | 458 | ;;; org-attach.el ends here |
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el index be395ad3927..0fcf27565d5 100644 --- a/lisp/org/org-bbdb.el +++ b/lisp/org/org-bbdb.el | |||
| @@ -338,7 +338,7 @@ This is used by Org to re-create the anniversary hash table." | |||
| 338 | (add-hook 'bbdb-after-change-hook 'org-bbdb-updated) | 338 | (add-hook 'bbdb-after-change-hook 'org-bbdb-updated) |
| 339 | 339 | ||
| 340 | ;;;###autoload | 340 | ;;;###autoload |
| 341 | (defun org-bbdb-anniversaries() | 341 | (defun org-bbdb-anniversaries () |
| 342 | "Extract anniversaries from BBDB for display in the agenda." | 342 | "Extract anniversaries from BBDB for display in the agenda." |
| 343 | (require 'bbdb) | 343 | (require 'bbdb) |
| 344 | (require 'diary-lib) | 344 | (require 'diary-lib) |
| @@ -433,4 +433,8 @@ END:VEVENT\n" | |||
| 433 | 433 | ||
| 434 | (provide 'org-bbdb) | 434 | (provide 'org-bbdb) |
| 435 | 435 | ||
| 436 | ;; Local variables: | ||
| 437 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 438 | ;; End: | ||
| 439 | |||
| 436 | ;;; org-bbdb.el ends here | 440 | ;;; org-bbdb.el ends here |
diff --git a/lisp/org/org-beamer.el b/lisp/org/org-beamer.el index b5f3013e000..73d15416e60 100644 --- a/lisp/org/org-beamer.el +++ b/lisp/org/org-beamer.el | |||
| @@ -228,7 +228,7 @@ the tag does not have any semantic meaning." | |||
| 228 | (org-entry-put nil "BEAMER_env" (match-string 1 tags))) | 228 | (org-entry-put nil "BEAMER_env" (match-string 1 tags))) |
| 229 | (t (org-entry-delete nil "BEAMER_env")))))) | 229 | (t (org-entry-delete nil "BEAMER_env")))))) |
| 230 | 230 | ||
| 231 | 231 | ;;;###autoload | |
| 232 | (defun org-beamer-sectioning (level text) | 232 | (defun org-beamer-sectioning (level text) |
| 233 | "Return the sectioning entry for the current headline. | 233 | "Return the sectioning entry for the current headline. |
| 234 | LEVEL is the reduced level of the headline. | 234 | LEVEL is the reduced level of the headline. |
| @@ -370,6 +370,7 @@ org-beamer-extra are all scoped into this function dynamically." | |||
| 370 | "The keymap for `org-beamer-mode'.") | 370 | "The keymap for `org-beamer-mode'.") |
| 371 | (define-key org-beamer-mode-map "\C-c\C-b" 'org-beamer-select-environment) | 371 | (define-key org-beamer-mode-map "\C-c\C-b" 'org-beamer-select-environment) |
| 372 | 372 | ||
| 373 | ;;;###autoload | ||
| 373 | (define-minor-mode org-beamer-mode | 374 | (define-minor-mode org-beamer-mode |
| 374 | "Special support for editing Org-mode files made to export to beamer." | 375 | "Special support for editing Org-mode files made to export to beamer." |
| 375 | nil " Bm" nil) | 376 | nil " Bm" nil) |
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index 9d20814a2ca..1dfffc6fe1d 100644 --- a/lisp/org/org-capture.el +++ b/lisp/org/org-capture.el | |||
| @@ -434,9 +434,10 @@ Turning on this mode runs the normal hook `org-capture-mode-hook'." | |||
| 434 | 434 | ||
| 435 | ;;; The main commands | 435 | ;;; The main commands |
| 436 | 436 | ||
| 437 | ;;;###autoload | ||
| 438 | (defvar org-capture-initial nil) | 437 | (defvar org-capture-initial nil) |
| 439 | (defvar org-capture-entry nil) | 438 | (defvar org-capture-entry nil) |
| 439 | |||
| 440 | ;;;###autoload | ||
| 440 | (defun org-capture-string (string &optional keys) | 441 | (defun org-capture-string (string &optional keys) |
| 441 | (interactive "sInitial text: \n") | 442 | (interactive "sInitial text: \n") |
| 442 | (let ((org-capture-initial string) | 443 | (let ((org-capture-initial string) |
| @@ -1249,7 +1250,8 @@ Of course, if exact position has been required, just put it there." | |||
| 1249 | (save-restriction | 1250 | (save-restriction |
| 1250 | (widen) | 1251 | (widen) |
| 1251 | (goto-char pos) | 1252 | (goto-char pos) |
| 1252 | (bookmark-set "org-capture-last-stored") | 1253 | (with-demoted-errors |
| 1254 | (bookmark-set "org-capture-last-stored")) | ||
| 1253 | (move-marker org-capture-last-stored-marker (point))))))) | 1255 | (move-marker org-capture-last-stored-marker (point))))))) |
| 1254 | 1256 | ||
| 1255 | (defun org-capture-narrow (beg end) | 1257 | (defun org-capture-narrow (beg end) |
| @@ -1280,7 +1282,7 @@ Point will remain at the first line after the inserted text." | |||
| 1280 | (goto-char pos))) | 1282 | (goto-char pos))) |
| 1281 | 1283 | ||
| 1282 | (defvar org-clock-marker) ; Defined in org.el | 1284 | (defvar org-clock-marker) ; Defined in org.el |
| 1283 | ;;;###autoload | 1285 | |
| 1284 | (defun org-capture-insert-template-here () | 1286 | (defun org-capture-insert-template-here () |
| 1285 | (let* ((template (org-capture-get :template)) | 1287 | (let* ((template (org-capture-get :template)) |
| 1286 | (type (org-capture-get :type)) | 1288 | (type (org-capture-get :type)) |
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index bb6f2b955b3..3f252fd8c32 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el | |||
| @@ -201,7 +201,10 @@ file name play this sound file. If not possible, fall back to beep" | |||
| 201 | (const :tag "Standard beep" t) | 201 | (const :tag "Standard beep" t) |
| 202 | (file :tag "Play sound file"))) | 202 | (file :tag "Play sound file"))) |
| 203 | 203 | ||
| 204 | (defcustom org-clock-modeline-total 'auto | 204 | (define-obsolete-variable-alias 'org-clock-modeline-total |
| 205 | 'org-clock-mode-line-total "24.3") | ||
| 206 | |||
| 207 | (defcustom org-clock-mode-line-total 'auto | ||
| 205 | "Default setting for the time included for the mode line clock. | 208 | "Default setting for the time included for the mode line clock. |
| 206 | This can be overruled locally using the CLOCK_MODELINE_TOTAL property. | 209 | This can be overruled locally using the CLOCK_MODELINE_TOTAL property. |
| 207 | Allowed values are: | 210 | Allowed values are: |
| @@ -962,6 +965,7 @@ to be CLOCKED OUT."))) | |||
| 962 | (not (memq ch '(?K ?G ?S ?C)))) | 965 | (not (memq ch '(?K ?G ?S ?C)))) |
| 963 | fail-quietly))))) | 966 | fail-quietly))))) |
| 964 | 967 | ||
| 968 | ;;;###autoload | ||
| 965 | (defun org-resolve-clocks (&optional only-dangling-p prompt-fn last-valid) | 969 | (defun org-resolve-clocks (&optional only-dangling-p prompt-fn last-valid) |
| 966 | "Resolve all currently open org-mode clocks. | 970 | "Resolve all currently open org-mode clocks. |
| 967 | If `only-dangling-p' is non-nil, only ask to resolve dangling | 971 | If `only-dangling-p' is non-nil, only ask to resolve dangling |
| @@ -1059,6 +1063,8 @@ so long." | |||
| 1059 | (setq org-clock-current-task nil)) | 1063 | (setq org-clock-current-task nil)) |
| 1060 | 1064 | ||
| 1061 | (defvar org-clock-out-time nil) ; store the time of the last clock-out | 1065 | (defvar org-clock-out-time nil) ; store the time of the last clock-out |
| 1066 | |||
| 1067 | ;;;###autoload | ||
| 1062 | (defun org-clock-in (&optional select start-time) | 1068 | (defun org-clock-in (&optional select start-time) |
| 1063 | "Start the clock on the current item. | 1069 | "Start the clock on the current item. |
| 1064 | If necessary, clock-out of the currently active clock. | 1070 | If necessary, clock-out of the currently active clock. |
| @@ -1132,7 +1138,6 @@ make this the default behavior.)" | |||
| 1132 | (if (and (eobp) (not (org-at-heading-p))) | 1138 | (if (and (eobp) (not (org-at-heading-p))) |
| 1133 | (point-at-bol 0) | 1139 | (point-at-bol 0) |
| 1134 | (point))) | 1140 | (point))) |
| 1135 | (run-hooks 'org-clock-in-prepare-hook) | ||
| 1136 | (save-excursion | 1141 | (save-excursion |
| 1137 | (when (and selected-task (marker-buffer selected-task)) | 1142 | (when (and selected-task (marker-buffer selected-task)) |
| 1138 | ;; There is a selected task, move to the correct buffer | 1143 | ;; There is a selected task, move to the correct buffer |
| @@ -1151,6 +1156,7 @@ make this the default behavior.)" | |||
| 1151 | ;; beginning of the heading, since the | 1156 | ;; beginning of the heading, since the |
| 1152 | ;; user is liking to insert stuff here | 1157 | ;; user is liking to insert stuff here |
| 1153 | ;; manually | 1158 | ;; manually |
| 1159 | (run-hooks 'org-clock-in-prepare-hook) | ||
| 1154 | (org-clock-history-push)) | 1160 | (org-clock-history-push)) |
| 1155 | (org-clock-set-current) | 1161 | (org-clock-set-current) |
| 1156 | (cond ((functionp org-clock-in-switch-to-state) | 1162 | (cond ((functionp org-clock-in-switch-to-state) |
| @@ -1310,10 +1316,10 @@ for a todo state to switch to, overriding the existing value | |||
| 1310 | This is for the currently running clock as it is displayed | 1316 | This is for the currently running clock as it is displayed |
| 1311 | in the mode line. This function looks at the properties | 1317 | in the mode line. This function looks at the properties |
| 1312 | LAST_REPEAT and in particular CLOCK_MODELINE_TOTAL and the | 1318 | LAST_REPEAT and in particular CLOCK_MODELINE_TOTAL and the |
| 1313 | corresponding variable `org-clock-modeline-total' and then | 1319 | corresponding variable `org-clock-mode-line-total' and then |
| 1314 | decides which time to use." | 1320 | decides which time to use." |
| 1315 | (let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL") | 1321 | (let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL") |
| 1316 | (symbol-name org-clock-modeline-total))) | 1322 | (symbol-name org-clock-mode-line-total))) |
| 1317 | (lr (org-entry-get nil "LAST_REPEAT"))) | 1323 | (lr (org-entry-get nil "LAST_REPEAT"))) |
| 1318 | (cond | 1324 | (cond |
| 1319 | ((equal cmt "current") | 1325 | ((equal cmt "current") |
| @@ -1428,6 +1434,7 @@ line and position cursor in that line." | |||
| 1428 | (and (re-search-forward org-property-end-re nil t) | 1434 | (and (re-search-forward org-property-end-re nil t) |
| 1429 | (goto-char (match-beginning 0)))))))) | 1435 | (goto-char (match-beginning 0)))))))) |
| 1430 | 1436 | ||
| 1437 | ;;;###autoload | ||
| 1431 | (defun org-clock-out (&optional switch-to-state fail-quietly at-time) | 1438 | (defun org-clock-out (&optional switch-to-state fail-quietly at-time) |
| 1432 | "Stop the currently running clock. | 1439 | "Stop the currently running clock. |
| 1433 | Throw an error if there is no running clock and FAIL-QUIETLY is nil. | 1440 | Throw an error if there is no running clock and FAIL-QUIETLY is nil. |
| @@ -1587,6 +1594,7 @@ UPDOWN tells whether to change 'up or 'down." | |||
| 1587 | ((eq org-ts-what 'year) (* 24 3600 365.2))))) | 1594 | ((eq org-ts-what 'year) (* 24 3600 365.2))))) |
| 1588 | org-ts-what 'updown))))))) | 1595 | org-ts-what 'updown))))))) |
| 1589 | 1596 | ||
| 1597 | ;;;###autoload | ||
| 1590 | (defun org-clock-cancel () | 1598 | (defun org-clock-cancel () |
| 1591 | "Cancel the running clock by removing the start timestamp." | 1599 | "Cancel the running clock by removing the start timestamp." |
| 1592 | (interactive) | 1600 | (interactive) |
| @@ -1613,6 +1621,7 @@ UPDOWN tells whether to change 'up or 'down." | |||
| 1613 | (message "Clock canceled") | 1621 | (message "Clock canceled") |
| 1614 | (run-hooks 'org-clock-cancel-hook)) | 1622 | (run-hooks 'org-clock-cancel-hook)) |
| 1615 | 1623 | ||
| 1624 | ;;;###autoload | ||
| 1616 | (defun org-clock-goto (&optional select) | 1625 | (defun org-clock-goto (&optional select) |
| 1617 | "Go to the currently clocked-in entry, or to the most recently clocked one. | 1626 | "Go to the currently clocked-in entry, or to the most recently clocked one. |
| 1618 | With prefix arg SELECT, offer recently clocked tasks for selection." | 1627 | With prefix arg SELECT, offer recently clocked tasks for selection." |
| @@ -1651,6 +1660,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection." | |||
| 1651 | (let ((range (org-clock-special-range 'today))) | 1660 | (let ((range (org-clock-special-range 'today))) |
| 1652 | (org-clock-sum (car range) (cadr range) nil :org-clock-minutes-today))) | 1661 | (org-clock-sum (car range) (cadr range) nil :org-clock-minutes-today))) |
| 1653 | 1662 | ||
| 1663 | ;;;###autoload | ||
| 1654 | (defun org-clock-sum (&optional tstart tend headline-filter propname) | 1664 | (defun org-clock-sum (&optional tstart tend headline-filter propname) |
| 1655 | "Sum the times for each subtree. | 1665 | "Sum the times for each subtree. |
| 1656 | Puts the resulting times in minutes as a text property on each headline. | 1666 | Puts the resulting times in minutes as a text property on each headline. |
| @@ -1749,6 +1759,7 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes." | |||
| 1749 | (org-clock-sum tstart) | 1759 | (org-clock-sum tstart) |
| 1750 | org-clock-file-total-minutes))) | 1760 | org-clock-file-total-minutes))) |
| 1751 | 1761 | ||
| 1762 | ;;;###autoload | ||
| 1752 | (defun org-clock-display (&optional total-only) | 1763 | (defun org-clock-display (&optional total-only) |
| 1753 | "Show subtree times in the entire buffer. | 1764 | "Show subtree times in the entire buffer. |
| 1754 | If TOTAL-ONLY is non-nil, only show the total time for the entire file | 1765 | If TOTAL-ONLY is non-nil, only show the total time for the entire file |
| @@ -1859,7 +1870,7 @@ and is only done if the variable `org-clock-out-when-done' is not nil." | |||
| 1859 | 'org-clock-out-if-current) | 1870 | 'org-clock-out-if-current) |
| 1860 | 1871 | ||
| 1861 | ;;;###autoload | 1872 | ;;;###autoload |
| 1862 | (defun org-get-clocktable (&rest props) | 1873 | (defun org-clock-get-clocktable (&rest props) |
| 1863 | "Get a formatted clocktable with parameters according to PROPS. | 1874 | "Get a formatted clocktable with parameters according to PROPS. |
| 1864 | The table is created in a temporary buffer, fully formatted and | 1875 | The table is created in a temporary buffer, fully formatted and |
| 1865 | fontified, and then returned." | 1876 | fontified, and then returned." |
| @@ -1879,6 +1890,7 @@ fontified, and then returned." | |||
| 1879 | (re-search-forward "^[ \t]*#\\+END" nil t) | 1890 | (re-search-forward "^[ \t]*#\\+END" nil t) |
| 1880 | (point-at-bol))))) | 1891 | (point-at-bol))))) |
| 1881 | 1892 | ||
| 1893 | ;;;###autoload | ||
| 1882 | (defun org-clock-report (&optional arg) | 1894 | (defun org-clock-report (&optional arg) |
| 1883 | "Create a table containing a report about clocked time. | 1895 | "Create a table containing a report about clocked time. |
| 1884 | If the cursor is inside an existing clocktable block, then the table | 1896 | If the cursor is inside an existing clocktable block, then the table |
| @@ -2165,6 +2177,7 @@ the currently selected interval size." | |||
| 2165 | (org-update-dblock) | 2177 | (org-update-dblock) |
| 2166 | t))))) | 2178 | t))))) |
| 2167 | 2179 | ||
| 2180 | ;;;###autoload | ||
| 2168 | (defun org-dblock-write:clocktable (params) | 2181 | (defun org-dblock-write:clocktable (params) |
| 2169 | "Write the standard clocktable." | 2182 | "Write the standard clocktable." |
| 2170 | (setq params (org-combine-plists org-clocktable-defaults params)) | 2183 | (setq params (org-combine-plists org-clocktable-defaults params)) |
| @@ -2675,6 +2688,48 @@ This function is made for clock tables." | |||
| 2675 | (defvar org-clock-loaded nil | 2688 | (defvar org-clock-loaded nil |
| 2676 | "Was the clock file loaded?") | 2689 | "Was the clock file loaded?") |
| 2677 | 2690 | ||
| 2691 | (defun org-clock-update-time-maybe () | ||
| 2692 | "If this is a CLOCK line, update it and return t. | ||
| 2693 | Otherwise, return nil." | ||
| 2694 | (interactive) | ||
| 2695 | (save-excursion | ||
| 2696 | (beginning-of-line 1) | ||
| 2697 | (skip-chars-forward " \t") | ||
| 2698 | (when (looking-at org-clock-string) | ||
| 2699 | (let ((re (concat "[ \t]*" org-clock-string | ||
| 2700 | " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]" | ||
| 2701 | "\\([ \t]*=>.*\\)?\\)?")) | ||
| 2702 | ts te h m s neg) | ||
| 2703 | (cond | ||
| 2704 | ((not (looking-at re)) | ||
| 2705 | nil) | ||
| 2706 | ((not (match-end 2)) | ||
| 2707 | (when (and (equal (marker-buffer org-clock-marker) (current-buffer)) | ||
| 2708 | (> org-clock-marker (point)) | ||
| 2709 | (<= org-clock-marker (point-at-eol))) | ||
| 2710 | ;; The clock is running here | ||
| 2711 | (setq org-clock-start-time | ||
| 2712 | (apply 'encode-time | ||
| 2713 | (org-parse-time-string (match-string 1)))) | ||
| 2714 | (org-clock-update-mode-line))) | ||
| 2715 | (t | ||
| 2716 | (and (match-end 4) (delete-region (match-beginning 4) (match-end 4))) | ||
| 2717 | (end-of-line 1) | ||
| 2718 | (setq ts (match-string 1) | ||
| 2719 | te (match-string 3)) | ||
| 2720 | (setq s (- (org-float-time | ||
| 2721 | (apply 'encode-time (org-parse-time-string te))) | ||
| 2722 | (org-float-time | ||
| 2723 | (apply 'encode-time (org-parse-time-string ts)))) | ||
| 2724 | neg (< s 0) | ||
| 2725 | s (abs s) | ||
| 2726 | h (floor (/ s 3600)) | ||
| 2727 | s (- s (* 3600 h)) | ||
| 2728 | m (floor (/ s 60)) | ||
| 2729 | s (- s (* 60 s))) | ||
| 2730 | (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m)) | ||
| 2731 | t)))))) | ||
| 2732 | |||
| 2678 | (defun org-clock-save () | 2733 | (defun org-clock-save () |
| 2679 | "Persist various clock-related data to disk. | 2734 | "Persist various clock-related data to disk. |
| 2680 | The details of what will be saved are regulated by the variable | 2735 | The details of what will be saved are regulated by the variable |
| @@ -2766,15 +2821,13 @@ The details of what will be saved are regulated by the variable | |||
| 2766 | (if (outline-invisible-p) | 2821 | (if (outline-invisible-p) |
| 2767 | (org-show-context)))))))))) | 2822 | (org-show-context)))))))))) |
| 2768 | 2823 | ||
| 2769 | ;;;###autoload | ||
| 2770 | (defun org-clock-persistence-insinuate () | ||
| 2771 | "Set up hooks for clock persistence." | ||
| 2772 | (add-hook 'org-mode-hook 'org-clock-load) | ||
| 2773 | (add-hook 'kill-emacs-hook 'org-clock-save)) | ||
| 2774 | |||
| 2775 | ;; Suggested bindings | 2824 | ;; Suggested bindings |
| 2776 | (org-defkey org-mode-map "\C-c\C-x\C-e" 'org-clock-modify-effort-estimate) | 2825 | (org-defkey org-mode-map "\C-c\C-x\C-e" 'org-clock-modify-effort-estimate) |
| 2777 | 2826 | ||
| 2778 | (provide 'org-clock) | 2827 | (provide 'org-clock) |
| 2779 | 2828 | ||
| 2829 | ;; Local variables: | ||
| 2830 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 2831 | ;; End: | ||
| 2832 | |||
| 2780 | ;;; org-clock.el ends here | 2833 | ;;; org-clock.el ends here |
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el index e17210b7ff5..1be105d44fb 100644 --- a/lisp/org/org-colview.el +++ b/lisp/org/org-colview.el | |||
| @@ -686,6 +686,7 @@ around it." | |||
| 686 | (move-marker org-columns-top-level-marker org-entry-property-inherited-from) | 686 | (move-marker org-columns-top-level-marker org-entry-property-inherited-from) |
| 687 | (move-marker org-columns-top-level-marker (point)))) | 687 | (move-marker org-columns-top-level-marker (point)))) |
| 688 | 688 | ||
| 689 | ;;;###autoload | ||
| 689 | (defun org-columns (&optional columns-fmt-string) | 690 | (defun org-columns (&optional columns-fmt-string) |
| 690 | "Turn on column view on an org-mode file. | 691 | "Turn on column view on an org-mode file. |
| 691 | When COLUMNS-FMT-STRING is non-nil, use it as the column format." | 692 | When COLUMNS-FMT-STRING is non-nil, use it as the column format." |
| @@ -1222,6 +1223,7 @@ of fields." | |||
| 1222 | (push row tbl))))) | 1223 | (push row tbl))))) |
| 1223 | (append (list title 'hline) (nreverse tbl))))) | 1224 | (append (list title 'hline) (nreverse tbl))))) |
| 1224 | 1225 | ||
| 1226 | ;;;###autoload | ||
| 1225 | (defun org-dblock-write:columnview (params) | 1227 | (defun org-dblock-write:columnview (params) |
| 1226 | "Write the column view table. | 1228 | "Write the column view table. |
| 1227 | PARAMS is a property list of parameters: | 1229 | PARAMS is a property list of parameters: |
| @@ -1334,6 +1336,7 @@ and tailing newline characters." | |||
| 1334 | (t (error "Garbage in listtable: %s" x)))) | 1336 | (t (error "Garbage in listtable: %s" x)))) |
| 1335 | tbl "\n")) | 1337 | tbl "\n")) |
| 1336 | 1338 | ||
| 1339 | ;;;###autoload | ||
| 1337 | (defun org-insert-columns-dblock () | 1340 | (defun org-insert-columns-dblock () |
| 1338 | "Create a dynamic block capturing a column view table." | 1341 | "Create a dynamic block capturing a column view table." |
| 1339 | (interactive) | 1342 | (interactive) |
| @@ -1357,6 +1360,7 @@ and tailing newline characters." | |||
| 1357 | (defvar org-agenda-columns-compute-summary-properties); defined in org-agenda.el | 1360 | (defvar org-agenda-columns-compute-summary-properties); defined in org-agenda.el |
| 1358 | (defvar org-agenda-columns-add-appointments-to-effort-sum); as well | 1361 | (defvar org-agenda-columns-add-appointments-to-effort-sum); as well |
| 1359 | 1362 | ||
| 1363 | ;;;###autoload | ||
| 1360 | (defun org-agenda-columns () | 1364 | (defun org-agenda-columns () |
| 1361 | "Turn on or update column view in the agenda." | 1365 | "Turn on or update column view in the agenda." |
| 1362 | (interactive) | 1366 | (interactive) |
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index 76042849663..6e582b8c1d6 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el | |||
| @@ -327,7 +327,7 @@ Works on both Emacs and XEmacs." | |||
| 327 | (apply 'propertize string properties))) | 327 | (apply 'propertize string properties))) |
| 328 | 328 | ||
| 329 | (defmacro org-find-library-dir (library) | 329 | (defmacro org-find-library-dir (library) |
| 330 | `(file-name-directory (locate-library ,library))) | 330 | `(file-name-directory (or (locate-library ,library) ""))) |
| 331 | 331 | ||
| 332 | (defun org-count-lines (s) | 332 | (defun org-count-lines (s) |
| 333 | "How many lines in string S?" | 333 | "How many lines in string S?" |
diff --git a/lisp/org/org-datetree.el b/lisp/org/org-datetree.el index 4ff8e7d00d0..a2b2e5621da 100644 --- a/lisp/org/org-datetree.el +++ b/lisp/org/org-datetree.el | |||
| @@ -207,4 +207,8 @@ before running this command, even though the command tries to be smart." | |||
| 207 | 207 | ||
| 208 | (provide 'org-datetree) | 208 | (provide 'org-datetree) |
| 209 | 209 | ||
| 210 | ;; Local variables: | ||
| 211 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 212 | ;; End: | ||
| 213 | |||
| 210 | ;;; org-datetree.el ends here | 214 | ;;; org-datetree.el ends here |
diff --git a/lisp/org/org-docbook.el b/lisp/org/org-docbook.el index 22cc5a7cdac..a40d5b969f3 100644 --- a/lisp/org/org-docbook.el +++ b/lisp/org/org-docbook.el | |||
| @@ -1451,4 +1451,8 @@ the alist of previous items." | |||
| 1451 | 1451 | ||
| 1452 | (provide 'org-docbook) | 1452 | (provide 'org-docbook) |
| 1453 | 1453 | ||
| 1454 | ;; Local variables: | ||
| 1455 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 1456 | ;; End: | ||
| 1457 | |||
| 1454 | ;;; org-docbook.el ends here | 1458 | ;;; org-docbook.el ends here |
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index 8b44d4936f5..5da2dec3fb3 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el | |||
| @@ -478,7 +478,7 @@ containing `:begin', `:end', `:hiddenp', `:contents-begin', | |||
| 478 | Assume point is at the beginning of the block." | 478 | Assume point is at the beginning of the block." |
| 479 | (let ((case-fold-search t)) | 479 | (let ((case-fold-search t)) |
| 480 | (if (not (save-excursion | 480 | (if (not (save-excursion |
| 481 | (re-search-forward "^[ \t]*#\\+END_CENTER" limit t))) | 481 | (re-search-forward "^[ \t]*#\\+END_CENTER[ \t]*$" limit t))) |
| 482 | ;; Incomplete block: parse it as a paragraph. | 482 | ;; Incomplete block: parse it as a paragraph. |
| 483 | (org-element-paragraph-parser limit) | 483 | (org-element-paragraph-parser limit) |
| 484 | (let ((block-end-line (match-beginning 0))) | 484 | (let ((block-end-line (match-beginning 0))) |
| @@ -494,7 +494,8 @@ Assume point is at the beginning of the block." | |||
| 494 | (forward-line) | 494 | (forward-line) |
| 495 | (point))) | 495 | (point))) |
| 496 | (end (save-excursion (skip-chars-forward " \r\t\n" limit) | 496 | (end (save-excursion (skip-chars-forward " \r\t\n" limit) |
| 497 | (if (eobp) (point) (point-at-bol))))) | 497 | (skip-chars-backward " \t") |
| 498 | (if (bolp) (point) (line-end-position))))) | ||
| 498 | (list 'center-block | 499 | (list 'center-block |
| 499 | (nconc | 500 | (nconc |
| 500 | (list :begin begin | 501 | (list :begin begin |
| @@ -524,7 +525,7 @@ Return a list whose CAR is `drawer' and CDR is a plist containing | |||
| 524 | 525 | ||
| 525 | Assume point is at beginning of drawer." | 526 | Assume point is at beginning of drawer." |
| 526 | (let ((case-fold-search t)) | 527 | (let ((case-fold-search t)) |
| 527 | (if (not (save-excursion (re-search-forward "^[ \t]*:END:" limit t))) | 528 | (if (not (save-excursion (re-search-forward "^[ \t]*:END:[ \t]*$" limit t))) |
| 528 | ;; Incomplete drawer: parse it as a paragraph. | 529 | ;; Incomplete drawer: parse it as a paragraph. |
| 529 | (org-element-paragraph-parser limit) | 530 | (org-element-paragraph-parser limit) |
| 530 | (let ((drawer-end-line (match-beginning 0))) | 531 | (let ((drawer-end-line (match-beginning 0))) |
| @@ -544,7 +545,8 @@ Assume point is at beginning of drawer." | |||
| 544 | (forward-line) | 545 | (forward-line) |
| 545 | (point))) | 546 | (point))) |
| 546 | (end (progn (skip-chars-forward " \r\t\n" limit) | 547 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 547 | (if (eobp) (point) (point-at-bol))))) | 548 | (skip-chars-backward " \t") |
| 549 | (if (bolp) (point) (line-end-position))))) | ||
| 548 | (list 'drawer | 550 | (list 'drawer |
| 549 | (nconc | 551 | (nconc |
| 550 | (list :begin begin | 552 | (list :begin begin |
| @@ -578,7 +580,8 @@ containing `:block-name', `:begin', `:end', `:hiddenp', | |||
| 578 | 580 | ||
| 579 | Assume point is at beginning of dynamic block." | 581 | Assume point is at beginning of dynamic block." |
| 580 | (let ((case-fold-search t)) | 582 | (let ((case-fold-search t)) |
| 581 | (if (not (save-excursion (re-search-forward org-dblock-end-re limit t))) | 583 | (if (not (save-excursion |
| 584 | (re-search-forward "^[ \t]*#\\+END:?[ \t]*$" limit t))) | ||
| 582 | ;; Incomplete block: parse it as a paragraph. | 585 | ;; Incomplete block: parse it as a paragraph. |
| 583 | (org-element-paragraph-parser limit) | 586 | (org-element-paragraph-parser limit) |
| 584 | (let ((block-end-line (match-beginning 0))) | 587 | (let ((block-end-line (match-beginning 0))) |
| @@ -598,7 +601,8 @@ Assume point is at beginning of dynamic block." | |||
| 598 | (forward-line) | 601 | (forward-line) |
| 599 | (point))) | 602 | (point))) |
| 600 | (end (progn (skip-chars-forward " \r\t\n" limit) | 603 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 601 | (if (eobp) (point) (point-at-bol))))) | 604 | (skip-chars-backward " \t") |
| 605 | (if (bolp) (point) (line-end-position))))) | ||
| 602 | (list 'dynamic-block | 606 | (list 'dynamic-block |
| 603 | (nconc | 607 | (nconc |
| 604 | (list :begin begin | 608 | (list :begin begin |
| @@ -653,7 +657,8 @@ Assume point is at the beginning of the footnote definition." | |||
| 653 | (contents-end (and contents-begin ending)) | 657 | (contents-end (and contents-begin ending)) |
| 654 | (end (progn (goto-char ending) | 658 | (end (progn (goto-char ending) |
| 655 | (skip-chars-forward " \r\t\n" limit) | 659 | (skip-chars-forward " \r\t\n" limit) |
| 656 | (if (eobp) (point) (point-at-bol))))) | 660 | (skip-chars-backward " \t") |
| 661 | (if (bolp) (point) (line-end-position))))) | ||
| 657 | (list 'footnote-definition | 662 | (list 'footnote-definition |
| 658 | (nconc | 663 | (nconc |
| 659 | (list :label label | 664 | (list :label label |
| @@ -904,7 +909,8 @@ Assume point is at beginning of the inline task." | |||
| 904 | (forward-line) | 909 | (forward-line) |
| 905 | (point))) | 910 | (point))) |
| 906 | (end (progn (skip-chars-forward " \r\t\n" limit) | 911 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 907 | (if (eobp) (point) (point-at-bol)))) | 912 | (skip-chars-backward " \t") |
| 913 | (if (bolp) (point) (line-end-position)))) | ||
| 908 | (inlinetask | 914 | (inlinetask |
| 909 | (list 'inlinetask | 915 | (list 'inlinetask |
| 910 | (nconc | 916 | (nconc |
| @@ -1108,7 +1114,8 @@ Assume point is at the beginning of the list." | |||
| 1108 | (unless (bolp) (forward-line)) | 1114 | (unless (bolp) (forward-line)) |
| 1109 | (point))) | 1115 | (point))) |
| 1110 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1116 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1111 | (if (eobp) (point) (point-at-bol))))) | 1117 | (skip-chars-backward " \t") |
| 1118 | (if (bolp) (point) (line-end-position))))) | ||
| 1112 | ;; Return value. | 1119 | ;; Return value. |
| 1113 | (list 'plain-list | 1120 | (list 'plain-list |
| 1114 | (nconc | 1121 | (nconc |
| @@ -1145,7 +1152,7 @@ containing `:begin', `:end', `:hiddenp', `:contents-begin', | |||
| 1145 | Assume point is at the beginning of the block." | 1152 | Assume point is at the beginning of the block." |
| 1146 | (let ((case-fold-search t)) | 1153 | (let ((case-fold-search t)) |
| 1147 | (if (not (save-excursion | 1154 | (if (not (save-excursion |
| 1148 | (re-search-forward "^[ \t]*#\\+END_QUOTE" limit t))) | 1155 | (re-search-forward "^[ \t]*#\\+END_QUOTE[ \t]*$" limit t))) |
| 1149 | ;; Incomplete block: parse it as a paragraph. | 1156 | ;; Incomplete block: parse it as a paragraph. |
| 1150 | (org-element-paragraph-parser limit) | 1157 | (org-element-paragraph-parser limit) |
| 1151 | (let ((block-end-line (match-beginning 0))) | 1158 | (let ((block-end-line (match-beginning 0))) |
| @@ -1162,7 +1169,8 @@ Assume point is at the beginning of the block." | |||
| 1162 | (forward-line) | 1169 | (forward-line) |
| 1163 | (point))) | 1170 | (point))) |
| 1164 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1171 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1165 | (if (eobp) (point) (point-at-bol))))) | 1172 | (skip-chars-backward " \t") |
| 1173 | (if (bolp) (point) (line-end-position))))) | ||
| 1166 | (list 'quote-block | 1174 | (list 'quote-block |
| 1167 | (nconc | 1175 | (nconc |
| 1168 | (list :begin begin | 1176 | (list :begin begin |
| @@ -1227,7 +1235,8 @@ Assume point is at the beginning of the block." | |||
| 1227 | (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(S-+\\)") | 1235 | (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(S-+\\)") |
| 1228 | (upcase (match-string-no-properties 1))))) | 1236 | (upcase (match-string-no-properties 1))))) |
| 1229 | (if (not (save-excursion | 1237 | (if (not (save-excursion |
| 1230 | (re-search-forward (concat "^[ \t]*#\\+END_" type) limit t))) | 1238 | (re-search-forward |
| 1239 | (format "^[ \t]*#\\+END_%s[ \t]*$" type) limit t))) | ||
| 1231 | ;; Incomplete block: parse it as a paragraph. | 1240 | ;; Incomplete block: parse it as a paragraph. |
| 1232 | (org-element-paragraph-parser limit) | 1241 | (org-element-paragraph-parser limit) |
| 1233 | (let ((block-end-line (match-beginning 0))) | 1242 | (let ((block-end-line (match-beginning 0))) |
| @@ -1243,8 +1252,9 @@ Assume point is at the beginning of the block." | |||
| 1243 | (pos-before-blank (progn (goto-char block-end-line) | 1252 | (pos-before-blank (progn (goto-char block-end-line) |
| 1244 | (forward-line) | 1253 | (forward-line) |
| 1245 | (point))) | 1254 | (point))) |
| 1246 | (end (progn (org-skip-whitespace) | 1255 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1247 | (if (eobp) (point) (point-at-bol))))) | 1256 | (skip-chars-backward " \t") |
| 1257 | (if (bolp) (point) (line-end-position))))) | ||
| 1248 | (list 'special-block | 1258 | (list 'special-block |
| 1249 | (nconc | 1259 | (nconc |
| 1250 | (list :type type | 1260 | (list :type type |
| @@ -1295,7 +1305,8 @@ keywords." | |||
| 1295 | (begin (point-at-bol)) | 1305 | (begin (point-at-bol)) |
| 1296 | (pos-before-blank (progn (forward-line) (point))) | 1306 | (pos-before-blank (progn (forward-line) (point))) |
| 1297 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1307 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1298 | (if (eobp) (point) (point-at-bol))))) | 1308 | (skip-chars-backward " \t") |
| 1309 | (if (bolp) (point) (line-end-position))))) | ||
| 1299 | (list 'babel-call | 1310 | (list 'babel-call |
| 1300 | (list :begin begin | 1311 | (list :begin begin |
| 1301 | :end end | 1312 | :end end |
| @@ -1338,7 +1349,8 @@ as keywords." | |||
| 1338 | (status (if time 'closed 'running)) | 1349 | (status (if time 'closed 'running)) |
| 1339 | (post-blank (let ((before-blank (progn (forward-line) (point)))) | 1350 | (post-blank (let ((before-blank (progn (forward-line) (point)))) |
| 1340 | (skip-chars-forward " \r\t\n" limit) | 1351 | (skip-chars-forward " \r\t\n" limit) |
| 1341 | (unless (eobp) (beginning-of-line)) | 1352 | (skip-chars-backward " \t") |
| 1353 | (unless (bolp) (end-of-line)) | ||
| 1342 | (count-lines before-blank (point)))) | 1354 | (count-lines before-blank (point)))) |
| 1343 | (end (point))) | 1355 | (end (point))) |
| 1344 | (list 'clock | 1356 | (list 'clock |
| @@ -1396,7 +1408,8 @@ Assume point is at comment beginning." | |||
| 1396 | (point))) | 1408 | (point))) |
| 1397 | (end (progn (goto-char com-end) | 1409 | (end (progn (goto-char com-end) |
| 1398 | (skip-chars-forward " \r\t\n" limit) | 1410 | (skip-chars-forward " \r\t\n" limit) |
| 1399 | (if (eobp) (point) (point-at-bol))))) | 1411 | (skip-chars-backward " \t") |
| 1412 | (if (bolp) (point) (line-end-position))))) | ||
| 1400 | (list 'comment | 1413 | (list 'comment |
| 1401 | (nconc | 1414 | (nconc |
| 1402 | (list :begin begin | 1415 | (list :begin begin |
| @@ -1425,7 +1438,7 @@ containing `:begin', `:end', `:hiddenp', `:value' and | |||
| 1425 | Assume point is at comment block beginning." | 1438 | Assume point is at comment block beginning." |
| 1426 | (let ((case-fold-search t)) | 1439 | (let ((case-fold-search t)) |
| 1427 | (if (not (save-excursion | 1440 | (if (not (save-excursion |
| 1428 | (re-search-forward "^[ \t]*#\\+END_COMMENT" limit t))) | 1441 | (re-search-forward "^[ \t]*#\\+END_COMMENT[ \t]*$" limit t))) |
| 1429 | ;; Incomplete block: parse it as a paragraph. | 1442 | ;; Incomplete block: parse it as a paragraph. |
| 1430 | (org-element-paragraph-parser limit) | 1443 | (org-element-paragraph-parser limit) |
| 1431 | (let ((contents-end (match-beginning 0))) | 1444 | (let ((contents-end (match-beginning 0))) |
| @@ -1438,7 +1451,8 @@ Assume point is at comment block beginning." | |||
| 1438 | (forward-line) | 1451 | (forward-line) |
| 1439 | (point))) | 1452 | (point))) |
| 1440 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1453 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1441 | (if (eobp) (point) (point-at-bol)))) | 1454 | (skip-chars-backward " \t") |
| 1455 | (if (bolp) (point) (line-end-position)))) | ||
| 1442 | (value (buffer-substring-no-properties | 1456 | (value (buffer-substring-no-properties |
| 1443 | contents-begin contents-end))) | 1457 | contents-begin contents-end))) |
| 1444 | (list 'comment-block | 1458 | (list 'comment-block |
| @@ -1470,7 +1484,7 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent', | |||
| 1470 | `:switches', `:value' and `:post-blank' keywords." | 1484 | `:switches', `:value' and `:post-blank' keywords." |
| 1471 | (let ((case-fold-search t)) | 1485 | (let ((case-fold-search t)) |
| 1472 | (if (not (save-excursion | 1486 | (if (not (save-excursion |
| 1473 | (re-search-forward "^[ \t]*#\\+END_EXAMPLE" limit t))) | 1487 | (re-search-forward "^[ \t]*#\\+END_EXAMPLE[ \t]*$" limit t))) |
| 1474 | ;; Incomplete block: parse it as a paragraph. | 1488 | ;; Incomplete block: parse it as a paragraph. |
| 1475 | (org-element-paragraph-parser limit) | 1489 | (org-element-paragraph-parser limit) |
| 1476 | (let ((contents-end (match-beginning 0))) | 1490 | (let ((contents-end (match-beginning 0))) |
| @@ -1502,12 +1516,15 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent', | |||
| 1502 | (begin (car keywords)) | 1516 | (begin (car keywords)) |
| 1503 | (contents-begin (progn (forward-line) (point))) | 1517 | (contents-begin (progn (forward-line) (point))) |
| 1504 | (hidden (org-invisible-p2)) | 1518 | (hidden (org-invisible-p2)) |
| 1505 | (value (buffer-substring-no-properties contents-begin contents-end)) | 1519 | (value (org-unescape-code-in-string |
| 1520 | (buffer-substring-no-properties | ||
| 1521 | contents-begin contents-end))) | ||
| 1506 | (pos-before-blank (progn (goto-char contents-end) | 1522 | (pos-before-blank (progn (goto-char contents-end) |
| 1507 | (forward-line) | 1523 | (forward-line) |
| 1508 | (point))) | 1524 | (point))) |
| 1509 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1525 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1510 | (if (eobp) (point) (point-at-bol))))) | 1526 | (skip-chars-backward " \t") |
| 1527 | (if (bolp) (point) (line-end-position))))) | ||
| 1511 | (list 'example-block | 1528 | (list 'example-block |
| 1512 | (nconc | 1529 | (nconc |
| 1513 | (list :begin begin | 1530 | (list :begin begin |
| @@ -1529,7 +1546,8 @@ CONTENTS is nil." | |||
| 1529 | (let ((switches (org-element-property :switches example-block))) | 1546 | (let ((switches (org-element-property :switches example-block))) |
| 1530 | (concat "#+BEGIN_EXAMPLE" (and switches (concat " " switches)) "\n" | 1547 | (concat "#+BEGIN_EXAMPLE" (and switches (concat " " switches)) "\n" |
| 1531 | (org-remove-indentation | 1548 | (org-remove-indentation |
| 1532 | (org-element-property :value example-block)) | 1549 | (org-escape-code-in-string |
| 1550 | (org-element-property :value example-block))) | ||
| 1533 | "#+END_EXAMPLE"))) | 1551 | "#+END_EXAMPLE"))) |
| 1534 | 1552 | ||
| 1535 | 1553 | ||
| @@ -1549,7 +1567,8 @@ Assume point is at export-block beginning." | |||
| 1549 | (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)") | 1567 | (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)") |
| 1550 | (upcase (org-match-string-no-properties 1))))) | 1568 | (upcase (org-match-string-no-properties 1))))) |
| 1551 | (if (not (save-excursion | 1569 | (if (not (save-excursion |
| 1552 | (re-search-forward (concat "^[ \t]*#\\+END_" type) limit t))) | 1570 | (re-search-forward |
| 1571 | (format "^[ \t]*#\\+END_%s[ \t]*$" type) limit t))) | ||
| 1553 | ;; Incomplete block: parse it as a paragraph. | 1572 | ;; Incomplete block: parse it as a paragraph. |
| 1554 | (org-element-paragraph-parser limit) | 1573 | (org-element-paragraph-parser limit) |
| 1555 | (let ((contents-end (match-beginning 0))) | 1574 | (let ((contents-end (match-beginning 0))) |
| @@ -1562,7 +1581,8 @@ Assume point is at export-block beginning." | |||
| 1562 | (forward-line) | 1581 | (forward-line) |
| 1563 | (point))) | 1582 | (point))) |
| 1564 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1583 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1565 | (if (eobp) (point) (point-at-bol)))) | 1584 | (skip-chars-backward " \t") |
| 1585 | (if (bolp) (point) (line-end-position)))) | ||
| 1566 | (value (buffer-substring-no-properties contents-begin | 1586 | (value (buffer-substring-no-properties contents-begin |
| 1567 | contents-end))) | 1587 | contents-end))) |
| 1568 | (list 'export-block | 1588 | (list 'export-block |
| @@ -1612,7 +1632,8 @@ Assume point is at the beginning of the fixed-width area." | |||
| 1612 | (forward-line)) | 1632 | (forward-line)) |
| 1613 | (point))) | 1633 | (point))) |
| 1614 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1634 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1615 | (if (eobp) (point) (point-at-bol))))) | 1635 | (skip-chars-backward " \t") |
| 1636 | (if (bolp) (point) (line-end-position))))) | ||
| 1616 | (list 'fixed-width | 1637 | (list 'fixed-width |
| 1617 | (nconc | 1638 | (nconc |
| 1618 | (list :begin begin | 1639 | (list :begin begin |
| @@ -1642,7 +1663,8 @@ containing `:begin', `:end' and `:post-blank' keywords." | |||
| 1642 | (begin (car keywords)) | 1663 | (begin (car keywords)) |
| 1643 | (post-hr (progn (forward-line) (point))) | 1664 | (post-hr (progn (forward-line) (point))) |
| 1644 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1665 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1645 | (if (eobp) (point) (point-at-bol))))) | 1666 | (skip-chars-backward " \t") |
| 1667 | (if (bolp) (point) (line-end-position))))) | ||
| 1646 | (list 'horizontal-rule | 1668 | (list 'horizontal-rule |
| 1647 | (nconc | 1669 | (nconc |
| 1648 | (list :begin begin | 1670 | (list :begin begin |
| @@ -1675,7 +1697,8 @@ keywords." | |||
| 1675 | (match-end 0) (point-at-eol)))) | 1697 | (match-end 0) (point-at-eol)))) |
| 1676 | (pos-before-blank (progn (forward-line) (point))) | 1698 | (pos-before-blank (progn (forward-line) (point))) |
| 1677 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1699 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1678 | (if (eobp) (point) (point-at-bol))))) | 1700 | (skip-chars-backward " \t") |
| 1701 | (if (bolp) (point) (line-end-position))))) | ||
| 1679 | (list 'keyword | 1702 | (list 'keyword |
| 1680 | (list :key key | 1703 | (list :key key |
| 1681 | :value value | 1704 | :value value |
| @@ -1711,12 +1734,14 @@ Assume point is at the beginning of the latex environment." | |||
| 1711 | (env (progn (looking-at "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}") | 1734 | (env (progn (looking-at "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}") |
| 1712 | (regexp-quote (match-string 1)))) | 1735 | (regexp-quote (match-string 1)))) |
| 1713 | (code-end | 1736 | (code-end |
| 1714 | (progn (re-search-forward (format "^[ \t]*\\\\end{%s}" env) limit t) | 1737 | (progn (re-search-forward |
| 1738 | (format "^[ \t]*\\\\end{%s}[ \t]*$" env) limit t) | ||
| 1715 | (forward-line) | 1739 | (forward-line) |
| 1716 | (point))) | 1740 | (point))) |
| 1717 | (value (buffer-substring-no-properties code-begin code-end)) | 1741 | (value (buffer-substring-no-properties code-begin code-end)) |
| 1718 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1742 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1719 | (if (eobp) (point) (point-at-bol))))) | 1743 | (skip-chars-backward " \t") |
| 1744 | (if (bolp) (point) (line-end-position))))) | ||
| 1720 | (list 'latex-environment | 1745 | (list 'latex-environment |
| 1721 | (nconc | 1746 | (nconc |
| 1722 | (list :begin begin | 1747 | (list :begin begin |
| @@ -1744,69 +1769,80 @@ containing `:begin', `:end', `:contents-begin' and | |||
| 1744 | 1769 | ||
| 1745 | Assume point is at the beginning of the paragraph." | 1770 | Assume point is at the beginning of the paragraph." |
| 1746 | (save-excursion | 1771 | (save-excursion |
| 1747 | (let* (;; INNER-PAR-P is non-nil when paragraph is at the | 1772 | (let* ((contents-begin (point)) |
| 1773 | ;; INNER-PAR-P is non-nil when paragraph is at the | ||
| 1748 | ;; beginning of an item or a footnote reference. In that | 1774 | ;; beginning of an item or a footnote reference. In that |
| 1749 | ;; case, we mustn't look for affiliated keywords since they | 1775 | ;; case, we mustn't look for affiliated keywords since they |
| 1750 | ;; belong to the container. | 1776 | ;; belong to the container. |
| 1751 | (inner-par-p (not (bolp))) | 1777 | (inner-par-p (not (bolp))) |
| 1752 | (contents-begin (point)) | ||
| 1753 | (keywords (unless inner-par-p | 1778 | (keywords (unless inner-par-p |
| 1754 | (org-element--collect-affiliated-keywords))) | 1779 | (org-element--collect-affiliated-keywords))) |
| 1755 | (begin (if inner-par-p contents-begin (car keywords))) | 1780 | (begin (if inner-par-p contents-begin (car keywords))) |
| 1756 | (before-blank | 1781 | (before-blank |
| 1757 | (let ((case-fold-search t)) | 1782 | (let ((case-fold-search t)) |
| 1758 | (end-of-line) | 1783 | (end-of-line) |
| 1759 | (re-search-forward org-element-paragraph-separate limit 'm) | 1784 | (if (not (re-search-forward |
| 1760 | (while (and (/= (point) limit) | 1785 | org-element-paragraph-separate limit 'm)) |
| 1761 | (cond | 1786 | limit |
| 1762 | ;; Skip non-existent or incomplete drawer. | 1787 | ;; A matching `org-element-paragraph-separate' is not |
| 1763 | ((save-excursion | 1788 | ;; necessarily the end of the paragraph. In |
| 1764 | (beginning-of-line) | 1789 | ;; particular, lines starting with # or : as a first |
| 1765 | (and (looking-at "[ \t]*:\\S-") | 1790 | ;; non-space character are ambiguous. We have check |
| 1766 | (or (not (looking-at org-drawer-regexp)) | 1791 | ;; if they are valid Org syntax (i.e. not an |
| 1767 | (not (save-excursion | 1792 | ;; incomplete keyword). |
| 1768 | (re-search-forward | 1793 | (beginning-of-line) |
| 1769 | "^[ \t]*:END:" limit t))))))) | 1794 | (while (not |
| 1770 | ;; Stop at comments. | 1795 | (or |
| 1771 | ((save-excursion | 1796 | ;; There's no ambiguity for other symbols or |
| 1772 | (beginning-of-line) | 1797 | ;; empty lines: stop here. |
| 1773 | (not (looking-at "[ \t]*#\\S-"))) nil) | 1798 | (looking-at "[ \t]*\\(?:[^:#]\\|$\\)") |
| 1774 | ;; Skip incomplete dynamic blocks. | 1799 | ;; Stop at valid fixed-width areas. |
| 1775 | ((save-excursion | 1800 | (looking-at "[ \t]*:\\(?: \\|$\\)") |
| 1776 | (beginning-of-line) | 1801 | ;; Stop at drawers. |
| 1777 | (looking-at "[ \t]*#\\+BEGIN: ")) | 1802 | (and (looking-at org-drawer-regexp) |
| 1778 | (not (save-excursion | 1803 | (save-excursion |
| 1779 | (re-search-forward | 1804 | (re-search-forward |
| 1780 | "^[ \t]*\\+END:" limit t)))) | 1805 | "^[ \t]*:END:[ \t]*$" limit t))) |
| 1781 | ;; Skip incomplete blocks. | 1806 | ;; Stop at valid comments. |
| 1782 | ((save-excursion | 1807 | (looking-at "[ \t]*#\\(?: \\|$\\)") |
| 1783 | (beginning-of-line) | 1808 | ;; Stop at valid dynamic blocks. |
| 1784 | (looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)")) | 1809 | (and (looking-at org-dblock-start-re) |
| 1785 | (not (save-excursion | 1810 | (save-excursion |
| 1786 | (re-search-forward | 1811 | (re-search-forward |
| 1787 | (concat "^[ \t]*#\\+END_" | 1812 | "^[ \t]*#\\+END:?[ \t]*$" limit t))) |
| 1788 | (match-string 1)) | 1813 | ;; Stop at valid blocks. |
| 1789 | limit t)))) | 1814 | (and (looking-at |
| 1790 | ;; Skip incomplete latex environments. | 1815 | "[ \t]*#\\+BEGIN_\\(\\S-+\\)") |
| 1791 | ((save-excursion | 1816 | (save-excursion |
| 1792 | (beginning-of-line) | 1817 | (re-search-forward |
| 1793 | (looking-at "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}")) | 1818 | (format "^[ \t]*#\\+END_%s[ \t]*$" |
| 1794 | (not (save-excursion | 1819 | (match-string 1)) |
| 1795 | (re-search-forward | 1820 | limit t))) |
| 1796 | (format "^[ \t]*\\\\end{%s}" | 1821 | ;; Stop at valid latex environments. |
| 1797 | (match-string 1)) | 1822 | (and (looking-at |
| 1798 | limit t)))) | 1823 | "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}[ \t]*$") |
| 1799 | ;; Skip ill-formed keywords. | 1824 | (save-excursion |
| 1800 | ((not (save-excursion | 1825 | (re-search-forward |
| 1801 | (beginning-of-line) | 1826 | (format "^[ \t]*\\\\end{%s}[ \t]*$" |
| 1802 | (looking-at "[ \t]*#\\+\\S-+:")))))) | 1827 | (match-string 1)) |
| 1803 | (re-search-forward org-element-paragraph-separate limit 'm)) | 1828 | limit t))) |
| 1804 | (if (eobp) (point) (goto-char (line-beginning-position))))) | 1829 | ;; Stop at valid keywords. |
| 1830 | (looking-at "[ \t]*#\\+\\S-+:") | ||
| 1831 | ;; Skip everything else. | ||
| 1832 | (not | ||
| 1833 | (progn | ||
| 1834 | (end-of-line) | ||
| 1835 | (re-search-forward org-element-paragraph-separate | ||
| 1836 | limit 'm))))) | ||
| 1837 | (beginning-of-line))) | ||
| 1838 | (if (= (point) limit) limit | ||
| 1839 | (goto-char (line-beginning-position))))) | ||
| 1805 | (contents-end (progn (skip-chars-backward " \r\t\n" contents-begin) | 1840 | (contents-end (progn (skip-chars-backward " \r\t\n" contents-begin) |
| 1806 | (forward-line) | 1841 | (forward-line) |
| 1807 | (point))) | 1842 | (point))) |
| 1808 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1843 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1809 | (if (eobp) (point) (point-at-bol))))) | 1844 | (skip-chars-backward " \t") |
| 1845 | (if (bolp) (point) (line-end-position))))) | ||
| 1810 | (list 'paragraph | 1846 | (list 'paragraph |
| 1811 | (nconc | 1847 | (nconc |
| 1812 | (list :begin begin | 1848 | (list :begin begin |
| @@ -1837,7 +1873,8 @@ and `:post-blank' keywords." | |||
| 1837 | (begin (point)) | 1873 | (begin (point)) |
| 1838 | (post-blank (let ((before-blank (progn (forward-line) (point)))) | 1874 | (post-blank (let ((before-blank (progn (forward-line) (point)))) |
| 1839 | (skip-chars-forward " \r\t\n" limit) | 1875 | (skip-chars-forward " \r\t\n" limit) |
| 1840 | (unless (eobp) (beginning-of-line)) | 1876 | (skip-chars-backward " \t") |
| 1877 | (unless (bolp) (end-of-line)) | ||
| 1841 | (count-lines before-blank (point)))) | 1878 | (count-lines before-blank (point)))) |
| 1842 | (end (point)) | 1879 | (end (point)) |
| 1843 | closed deadline scheduled) | 1880 | closed deadline scheduled) |
| @@ -1895,7 +1932,7 @@ Assume point is at the beginning of the property drawer." | |||
| 1895 | (hidden (org-invisible-p2)) | 1932 | (hidden (org-invisible-p2)) |
| 1896 | (properties | 1933 | (properties |
| 1897 | (let (val) | 1934 | (let (val) |
| 1898 | (while (not (looking-at "^[ \t]*:END:")) | 1935 | (while (not (looking-at "^[ \t]*:END:[ \t]*$")) |
| 1899 | (when (looking-at "[ \t]*:\\([A-Za-z][-_A-Za-z0-9]*\\):") | 1936 | (when (looking-at "[ \t]*:\\([A-Za-z][-_A-Za-z0-9]*\\):") |
| 1900 | (push (cons (org-match-string-no-properties 1) | 1937 | (push (cons (org-match-string-no-properties 1) |
| 1901 | (org-trim | 1938 | (org-trim |
| @@ -1908,7 +1945,8 @@ Assume point is at the beginning of the property drawer." | |||
| 1908 | (point-at-bol))) | 1945 | (point-at-bol))) |
| 1909 | (pos-before-blank (progn (forward-line) (point))) | 1946 | (pos-before-blank (progn (forward-line) (point))) |
| 1910 | (end (progn (skip-chars-forward " \r\t\n" limit) | 1947 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 1911 | (if (eobp) (point) (point-at-bol))))) | 1948 | (skip-chars-backward " \t") |
| 1949 | (if (bolp) (point) (line-end-position))))) | ||
| 1912 | (list 'property-drawer | 1950 | (list 'property-drawer |
| 1913 | (list :begin begin | 1951 | (list :begin begin |
| 1914 | :end end | 1952 | :end end |
| @@ -1974,7 +2012,8 @@ containing `:language', `:switches', `:parameters', `:begin', | |||
| 1974 | 2012 | ||
| 1975 | Assume point is at the beginning of the block." | 2013 | Assume point is at the beginning of the block." |
| 1976 | (let ((case-fold-search t)) | 2014 | (let ((case-fold-search t)) |
| 1977 | (if (not (save-excursion (re-search-forward "^[ \t]*#\\+END_SRC" limit t))) | 2015 | (if (not (save-excursion (re-search-forward "^[ \t]*#\\+END_SRC[ \t]*$" |
| 2016 | limit t))) | ||
| 1978 | ;; Incomplete block: parse it as a paragraph. | 2017 | ;; Incomplete block: parse it as a paragraph. |
| 1979 | (org-element-paragraph-parser limit) | 2018 | (org-element-paragraph-parser limit) |
| 1980 | (let ((contents-end (match-beginning 0))) | 2019 | (let ((contents-end (match-beginning 0))) |
| @@ -2017,13 +2056,15 @@ Assume point is at the beginning of the block." | |||
| 2017 | ;; Get visibility status. | 2056 | ;; Get visibility status. |
| 2018 | (hidden (progn (forward-line) (org-invisible-p2))) | 2057 | (hidden (progn (forward-line) (org-invisible-p2))) |
| 2019 | ;; Retrieve code. | 2058 | ;; Retrieve code. |
| 2020 | (value (buffer-substring-no-properties (point) contents-end)) | 2059 | (value (org-unescape-code-in-string |
| 2060 | (buffer-substring-no-properties (point) contents-end))) | ||
| 2021 | (pos-before-blank (progn (goto-char contents-end) | 2061 | (pos-before-blank (progn (goto-char contents-end) |
| 2022 | (forward-line) | 2062 | (forward-line) |
| 2023 | (point))) | 2063 | (point))) |
| 2024 | ;; Get position after ending blank lines. | 2064 | ;; Get position after ending blank lines. |
| 2025 | (end (progn (skip-chars-forward " \r\t\n" limit) | 2065 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 2026 | (if (eobp) (point) (point-at-bol))))) | 2066 | (skip-chars-backward " \t") |
| 2067 | (if (bolp) (point) (line-end-position))))) | ||
| 2027 | (list 'src-block | 2068 | (list 'src-block |
| 2028 | (nconc | 2069 | (nconc |
| 2029 | (list :language language | 2070 | (list :language language |
| @@ -2051,7 +2092,6 @@ CONTENTS is nil." | |||
| 2051 | (params (org-element-property :parameters src-block)) | 2092 | (params (org-element-property :parameters src-block)) |
| 2052 | (value (let ((val (org-element-property :value src-block))) | 2093 | (value (let ((val (org-element-property :value src-block))) |
| 2053 | (cond | 2094 | (cond |
| 2054 | |||
| 2055 | (org-src-preserve-indentation val) | 2095 | (org-src-preserve-indentation val) |
| 2056 | ((zerop org-edit-src-content-indentation) | 2096 | ((zerop org-edit-src-content-indentation) |
| 2057 | (org-remove-indentation val)) | 2097 | (org-remove-indentation val)) |
| @@ -2065,7 +2105,7 @@ CONTENTS is nil." | |||
| 2065 | (concat (and lang (concat " " lang)) | 2105 | (concat (and lang (concat " " lang)) |
| 2066 | (and switches (concat " " switches)) | 2106 | (and switches (concat " " switches)) |
| 2067 | (and params (concat " " params)))) | 2107 | (and params (concat " " params)))) |
| 2068 | value | 2108 | (org-escape-code-in-string value) |
| 2069 | "#+END_SRC"))) | 2109 | "#+END_SRC"))) |
| 2070 | 2110 | ||
| 2071 | 2111 | ||
| @@ -2087,7 +2127,10 @@ Assume point is at the beginning of the table." | |||
| 2087 | (type (if (org-at-table.el-p) 'table.el 'org)) | 2127 | (type (if (org-at-table.el-p) 'table.el 'org)) |
| 2088 | (keywords (org-element--collect-affiliated-keywords)) | 2128 | (keywords (org-element--collect-affiliated-keywords)) |
| 2089 | (begin (car keywords)) | 2129 | (begin (car keywords)) |
| 2090 | (table-end (goto-char (marker-position (org-table-end t)))) | 2130 | (table-end |
| 2131 | (if (re-search-forward org-table-any-border-regexp limit 'm) | ||
| 2132 | (goto-char (match-beginning 0)) | ||
| 2133 | (point))) | ||
| 2091 | (tblfm (let (acc) | 2134 | (tblfm (let (acc) |
| 2092 | (while (looking-at "[ \t]*#\\+TBLFM: +\\(.*\\)[ \t]*$") | 2135 | (while (looking-at "[ \t]*#\\+TBLFM: +\\(.*\\)[ \t]*$") |
| 2093 | (push (org-match-string-no-properties 1) acc) | 2136 | (push (org-match-string-no-properties 1) acc) |
| @@ -2095,7 +2138,8 @@ Assume point is at the beginning of the table." | |||
| 2095 | acc)) | 2138 | acc)) |
| 2096 | (pos-before-blank (point)) | 2139 | (pos-before-blank (point)) |
| 2097 | (end (progn (skip-chars-forward " \r\t\n" limit) | 2140 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 2098 | (if (eobp) (point) (point-at-bol))))) | 2141 | (skip-chars-backward " \t") |
| 2142 | (if (bolp) (point) (line-end-position))))) | ||
| 2099 | (list 'table | 2143 | (list 'table |
| 2100 | (nconc | 2144 | (nconc |
| 2101 | (list :begin begin | 2145 | (list :begin begin |
| @@ -2179,7 +2223,7 @@ containing `:begin', `:end', `:contents-begin', `:contents-end', | |||
| 2179 | Assume point is at beginning of the block." | 2223 | Assume point is at beginning of the block." |
| 2180 | (let ((case-fold-search t)) | 2224 | (let ((case-fold-search t)) |
| 2181 | (if (not (save-excursion | 2225 | (if (not (save-excursion |
| 2182 | (re-search-forward "^[ \t]*#\\+END_VERSE" limit t))) | 2226 | (re-search-forward "^[ \t]*#\\+END_VERSE[ \t]*$" limit t))) |
| 2183 | ;; Incomplete block: parse it as a paragraph. | 2227 | ;; Incomplete block: parse it as a paragraph. |
| 2184 | (org-element-paragraph-parser limit) | 2228 | (org-element-paragraph-parser limit) |
| 2185 | (let ((contents-end (match-beginning 0))) | 2229 | (let ((contents-end (match-beginning 0))) |
| @@ -2192,7 +2236,8 @@ Assume point is at beginning of the block." | |||
| 2192 | (forward-line) | 2236 | (forward-line) |
| 2193 | (point))) | 2237 | (point))) |
| 2194 | (end (progn (skip-chars-forward " \r\t\n" limit) | 2238 | (end (progn (skip-chars-forward " \r\t\n" limit) |
| 2195 | (if (eobp) (point) (point-at-bol))))) | 2239 | (skip-chars-backward " \t") |
| 2240 | (if (bolp) (point) (line-end-position))))) | ||
| 2196 | (list 'verse-block | 2241 | (list 'verse-block |
| 2197 | (nconc | 2242 | (nconc |
| 2198 | (list :begin begin | 2243 | (list :begin begin |
| @@ -2367,6 +2412,7 @@ LIMIT bounds the search. | |||
| 2367 | Return value is a cons cell whose CAR is `entity' or | 2412 | Return value is a cons cell whose CAR is `entity' or |
| 2368 | `latex-fragment' and CDR is beginning position." | 2413 | `latex-fragment' and CDR is beginning position." |
| 2369 | (save-excursion | 2414 | (save-excursion |
| 2415 | (unless (bolp) (backward-char)) | ||
| 2370 | (let ((matchers | 2416 | (let ((matchers |
| 2371 | (remove "begin" (plist-get org-format-latex-options :matchers))) | 2417 | (remove "begin" (plist-get org-format-latex-options :matchers))) |
| 2372 | ;; ENTITY-RE matches both LaTeX commands and Org entities. | 2418 | ;; ENTITY-RE matches both LaTeX commands and Org entities. |
| @@ -3044,6 +3090,7 @@ LIMIT bounds the search. | |||
| 3044 | Return value is a cons cell whose CAR is either `subscript' or | 3090 | Return value is a cons cell whose CAR is either `subscript' or |
| 3045 | `superscript' and CDR is beginning position." | 3091 | `superscript' and CDR is beginning position." |
| 3046 | (save-excursion | 3092 | (save-excursion |
| 3093 | (unless (bolp) (backward-char)) | ||
| 3047 | (when (re-search-forward org-match-substring-regexp limit t) | 3094 | (when (re-search-forward org-match-substring-regexp limit t) |
| 3048 | (cons (if (string= (match-string 2) "_") 'subscript 'superscript) | 3095 | (cons (if (string= (match-string 2) "_") 'subscript 'superscript) |
| 3049 | (match-beginning 2))))) | 3096 | (match-beginning 2))))) |
| @@ -3838,6 +3885,15 @@ Return value is an alist whose CAR is position and CDR the object | |||
| 3838 | type, as a symbol. | 3885 | type, as a symbol. |
| 3839 | 3886 | ||
| 3840 | OBJECTS is the previous candidates alist." | 3887 | OBJECTS is the previous candidates alist." |
| 3888 | ;; Filter out any object found but not belonging to RESTRICTION. | ||
| 3889 | (setq objects | ||
| 3890 | (org-remove-if-not | ||
| 3891 | (lambda (obj) | ||
| 3892 | (let ((type (car obj))) | ||
| 3893 | (memq (or (cdr (assq type org-element-object-successor-alist)) | ||
| 3894 | type) | ||
| 3895 | restriction))) | ||
| 3896 | objects)) | ||
| 3841 | (let (next-candidates types-to-search) | 3897 | (let (next-candidates types-to-search) |
| 3842 | ;; If no previous result, search every object type in RESTRICTION. | 3898 | ;; If no previous result, search every object type in RESTRICTION. |
| 3843 | ;; Otherwise, keep potential candidates (old objects located after | 3899 | ;; Otherwise, keep potential candidates (old objects located after |
| @@ -4235,7 +4291,7 @@ and :post-blank properties." | |||
| 4235 | (progn (beginning-of-line) | 4291 | (progn (beginning-of-line) |
| 4236 | (skip-chars-forward "* ") | 4292 | (skip-chars-forward "* ") |
| 4237 | (setq end (point-at-eol)))) | 4293 | (setq end (point-at-eol)))) |
| 4238 | (and (memq type '(paragraph table-cell verse-block)) | 4294 | (and (memq type '(paragraph table-row verse-block)) |
| 4239 | (let ((cbeg (org-element-property | 4295 | (let ((cbeg (org-element-property |
| 4240 | :contents-begin element)) | 4296 | :contents-begin element)) |
| 4241 | (cend (org-element-property | 4297 | (cend (org-element-property |
| @@ -4254,7 +4310,7 @@ and :post-blank properties." | |||
| 4254 | candidates))) | 4310 | candidates))) |
| 4255 | ;; If ORIGIN is before next object in element, there's | 4311 | ;; If ORIGIN is before next object in element, there's |
| 4256 | ;; no point in looking further. | 4312 | ;; no point in looking further. |
| 4257 | (if (> (cdr closest-cand) origin) (throw 'exit element) | 4313 | (if (> (cdr closest-cand) origin) (throw 'exit parent) |
| 4258 | (let* ((object | 4314 | (let* ((object |
| 4259 | (progn (goto-char (cdr closest-cand)) | 4315 | (progn (goto-char (cdr closest-cand)) |
| 4260 | (funcall (intern (format "org-element-%s-parser" | 4316 | (funcall (intern (format "org-element-%s-parser" |
| @@ -4274,7 +4330,9 @@ and :post-blank properties." | |||
| 4274 | ;; search to the end of its contents. | 4330 | ;; search to the end of its contents. |
| 4275 | (t (goto-char cbeg) | 4331 | (t (goto-char cbeg) |
| 4276 | (org-element-put-property object :parent parent) | 4332 | (org-element-put-property object :parent parent) |
| 4277 | (setq parent object end cend))))))) | 4333 | (setq parent object |
| 4334 | restriction (org-element-restriction object) | ||
| 4335 | end cend))))))) | ||
| 4278 | parent)))))) | 4336 | parent)))))) |
| 4279 | 4337 | ||
| 4280 | (defsubst org-element-nested-p (elem-A elem-B) | 4338 | (defsubst org-element-nested-p (elem-A elem-B) |
| @@ -4351,6 +4409,10 @@ end of ELEM-A." | |||
| 4351 | (cdr overlays))) | 4409 | (cdr overlays))) |
| 4352 | (goto-char (org-element-property :end elem-B))))) | 4410 | (goto-char (org-element-property :end elem-B))))) |
| 4353 | 4411 | ||
| 4354 | |||
| 4355 | (provide 'org-element) | 4412 | (provide 'org-element) |
| 4413 | |||
| 4414 | ;; Local variables: | ||
| 4415 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 4416 | ;; End: | ||
| 4417 | |||
| 4356 | ;;; org-element.el ends here | 4418 | ;;; org-element.el ends here |
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el index 6b506cd1275..a578fe70f07 100644 --- a/lisp/org/org-exp.el +++ b/lisp/org/org-exp.el | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | (declare-function org-table-colgroup-line-p "org-table" (line)) | 48 | (declare-function org-table-colgroup-line-p "org-table" (line)) |
| 49 | (declare-function org-pop-to-buffer-same-window "org-compat" | 49 | (declare-function org-pop-to-buffer-same-window "org-compat" |
| 50 | (&optional buffer-or-name norecord label)) | 50 | (&optional buffer-or-name norecord label)) |
| 51 | (declare-function org-unescape-code-in-region "org-src" (beg end)) | ||
| 51 | 52 | ||
| 52 | (autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t) | 53 | (autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t) |
| 53 | 54 | ||
| @@ -1790,7 +1791,7 @@ from the buffer." | |||
| 1790 | beg-content end-content | 1791 | beg-content end-content |
| 1791 | `(org-protected t original-indentation ,ind org-native-text t)) | 1792 | `(org-protected t original-indentation ,ind org-native-text t)) |
| 1792 | ;; strip protective commas | 1793 | ;; strip protective commas |
| 1793 | (org-strip-protective-commas beg-content end-content) | 1794 | (org-unescape-code-in-region beg-content end-content) |
| 1794 | (delete-region (match-beginning 0) (match-end 0)) | 1795 | (delete-region (match-beginning 0) (match-end 0)) |
| 1795 | (save-excursion | 1796 | (save-excursion |
| 1796 | (goto-char beg) | 1797 | (goto-char beg) |
| @@ -3230,7 +3231,6 @@ Does include HTML export options as well as TODO and CATEGORY stuff." | |||
| 3230 | org-archive-location | 3231 | org-archive-location |
| 3231 | "org file:~/org/%s.org")) | 3232 | "org file:~/org/%s.org")) |
| 3232 | 3233 | ||
| 3233 | ;;;###autoload | ||
| 3234 | (defun org-insert-export-options-template () | 3234 | (defun org-insert-export-options-template () |
| 3235 | "Insert into the buffer a template with information for exporting." | 3235 | "Insert into the buffer a template with information for exporting." |
| 3236 | (interactive) | 3236 | (interactive) |
| @@ -3348,4 +3348,8 @@ The depends on the variable `org-export-copy-to-kill-ring'." | |||
| 3348 | 3348 | ||
| 3349 | (provide 'org-exp) | 3349 | (provide 'org-exp) |
| 3350 | 3350 | ||
| 3351 | ;; Local variables: | ||
| 3352 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 3353 | ;; End: | ||
| 3354 | |||
| 3351 | ;;; org-exp.el ends here | 3355 | ;;; org-exp.el ends here |
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el index 51aead1b8bb..58be52d9e28 100644 --- a/lisp/org/org-faces.el +++ b/lisp/org/org-faces.el | |||
| @@ -692,13 +692,13 @@ month and 365.24 days for a year)." | |||
| 692 | :group 'org-faces) | 692 | :group 'org-faces) |
| 693 | 693 | ||
| 694 | (defface org-agenda-filter-tags | 694 | (defface org-agenda-filter-tags |
| 695 | (org-compatible-face 'modeline | 695 | (org-compatible-face 'mode-line |
| 696 | nil) | 696 | nil) |
| 697 | "Face for tag(s) in the mode-line when filtering the agenda." | 697 | "Face for tag(s) in the mode-line when filtering the agenda." |
| 698 | :group 'org-faces) | 698 | :group 'org-faces) |
| 699 | 699 | ||
| 700 | (defface org-agenda-filter-category | 700 | (defface org-agenda-filter-category |
| 701 | (org-compatible-face 'modeline | 701 | (org-compatible-face 'mode-line |
| 702 | nil) | 702 | nil) |
| 703 | "Face for tag(s) in the mode-line when filtering the agenda." | 703 | "Face for tag(s) in the mode-line when filtering the agenda." |
| 704 | :group 'org-faces) | 704 | :group 'org-faces) |
| @@ -770,9 +770,9 @@ level org-n-level-faces" | |||
| 770 | "Face used to highlight math latex and other special exporter stuff." | 770 | "Face used to highlight math latex and other special exporter stuff." |
| 771 | :group 'org-faces) | 771 | :group 'org-faces) |
| 772 | 772 | ||
| 773 | (org-copy-face 'modeline 'org-mode-line-clock | 773 | (org-copy-face 'mode-line 'org-mode-line-clock |
| 774 | "Face used for clock display in mode line.") | 774 | "Face used for clock display in mode line.") |
| 775 | (org-copy-face 'modeline 'org-mode-line-clock-overrun | 775 | (org-copy-face 'mode-line 'org-mode-line-clock-overrun |
| 776 | "Face used for clock display for overrun tasks in mode line." | 776 | "Face used for clock display for overrun tasks in mode line." |
| 777 | :background "red") | 777 | :background "red") |
| 778 | 778 | ||
diff --git a/lisp/org/org-feed.el b/lisp/org/org-feed.el index 91bf3347953..7724578ae58 100644 --- a/lisp/org/org-feed.el +++ b/lisp/org/org-feed.el | |||
| @@ -695,4 +695,8 @@ formatted as a string, not the original XML data." | |||
| 695 | 695 | ||
| 696 | (provide 'org-feed) | 696 | (provide 'org-feed) |
| 697 | 697 | ||
| 698 | ;; Local variables: | ||
| 699 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 700 | ;; End: | ||
| 701 | |||
| 698 | ;;; org-feed.el ends here | 702 | ;;; org-feed.el ends here |
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el index 3aaa44b7ac3..c598965f4c7 100644 --- a/lisp/org/org-footnote.el +++ b/lisp/org/org-footnote.el | |||
| @@ -948,4 +948,8 @@ If LABEL is non-nil, delete that footnote instead." | |||
| 948 | 948 | ||
| 949 | (provide 'org-footnote) | 949 | (provide 'org-footnote) |
| 950 | 950 | ||
| 951 | ;; Local variables: | ||
| 952 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 953 | ;; End: | ||
| 954 | |||
| 951 | ;;; org-footnote.el ends here | 955 | ;;; org-footnote.el ends here |
diff --git a/lisp/org/org-freemind.el b/lisp/org/org-freemind.el index a05cb554d4b..afc925d5426 100644 --- a/lisp/org/org-freemind.el +++ b/lisp/org/org-freemind.el | |||
| @@ -1219,8 +1219,8 @@ PATH should be a list of steps, where each step has the form | |||
| 1219 | 1219 | ||
| 1220 | (provide 'org-freemind) | 1220 | (provide 'org-freemind) |
| 1221 | 1221 | ||
| 1222 | 1222 | ;; Local variables: | |
| 1223 | 1223 | ;; generated-autoload-file: "org-loaddefs.el" | |
| 1224 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1224 | ;; End: |
| 1225 | 1225 | ||
| 1226 | ;;; org-freemind.el ends here | 1226 | ;;; org-freemind.el ends here |
diff --git a/lisp/org/org-html.el b/lisp/org/org-html.el index 79b028638a1..a6ca2d2a03b 100644 --- a/lisp/org/org-html.el +++ b/lisp/org/org-html.el | |||
| @@ -210,6 +210,7 @@ not be modified. Use the variables `org-export-html-style' to add | |||
| 210 | your own style information." | 210 | your own style information." |
| 211 | :group 'org-export-html | 211 | :group 'org-export-html |
| 212 | :type 'boolean) | 212 | :type 'boolean) |
| 213 | |||
| 213 | ;;;###autoload | 214 | ;;;###autoload |
| 214 | (put 'org-export-html-style-include-default 'safe-local-variable 'booleanp) | 215 | (put 'org-export-html-style-include-default 'safe-local-variable 'booleanp) |
| 215 | 216 | ||
| @@ -2380,7 +2381,6 @@ the settings define in the org-... variables." | |||
| 2380 | (plist-get htmlize-buffer-places 'content-end))) | 2381 | (plist-get htmlize-buffer-places 'content-end))) |
| 2381 | (kill-buffer htmlbuf)))) | 2382 | (kill-buffer htmlbuf)))) |
| 2382 | 2383 | ||
| 2383 | ;;;###autoload | ||
| 2384 | (defun org-export-htmlize-generate-css () | 2384 | (defun org-export-htmlize-generate-css () |
| 2385 | "Create the CSS for all font definitions in the current Emacs session. | 2385 | "Create the CSS for all font definitions in the current Emacs session. |
| 2386 | Use this to create face definitions in your CSS style file that can then | 2386 | Use this to create face definitions in your CSS style file that can then |
| @@ -2749,4 +2749,8 @@ the alist of previous items." | |||
| 2749 | 2749 | ||
| 2750 | (provide 'org-html) | 2750 | (provide 'org-html) |
| 2751 | 2751 | ||
| 2752 | ;; Local variables: | ||
| 2753 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 2754 | ;; End: | ||
| 2755 | |||
| 2752 | ;;; org-html.el ends here | 2756 | ;;; org-html.el ends here |
diff --git a/lisp/org/org-icalendar.el b/lisp/org/org-icalendar.el index 8523b442583..a2d2117dcb4 100644 --- a/lisp/org/org-icalendar.el +++ b/lisp/org/org-icalendar.el | |||
| @@ -684,4 +684,8 @@ a time), or the day by one (if it does not contain a time)." | |||
| 684 | 684 | ||
| 685 | (provide 'org-icalendar) | 685 | (provide 'org-icalendar) |
| 686 | 686 | ||
| 687 | ;; Local variables: | ||
| 688 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 689 | ;; End: | ||
| 690 | |||
| 687 | ;;; org-icalendar.el ends here | 691 | ;;; org-icalendar.el ends here |
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el index c156e240dbf..f870ccc5a52 100644 --- a/lisp/org/org-id.el +++ b/lisp/org/org-id.el | |||
| @@ -233,7 +233,6 @@ With optional argument FORCE, force the creation of a new ID." | |||
| 233 | (org-entry-put (point) "ID" nil)) | 233 | (org-entry-put (point) "ID" nil)) |
| 234 | (org-id-get (point) 'create)) | 234 | (org-id-get (point) 'create)) |
| 235 | 235 | ||
| 236 | ;;;###autoload | ||
| 237 | (defun org-id-copy () | 236 | (defun org-id-copy () |
| 238 | "Copy the ID of the entry at point to the kill ring. | 237 | "Copy the ID of the entry at point to the kill ring. |
| 239 | Create an ID if necessary." | 238 | Create an ID if necessary." |
| @@ -259,7 +258,6 @@ In any case, the ID of the entry is returned." | |||
| 259 | (org-id-add-location id (buffer-file-name (buffer-base-buffer))) | 258 | (org-id-add-location id (buffer-file-name (buffer-base-buffer))) |
| 260 | id))))) | 259 | id))))) |
| 261 | 260 | ||
| 262 | ;;;###autoload | ||
| 263 | (defun org-id-get-with-outline-path-completion (&optional targets) | 261 | (defun org-id-get-with-outline-path-completion (&optional targets) |
| 264 | "Use outline-path-completion to retrieve the ID of an entry. | 262 | "Use outline-path-completion to retrieve the ID of an entry. |
| 265 | TARGETS may be a setting for `org-refile-targets' to define the eligible | 263 | TARGETS may be a setting for `org-refile-targets' to define the eligible |
| @@ -276,7 +274,6 @@ It returns the ID of the entry. If necessary, the ID is created." | |||
| 276 | (prog1 (org-id-get pom 'create) | 274 | (prog1 (org-id-get pom 'create) |
| 277 | (move-marker pom nil)))) | 275 | (move-marker pom nil)))) |
| 278 | 276 | ||
| 279 | ;;;###autoload | ||
| 280 | (defun org-id-get-with-outline-drilling (&optional targets) | 277 | (defun org-id-get-with-outline-drilling (&optional targets) |
| 281 | "Use an outline-cycling interface to retrieve the ID of an entry. | 278 | "Use an outline-cycling interface to retrieve the ID of an entry. |
| 282 | This only finds entries in the current buffer, using `org-get-location'. | 279 | This only finds entries in the current buffer, using `org-get-location'. |
| @@ -681,4 +678,8 @@ optional argument MARKERP, return the position as a new marker." | |||
| 681 | 678 | ||
| 682 | (provide 'org-id) | 679 | (provide 'org-id) |
| 683 | 680 | ||
| 681 | ;; Local variables: | ||
| 682 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 683 | ;; End: | ||
| 684 | |||
| 684 | ;;; org-id.el ends here | 685 | ;;; org-id.el ends here |
diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el index d006df86747..c4d74fbb2fa 100644 --- a/lisp/org/org-indent.el +++ b/lisp/org/org-indent.el | |||
| @@ -431,4 +431,8 @@ This function is meant to be called by `after-change-functions'." | |||
| 431 | 431 | ||
| 432 | (provide 'org-indent) | 432 | (provide 'org-indent) |
| 433 | 433 | ||
| 434 | ;; Local variables: | ||
| 435 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 436 | ;; End: | ||
| 437 | |||
| 434 | ;;; org-indent.el ends here | 438 | ;;; org-indent.el ends here |
diff --git a/lisp/org/org-install.el b/lisp/org/org-install.el index 8df78b6b68d..a31d8b79209 100644 --- a/lisp/org/org-install.el +++ b/lisp/org/org-install.el | |||
| @@ -1,37 +1,13 @@ | |||
| 1 | ;;; org-install.el --- Outline-based notes management and organizer | 1 | ;;; org-install.el --- autogenerated file, do not edit |
| 2 | ;; Carstens outline-mode for keeping track of everything. | ||
| 3 | ;; Copyright (C) 2004-2012 Free Software Foundation, Inc. | ||
| 4 | ;; | 2 | ;; |
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 3 | ;;; Code: |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 4 | (warn "The file org-install is obsolete. |
| 7 | ;; Homepage: http://orgmode.org | 5 | Please change your configuration to (require 'org) instead.") |
| 8 | ;; Version: 6.06b | 6 | |
| 9 | ;; | ||
| 10 | ;; This file is part of GNU Emacs. | ||
| 11 | ;; | ||
| 12 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 13 | ;; it under the terms of the GNU General Public License as published by | ||
| 14 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 15 | ;; (at your option) any later version. | ||
| 16 | |||
| 17 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | ;; GNU General Public License for more details. | ||
| 21 | |||
| 22 | ;; You should have received a copy of the GNU General Public License | ||
| 23 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 25 | ;; | ||
| 26 | ;;; Commentary: | ||
| 27 | ;; | ||
| 28 | ;; When Org-mode is distributed with Emacs, this is just a dummy file. | ||
| 29 | ;; In an Org-mode distribution outside Emacs, this file would provide | ||
| 30 | ;; the autoloads. We include this dummy version in Emacs, so that people | ||
| 31 | ;; can leave a (require 'org-install) in .emacs, independently of | ||
| 32 | ;; which kind of distribution they use. | ||
| 33 | ;; | ||
| 34 | |||
| 35 | (provide 'org-install) | 7 | (provide 'org-install) |
| 36 | 8 | ||
| 9 | ;; Local Variables: | ||
| 10 | ;; no-byte-compile: t | ||
| 11 | ;; coding: utf-8 | ||
| 12 | ;; End: | ||
| 37 | ;;; org-install.el ends here | 13 | ;;; org-install.el ends here |
diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el index 787eed7950f..d31b1828ddd 100644 --- a/lisp/org/org-irc.el +++ b/lisp/org/org-irc.el | |||
| @@ -252,4 +252,8 @@ default." | |||
| 252 | 252 | ||
| 253 | (provide 'org-irc) | 253 | (provide 'org-irc) |
| 254 | 254 | ||
| 255 | ;; Local variables: | ||
| 256 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 257 | ;; End: | ||
| 258 | |||
| 255 | ;;; org-irc.el ends here | 259 | ;;; org-irc.el ends here |
diff --git a/lisp/org/org-latex.el b/lisp/org/org-latex.el index 933fa56b8dd..9ce84f14e92 100644 --- a/lisp/org/org-latex.el +++ b/lisp/org/org-latex.el | |||
| @@ -787,14 +787,14 @@ emacs --batch | |||
| 787 | --load=$HOME/lib/emacs/org.el | 787 | --load=$HOME/lib/emacs/org.el |
| 788 | --eval \"(setq org-export-headline-levels 2)\" | 788 | --eval \"(setq org-export-headline-levels 2)\" |
| 789 | --visit=MyFile --funcall org-export-as-latex-batch" | 789 | --visit=MyFile --funcall org-export-as-latex-batch" |
| 790 | (org-export-as-latex org-export-headline-levels 'hidden)) | 790 | (org-export-as-latex org-export-headline-levels)) |
| 791 | 791 | ||
| 792 | ;;;###autoload | 792 | ;;;###autoload |
| 793 | (defun org-export-as-latex-to-buffer (arg) | 793 | (defun org-export-as-latex-to-buffer (arg) |
| 794 | "Call `org-export-as-latex` with output to a temporary buffer. | 794 | "Call `org-export-as-latex` with output to a temporary buffer. |
| 795 | No file is created. The prefix ARG is passed through to `org-export-as-latex'." | 795 | No file is created. The prefix ARG is passed through to `org-export-as-latex'." |
| 796 | (interactive "P") | 796 | (interactive "P") |
| 797 | (org-export-as-latex arg nil nil "*Org LaTeX Export*") | 797 | (org-export-as-latex arg nil "*Org LaTeX Export*") |
| 798 | (when org-export-show-temporary-export-buffer | 798 | (when org-export-show-temporary-export-buffer |
| 799 | (switch-to-buffer-other-window "*Org LaTeX Export*"))) | 799 | (switch-to-buffer-other-window "*Org LaTeX Export*"))) |
| 800 | 800 | ||
| @@ -848,7 +848,7 @@ in a window. A non-interactive call will only return the buffer." | |||
| 848 | (set-mark (point)) ;; to activate the region | 848 | (set-mark (point)) ;; to activate the region |
| 849 | (goto-char beg) | 849 | (goto-char beg) |
| 850 | (setq rtn (org-export-as-latex | 850 | (setq rtn (org-export-as-latex |
| 851 | nil nil ext-plist | 851 | nil ext-plist |
| 852 | buffer body-only)) | 852 | buffer body-only)) |
| 853 | (if (fboundp 'deactivate-mark) (deactivate-mark)) | 853 | (if (fboundp 'deactivate-mark) (deactivate-mark)) |
| 854 | (if (and (org-called-interactively-p 'any) (bufferp rtn)) | 854 | (if (and (org-called-interactively-p 'any) (bufferp rtn)) |
| @@ -856,21 +856,19 @@ in a window. A non-interactive call will only return the buffer." | |||
| 856 | rtn))) | 856 | rtn))) |
| 857 | 857 | ||
| 858 | ;;;###autoload | 858 | ;;;###autoload |
| 859 | (defun org-export-as-latex (arg &optional hidden ext-plist | 859 | (defun org-export-as-latex (arg &optional ext-plist to-buffer body-only pub-dir) |
| 860 | to-buffer body-only pub-dir) | ||
| 861 | "Export current buffer to a LaTeX file. | 860 | "Export current buffer to a LaTeX file. |
| 862 | If there is an active region, export only the region. The prefix | 861 | If there is an active region, export only the region. The prefix |
| 863 | ARG specifies how many levels of the outline should become | 862 | ARG specifies how many levels of the outline should become |
| 864 | headlines. The default is 3. Lower levels will be exported | 863 | headlines. The default is 3. Lower levels will be exported |
| 865 | depending on `org-export-latex-low-levels'. The default is to | 864 | depending on `org-export-latex-low-levels'. The default is to |
| 866 | convert them as description lists. | 865 | convert them as description lists. |
| 867 | HIDDEN is obsolete and does nothing. | 866 | EXT-PLIST is a property list with external parameters overriding |
| 868 | EXT-PLIST is a property list with | 867 | org-mode's default settings, but still inferior to file-local settings. |
| 869 | external parameters overriding org-mode's default settings, but | 868 | When TO-BUFFER is non-nil, create a buffer with that name and export |
| 870 | still inferior to file-local settings. When TO-BUFFER is | 869 | to that buffer. If TO-BUFFER is the symbol `string', don't leave any |
| 871 | non-nil, create a buffer with that name and export to that | 870 | buffer behind and just return the resulting LaTeX as a string, with |
| 872 | buffer. If TO-BUFFER is the symbol `string', don't leave any | 871 | no LaTeX header. |
| 873 | buffer behind but just return the resulting LaTeX as a string. | ||
| 874 | When BODY-ONLY is set, don't produce the file header and footer, | 872 | When BODY-ONLY is set, don't produce the file header and footer, |
| 875 | simply return the content of \\begin{document}...\\end{document}, | 873 | simply return the content of \\begin{document}...\\end{document}, |
| 876 | without even the \\begin{document} and \\end{document} commands. | 874 | without even the \\begin{document} and \\end{document} commands. |
| @@ -957,10 +955,9 @@ when PUB-DIR is set, use this as the publishing directory." | |||
| 957 | (auto-insert nil); Avoid any auto-insert stuff for the new file | 955 | (auto-insert nil); Avoid any auto-insert stuff for the new file |
| 958 | (TeX-master (boundp 'TeX-master)) | 956 | (TeX-master (boundp 'TeX-master)) |
| 959 | (buffer (if to-buffer | 957 | (buffer (if to-buffer |
| 960 | (cond | 958 | (if (eq to-buffer 'string) |
| 961 | ((eq to-buffer 'string) (get-buffer-create | 959 | (get-buffer-create "*Org LaTeX Export*") |
| 962 | "*Org LaTeX Export*")) | 960 | (get-buffer-create to-buffer)) |
| 963 | (t (get-buffer-create to-buffer))) | ||
| 964 | (find-file-noselect filename))) | 961 | (find-file-noselect filename))) |
| 965 | (odd org-odd-levels-only) | 962 | (odd org-odd-levels-only) |
| 966 | (header (org-export-latex-make-header title opt-plist)) | 963 | (header (org-export-latex-make-header title opt-plist)) |
| @@ -1120,8 +1117,7 @@ when PUB-DIR is set, use this as the publishing directory." | |||
| 1120 | (interactive "P") | 1117 | (interactive "P") |
| 1121 | (message "Exporting to PDF...") | 1118 | (message "Exporting to PDF...") |
| 1122 | (let* ((wconfig (current-window-configuration)) | 1119 | (let* ((wconfig (current-window-configuration)) |
| 1123 | (lbuf (org-export-as-latex arg hidden ext-plist | 1120 | (lbuf (org-export-as-latex arg ext-plist to-buffer body-only pub-dir)) |
| 1124 | to-buffer body-only pub-dir)) | ||
| 1125 | (file (buffer-file-name lbuf)) | 1121 | (file (buffer-file-name lbuf)) |
| 1126 | (base (file-name-sans-extension (buffer-file-name lbuf))) | 1122 | (base (file-name-sans-extension (buffer-file-name lbuf))) |
| 1127 | (pdffile (concat base ".pdf")) | 1123 | (pdffile (concat base ".pdf")) |
| @@ -2899,4 +2895,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." | |||
| 2899 | (provide 'org-export-latex) | 2895 | (provide 'org-export-latex) |
| 2900 | (provide 'org-latex) | 2896 | (provide 'org-latex) |
| 2901 | 2897 | ||
| 2898 | ;; Local variables: | ||
| 2899 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 2900 | ;; End: | ||
| 2901 | |||
| 2902 | ;;; org-latex.el ends here | 2902 | ;;; org-latex.el ends here |
diff --git a/lisp/org/org-lparse.el b/lisp/org/org-lparse.el index 7024912050a..c5ced3ef01c 100644 --- a/lisp/org/org-lparse.el +++ b/lisp/org/org-lparse.el | |||
| @@ -50,7 +50,6 @@ | |||
| 50 | (require 'org-list) | 50 | (require 'org-list) |
| 51 | (require 'format-spec) | 51 | (require 'format-spec) |
| 52 | 52 | ||
| 53 | ;;;###autoload | ||
| 54 | (defun org-lparse-and-open (target-backend native-backend arg | 53 | (defun org-lparse-and-open (target-backend native-backend arg |
| 55 | &optional file-or-buf) | 54 | &optional file-or-buf) |
| 56 | "Export outline to TARGET-BACKEND via NATIVE-BACKEND and open exported file. | 55 | "Export outline to TARGET-BACKEND via NATIVE-BACKEND and open exported file. |
| @@ -71,7 +70,6 @@ lists." | |||
| 71 | (when org-export-kill-product-buffer-when-displayed | 70 | (when org-export-kill-product-buffer-when-displayed |
| 72 | (kill-buffer (current-buffer)))))) | 71 | (kill-buffer (current-buffer)))))) |
| 73 | 72 | ||
| 74 | ;;;###autoload | ||
| 75 | (defun org-lparse-batch (target-backend &optional native-backend) | 73 | (defun org-lparse-batch (target-backend &optional native-backend) |
| 76 | "Call the function `org-lparse'. | 74 | "Call the function `org-lparse'. |
| 77 | This function can be used in batch processing as: | 75 | This function can be used in batch processing as: |
| @@ -83,7 +81,6 @@ emacs --batch | |||
| 83 | (org-lparse target-backend native-backend | 81 | (org-lparse target-backend native-backend |
| 84 | org-export-headline-levels 'hidden)) | 82 | org-export-headline-levels 'hidden)) |
| 85 | 83 | ||
| 86 | ;;;###autoload | ||
| 87 | (defun org-lparse-to-buffer (backend arg) | 84 | (defun org-lparse-to-buffer (backend arg) |
| 88 | "Call `org-lparse' with output to a temporary buffer. | 85 | "Call `org-lparse' with output to a temporary buffer. |
| 89 | No file is created. The prefix ARG is passed through to | 86 | No file is created. The prefix ARG is passed through to |
| @@ -93,7 +90,6 @@ No file is created. The prefix ARG is passed through to | |||
| 93 | (when org-export-show-temporary-export-buffer | 90 | (when org-export-show-temporary-export-buffer |
| 94 | (switch-to-buffer-other-window tempbuf)))) | 91 | (switch-to-buffer-other-window tempbuf)))) |
| 95 | 92 | ||
| 96 | ;;;###autoload | ||
| 97 | (defun org-replace-region-by (backend beg end) | 93 | (defun org-replace-region-by (backend beg end) |
| 98 | "Assume the current region has org-mode syntax, and convert it to HTML. | 94 | "Assume the current region has org-mode syntax, and convert it to HTML. |
| 99 | This can be used in any buffer. For example, you could write an | 95 | This can be used in any buffer. For example, you could write an |
| @@ -115,7 +111,6 @@ this command to convert it." | |||
| 115 | (delete-region beg end) | 111 | (delete-region beg end) |
| 116 | (insert backend-string))) | 112 | (insert backend-string))) |
| 117 | 113 | ||
| 118 | ;;;###autoload | ||
| 119 | (defun org-lparse-region (backend beg end &optional body-only buffer) | 114 | (defun org-lparse-region (backend beg end &optional body-only buffer) |
| 120 | "Convert region from BEG to END in org-mode buffer to HTML. | 115 | "Convert region from BEG to END in org-mode buffer to HTML. |
| 121 | If prefix arg BODY-ONLY is set, omit file header, footer, and table of | 116 | If prefix arg BODY-ONLY is set, omit file header, footer, and table of |
| @@ -447,11 +442,12 @@ PUB-DIR specifies the publishing directory." | |||
| 447 | (error "Don't know how to export to backend %s %s" target-backend | 442 | (error "Don't know how to export to backend %s %s" target-backend |
| 448 | (format "via %s" native-backend))) | 443 | (format "via %s" native-backend))) |
| 449 | (run-hooks 'org-export-first-hook) | 444 | (run-hooks 'org-export-first-hook) |
| 450 | (org-do-lparse arg hidden ext-plist to-buffer body-only pub-dir) | 445 | (prog1 |
| 451 | (remove-hook 'org-export-preprocess-hook | 446 | (org-do-lparse arg hidden ext-plist to-buffer body-only pub-dir) |
| 452 | 'org-lparse-strip-experimental-blocks-maybe) | 447 | (remove-hook 'org-export-preprocess-hook |
| 453 | (remove-hook 'org-export-preprocess-after-blockquote-hook | 448 | 'org-lparse-strip-experimental-blocks-maybe) |
| 454 | 'org-lparse-preprocess-after-blockquote))) | 449 | (remove-hook 'org-export-preprocess-after-blockquote-hook |
| 450 | 'org-lparse-preprocess-after-blockquote)))) | ||
| 455 | 451 | ||
| 456 | (defcustom org-lparse-use-flashy-warning nil | 452 | (defcustom org-lparse-use-flashy-warning nil |
| 457 | "Control flashing of messages logged with `org-lparse-warn'. | 453 | "Control flashing of messages logged with `org-lparse-warn'. |
| @@ -480,6 +476,8 @@ This is a helper routine for interactive use." | |||
| 480 | (eval-when-compile | 476 | (eval-when-compile |
| 481 | (require 'browse-url)) | 477 | (require 'browse-url)) |
| 482 | 478 | ||
| 479 | (declare-function browse-url-file-url "browse-url" (file)) | ||
| 480 | |||
| 483 | (defun org-lparse-do-convert (in-file out-fmt &optional prefix-arg) | 481 | (defun org-lparse-do-convert (in-file out-fmt &optional prefix-arg) |
| 484 | "Workhorse routine for `org-export-odt-convert'." | 482 | "Workhorse routine for `org-export-odt-convert'." |
| 485 | (require 'browse-url) | 483 | (require 'browse-url) |
| @@ -2298,4 +2296,8 @@ Replaces invalid characters with \"_\"." | |||
| 2298 | 2296 | ||
| 2299 | (provide 'org-lparse) | 2297 | (provide 'org-lparse) |
| 2300 | 2298 | ||
| 2299 | ;; Local variables: | ||
| 2300 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 2301 | ;; End: | ||
| 2302 | |||
| 2301 | ;;; org-lparse.el ends here | 2303 | ;;; org-lparse.el ends here |
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el index d2c9c17367f..ffdd66513be 100644 --- a/lisp/org/org-mobile.el +++ b/lisp/org/org-mobile.el | |||
| @@ -680,7 +680,6 @@ The table of checksums is written to the file mobile-checksums." | |||
| 680 | (let ((table '(?: ?/))) | 680 | (let ((table '(?: ?/))) |
| 681 | (org-link-escape s table))) | 681 | (org-link-escape s table))) |
| 682 | 682 | ||
| 683 | ;;;###autoload | ||
| 684 | (defun org-mobile-create-sumo-agenda () | 683 | (defun org-mobile-create-sumo-agenda () |
| 685 | "Create a file that contains all custom agenda views." | 684 | "Create a file that contains all custom agenda views." |
| 686 | (interactive) | 685 | (interactive) |
| @@ -1129,4 +1128,8 @@ A and B must be strings or nil." | |||
| 1129 | 1128 | ||
| 1130 | (provide 'org-mobile) | 1129 | (provide 'org-mobile) |
| 1131 | 1130 | ||
| 1131 | ;; Local variables: | ||
| 1132 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 1133 | ;; End: | ||
| 1134 | |||
| 1132 | ;;; org-mobile.el ends here | 1135 | ;;; org-mobile.el ends here |
diff --git a/lisp/org/org-odt.el b/lisp/org/org-odt.el index 7de4b5de853..2dc3af39b09 100644 --- a/lisp/org/org-odt.el +++ b/lisp/org/org-odt.el | |||
| @@ -2718,7 +2718,7 @@ Do this when translation to MathML fails." | |||
| 2718 | (defun org-export-odt-preprocess (parameters) | 2718 | (defun org-export-odt-preprocess (parameters) |
| 2719 | (org-export-odt-preprocess-label-references)) | 2719 | (org-export-odt-preprocess-label-references)) |
| 2720 | 2720 | ||
| 2721 | (declare-function archive-zip-extract "arc-mode.el" (archive name)) | 2721 | (declare-function archive-zip-extract "arc-mode" (archive name)) |
| 2722 | (defun org-odt-zip-extract-one (archive member &optional target) | 2722 | (defun org-odt-zip-extract-one (archive member &optional target) |
| 2723 | (require 'arc-mode) | 2723 | (require 'arc-mode) |
| 2724 | (let* ((target (or target default-directory)) | 2724 | (let* ((target (or target default-directory)) |
| @@ -2847,4 +2847,8 @@ formula file." | |||
| 2847 | 2847 | ||
| 2848 | (provide 'org-odt) | 2848 | (provide 'org-odt) |
| 2849 | 2849 | ||
| 2850 | ;; Local variables: | ||
| 2851 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 2852 | ;; End: | ||
| 2853 | |||
| 2850 | ;;; org-odt.el ends here | 2854 | ;;; org-odt.el ends here |
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el index 48d72ac2810..5dec304363f 100644 --- a/lisp/org/org-plot.el +++ b/lisp/org/org-plot.el | |||
| @@ -351,4 +351,8 @@ line directly before or after the table." | |||
| 351 | 351 | ||
| 352 | (provide 'org-plot) | 352 | (provide 'org-plot) |
| 353 | 353 | ||
| 354 | ;; Local variables: | ||
| 355 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 356 | ;; End: | ||
| 357 | |||
| 354 | ;;; org-plot.el ends here | 358 | ;;; org-plot.el ends here |
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el index 947d52b9200..d10514255b6 100644 --- a/lisp/org/org-publish.el +++ b/lisp/org/org-publish.el | |||
| @@ -916,7 +916,6 @@ directory and force publishing all files." | |||
| 916 | (if force nil org-publish-use-timestamps-flag))) | 916 | (if force nil org-publish-use-timestamps-flag))) |
| 917 | (org-publish-projects org-publish-project-alist)))) | 917 | (org-publish-projects org-publish-project-alist)))) |
| 918 | 918 | ||
| 919 | |||
| 920 | ;;;###autoload | 919 | ;;;###autoload |
| 921 | (defun org-publish-current-file (&optional force) | 920 | (defun org-publish-current-file (&optional force) |
| 922 | "Publish the current file. | 921 | "Publish the current file. |
| @@ -1192,4 +1191,8 @@ Returns value on success, else nil." | |||
| 1192 | 1191 | ||
| 1193 | (provide 'org-publish) | 1192 | (provide 'org-publish) |
| 1194 | 1193 | ||
| 1194 | ;; Local variables: | ||
| 1195 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 1196 | ;; End: | ||
| 1197 | |||
| 1195 | ;;; org-publish.el ends here | 1198 | ;;; org-publish.el ends here |
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el index dd493749295..d555ca65d21 100644 --- a/lisp/org/org-remember.el +++ b/lisp/org/org-remember.el | |||
| @@ -1149,4 +1149,8 @@ See also the variable `org-reverse-note-order'." | |||
| 1149 | 1149 | ||
| 1150 | (provide 'org-remember) | 1150 | (provide 'org-remember) |
| 1151 | 1151 | ||
| 1152 | ;; Local variables: | ||
| 1153 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 1154 | ;; End: | ||
| 1155 | |||
| 1152 | ;;; org-remember.el ends here | 1156 | ;;; org-remember.el ends here |
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el index 9d6bc1aa2c8..b4d4c0489a9 100644 --- a/lisp/org/org-src.el +++ b/lisp/org/org-src.el | |||
| @@ -41,10 +41,8 @@ | |||
| 41 | (declare-function org-at-table.el-p "org" ()) | 41 | (declare-function org-at-table.el-p "org" ()) |
| 42 | (declare-function org-get-indentation "org" (&optional line)) | 42 | (declare-function org-get-indentation "org" (&optional line)) |
| 43 | (declare-function org-switch-to-buffer-other-window "org" (&rest args)) | 43 | (declare-function org-switch-to-buffer-other-window "org" (&rest args)) |
| 44 | (declare-function org-strip-protective-commas "org" (beg end)) | ||
| 45 | (declare-function org-pop-to-buffer-same-window | 44 | (declare-function org-pop-to-buffer-same-window |
| 46 | "org-compat" (&optional buffer-or-name norecord label)) | 45 | "org-compat" (&optional buffer-or-name norecord label)) |
| 47 | (declare-function org-strip-protective-commas "org" (beg end)) | ||
| 48 | (declare-function org-base-buffer "org" (buffer)) | 46 | (declare-function org-base-buffer "org" (buffer)) |
| 49 | 47 | ||
| 50 | (defcustom org-edit-src-region-extra nil | 48 | (defcustom org-edit-src-region-extra nil |
| @@ -311,13 +309,8 @@ buffer." | |||
| 311 | (error "Language mode `%s' fails with: %S" lang-f (nth 1 e))))) | 309 | (error "Language mode `%s' fails with: %S" lang-f (nth 1 e))))) |
| 312 | (dolist (pair transmitted-variables) | 310 | (dolist (pair transmitted-variables) |
| 313 | (org-set-local (car pair) (cadr pair))) | 311 | (org-set-local (car pair) (cadr pair))) |
| 314 | (if (derived-mode-p 'org-mode) | 312 | ;; Remove protecting commas from visible part of buffer. |
| 315 | (progn | 313 | (org-unescape-code-in-region (point-min) (point-max)) |
| 316 | (goto-char (point-min)) | ||
| 317 | (while (re-search-forward "^," nil t) | ||
| 318 | (if (eq (org-current-line) line) (setq total-nindent (1+ total-nindent))) | ||
| 319 | (replace-match ""))) | ||
| 320 | (org-strip-protective-commas (point-min) (point-max))) | ||
| 321 | (when markline | 314 | (when markline |
| 322 | (org-goto-line (1+ (- markline begline))) | 315 | (org-goto-line (1+ (- markline begline))) |
| 323 | (org-move-to-column | 316 | (org-move-to-column |
| @@ -590,20 +583,38 @@ the language, a switch telling if the content should be in a single line." | |||
| 590 | (goto-char pos) | 583 | (goto-char pos) |
| 591 | (org-get-indentation))) | 584 | (org-get-indentation))) |
| 592 | 585 | ||
| 593 | (defun org-add-protective-commas (beg end &optional line) | 586 | (defun org-escape-code-in-region (beg end) |
| 594 | "Add protective commas in region. | 587 | "Escape lines between BEG and END. |
| 595 | Return the delta in size of the region." | 588 | Escaping happens when a line starts with \"*\", \"#+\", \",*\" or |
| 589 | \",#+\" by appending a comma to it." | ||
| 596 | (interactive "r") | 590 | (interactive "r") |
| 597 | (let ((org-re "^\\(.\\)") | 591 | (save-excursion |
| 598 | (other-re "^\\([*]\\|[ \t]*#\\+\\)") | 592 | (goto-char beg) |
| 599 | (delta 0)) | 593 | (while (re-search-forward "^[ \t]*,?\\(\\*\\|#\\+\\)" end t) |
| 600 | (save-excursion | 594 | (replace-match ",\\1" nil nil nil 1)))) |
| 601 | (goto-char beg) | 595 | |
| 602 | (while (re-search-forward (if (derived-mode-p 'org-mode) org-re other-re) | 596 | (defun org-escape-code-in-string (s) |
| 603 | end t) | 597 | "Escape lines in string S. |
| 604 | (if (and line (eq (org-current-line) line)) (setq delta (1+ delta))) | 598 | Escaping happens when a line starts with \"*\", \"#+\", \",*\" or |
| 605 | (replace-match ",\\1"))) | 599 | \",#+\" by appending a comma to it." |
| 606 | delta)) | 600 | (replace-regexp-in-string "^[ \t]*,?\\(\\*\\|#\\+\\)" ",\\1" s nil nil 1)) |
| 601 | |||
| 602 | (defun org-unescape-code-in-region (beg end) | ||
| 603 | "Un-escape lines between BEG and END. | ||
| 604 | Un-escaping happens by removing the first comma on lines starting | ||
| 605 | with \",*\", \",#+\", \",,*\" and \",,#+\"." | ||
| 606 | (interactive "r") | ||
| 607 | (save-excursion | ||
| 608 | (goto-char beg) | ||
| 609 | (while (re-search-forward "^[ \t]*,?\\(,\\)\\(?:\\*\\|#\\+\\)" end t) | ||
| 610 | (replace-match "" nil nil nil 1)))) | ||
| 611 | |||
| 612 | (defun org-unescape-code-in-string (s) | ||
| 613 | "Un-escape lines in string S. | ||
| 614 | Un-escaping happens by removing the first comma on lines starting | ||
| 615 | with \",*\", \",#+\", \",,*\" and \",,#+\"." | ||
| 616 | (replace-regexp-in-string | ||
| 617 | "^[ \t]*,?\\(,\\)\\(?:\\*\\|#\\+\\)" "" s nil nil 1)) | ||
| 607 | 618 | ||
| 608 | (defun org-edit-src-exit (&optional context) | 619 | (defun org-edit-src-exit (&optional context) |
| 609 | "Exit special edit and protect problematic lines." | 620 | "Exit special edit and protect problematic lines." |
| @@ -649,8 +660,12 @@ Return the delta in size of the region." | |||
| 649 | (goto-char (point-min)) | 660 | (goto-char (point-min)) |
| 650 | (if (looking-at "\\s-*") (replace-match " "))) | 661 | (if (looking-at "\\s-*") (replace-match " "))) |
| 651 | (when (org-bound-and-true-p org-edit-src-from-org-mode) | 662 | (when (org-bound-and-true-p org-edit-src-from-org-mode) |
| 652 | (setq delta (+ delta (org-add-protective-commas | 663 | (org-escape-code-in-region (point-min) (point-max)) |
| 653 | (point-min) (point-max) line)))) | 664 | (setq delta (+ delta |
| 665 | (save-excursion | ||
| 666 | (org-goto-line line) | ||
| 667 | (if (looking-at "[ \t]*\\(,,\\)?\\(\\*\\|#+\\)") 1 | ||
| 668 | 0))))) | ||
| 654 | (when (org-bound-and-true-p org-edit-src-picture) | 669 | (when (org-bound-and-true-p org-edit-src-picture) |
| 655 | (setq preserve-indentation nil) | 670 | (setq preserve-indentation nil) |
| 656 | (untabify (point-min) (point-max)) | 671 | (untabify (point-min) (point-max)) |
| @@ -674,9 +689,10 @@ Return the delta in size of the region." | |||
| 674 | (kill-buffer buffer)) | 689 | (kill-buffer buffer)) |
| 675 | (goto-char beg) | 690 | (goto-char beg) |
| 676 | (when allow-write-back-p | 691 | (when allow-write-back-p |
| 677 | (delete-region beg (1- end)) | 692 | (delete-region beg (max beg (1- end))) |
| 678 | (insert code) | 693 | (unless (string-match "^[ \t]*$" code) |
| 679 | (delete-char 1) | 694 | (insert code) |
| 695 | (delete-char 1)) | ||
| 680 | (goto-char beg) | 696 | (goto-char beg) |
| 681 | (if single (just-one-space))) | 697 | (if single (just-one-space))) |
| 682 | (if (memq t (mapcar (lambda (overlay) | 698 | (if (memq t (mapcar (lambda (overlay) |
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 3eb63b6e53c..0555041231b 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el | |||
| @@ -423,6 +423,7 @@ available parameters." | |||
| 423 | (concat "\\(" "@[-0-9I$]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\)") | 423 | (concat "\\(" "@[-0-9I$]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\)") |
| 424 | "Match a reference that needs translation, for reference display.") | 424 | "Match a reference that needs translation, for reference display.") |
| 425 | 425 | ||
| 426 | ;;;###autoload | ||
| 426 | (defun org-table-create-with-table.el () | 427 | (defun org-table-create-with-table.el () |
| 427 | "Use the table.el package to insert a new table. | 428 | "Use the table.el package to insert a new table. |
| 428 | If there is already a table at point, convert between Org-mode tables | 429 | If there is already a table at point, convert between Org-mode tables |
| @@ -439,6 +440,7 @@ and table.el tables." | |||
| 439 | (org-table-convert))) | 440 | (org-table-convert))) |
| 440 | (t (call-interactively 'table-insert)))) | 441 | (t (call-interactively 'table-insert)))) |
| 441 | 442 | ||
| 443 | ;;;###autoload | ||
| 442 | (defun org-table-create-or-convert-from-region (arg) | 444 | (defun org-table-create-or-convert-from-region (arg) |
| 443 | "Convert region to table, or create an empty table. | 445 | "Convert region to table, or create an empty table. |
| 444 | If there is an active region, convert it to a table, using the function | 446 | If there is an active region, convert it to a table, using the function |
| @@ -451,6 +453,7 @@ If there is no such region, create an empty table with `org-table-create'." | |||
| 451 | (org-table-convert-region (region-beginning) (region-end) arg) | 453 | (org-table-convert-region (region-beginning) (region-end) arg) |
| 452 | (org-table-create arg))) | 454 | (org-table-create arg))) |
| 453 | 455 | ||
| 456 | ;;;###autoload | ||
| 454 | (defun org-table-create (&optional size) | 457 | (defun org-table-create (&optional size) |
| 455 | "Query for a size and insert a table skeleton. | 458 | "Query for a size and insert a table skeleton. |
| 456 | SIZE is a string Columns x Rows like for example \"3x2\"." | 459 | SIZE is a string Columns x Rows like for example \"3x2\"." |
| @@ -483,6 +486,7 @@ SIZE is a string Columns x Rows like for example \"3x2\"." | |||
| 483 | (goto-char pos))) | 486 | (goto-char pos))) |
| 484 | (org-table-align))) | 487 | (org-table-align))) |
| 485 | 488 | ||
| 489 | ;;;###autoload | ||
| 486 | (defun org-table-convert-region (beg0 end0 &optional separator) | 490 | (defun org-table-convert-region (beg0 end0 &optional separator) |
| 487 | "Convert region to a table. | 491 | "Convert region to a table. |
| 488 | The region goes from BEG0 to END0, but these borders will be moved | 492 | The region goes from BEG0 to END0, but these borders will be moved |
| @@ -543,6 +547,7 @@ nil When nil, the command tries to be smart and figure out the | |||
| 543 | (goto-char beg) | 547 | (goto-char beg) |
| 544 | (org-table-align))) | 548 | (org-table-align))) |
| 545 | 549 | ||
| 550 | ;;;###autoload | ||
| 546 | (defun org-table-import (file arg) | 551 | (defun org-table-import (file arg) |
| 547 | "Import FILE as a table. | 552 | "Import FILE as a table. |
| 548 | The file is assumed to be tab-separated. Such files can be produced by most | 553 | The file is assumed to be tab-separated. Such files can be produced by most |
| @@ -558,6 +563,7 @@ are found, lines will be split on whitespace into fields." | |||
| 558 | 563 | ||
| 559 | (defvar org-table-last-alignment) | 564 | (defvar org-table-last-alignment) |
| 560 | (defvar org-table-last-column-widths) | 565 | (defvar org-table-last-column-widths) |
| 566 | ;;;###autoload | ||
| 561 | (defun org-table-export (&optional file format) | 567 | (defun org-table-export (&optional file format) |
| 562 | "Export table to a file, with configurable format. | 568 | "Export table to a file, with configurable format. |
| 563 | Such a file can be imported into usual spreadsheet programs. | 569 | Such a file can be imported into usual spreadsheet programs. |
| @@ -673,6 +679,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.") | |||
| 673 | (defconst org-narrow-column-arrow "=>" | 679 | (defconst org-narrow-column-arrow "=>" |
| 674 | "Used as display property in narrowed table columns.") | 680 | "Used as display property in narrowed table columns.") |
| 675 | 681 | ||
| 682 | ;;;###autoload | ||
| 676 | (defun org-table-align () | 683 | (defun org-table-align () |
| 677 | "Align the table at point by aligning all vertical bars." | 684 | "Align the table at point by aligning all vertical bars." |
| 678 | (interactive) | 685 | (interactive) |
| @@ -884,6 +891,7 @@ With argument TABLE-TYPE, go to the end of a table.el-type table." | |||
| 884 | (goto-char (match-beginning 0))) | 891 | (goto-char (match-beginning 0))) |
| 885 | (point-marker))) | 892 | (point-marker))) |
| 886 | 893 | ||
| 894 | ;;;###autoload | ||
| 887 | (defun org-table-justify-field-maybe (&optional new) | 895 | (defun org-table-justify-field-maybe (&optional new) |
| 888 | "Justify the current field, text to left, number to right. | 896 | "Justify the current field, text to left, number to right. |
| 889 | Optional argument NEW may specify text to replace the current field content." | 897 | Optional argument NEW may specify text to replace the current field content." |
| @@ -924,6 +932,7 @@ Optional argument NEW may specify text to replace the current field content." | |||
| 924 | (setq org-table-may-need-update t)) | 932 | (setq org-table-may-need-update t)) |
| 925 | (goto-char pos)))))) | 933 | (goto-char pos)))))) |
| 926 | 934 | ||
| 935 | ;;;###autoload | ||
| 927 | (defun org-table-next-field () | 936 | (defun org-table-next-field () |
| 928 | "Go to the next field in the current table, creating new lines as needed. | 937 | "Go to the next field in the current table, creating new lines as needed. |
| 929 | Before doing so, re-align the table if necessary." | 938 | Before doing so, re-align the table if necessary." |
| @@ -953,6 +962,7 @@ Before doing so, re-align the table if necessary." | |||
| 953 | (error | 962 | (error |
| 954 | (org-table-insert-row 'below))))) | 963 | (org-table-insert-row 'below))))) |
| 955 | 964 | ||
| 965 | ;;;###autoload | ||
| 956 | (defun org-table-previous-field () | 966 | (defun org-table-previous-field () |
| 957 | "Go to the previous field in the table. | 967 | "Go to the previous field in the table. |
| 958 | Before doing so, re-align the table if necessary." | 968 | Before doing so, re-align the table if necessary." |
| @@ -1006,6 +1016,7 @@ With numeric argument N, move N-1 fields backward first." | |||
| 1006 | (forward-char 1))) | 1016 | (forward-char 1))) |
| 1007 | (if (<= (point) pos) (org-table-end-of-field 2)))) | 1017 | (if (<= (point) pos) (org-table-end-of-field 2)))) |
| 1008 | 1018 | ||
| 1019 | ;;;###autoload | ||
| 1009 | (defun org-table-next-row () | 1020 | (defun org-table-next-row () |
| 1010 | "Go to the next row (same column) in the current table. | 1021 | "Go to the next row (same column) in the current table. |
| 1011 | Before doing so, re-align the table if necessary." | 1022 | Before doing so, re-align the table if necessary." |
| @@ -1029,6 +1040,7 @@ Before doing so, re-align the table if necessary." | |||
| 1029 | (skip-chars-backward "^|\n\r") | 1040 | (skip-chars-backward "^|\n\r") |
| 1030 | (if (looking-at " ") (forward-char 1))))) | 1041 | (if (looking-at " ") (forward-char 1))))) |
| 1031 | 1042 | ||
| 1043 | ;;;###autoload | ||
| 1032 | (defun org-table-copy-down (n) | 1044 | (defun org-table-copy-down (n) |
| 1033 | "Copy a field down in the current column. | 1045 | "Copy a field down in the current column. |
| 1034 | If the field at the cursor is empty, copy into it the content of | 1046 | If the field at the cursor is empty, copy into it the content of |
| @@ -1173,6 +1185,7 @@ is always the old value." | |||
| 1173 | val) | 1185 | val) |
| 1174 | (forward-char 1) "")) | 1186 | (forward-char 1) "")) |
| 1175 | 1187 | ||
| 1188 | ;;;###autoload | ||
| 1176 | (defun org-table-field-info (arg) | 1189 | (defun org-table-field-info (arg) |
| 1177 | "Show info about the current field, and highlight any reference at point." | 1190 | "Show info about the current field, and highlight any reference at point." |
| 1178 | (interactive "P") | 1191 | (interactive "P") |
| @@ -1228,6 +1241,7 @@ is always the old value." | |||
| 1228 | (message "In table column %d" cnt)) | 1241 | (message "In table column %d" cnt)) |
| 1229 | cnt))) | 1242 | cnt))) |
| 1230 | 1243 | ||
| 1244 | ;;;###autoload | ||
| 1231 | (defun org-table-current-dline () | 1245 | (defun org-table-current-dline () |
| 1232 | "Find out what table data line we are in. | 1246 | "Find out what table data line we are in. |
| 1233 | Only data lines count for this." | 1247 | Only data lines count for this." |
| @@ -1244,6 +1258,7 @@ Only data lines count for this." | |||
| 1244 | (message "This is table line %d" cnt)) | 1258 | (message "This is table line %d" cnt)) |
| 1245 | cnt))) | 1259 | cnt))) |
| 1246 | 1260 | ||
| 1261 | ;;;###autoload | ||
| 1247 | (defun org-table-goto-column (n &optional on-delim force) | 1262 | (defun org-table-goto-column (n &optional on-delim force) |
| 1248 | "Move the cursor to the Nth column in the current table line. | 1263 | "Move the cursor to the Nth column in the current table line. |
| 1249 | With optional argument ON-DELIM, stop with point before the left delimiter | 1264 | With optional argument ON-DELIM, stop with point before the left delimiter |
| @@ -1266,6 +1281,7 @@ However, when FORCE is non-nil, create new columns if necessary." | |||
| 1266 | (backward-char 1) | 1281 | (backward-char 1) |
| 1267 | (if (looking-at " ") (forward-char 1))))) | 1282 | (if (looking-at " ") (forward-char 1))))) |
| 1268 | 1283 | ||
| 1284 | ;;;###autoload | ||
| 1269 | (defun org-table-insert-column () | 1285 | (defun org-table-insert-column () |
| 1270 | "Insert a new column into the table." | 1286 | "Insert a new column into the table." |
| 1271 | (interactive) | 1287 | (interactive) |
| @@ -1335,6 +1351,7 @@ first dline below it is used. When ABOVE is non-nil, the one above is used." | |||
| 1335 | (setq i (1+ i))))) | 1351 | (setq i (1+ i))))) |
| 1336 | nil)) | 1352 | nil)) |
| 1337 | 1353 | ||
| 1354 | ;;;###autoload | ||
| 1338 | (defun org-table-delete-column () | 1355 | (defun org-table-delete-column () |
| 1339 | "Delete a column from the table." | 1356 | "Delete a column from the table." |
| 1340 | (interactive) | 1357 | (interactive) |
| @@ -1367,15 +1384,18 @@ first dline below it is used. When ABOVE is non-nil, the one above is used." | |||
| 1367 | (org-table-fix-formulas "$LR" (list (cons (number-to-string col) "INVALID")) | 1384 | (org-table-fix-formulas "$LR" (list (cons (number-to-string col) "INVALID")) |
| 1368 | col -1 col)))) | 1385 | col -1 col)))) |
| 1369 | 1386 | ||
| 1387 | ;;;###autoload | ||
| 1370 | (defun org-table-move-column-right () | 1388 | (defun org-table-move-column-right () |
| 1371 | "Move column to the right." | 1389 | "Move column to the right." |
| 1372 | (interactive) | 1390 | (interactive) |
| 1373 | (org-table-move-column nil)) | 1391 | (org-table-move-column nil)) |
| 1392 | ;;;###autoload | ||
| 1374 | (defun org-table-move-column-left () | 1393 | (defun org-table-move-column-left () |
| 1375 | "Move column to the left." | 1394 | "Move column to the left." |
| 1376 | (interactive) | 1395 | (interactive) |
| 1377 | (org-table-move-column 'left)) | 1396 | (org-table-move-column 'left)) |
| 1378 | 1397 | ||
| 1398 | ;;;###autoload | ||
| 1379 | (defun org-table-move-column (&optional left) | 1399 | (defun org-table-move-column (&optional left) |
| 1380 | "Move the current column to the right. With arg LEFT, move to the left." | 1400 | "Move the current column to the right. With arg LEFT, move to the left." |
| 1381 | (interactive "P") | 1401 | (interactive "P") |
| @@ -1415,15 +1435,18 @@ first dline below it is used. When ABOVE is non-nil, the one above is used." | |||
| 1415 | "$LR" (list (cons (number-to-string col) (number-to-string colpos)) | 1435 | "$LR" (list (cons (number-to-string col) (number-to-string colpos)) |
| 1416 | (cons (number-to-string colpos) (number-to-string col))))))) | 1436 | (cons (number-to-string colpos) (number-to-string col))))))) |
| 1417 | 1437 | ||
| 1438 | ;;;###autoload | ||
| 1418 | (defun org-table-move-row-down () | 1439 | (defun org-table-move-row-down () |
| 1419 | "Move table row down." | 1440 | "Move table row down." |
| 1420 | (interactive) | 1441 | (interactive) |
| 1421 | (org-table-move-row nil)) | 1442 | (org-table-move-row nil)) |
| 1443 | ;;;###autoload | ||
| 1422 | (defun org-table-move-row-up () | 1444 | (defun org-table-move-row-up () |
| 1423 | "Move table row up." | 1445 | "Move table row up." |
| 1424 | (interactive) | 1446 | (interactive) |
| 1425 | (org-table-move-row 'up)) | 1447 | (org-table-move-row 'up)) |
| 1426 | 1448 | ||
| 1449 | ;;;###autoload | ||
| 1427 | (defun org-table-move-row (&optional up) | 1450 | (defun org-table-move-row (&optional up) |
| 1428 | "Move the current table line down. With arg UP, move it up." | 1451 | "Move the current table line down. With arg UP, move it up." |
| 1429 | (interactive "P") | 1452 | (interactive "P") |
| @@ -1457,6 +1480,7 @@ first dline below it is used. When ABOVE is non-nil, the one above is used." | |||
| 1457 | "@" (list (cons (number-to-string dline1) (number-to-string dline2)) | 1480 | "@" (list (cons (number-to-string dline1) (number-to-string dline2)) |
| 1458 | (cons (number-to-string dline2) (number-to-string dline1))))))) | 1481 | (cons (number-to-string dline2) (number-to-string dline1))))))) |
| 1459 | 1482 | ||
| 1483 | ;;;###autoload | ||
| 1460 | (defun org-table-insert-row (&optional arg) | 1484 | (defun org-table-insert-row (&optional arg) |
| 1461 | "Insert a new row above the current line into the table. | 1485 | "Insert a new row above the current line into the table. |
| 1462 | With prefix ARG, insert below the current line." | 1486 | With prefix ARG, insert below the current line." |
| @@ -1478,6 +1502,7 @@ With prefix ARG, insert below the current line." | |||
| 1478 | (funcall org-table-fix-formulas-confirm "Fix formulas? ")) | 1502 | (funcall org-table-fix-formulas-confirm "Fix formulas? ")) |
| 1479 | (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1)))) | 1503 | (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1)))) |
| 1480 | 1504 | ||
| 1505 | ;;;###autoload | ||
| 1481 | (defun org-table-insert-hline (&optional above) | 1506 | (defun org-table-insert-hline (&optional above) |
| 1482 | "Insert a horizontal-line below the current line into the table. | 1507 | "Insert a horizontal-line below the current line into the table. |
| 1483 | With prefix ABOVE, insert above the current line." | 1508 | With prefix ABOVE, insert above the current line." |
| @@ -1501,6 +1526,7 @@ With prefix ABOVE, insert above the current line." | |||
| 1501 | (org-move-to-column col) | 1526 | (org-move-to-column col) |
| 1502 | (and org-table-overlay-coordinates (org-table-align)))) | 1527 | (and org-table-overlay-coordinates (org-table-align)))) |
| 1503 | 1528 | ||
| 1529 | ;;;###autoload | ||
| 1504 | (defun org-table-hline-and-move (&optional same-column) | 1530 | (defun org-table-hline-and-move (&optional same-column) |
| 1505 | "Insert a hline and move to the row below that line." | 1531 | "Insert a hline and move to the row below that line." |
| 1506 | (interactive "P") | 1532 | (interactive "P") |
| @@ -1527,6 +1553,7 @@ In particular, this does handle wide and invisible characters." | |||
| 1527 | t t s))) | 1553 | t t s))) |
| 1528 | s)) | 1554 | s)) |
| 1529 | 1555 | ||
| 1556 | ;;;###autoload | ||
| 1530 | (defun org-table-kill-row () | 1557 | (defun org-table-kill-row () |
| 1531 | "Delete the current row or horizontal line from the table." | 1558 | "Delete the current row or horizontal line from the table." |
| 1532 | (interactive) | 1559 | (interactive) |
| @@ -1542,6 +1569,7 @@ In particular, this does handle wide and invisible characters." | |||
| 1542 | (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID")) | 1569 | (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID")) |
| 1543 | dline -1 dline)))) | 1570 | dline -1 dline)))) |
| 1544 | 1571 | ||
| 1572 | ;;;###autoload | ||
| 1545 | (defun org-table-sort-lines (with-case &optional sorting-type) | 1573 | (defun org-table-sort-lines (with-case &optional sorting-type) |
| 1546 | "Sort table lines according to the column at point. | 1574 | "Sort table lines according to the column at point. |
| 1547 | 1575 | ||
| @@ -1622,7 +1650,7 @@ should be done in reverse order." | |||
| 1622 | (org-table-goto-column thiscol) | 1650 | (org-table-goto-column thiscol) |
| 1623 | (message "%d lines sorted, based on column %d" (length lns) column))) | 1651 | (message "%d lines sorted, based on column %d" (length lns) column))) |
| 1624 | 1652 | ||
| 1625 | 1653 | ;;;###autoload | |
| 1626 | (defun org-table-cut-region (beg end) | 1654 | (defun org-table-cut-region (beg end) |
| 1627 | "Copy region in table to the clipboard and blank all relevant fields. | 1655 | "Copy region in table to the clipboard and blank all relevant fields. |
| 1628 | If there is no active region, use just the field at point." | 1656 | If there is no active region, use just the field at point." |
| @@ -1631,6 +1659,7 @@ If there is no active region, use just the field at point." | |||
| 1631 | (if (org-region-active-p) (region-end) (point)))) | 1659 | (if (org-region-active-p) (region-end) (point)))) |
| 1632 | (org-table-copy-region beg end 'cut)) | 1660 | (org-table-copy-region beg end 'cut)) |
| 1633 | 1661 | ||
| 1662 | ;;;###autoload | ||
| 1634 | (defun org-table-copy-region (beg end &optional cut) | 1663 | (defun org-table-copy-region (beg end &optional cut) |
| 1635 | "Copy rectangular region in table to clipboard. | 1664 | "Copy rectangular region in table to clipboard. |
| 1636 | A special clipboard is used which can only be accessed | 1665 | A special clipboard is used which can only be accessed |
| @@ -1668,6 +1697,7 @@ with `org-table-paste-rectangle'." | |||
| 1668 | (if cut (org-table-align)) | 1697 | (if cut (org-table-align)) |
| 1669 | org-table-clip)) | 1698 | org-table-clip)) |
| 1670 | 1699 | ||
| 1700 | ;;;###autoload | ||
| 1671 | (defun org-table-paste-rectangle () | 1701 | (defun org-table-paste-rectangle () |
| 1672 | "Paste a rectangular region into a table. | 1702 | "Paste a rectangular region into a table. |
| 1673 | The upper right corner ends up in the current field. All involved fields | 1703 | The upper right corner ends up in the current field. All involved fields |
| @@ -1698,6 +1728,7 @@ lines." | |||
| 1698 | (org-table-goto-column col) | 1728 | (org-table-goto-column col) |
| 1699 | (org-table-align))) | 1729 | (org-table-align))) |
| 1700 | 1730 | ||
| 1731 | ;;;###autoload | ||
| 1701 | (defun org-table-convert () | 1732 | (defun org-table-convert () |
| 1702 | "Convert from `org-mode' table to table.el and back. | 1733 | "Convert from `org-mode' table to table.el and back. |
| 1703 | Obviously, this only works within limits. When an Org-mode table is | 1734 | Obviously, this only works within limits. When an Org-mode table is |
| @@ -1771,6 +1802,7 @@ Note that horizontal lines disappeared." | |||
| 1771 | contents "")) | 1802 | contents "")) |
| 1772 | (org-table-align))) | 1803 | (org-table-align))) |
| 1773 | 1804 | ||
| 1805 | ;;;###autoload | ||
| 1774 | (defun org-table-wrap-region (arg) | 1806 | (defun org-table-wrap-region (arg) |
| 1775 | "Wrap several fields in a column like a paragraph. | 1807 | "Wrap several fields in a column like a paragraph. |
| 1776 | This is useful if you'd like to spread the contents of a field over several | 1808 | This is useful if you'd like to spread the contents of a field over several |
| @@ -1841,6 +1873,7 @@ blank, and the content is appended to the field above." | |||
| 1841 | 1873 | ||
| 1842 | (defvar org-field-marker nil) | 1874 | (defvar org-field-marker nil) |
| 1843 | 1875 | ||
| 1876 | ;;;###autoload | ||
| 1844 | (defun org-table-edit-field (arg) | 1877 | (defun org-table-edit-field (arg) |
| 1845 | "Edit table field in a different window. | 1878 | "Edit table field in a different window. |
| 1846 | This is mainly useful for fields that contain hidden parts. | 1879 | This is mainly useful for fields that contain hidden parts. |
| @@ -1944,6 +1977,7 @@ table (but see `org-table-exit-follow-field-mode-when-leaving-table')." | |||
| 1944 | 1977 | ||
| 1945 | (defvar org-timecnt) ; dynamically scoped parameter | 1978 | (defvar org-timecnt) ; dynamically scoped parameter |
| 1946 | 1979 | ||
| 1980 | ;;;###autoload | ||
| 1947 | (defun org-table-sum (&optional beg end nlast) | 1981 | (defun org-table-sum (&optional beg end nlast) |
| 1948 | "Sum numbers in region of current table column. | 1982 | "Sum numbers in region of current table column. |
| 1949 | The result will be displayed in the echo area, and will be available | 1983 | The result will be displayed in the echo area, and will be available |
| @@ -2144,9 +2178,10 @@ When NAMED is non-nil, look for a named equation." | |||
| 2144 | (bs (org-table-formula-make-cmp-string (car b)))) | 2178 | (bs (org-table-formula-make-cmp-string (car b)))) |
| 2145 | (and as bs (string< as bs)))) | 2179 | (and as bs (string< as bs)))) |
| 2146 | 2180 | ||
| 2181 | ;;;###autoload | ||
| 2147 | (defun org-table-get-stored-formulas (&optional noerror) | 2182 | (defun org-table-get-stored-formulas (&optional noerror) |
| 2148 | "Return an alist with the stored formulas directly after current table." | 2183 | "Return an alist with the stored formulas directly after current table." |
| 2149 | (interactive) | 2184 | (interactive) ;; FIXME interactive? |
| 2150 | (let ((case-fold-search t) scol eq eq-alist strings string seen) | 2185 | (let ((case-fold-search t) scol eq eq-alist strings string seen) |
| 2151 | (save-excursion | 2186 | (save-excursion |
| 2152 | (goto-char (org-table-end)) | 2187 | (goto-char (org-table-end)) |
| @@ -2283,6 +2318,7 @@ For all numbers larger than LIMIT, shift them by DELTA." | |||
| 2283 | (setq org-table-local-parameters | 2318 | (setq org-table-local-parameters |
| 2284 | (append org-table-local-parameters al2)))))) | 2319 | (append org-table-local-parameters al2)))))) |
| 2285 | 2320 | ||
| 2321 | ;;;###autoload | ||
| 2286 | (defun org-table-maybe-eval-formula () | 2322 | (defun org-table-maybe-eval-formula () |
| 2287 | "Check if the current field starts with \"=\" or \":=\". | 2323 | "Check if the current field starts with \"=\" or \":=\". |
| 2288 | If yes, store the formula and apply it." | 2324 | If yes, store the formula and apply it." |
| @@ -2313,6 +2349,7 @@ Will be filled automatically during use.") | |||
| 2313 | ("_" . "Names for values in row below this one.") | 2349 | ("_" . "Names for values in row below this one.") |
| 2314 | ("^" . "Names for values in row above this one."))) | 2350 | ("^" . "Names for values in row above this one."))) |
| 2315 | 2351 | ||
| 2352 | ;;;###autoload | ||
| 2316 | (defun org-table-rotate-recalc-marks (&optional newchar) | 2353 | (defun org-table-rotate-recalc-marks (&optional newchar) |
| 2317 | "Rotate the recalculation mark in the first column. | 2354 | "Rotate the recalculation mark in the first column. |
| 2318 | If in any row, the first field is not consistent with a mark, | 2355 | If in any row, the first field is not consistent with a mark, |
| @@ -2374,6 +2411,7 @@ of the new mark." | |||
| 2374 | (and (org-called-interactively-p 'interactive) | 2411 | (and (org-called-interactively-p 'interactive) |
| 2375 | (message "%s" (cdr (assoc new org-recalc-marks)))))) | 2412 | (message "%s" (cdr (assoc new org-recalc-marks)))))) |
| 2376 | 2413 | ||
| 2414 | ;;;###autoload | ||
| 2377 | (defun org-table-maybe-recalculate-line () | 2415 | (defun org-table-maybe-recalculate-line () |
| 2378 | "Recompute the current line if marked for it, and if we haven't just done it." | 2416 | "Recompute the current line if marked for it, and if we haven't just done it." |
| 2379 | (interactive) | 2417 | (interactive) |
| @@ -2397,6 +2435,7 @@ of the new mark." | |||
| 2397 | (cons var (cons value org-tbl-calc-modes))) | 2435 | (cons var (cons value org-tbl-calc-modes))) |
| 2398 | org-tbl-calc-modes) | 2436 | org-tbl-calc-modes) |
| 2399 | 2437 | ||
| 2438 | ;;;###autoload | ||
| 2400 | (defun org-table-eval-formula (&optional arg equation | 2439 | (defun org-table-eval-formula (&optional arg equation |
| 2401 | suppress-align suppress-const | 2440 | suppress-align suppress-const |
| 2402 | suppress-store suppress-analysis) | 2441 | suppress-store suppress-analysis) |
| @@ -2823,6 +2862,7 @@ LISPP means to return something appropriate for a Lisp list." | |||
| 2823 | elements | 2862 | elements |
| 2824 | ",") "]")))) | 2863 | ",") "]")))) |
| 2825 | 2864 | ||
| 2865 | ;;;###autoload | ||
| 2826 | (defun org-table-recalculate (&optional all noalign) | 2866 | (defun org-table-recalculate (&optional all noalign) |
| 2827 | "Recalculate the current table line by applying all stored formulas. | 2867 | "Recalculate the current table line by applying all stored formulas. |
| 2828 | With prefix arg ALL, do this for all lines in the table. | 2868 | With prefix arg ALL, do this for all lines in the table. |
| @@ -2961,6 +3001,7 @@ known that the table will be realigned a little later anyway." | |||
| 2961 | (or noalign (and org-table-may-need-update (org-table-align)) | 3001 | (or noalign (and org-table-may-need-update (org-table-align)) |
| 2962 | (and all (message "Re-applying formulas...done")))))) | 3002 | (and all (message "Re-applying formulas...done")))))) |
| 2963 | 3003 | ||
| 3004 | ;;;###autoload | ||
| 2964 | (defun org-table-iterate (&optional arg) | 3005 | (defun org-table-iterate (&optional arg) |
| 2965 | "Recalculate the table until it does not change anymore. | 3006 | "Recalculate the table until it does not change anymore. |
| 2966 | The maximum number of iterations is 10, but you can choose a different value | 3007 | The maximum number of iterations is 10, but you can choose a different value |
| @@ -2997,10 +3038,9 @@ with the prefix ARG." | |||
| 2997 | "Iterate all tables in the buffer, to converge inter-table dependencies." | 3038 | "Iterate all tables in the buffer, to converge inter-table dependencies." |
| 2998 | (interactive) | 3039 | (interactive) |
| 2999 | (let* ((imax 10) | 3040 | (let* ((imax 10) |
| 3041 | (i imax) | ||
| 3000 | (checksum (md5 (buffer-string))) | 3042 | (checksum (md5 (buffer-string))) |
| 3001 | 3043 | c1) | |
| 3002 | c1 | ||
| 3003 | (i imax)) | ||
| 3004 | (save-excursion | 3044 | (save-excursion |
| 3005 | (save-restriction | 3045 | (save-restriction |
| 3006 | (widen) | 3046 | (widen) |
| @@ -3164,6 +3204,7 @@ Parameters get priority." | |||
| 3164 | 3204 | ||
| 3165 | (defvar org-pos) | 3205 | (defvar org-pos) |
| 3166 | 3206 | ||
| 3207 | ;;;###autoload | ||
| 3167 | (defun org-table-edit-formulas () | 3208 | (defun org-table-edit-formulas () |
| 3168 | "Edit the formulas of the current table in a separate buffer." | 3209 | "Edit the formulas of the current table in a separate buffer." |
| 3169 | (interactive) | 3210 | (interactive) |
| @@ -3801,6 +3842,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line." | |||
| 3801 | (org-overlay-display ov str 'org-special-keyword 'evaporate))) | 3842 | (org-overlay-display ov str 'org-special-keyword 'evaporate))) |
| 3802 | (beginning-of-line 2))))) | 3843 | (beginning-of-line 2))))) |
| 3803 | 3844 | ||
| 3845 | ;;;###autoload | ||
| 3804 | (defun org-table-toggle-coordinate-overlays () | 3846 | (defun org-table-toggle-coordinate-overlays () |
| 3805 | "Toggle the display of Row/Column numbers in tables." | 3847 | "Toggle the display of Row/Column numbers in tables." |
| 3806 | (interactive) | 3848 | (interactive) |
| @@ -3813,6 +3855,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line." | |||
| 3813 | (mapc 'delete-overlay org-table-coordinate-overlays) | 3855 | (mapc 'delete-overlay org-table-coordinate-overlays) |
| 3814 | (setq org-table-coordinate-overlays nil))) | 3856 | (setq org-table-coordinate-overlays nil))) |
| 3815 | 3857 | ||
| 3858 | ;;;###autoload | ||
| 3816 | (defun org-table-toggle-formula-debugger () | 3859 | (defun org-table-toggle-formula-debugger () |
| 3817 | "Toggle the formula debugger in tables." | 3860 | "Toggle the formula debugger in tables." |
| 3818 | (interactive) | 3861 | (interactive) |
| @@ -3852,11 +3895,6 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line." | |||
| 3852 | (defvar orgtbl-mode-map (make-keymap) | 3895 | (defvar orgtbl-mode-map (make-keymap) |
| 3853 | "Keymap for `orgtbl-mode'.") | 3896 | "Keymap for `orgtbl-mode'.") |
| 3854 | 3897 | ||
| 3855 | ;;;###autoload | ||
| 3856 | (defun turn-on-orgtbl () | ||
| 3857 | "Unconditionally turn on `orgtbl-mode'." | ||
| 3858 | (orgtbl-mode 1)) | ||
| 3859 | |||
| 3860 | (defvar org-old-auto-fill-inhibit-regexp nil | 3898 | (defvar org-old-auto-fill-inhibit-regexp nil |
| 3861 | "Local variable used by `orgtbl-mode'.") | 3899 | "Local variable used by `orgtbl-mode'.") |
| 3862 | 3900 | ||
| @@ -4480,6 +4518,7 @@ First element has index 0, or I0 if given." | |||
| 4480 | (*orgtbl-lfmt* *orgtbl-llfmt*)) | 4518 | (*orgtbl-lfmt* *orgtbl-llfmt*)) |
| 4481 | (orgtbl-format-line prevline)))))) | 4519 | (orgtbl-format-line prevline)))))) |
| 4482 | 4520 | ||
| 4521 | ;;;###autoload | ||
| 4483 | (defun orgtbl-to-generic (table params) | 4522 | (defun orgtbl-to-generic (table params) |
| 4484 | "Convert the orgtbl-mode TABLE to some other format. | 4523 | "Convert the orgtbl-mode TABLE to some other format. |
| 4485 | This generic routine can be used for many standard cases. | 4524 | This generic routine can be used for many standard cases. |
| @@ -4606,9 +4645,11 @@ directly by `orgtbl-send-table'. See manual." | |||
| 4606 | (remq nil *orgtbl-rtn*) | 4645 | (remq nil *orgtbl-rtn*) |
| 4607 | *orgtbl-rtn*)) "\n"))) | 4646 | *orgtbl-rtn*)) "\n"))) |
| 4608 | 4647 | ||
| 4648 | ;;;###autoload | ||
| 4609 | (defun orgtbl-to-tsv (table params) | 4649 | (defun orgtbl-to-tsv (table params) |
| 4610 | "Convert the orgtbl-mode table to TAB separated material." | 4650 | "Convert the orgtbl-mode table to TAB separated material." |
| 4611 | (orgtbl-to-generic table (org-combine-plists '(:sep "\t") params))) | 4651 | (orgtbl-to-generic table (org-combine-plists '(:sep "\t") params))) |
| 4652 | ;;;###autoload | ||
| 4612 | (defun orgtbl-to-csv (table params) | 4653 | (defun orgtbl-to-csv (table params) |
| 4613 | "Convert the orgtbl-mode table to CSV material. | 4654 | "Convert the orgtbl-mode table to CSV material. |
| 4614 | This does take care of the proper quoting of fields with comma or quotes." | 4655 | This does take care of the proper quoting of fields with comma or quotes." |
| @@ -4616,6 +4657,7 @@ This does take care of the proper quoting of fields with comma or quotes." | |||
| 4616 | '(:sep "," :fmt org-quote-csv-field) | 4657 | '(:sep "," :fmt org-quote-csv-field) |
| 4617 | params))) | 4658 | params))) |
| 4618 | 4659 | ||
| 4660 | ;;;###autoload | ||
| 4619 | (defun orgtbl-to-latex (table params) | 4661 | (defun orgtbl-to-latex (table params) |
| 4620 | "Convert the orgtbl-mode TABLE to LaTeX. | 4662 | "Convert the orgtbl-mode TABLE to LaTeX. |
| 4621 | TABLE is a list, each entry either the symbol `hline' for a horizontal | 4663 | TABLE is a list, each entry either the symbol `hline' for a horizontal |
| @@ -4654,6 +4696,7 @@ this function is called." | |||
| 4654 | :efmt "%s\\,(%s)" :hline "\\hline"))) | 4696 | :efmt "%s\\,(%s)" :hline "\\hline"))) |
| 4655 | (orgtbl-to-generic table (org-combine-plists params2 params)))) | 4697 | (orgtbl-to-generic table (org-combine-plists params2 params)))) |
| 4656 | 4698 | ||
| 4699 | ;;;###autoload | ||
| 4657 | (defun orgtbl-to-html (table params) | 4700 | (defun orgtbl-to-html (table params) |
| 4658 | "Convert the orgtbl-mode TABLE to HTML. | 4701 | "Convert the orgtbl-mode TABLE to HTML. |
| 4659 | TABLE is a list, each entry either the symbol `hline' for a horizontal | 4702 | TABLE is a list, each entry either the symbol `hline' for a horizontal |
| @@ -4684,6 +4727,7 @@ so you cannot specify parameters for it." | |||
| 4684 | (setq html (replace-match "" t t html))) | 4727 | (setq html (replace-match "" t t html))) |
| 4685 | html)) | 4728 | html)) |
| 4686 | 4729 | ||
| 4730 | ;;;###autoload | ||
| 4687 | (defun orgtbl-to-texinfo (table params) | 4731 | (defun orgtbl-to-texinfo (table params) |
| 4688 | "Convert the orgtbl-mode TABLE to TeXInfo. | 4732 | "Convert the orgtbl-mode TABLE to TeXInfo. |
| 4689 | TABLE is a list, each entry either the symbol `hline' for a horizontal | 4733 | TABLE is a list, each entry either the symbol `hline' for a horizontal |
| @@ -4722,6 +4766,7 @@ this function is called." | |||
| 4722 | :hlstart "@headitem "))) | 4766 | :hlstart "@headitem "))) |
| 4723 | (orgtbl-to-generic table (org-combine-plists params2 params)))) | 4767 | (orgtbl-to-generic table (org-combine-plists params2 params)))) |
| 4724 | 4768 | ||
| 4769 | ;;;###autoload | ||
| 4725 | (defun orgtbl-to-orgtbl (table params) | 4770 | (defun orgtbl-to-orgtbl (table params) |
| 4726 | "Convert the orgtbl-mode TABLE into another orgtbl-mode table. | 4771 | "Convert the orgtbl-mode TABLE into another orgtbl-mode table. |
| 4727 | Useful when slicing one table into many. The :hline, :sep, | 4772 | Useful when slicing one table into many. The :hline, :sep, |
| @@ -4832,4 +4877,8 @@ list of the fields in the rectangle ." | |||
| 4832 | 4877 | ||
| 4833 | (provide 'org-table) | 4878 | (provide 'org-table) |
| 4834 | 4879 | ||
| 4880 | ;; Local variables: | ||
| 4881 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 4882 | ;; End: | ||
| 4883 | |||
| 4835 | ;;; org-table.el ends here | 4884 | ;;; org-table.el ends here |
diff --git a/lisp/org/org-taskjuggler.el b/lisp/org/org-taskjuggler.el index aa645d296e8..a3de6e41239 100644 --- a/lisp/org/org-taskjuggler.el +++ b/lisp/org/org-taskjuggler.el | |||
| @@ -692,4 +692,8 @@ org-mode priority string." | |||
| 692 | 692 | ||
| 693 | (provide 'org-taskjuggler) | 693 | (provide 'org-taskjuggler) |
| 694 | 694 | ||
| 695 | ;; Local variables: | ||
| 696 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 697 | ;; End: | ||
| 698 | |||
| 695 | ;;; org-taskjuggler.el ends here | 699 | ;;; org-taskjuggler.el ends here |
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el index 92aaf1c7bb8..a314564b94a 100644 --- a/lisp/org/org-timer.el +++ b/lisp/org/org-timer.el | |||
| @@ -130,7 +130,6 @@ the region 0:00:00." | |||
| 130 | (org-timer-secs-to-hms (or delta 0))) | 130 | (org-timer-secs-to-hms (or delta 0))) |
| 131 | (run-hooks 'org-timer-start-hook)))) | 131 | (run-hooks 'org-timer-start-hook)))) |
| 132 | 132 | ||
| 133 | ;;;###autoload | ||
| 134 | (defun org-timer-pause-or-continue (&optional stop) | 133 | (defun org-timer-pause-or-continue (&optional stop) |
| 135 | "Pause or continue the relative timer. | 134 | "Pause or continue the relative timer. |
| 136 | With prefix arg STOP, stop it entirely." | 135 | With prefix arg STOP, stop it entirely." |
| @@ -157,7 +156,6 @@ With prefix arg STOP, stop it entirely." | |||
| 157 | (org-timer-set-mode-line 'pause) | 156 | (org-timer-set-mode-line 'pause) |
| 158 | (message "Timer paused at %s" (org-timer-value-string))))) | 157 | (message "Timer paused at %s" (org-timer-value-string))))) |
| 159 | 158 | ||
| 160 | ;;;###autoload | ||
| 161 | (defun org-timer-stop () | 159 | (defun org-timer-stop () |
| 162 | "Stop the relative timer." | 160 | "Stop the relative timer." |
| 163 | (interactive) | 161 | (interactive) |
| @@ -443,4 +441,8 @@ replace any running timer." | |||
| 443 | 441 | ||
| 444 | (provide 'org-timer) | 442 | (provide 'org-timer) |
| 445 | 443 | ||
| 444 | ;; Local variables: | ||
| 445 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 446 | ;; End: | ||
| 447 | |||
| 446 | ;;; org-timer.el ends here | 448 | ;;; org-timer.el ends here |
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 688947def52..564b49a5cea 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el | |||
| @@ -5,16 +5,16 @@ | |||
| 5 | (defun org-release () | 5 | (defun org-release () |
| 6 | "The release version of org-mode. | 6 | "The release version of org-mode. |
| 7 | Inserted by installing org-mode or when a release is made." | 7 | Inserted by installing org-mode or when a release is made." |
| 8 | (let ((org-release "7.9.2")) | 8 | (let ((org-release "7.9.2+")) |
| 9 | org-release)) | 9 | org-release)) |
| 10 | ;;;###autoload | 10 | ;;;###autoload |
| 11 | (defun org-git-version () | 11 | (defun org-git-version () |
| 12 | "The Git version of org-mode. | 12 | "The Git version of org-mode. |
| 13 | Inserted by installing org-mode or when a release is made." | 13 | Inserted by installing org-mode or when a release is made." |
| 14 | (let ((org-git-version "7.9.2-GNU-Emacs-24-3")) | 14 | (let ((org-git-version "7.9.2+-GNU-Emacs-24-3")) |
| 15 | org-git-version)) | 15 | org-git-version)) |
| 16 | ;;;###autoload | 16 | ;;;###autoload |
| 17 | (defconst org-odt-data-dir "/usr/share/emacs/etc/org" | 17 | (defvar org-odt-data-dir "/usr/share/emacs/etc/org" |
| 18 | "The location of ODT styles.") | 18 | "The location of ODT styles.") |
| 19 | 19 | ||
| 20 | (provide 'org-version) | 20 | (provide 'org-version) |
diff --git a/lisp/org/org-xoxo.el b/lisp/org/org-xoxo.el index ee549627a85..6ff78b56839 100644 --- a/lisp/org/org-xoxo.el +++ b/lisp/org/org-xoxo.el | |||
| @@ -122,4 +122,8 @@ The XOXO buffer is named *xoxo-<source buffer name>*" | |||
| 122 | 122 | ||
| 123 | (provide 'org-xoxo) | 123 | (provide 'org-xoxo) |
| 124 | 124 | ||
| 125 | ;; Local variables: | ||
| 126 | ;; generated-autoload-file: "org-loaddefs.el" | ||
| 127 | ;; End: | ||
| 128 | |||
| 125 | ;;; org-xoxo.el ends here | 129 | ;;; org-xoxo.el ends here |
diff --git a/lisp/org/org.el b/lisp/org/org.el index cfd86513fbc..45dbe2754e8 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el | |||
| @@ -78,6 +78,8 @@ | |||
| 78 | (require 'find-func) | 78 | (require 'find-func) |
| 79 | (require 'format-spec) | 79 | (require 'format-spec) |
| 80 | 80 | ||
| 81 | (load "org-loaddefs.el" t t) | ||
| 82 | |||
| 81 | ;; `org-outline-regexp' ought to be a defconst but is let-binding in | 83 | ;; `org-outline-regexp' ought to be a defconst but is let-binding in |
| 82 | ;; some places -- e.g. see the macro org-with-limited-levels. | 84 | ;; some places -- e.g. see the macro org-with-limited-levels. |
| 83 | ;; | 85 | ;; |
| @@ -117,8 +119,23 @@ Stars are put in group 1 and the trimmed body in group 2.") | |||
| 117 | (declare-function org-clock-timestamps-down "org-clock" ()) | 119 | (declare-function org-clock-timestamps-down "org-clock" ()) |
| 118 | (declare-function org-clock-sum-current-item "org-clock" (&optional tstart)) | 120 | (declare-function org-clock-sum-current-item "org-clock" (&optional tstart)) |
| 119 | 121 | ||
| 122 | (declare-function orgtbl-mode "org-table" (&optional arg)) | ||
| 123 | (declare-function org-clock-out "org-clock" (&optional switch-to-state fail-quietly at-time)) | ||
| 124 | (declare-function org-beamer-mode "org-beamer" ()) | ||
| 125 | (declare-function org-table-edit-field "org-table" (arg)) | ||
| 126 | (declare-function org-table-justify-field-maybe "org-table" (&optional new)) | ||
| 127 | (declare-function org-id-get-create "org-id" (&optional force)) | ||
| 128 | (declare-function org-id-find-id-file "org-id" (id)) | ||
| 129 | (declare-function org-tags-view "org-agenda" (&optional todo-only match)) | ||
| 130 | (declare-function org-agenda-list "org-agenda" (&optional arg start-day span)) | ||
| 131 | (declare-function org-table-align "org-table" ()) | ||
| 132 | (declare-function org-table-paste-rectangle "org-table" ()) | ||
| 133 | (declare-function org-table-maybe-eval-formula "org-table" ()) | ||
| 134 | (declare-function org-table-maybe-recalculate-line "org-table" ()) | ||
| 135 | |||
| 120 | ;; load languages based on value of `org-babel-load-languages' | 136 | ;; load languages based on value of `org-babel-load-languages' |
| 121 | (defvar org-babel-load-languages) | 137 | (defvar org-babel-load-languages) |
| 138 | |||
| 122 | ;;;###autoload | 139 | ;;;###autoload |
| 123 | (defun org-babel-do-load-languages (sym value) | 140 | (defun org-babel-do-load-languages (sym value) |
| 124 | "Load the languages defined in `org-babel-load-languages'." | 141 | "Load the languages defined in `org-babel-load-languages'." |
| @@ -206,6 +223,7 @@ identifier." | |||
| 206 | ;;; Version | 223 | ;;; Version |
| 207 | (require 'org-compat) | 224 | (require 'org-compat) |
| 208 | (org-check-version) | 225 | (org-check-version) |
| 226 | |||
| 209 | ;;;###autoload | 227 | ;;;###autoload |
| 210 | (defun org-version (&optional here full message) | 228 | (defun org-version (&optional here full message) |
| 211 | "Show the org-mode version in the echo area. | 229 | "Show the org-mode version in the echo area. |
| @@ -214,7 +232,7 @@ When FULL is non-nil, use a verbose version string. | |||
| 214 | When MESSAGE is non-nil, display a message with the version." | 232 | When MESSAGE is non-nil, display a message with the version." |
| 215 | (interactive "P") | 233 | (interactive "P") |
| 216 | (let* ((org-dir (ignore-errors (org-find-library-dir "org"))) | 234 | (let* ((org-dir (ignore-errors (org-find-library-dir "org"))) |
| 217 | (org-install-dir (ignore-errors (org-find-library-dir "org-install.el"))) | 235 | (org-install-dir (ignore-errors (org-find-library-dir "org-loaddefs.el"))) |
| 218 | (org-trash (or | 236 | (org-trash (or |
| 219 | (and (fboundp 'org-release) (fboundp 'org-git-version)) | 237 | (and (fboundp 'org-release) (fboundp 'org-git-version)) |
| 220 | (load (concat org-dir "org-version.el") | 238 | (load (concat org-dir "org-version.el") |
| @@ -228,7 +246,7 @@ When MESSAGE is non-nil, display a message with the version." | |||
| 228 | (if (string= org-dir org-install-dir) | 246 | (if (string= org-dir org-install-dir) |
| 229 | org-install-dir | 247 | org-install-dir |
| 230 | (concat "mixed installation! " org-install-dir " and " org-dir)) | 248 | (concat "mixed installation! " org-install-dir " and " org-dir)) |
| 231 | "org-install.el can not be found!"))) | 249 | "org-loaddefs.el can not be found!"))) |
| 232 | (_version (if full version org-version))) | 250 | (_version (if full version org-version))) |
| 233 | (if (org-called-interactively-p 'interactive) | 251 | (if (org-called-interactively-p 'interactive) |
| 234 | (if here | 252 | (if here |
| @@ -3264,13 +3282,6 @@ forth between agenda and calendar." | |||
| 3264 | :group 'org-agenda | 3282 | :group 'org-agenda |
| 3265 | :type 'sexp) | 3283 | :type 'sexp) |
| 3266 | 3284 | ||
| 3267 | (defcustom org-calendar-agenda-action-key [?k] | ||
| 3268 | "The key to be installed in `calendar-mode-map' for agenda-action. | ||
| 3269 | The command `org-agenda-action' will be bound to this key. The | ||
| 3270 | default is the character `k' because we use the same key in the agenda." | ||
| 3271 | :group 'org-agenda | ||
| 3272 | :type 'sexp) | ||
| 3273 | |||
| 3274 | (defcustom org-calendar-insert-diary-entry-key [?i] | 3285 | (defcustom org-calendar-insert-diary-entry-key [?i] |
| 3275 | "The key to be installed in `calendar-mode-map' for adding diary entries. | 3286 | "The key to be installed in `calendar-mode-map' for adding diary entries. |
| 3276 | This option is irrelevant until `org-agenda-diary-file' has been configured | 3287 | This option is irrelevant until `org-agenda-diary-file' has been configured |
| @@ -3296,8 +3307,6 @@ points to a file, `org-agenda-diary-entry' will be used instead." | |||
| 3296 | '(progn | 3307 | '(progn |
| 3297 | (org-defkey calendar-mode-map org-calendar-to-agenda-key | 3308 | (org-defkey calendar-mode-map org-calendar-to-agenda-key |
| 3298 | 'org-calendar-goto-agenda) | 3309 | 'org-calendar-goto-agenda) |
| 3299 | (org-defkey calendar-mode-map org-calendar-agenda-action-key | ||
| 3300 | 'org-agenda-action) | ||
| 3301 | (add-hook 'calendar-mode-hook | 3310 | (add-hook 'calendar-mode-hook |
| 3302 | (lambda () | 3311 | (lambda () |
| 3303 | (unless (eq org-agenda-diary-file 'diary-file) | 3312 | (unless (eq org-agenda-diary-file 'diary-file) |
| @@ -3869,30 +3878,13 @@ This works for both table types.") | |||
| 3869 | 3878 | ||
| 3870 | (eval-and-compile | 3879 | (eval-and-compile |
| 3871 | (org-autoload "org-table" | 3880 | (org-autoload "org-table" |
| 3872 | '(org-table-align org-table-begin org-table-blank-field | 3881 | '(org-table-begin org-table-blank-field org-table-end))) |
| 3873 | org-table-convert org-table-convert-region org-table-copy-down | 3882 | |
| 3874 | org-table-copy-region org-table-create | 3883 | ;;;###autoload |
| 3875 | org-table-create-or-convert-from-region | 3884 | (defun turn-on-orgtbl () |
| 3876 | org-table-create-with-table.el org-table-current-dline | 3885 | "Unconditionally turn on `orgtbl-mode'." |
| 3877 | org-table-cut-region org-table-delete-column org-table-edit-field | 3886 | (require 'org-table) |
| 3878 | org-table-edit-formulas org-table-end org-table-eval-formula | 3887 | (orgtbl-mode 1)) |
| 3879 | org-table-export org-table-field-info | ||
| 3880 | org-table-get-stored-formulas org-table-goto-column | ||
| 3881 | org-table-hline-and-move org-table-import org-table-insert-column | ||
| 3882 | org-table-insert-hline org-table-insert-row org-table-iterate | ||
| 3883 | org-table-justify-field-maybe org-table-kill-row | ||
| 3884 | org-table-maybe-eval-formula org-table-maybe-recalculate-line | ||
| 3885 | org-table-move-column org-table-move-column-left | ||
| 3886 | org-table-move-column-right org-table-move-row | ||
| 3887 | org-table-move-row-down org-table-move-row-up | ||
| 3888 | org-table-next-field org-table-next-row org-table-paste-rectangle | ||
| 3889 | org-table-previous-field org-table-recalculate | ||
| 3890 | org-table-rotate-recalc-marks org-table-sort-lines org-table-sum | ||
| 3891 | org-table-toggle-coordinate-overlays | ||
| 3892 | org-table-toggle-formula-debugger org-table-wrap-region | ||
| 3893 | orgtbl-mode turn-on-orgtbl org-table-to-lisp | ||
| 3894 | orgtbl-to-generic orgtbl-to-tsv orgtbl-to-csv orgtbl-to-latex | ||
| 3895 | orgtbl-to-orgtbl orgtbl-to-html orgtbl-to-texinfo))) | ||
| 3896 | 3888 | ||
| 3897 | (defun org-at-table-p (&optional table-type) | 3889 | (defun org-at-table-p (&optional table-type) |
| 3898 | "Return t if the cursor is inside an org-type table. | 3890 | "Return t if the cursor is inside an org-type table. |
| @@ -3971,62 +3963,14 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables." | |||
| 3971 | (declare-function org-default-export-plist "org-exp") | 3963 | (declare-function org-default-export-plist "org-exp") |
| 3972 | (declare-function org-infile-export-plist "org-exp") | 3964 | (declare-function org-infile-export-plist "org-exp") |
| 3973 | (declare-function org-get-current-options "org-exp") | 3965 | (declare-function org-get-current-options "org-exp") |
| 3974 | (eval-and-compile | ||
| 3975 | (org-autoload "org-exp" | ||
| 3976 | '(org-export org-export-visible | ||
| 3977 | org-insert-export-options-template | ||
| 3978 | org-table-clean-before-export)) | ||
| 3979 | (org-autoload "org-ascii" | ||
| 3980 | '(org-export-as-ascii org-export-ascii-preprocess | ||
| 3981 | org-export-as-ascii-to-buffer org-replace-region-by-ascii | ||
| 3982 | org-export-region-as-ascii)) | ||
| 3983 | (org-autoload "org-latex" | ||
| 3984 | '(org-export-as-latex-batch org-export-as-latex-to-buffer | ||
| 3985 | org-replace-region-by-latex org-export-region-as-latex | ||
| 3986 | org-export-as-latex org-export-as-pdf | ||
| 3987 | org-export-as-pdf-and-open)) | ||
| 3988 | (org-autoload "org-html" | ||
| 3989 | '(org-export-as-html-and-open | ||
| 3990 | org-export-as-html-batch org-export-as-html-to-buffer | ||
| 3991 | org-replace-region-by-html org-export-region-as-html | ||
| 3992 | org-export-as-html)) | ||
| 3993 | (org-autoload "org-docbook" | ||
| 3994 | '(org-export-as-docbook-batch org-export-as-docbook-to-buffer | ||
| 3995 | org-replace-region-by-docbook org-export-region-as-docbook | ||
| 3996 | org-export-as-docbook-pdf org-export-as-docbook-pdf-and-open | ||
| 3997 | org-export-as-docbook)) | ||
| 3998 | (org-autoload "org-icalendar" | ||
| 3999 | '(org-export-icalendar-this-file | ||
| 4000 | org-export-icalendar-all-agenda-files | ||
| 4001 | org-export-icalendar-combine-agenda-files)) | ||
| 4002 | (org-autoload "org-xoxo" '(org-export-as-xoxo)) | ||
| 4003 | (org-autoload "org-beamer" '(org-beamer-mode org-beamer-sectioning))) | ||
| 4004 | 3966 | ||
| 4005 | ;; Declare and autoload functions from org-agenda.el | 3967 | ;; Declare and autoload functions from org-agenda.el |
| 4006 | 3968 | ||
| 4007 | (eval-and-compile | 3969 | (eval-and-compile |
| 4008 | (org-autoload "org-agenda" | 3970 | (org-autoload "org-agenda" |
| 4009 | '(org-agenda org-agenda-list org-search-view | 3971 | '(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))) |
| 4010 | org-todo-list org-tags-view org-agenda-list-stuck-projects | ||
| 4011 | org-diary org-agenda-to-appt | ||
| 4012 | org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item))) | ||
| 4013 | |||
| 4014 | ;; Autoload org-remember | ||
| 4015 | 3972 | ||
| 4016 | (eval-and-compile | 3973 | (declare-function org-clock-save-markers-for-cut-and-paste "org-clock" (beg end)) |
| 4017 | (org-autoload "org-remember" | ||
| 4018 | '(org-remember-insinuate org-remember-annotation | ||
| 4019 | org-remember-apply-template org-remember org-remember-handler))) | ||
| 4020 | |||
| 4021 | (eval-and-compile | ||
| 4022 | (org-autoload "org-capture" | ||
| 4023 | '(org-capture org-capture-insert-template-here | ||
| 4024 | org-capture-import-remember-templates))) | ||
| 4025 | |||
| 4026 | ;; Autoload org-clock.el | ||
| 4027 | |||
| 4028 | (declare-function org-clock-save-markers-for-cut-and-paste "org-clock" | ||
| 4029 | (beg end)) | ||
| 4030 | (declare-function org-clock-update-mode-line "org-clock" ()) | 3974 | (declare-function org-clock-update-mode-line "org-clock" ()) |
| 4031 | (declare-function org-resolve-clocks "org-clock" | 3975 | (declare-function org-resolve-clocks "org-clock" |
| 4032 | (&optional also-non-dangling-p prompt last-valid)) | 3976 | (&optional also-non-dangling-p prompt last-valid)) |
| @@ -4043,55 +3987,9 @@ The return value is actually the clock marker." | |||
| 4043 | (marker-buffer org-clock-marker)) | 3987 | (marker-buffer org-clock-marker)) |
| 4044 | 3988 | ||
| 4045 | (eval-and-compile | 3989 | (eval-and-compile |
| 4046 | (org-autoload | 3990 | (org-autoload "org-clock" '(org-clock-remove-overlays |
| 4047 | "org-clock" | 3991 | org-clock-update-time-maybe |
| 4048 | '(org-clock-in org-clock-out org-clock-cancel | 3992 | org-clocktable-shift))) |
| 4049 | org-clock-goto org-clock-sum org-clock-display | ||
| 4050 | org-clock-remove-overlays org-clock-report | ||
| 4051 | org-clocktable-shift org-dblock-write:clocktable | ||
| 4052 | org-get-clocktable org-resolve-clocks))) | ||
| 4053 | |||
| 4054 | (defun org-clock-update-time-maybe () | ||
| 4055 | "If this is a CLOCK line, update it and return t. | ||
| 4056 | Otherwise, return nil." | ||
| 4057 | (interactive) | ||
| 4058 | (save-excursion | ||
| 4059 | (beginning-of-line 1) | ||
| 4060 | (skip-chars-forward " \t") | ||
| 4061 | (when (looking-at org-clock-string) | ||
| 4062 | (let ((re (concat "[ \t]*" org-clock-string | ||
| 4063 | " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]" | ||
| 4064 | "\\([ \t]*=>.*\\)?\\)?")) | ||
| 4065 | ts te h m s neg) | ||
| 4066 | (cond | ||
| 4067 | ((not (looking-at re)) | ||
| 4068 | nil) | ||
| 4069 | ((not (match-end 2)) | ||
| 4070 | (when (and (equal (marker-buffer org-clock-marker) (current-buffer)) | ||
| 4071 | (> org-clock-marker (point)) | ||
| 4072 | (<= org-clock-marker (point-at-eol))) | ||
| 4073 | ;; The clock is running here | ||
| 4074 | (setq org-clock-start-time | ||
| 4075 | (apply 'encode-time | ||
| 4076 | (org-parse-time-string (match-string 1)))) | ||
| 4077 | (org-clock-update-mode-line))) | ||
| 4078 | (t | ||
| 4079 | (and (match-end 4) (delete-region (match-beginning 4) (match-end 4))) | ||
| 4080 | (end-of-line 1) | ||
| 4081 | (setq ts (match-string 1) | ||
| 4082 | te (match-string 3)) | ||
| 4083 | (setq s (- (org-float-time | ||
| 4084 | (apply 'encode-time (org-parse-time-string te))) | ||
| 4085 | (org-float-time | ||
| 4086 | (apply 'encode-time (org-parse-time-string ts)))) | ||
| 4087 | neg (< s 0) | ||
| 4088 | s (abs s) | ||
| 4089 | h (floor (/ s 3600)) | ||
| 4090 | s (- s (* 3600 h)) | ||
| 4091 | m (floor (/ s 60)) | ||
| 4092 | s (- s (* 60 s))) | ||
| 4093 | (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m)) | ||
| 4094 | t)))))) | ||
| 4095 | 3993 | ||
| 4096 | (defun org-check-running-clock () | 3994 | (defun org-check-running-clock () |
| 4097 | "Check if the current buffer contains the running clock. | 3995 | "Check if the current buffer contains the running clock. |
| @@ -4108,44 +4006,18 @@ If yes, offer to stop it and to save the buffer with the changes." | |||
| 4108 | (when (org-match-line "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>") | 4006 | (when (org-match-line "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>") |
| 4109 | (org-clocktable-shift dir n))) | 4007 | (org-clocktable-shift dir n))) |
| 4110 | 4008 | ||
| 4111 | ;; Autoload org-timer.el | 4009 | ;;;###autoload |
| 4112 | 4010 | (defun org-clock-persistence-insinuate () | |
| 4113 | (eval-and-compile | 4011 | "Set up hooks for clock persistence." |
| 4114 | (org-autoload | 4012 | (require 'org-clock) |
| 4115 | "org-timer" | 4013 | (add-hook 'org-mode-hook 'org-clock-load) |
| 4116 | '(org-timer-start org-timer org-timer-item | 4014 | (add-hook 'kill-emacs-hook 'org-clock-save)) |
| 4117 | org-timer-change-times-in-region | ||
| 4118 | org-timer-set-timer | ||
| 4119 | org-timer-reset-timers | ||
| 4120 | org-timer-show-remaining-time))) | ||
| 4121 | |||
| 4122 | ;; Autoload org-feed.el | ||
| 4123 | |||
| 4124 | (eval-and-compile | ||
| 4125 | (org-autoload | ||
| 4126 | "org-feed" | ||
| 4127 | '(org-feed-update org-feed-update-all org-feed-goto-inbox))) | ||
| 4128 | |||
| 4129 | |||
| 4130 | ;; Autoload org-indent.el | ||
| 4131 | 4015 | ||
| 4132 | ;; Define the variable already here, to make sure we have it. | 4016 | ;; Define the variable already here, to make sure we have it. |
| 4133 | (defvar org-indent-mode nil | 4017 | (defvar org-indent-mode nil |
| 4134 | "Non-nil if Org-Indent mode is enabled. | 4018 | "Non-nil if Org-Indent mode is enabled. |
| 4135 | Use the command `org-indent-mode' to change this variable.") | 4019 | Use the command `org-indent-mode' to change this variable.") |
| 4136 | 4020 | ||
| 4137 | (eval-and-compile | ||
| 4138 | (org-autoload | ||
| 4139 | "org-indent" | ||
| 4140 | '(org-indent-mode))) | ||
| 4141 | |||
| 4142 | ;; Autoload org-mobile.el | ||
| 4143 | |||
| 4144 | (eval-and-compile | ||
| 4145 | (org-autoload | ||
| 4146 | "org-mobile" | ||
| 4147 | '(org-mobile-push org-mobile-pull org-mobile-create-sumo-agenda))) | ||
| 4148 | |||
| 4149 | ;; Autoload archiving code | 4021 | ;; Autoload archiving code |
| 4150 | ;; The stuff that is needed for cycling and tags has to be defined here. | 4022 | ;; The stuff that is needed for cycling and tags has to be defined here. |
| 4151 | 4023 | ||
| @@ -4319,10 +4191,7 @@ Otherwise, these types are allowed: | |||
| 4319 | 4191 | ||
| 4320 | (eval-and-compile | 4192 | (eval-and-compile |
| 4321 | (org-autoload "org-archive" | 4193 | (org-autoload "org-archive" |
| 4322 | '(org-add-archive-files org-archive-subtree | 4194 | '(org-add-archive-files))) |
| 4323 | org-archive-to-archive-sibling org-toggle-archive-tag | ||
| 4324 | org-archive-subtree-default | ||
| 4325 | org-archive-subtree-default-with-confirmation))) | ||
| 4326 | 4195 | ||
| 4327 | ;; Autoload Column View Code | 4196 | ;; Autoload Column View Code |
| 4328 | 4197 | ||
| @@ -4331,9 +4200,10 @@ Otherwise, these types are allowed: | |||
| 4331 | (declare-function org-columns-compute "org-colview" (property)) | 4200 | (declare-function org-columns-compute "org-colview" (property)) |
| 4332 | 4201 | ||
| 4333 | (org-autoload (if (featurep 'xemacs) "org-colview-xemacs" "org-colview") | 4202 | (org-autoload (if (featurep 'xemacs) "org-colview-xemacs" "org-colview") |
| 4334 | '(org-columns-number-to-string org-columns-get-format-and-top-level | 4203 | '(org-columns-number-to-string |
| 4335 | org-columns-compute org-agenda-columns org-columns-remove-overlays | 4204 | org-columns-get-format-and-top-level |
| 4336 | org-columns org-insert-columns-dblock org-dblock-write:columnview)) | 4205 | org-columns-compute |
| 4206 | org-columns-remove-overlays)) | ||
| 4337 | 4207 | ||
| 4338 | ;; Autoload ID code | 4208 | ;; Autoload ID code |
| 4339 | 4209 | ||
| @@ -4342,15 +4212,10 @@ Otherwise, these types are allowed: | |||
| 4342 | (declare-function org-id-locations-save "org-id") | 4212 | (declare-function org-id-locations-save "org-id") |
| 4343 | (defvar org-id-track-globally) | 4213 | (defvar org-id-track-globally) |
| 4344 | (org-autoload "org-id" | 4214 | (org-autoload "org-id" |
| 4345 | '(org-id-get-create org-id-new org-id-copy org-id-get | 4215 | '(org-id-new |
| 4346 | org-id-get-with-outline-path-completion | 4216 | org-id-copy |
| 4347 | org-id-get-with-outline-drilling org-id-store-link | 4217 | org-id-get-with-outline-path-completion |
| 4348 | org-id-goto org-id-find org-id-store-link)) | 4218 | org-id-get-with-outline-drilling)) |
| 4349 | |||
| 4350 | ;; Autoload Plotting Code | ||
| 4351 | |||
| 4352 | (org-autoload "org-plot" | ||
| 4353 | '(org-plot/gnuplot)) | ||
| 4354 | 4219 | ||
| 4355 | ;;; Variables for pre-computed regular expressions, all buffer local | 4220 | ;;; Variables for pre-computed regular expressions, all buffer local |
| 4356 | 4221 | ||
| @@ -5096,7 +4961,7 @@ The following commands are available: | |||
| 5096 | (lambda (&rest ignore) (org-show-context 'isearch)))) | 4961 | (lambda (&rest ignore) (org-show-context 'isearch)))) |
| 5097 | 4962 | ||
| 5098 | ;; Turn on org-beamer-mode? | 4963 | ;; Turn on org-beamer-mode? |
| 5099 | (and org-startup-with-beamer-mode (org-beamer-mode 1)) | 4964 | (and org-startup-with-beamer-mode (org-beamer-mode)) |
| 5100 | 4965 | ||
| 5101 | ;; Setup the pcomplete hooks | 4966 | ;; Setup the pcomplete hooks |
| 5102 | (set (make-local-variable 'pcomplete-command-completion-function) | 4967 | (set (make-local-variable 'pcomplete-command-completion-function) |
| @@ -5569,22 +5434,6 @@ by a #." | |||
| 5569 | t) | 5434 | t) |
| 5570 | (t nil)))))) | 5435 | (t nil)))))) |
| 5571 | 5436 | ||
| 5572 | (defun org-strip-protective-commas (beg end) | ||
| 5573 | "Strip protective commas between BEG and END in the current buffer." | ||
| 5574 | (interactive "r") | ||
| 5575 | (save-excursion | ||
| 5576 | (save-match-data | ||
| 5577 | (goto-char beg) | ||
| 5578 | (let ((front-line (save-excursion | ||
| 5579 | (re-search-forward | ||
| 5580 | "[^[:space:]]" end t) | ||
| 5581 | (goto-char (match-beginning 0)) | ||
| 5582 | (current-column)))) | ||
| 5583 | (while (re-search-forward "^[ \t]*\\(,\\)\\([*]\\|#\\)" end t) | ||
| 5584 | (goto-char (match-beginning 1)) | ||
| 5585 | (when (= (current-column) front-line) | ||
| 5586 | (replace-match "" nil nil nil 1))))))) | ||
| 5587 | |||
| 5588 | (defun org-activate-angle-links (limit) | 5437 | (defun org-activate-angle-links (limit) |
| 5589 | "Run through the buffer and add overlays to links." | 5438 | "Run through the buffer and add overlays to links." |
| 5590 | (if (re-search-forward org-angle-link-re limit t) | 5439 | (if (re-search-forward org-angle-link-re limit t) |
| @@ -6188,10 +6037,9 @@ and subscripts." | |||
| 6188 | (defvar org-cycle-subtree-status nil) | 6037 | (defvar org-cycle-subtree-status nil) |
| 6189 | (make-variable-buffer-local 'org-cycle-subtree-status) | 6038 | (make-variable-buffer-local 'org-cycle-subtree-status) |
| 6190 | 6039 | ||
| 6191 | ;;;###autoload | ||
| 6192 | |||
| 6193 | (defvar org-inlinetask-min-level) | 6040 | (defvar org-inlinetask-min-level) |
| 6194 | 6041 | ||
| 6042 | ;;;###autoload | ||
| 6195 | (defun org-cycle (&optional arg) | 6043 | (defun org-cycle (&optional arg) |
| 6196 | "TAB-action and visibility cycling for Org-mode. | 6044 | "TAB-action and visibility cycling for Org-mode. |
| 6197 | 6045 | ||
| @@ -9205,7 +9053,7 @@ If optional argument MERGE is set, merge TABLE into | |||
| 9205 | 9053 | ||
| 9206 | (defun org-link-unescape (str) | 9054 | (defun org-link-unescape (str) |
| 9207 | "Unhex hexified Unicode strings as returned from the JavaScript function | 9055 | "Unhex hexified Unicode strings as returned from the JavaScript function |
| 9208 | encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ö'." | 9056 | encodeURIComponent. E.g. `%C3%B6' is the german o-Umlaut." |
| 9209 | (unless (and (null str) (string= "" str)) | 9057 | (unless (and (null str) (string= "" str)) |
| 9210 | (let ((pos 0) (case-fold-search t) unhexed) | 9058 | (let ((pos 0) (case-fold-search t) unhexed) |
| 9211 | (while (setq pos (string-match "\\(%[0-9a-f][0-9a-f]\\)+" str pos)) | 9059 | (while (setq pos (string-match "\\(%[0-9a-f][0-9a-f]\\)+" str pos)) |
| @@ -9215,9 +9063,9 @@ encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ö'." | |||
| 9215 | str) | 9063 | str) |
| 9216 | 9064 | ||
| 9217 | (defun org-link-unescape-compound (hex) | 9065 | (defun org-link-unescape-compound (hex) |
| 9218 | "Unhexify Unicode hex-chars. E.g. `%C3%B6' is the German Umlaut `ö'. | 9066 | "Unhexify Unicode hex-chars. E.g. `%C3%B6' is the German o-Umlaut. |
| 9219 | Note: this function also decodes single byte encodings like | 9067 | Note: this function also decodes single byte encodings like |
| 9220 | `%E1' (\"á\") if not followed by another `%[A-F0-9]{2}' group." | 9068 | `%E1' (a-acute) if not followed by another `%[A-F0-9]{2}' group." |
| 9221 | (save-match-data | 9069 | (save-match-data |
| 9222 | (let* ((bytes (cdr (split-string hex "%"))) | 9070 | (let* ((bytes (cdr (split-string hex "%"))) |
| 9223 | (ret "") | 9071 | (ret "") |
| @@ -11028,11 +10876,13 @@ prefix argument (`C-u C-u C-u C-c C-w')." | |||
| 11028 | (and org-auto-align-tags | 10876 | (and org-auto-align-tags |
| 11029 | (let ((org-loop-over-headlines-in-active-region nil)) | 10877 | (let ((org-loop-over-headlines-in-active-region nil)) |
| 11030 | (org-set-tags nil t))) | 10878 | (org-set-tags nil t))) |
| 11031 | (bookmark-set "org-refile-last-stored") | 10879 | (with-demoted-errors |
| 10880 | (bookmark-set "org-refile-last-stored")) | ||
| 11032 | ;; If we are refiling for capture, make sure that the | 10881 | ;; If we are refiling for capture, make sure that the |
| 11033 | ;; last-capture pointers point here | 10882 | ;; last-capture pointers point here |
| 11034 | (when (org-bound-and-true-p org-refile-for-capture) | 10883 | (when (org-bound-and-true-p org-refile-for-capture) |
| 11035 | (bookmark-set "org-capture-last-stored-marker") | 10884 | (with-demoted-errors |
| 10885 | (bookmark-set "org-capture-last-stored-marker")) | ||
| 11036 | (move-marker org-capture-last-stored-marker (point))) | 10886 | (move-marker org-capture-last-stored-marker (point))) |
| 11037 | (if (fboundp 'deactivate-mark) (deactivate-mark)) | 10887 | (if (fboundp 'deactivate-mark) (deactivate-mark)) |
| 11038 | (run-hooks 'org-after-refile-insert-hook)))) | 10888 | (run-hooks 'org-after-refile-insert-hook)))) |
| @@ -11128,26 +10978,28 @@ this is used for the GOTO interface." | |||
| 11128 | (org-refile-new-child parent-target child))) | 10978 | (org-refile-new-child parent-target child))) |
| 11129 | (error "Invalid target location"))))) | 10979 | (error "Invalid target location"))))) |
| 11130 | 10980 | ||
| 11131 | (declare-function org-string-nw-p "org-macs.el" (s)) | 10981 | (declare-function org-string-nw-p "org-macs" (s)) |
| 11132 | (defun org-refile-check-position (refile-pointer) | 10982 | (defun org-refile-check-position (refile-pointer) |
| 11133 | "Check if the refile pointer matches the readline to which it points." | 10983 | "Check if the refile pointer matches the headline to which it points." |
| 11134 | (let* ((file (nth 1 refile-pointer)) | 10984 | (let* ((file (nth 1 refile-pointer)) |
| 11135 | (re (nth 2 refile-pointer)) | 10985 | (re (nth 2 refile-pointer)) |
| 11136 | (pos (nth 3 refile-pointer)) | 10986 | (pos (nth 3 refile-pointer)) |
| 11137 | buffer) | 10987 | buffer) |
| 11138 | (when (org-string-nw-p re) | 10988 | (if (and (not (markerp pos)) (not file)) |
| 11139 | (setq buffer (if (markerp pos) | 10989 | (error "Please save the buffer to a file before refiling") |
| 11140 | (marker-buffer pos) | 10990 | (when (org-string-nw-p re) |
| 11141 | (or (find-buffer-visiting file) | 10991 | (setq buffer (if (markerp pos) |
| 11142 | (find-file-noselect file)))) | 10992 | (marker-buffer pos) |
| 11143 | (with-current-buffer buffer | 10993 | (or (find-buffer-visiting file) |
| 11144 | (save-excursion | 10994 | (find-file-noselect file)))) |
| 11145 | (save-restriction | 10995 | (with-current-buffer buffer |
| 11146 | (widen) | 10996 | (save-excursion |
| 11147 | (goto-char pos) | 10997 | (save-restriction |
| 11148 | (beginning-of-line 1) | 10998 | (widen) |
| 11149 | (unless (org-looking-at-p re) | 10999 | (goto-char pos) |
| 11150 | (error "Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling")))))))) | 11000 | (beginning-of-line 1) |
| 11001 | (unless (org-looking-at-p re) | ||
| 11002 | (error "Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling"))))))))) | ||
| 11151 | 11003 | ||
| 11152 | (defun org-refile-new-child (parent-target child) | 11004 | (defun org-refile-new-child (parent-target child) |
| 11153 | "Use refile target PARENT-TARGET to add new CHILD below it." | 11005 | "Use refile target PARENT-TARGET to add new CHILD below it." |
| @@ -11337,7 +11189,6 @@ Error if there is no such block at point." | |||
| 11337 | (goto-char pos) | 11189 | (goto-char pos) |
| 11338 | (error "Not in a dynamic block")))) | 11190 | (error "Not in a dynamic block")))) |
| 11339 | 11191 | ||
| 11340 | ;;;###autoload | ||
| 11341 | (defun org-update-all-dblocks () | 11192 | (defun org-update-all-dblocks () |
| 11342 | "Update all dynamic blocks in the buffer. | 11193 | "Update all dynamic blocks in the buffer. |
| 11343 | This function can be used in a hook." | 11194 | This function can be used in a hook." |
| @@ -12821,7 +12672,7 @@ D Show deadlines and scheduled items between a date range." | |||
| 12821 | ((equal ans ?D) | 12672 | ((equal ans ?D) |
| 12822 | (call-interactively 'org-check-dates-range)) | 12673 | (call-interactively 'org-check-dates-range)) |
| 12823 | ((equal ans ?t) | 12674 | ((equal ans ?t) |
| 12824 | (org-show-todo-tree nil)) | 12675 | (call-interactively 'org-show-todo-tree)) |
| 12825 | ((equal ans ?T) | 12676 | ((equal ans ?T) |
| 12826 | (org-show-todo-tree '(4))) | 12677 | (org-show-todo-tree '(4))) |
| 12827 | ((member ans '(?T ?m)) | 12678 | ((member ans '(?T ?m)) |
| @@ -14157,7 +14008,6 @@ Returns the new tags string, or nil to not change the current settings." | |||
| 14157 | 14008 | ||
| 14158 | ;;;; The mapping API | 14009 | ;;;; The mapping API |
| 14159 | 14010 | ||
| 14160 | ;;;###autoload | ||
| 14161 | (defun org-map-entries (func &optional match scope &rest skip) | 14011 | (defun org-map-entries (func &optional match scope &rest skip) |
| 14162 | "Call FUNC at each headline selected by MATCH in SCOPE. | 14012 | "Call FUNC at each headline selected by MATCH in SCOPE. |
| 14163 | 14013 | ||
| @@ -15656,14 +15506,13 @@ user." | |||
| 15656 | 15506 | ||
| 15657 | ;; Help matching dotted european dates | 15507 | ;; Help matching dotted european dates |
| 15658 | (when (string-match | 15508 | (when (string-match |
| 15659 | "^ *\\(3[01]\\|0?[1-9]\\|[12][0-9]\\)\\. ?\\(0?[1-9]\\|1[012]\\)\\. ?\\([1-9][0-9][0-9][0-9]\\)?" ans) | 15509 | "^ *\\(3[01]\\|0?[1-9]\\|[12][0-9]\\)\\. ?\\(0?[1-9]\\|1[012]\\)\\.\\( ?[1-9][0-9]\\{3\\}\\)?" ans) |
| 15660 | (setq year (if (match-end 3) | 15510 | (setq year (if (match-end 3) (string-to-number (match-string 3 ans)) |
| 15661 | (string-to-number (match-string 3 ans)) | 15511 | (setq kill-year t) |
| 15662 | (progn (setq kill-year t) | 15512 | (string-to-number (format-time-string "%Y"))) |
| 15663 | (string-to-number (format-time-string "%Y")))) | ||
| 15664 | day (string-to-number (match-string 1 ans)) | 15513 | day (string-to-number (match-string 1 ans)) |
| 15665 | month (string-to-number (match-string 2 ans)) | 15514 | month (string-to-number (match-string 2 ans)) |
| 15666 | ans (replace-match (format "%04d-%02d-%02d\\5" year month day) | 15515 | ans (replace-match (format "%04d-%02d-%02d" year month day) |
| 15667 | t nil ans))) | 15516 | t nil ans))) |
| 15668 | 15517 | ||
| 15669 | ;; Help matching american dates, like 5/30 or 5/30/7 | 15518 | ;; Help matching american dates, like 5/30 or 5/30/7 |
| @@ -16311,7 +16160,12 @@ When PREFER is `future', return a date that is either CURRENT or future. | |||
| 16311 | When SHOW-ALL is nil, only return the current occurrence of a time stamp." | 16160 | When SHOW-ALL is nil, only return the current occurrence of a time stamp." |
| 16312 | ;; Make the proper lists from the dates | 16161 | ;; Make the proper lists from the dates |
| 16313 | (catch 'exit | 16162 | (catch 'exit |
| 16314 | (let ((a1 '(("d" . day) ("w" . week) ("m" . month) ("y" . year))) | 16163 | (let ((a1 '(("h" . hour) |
| 16164 | ("d" . day) | ||
| 16165 | ("w" . week) | ||
| 16166 | ("m" . month) | ||
| 16167 | ("y" . year))) | ||
| 16168 | (shour (nth 2 (org-parse-time-string start))) | ||
| 16315 | dn dw sday cday n1 n2 n0 | 16169 | dn dw sday cday n1 n2 n0 |
| 16316 | d m y y1 y2 date1 date2 nmonths nm ny m2) | 16170 | d m y y1 y2 date1 date2 nmonths nm ny m2) |
| 16317 | 16171 | ||
| @@ -16331,6 +16185,13 @@ When SHOW-ALL is nil, only return the current occurrence of a time stamp." | |||
| 16331 | (error "Invalid change specifier: %s" change)) | 16185 | (error "Invalid change specifier: %s" change)) |
| 16332 | (if (eq dw 'week) (setq dw 'day dn (* 7 dn))) | 16186 | (if (eq dw 'week) (setq dw 'day dn (* 7 dn))) |
| 16333 | (cond | 16187 | (cond |
| 16188 | ((eq dw 'hour) | ||
| 16189 | (let ((missing-hours | ||
| 16190 | (mod (+ (- (* 24 (- cday sday)) shour) org-extend-today-until) | ||
| 16191 | dn))) | ||
| 16192 | (setq n1 (if (zerop missing-hours) cday | ||
| 16193 | (- cday (1+ (floor (/ missing-hours 24))))) | ||
| 16194 | n2 (+ cday (floor (/ (- dn missing-hours) 24)))))) | ||
| 16334 | ((eq dw 'day) | 16195 | ((eq dw 'day) |
| 16335 | (setq n1 (+ sday (* dn (floor (/ (- cday sday) dn)))) | 16196 | (setq n1 (+ sday (* dn (floor (/ (- cday sday) dn)))) |
| 16336 | n2 (+ n1 dn))) | 16197 | n2 (+ n1 dn))) |
| @@ -16993,7 +16854,9 @@ end of the list." | |||
| 16993 | (file-alist (mapcar (lambda (x) | 16854 | (file-alist (mapcar (lambda (x) |
| 16994 | (cons (file-truename x) x)) | 16855 | (cons (file-truename x) x)) |
| 16995 | (org-agenda-files t))) | 16856 | (org-agenda-files t))) |
| 16996 | (ctf (file-truename buffer-file-name)) | 16857 | (ctf (file-truename |
| 16858 | (or buffer-file-name | ||
| 16859 | (error "Please save the current buffer to a file")))) | ||
| 16997 | x had) | 16860 | x had) |
| 16998 | (setq x (assoc ctf file-alist) had x) | 16861 | (setq x (assoc ctf file-alist) had x) |
| 16999 | 16862 | ||
| @@ -17012,7 +16875,8 @@ These are the files which are being checked for agenda entries. | |||
| 17012 | Optional argument FILE means use this file instead of the current." | 16875 | Optional argument FILE means use this file instead of the current." |
| 17013 | (interactive) | 16876 | (interactive) |
| 17014 | (let* ((org-agenda-skip-unavailable-files nil) | 16877 | (let* ((org-agenda-skip-unavailable-files nil) |
| 17015 | (file (or file buffer-file-name)) | 16878 | (file (or file buffer-file-name |
| 16879 | (error "Current buffer does not visit a file"))) | ||
| 17016 | (true-file (file-truename file)) | 16880 | (true-file (file-truename file)) |
| 17017 | (afile (abbreviate-file-name file)) | 16881 | (afile (abbreviate-file-name file)) |
| 17018 | (files (delq nil (mapcar | 16882 | (files (delq nil (mapcar |
| @@ -17034,7 +16898,7 @@ Optional argument FILE means use this file instead of the current." | |||
| 17034 | (defun org-check-agenda-file (file) | 16898 | (defun org-check-agenda-file (file) |
| 17035 | "Make sure FILE exists. If not, ask user what to do." | 16899 | "Make sure FILE exists. If not, ask user what to do." |
| 17036 | (when (not (file-exists-p file)) | 16900 | (when (not (file-exists-p file)) |
| 17037 | (message "non-existent agenda file %s. [R]emove from list or [A]bort?" | 16901 | (message "Non-existent agenda file %s. [R]emove from list or [A]bort?" |
| 17038 | (abbreviate-file-name file)) | 16902 | (abbreviate-file-name file)) |
| 17039 | (let ((r (downcase (read-char-exclusive)))) | 16903 | (let ((r (downcase (read-char-exclusive)))) |
| 17040 | (cond | 16904 | (cond |
| @@ -18113,7 +17977,6 @@ BEG and END default to the buffer boundaries." | |||
| 18113 | (org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree) | 17977 | (org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree) |
| 18114 | ;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree) | 17978 | ;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree) |
| 18115 | 17979 | ||
| 18116 | (org-defkey org-mode-map "\C-c\C-x\C-k" 'org-mark-entry-for-agenda-action) | ||
| 18117 | (org-defkey org-mode-map "\C-c\C-x\C-w" 'org-cut-special) | 17980 | (org-defkey org-mode-map "\C-c\C-x\C-w" 'org-cut-special) |
| 18118 | (org-defkey org-mode-map "\C-c\C-x\M-w" 'org-copy-special) | 17981 | (org-defkey org-mode-map "\C-c\C-x\M-w" 'org-copy-special) |
| 18119 | (org-defkey org-mode-map "\C-c\C-x\C-y" 'org-paste-special) | 17982 | (org-defkey org-mode-map "\C-c\C-x\C-y" 'org-paste-special) |
| @@ -18801,13 +18664,12 @@ this function returns t, nil otherwise." | |||
| 18801 | nil)))) | 18664 | nil)))) |
| 18802 | 18665 | ||
| 18803 | (autoload 'org-element-at-point "org-element") | 18666 | (autoload 'org-element-at-point "org-element") |
| 18667 | (autoload 'org-element-type "org-element") | ||
| 18804 | 18668 | ||
| 18805 | (declare-function org-element-at-point "org-element" (&optional keep-trail)) | 18669 | (declare-function org-element-at-point "org-element" (&optional keep-trail)) |
| 18806 | (declare-function org-element-type "org-element" (element)) | 18670 | (declare-function org-element-type "org-element" (element)) |
| 18807 | (declare-function org-element-context "org-element" ()) | ||
| 18808 | (declare-function org-element-contents "org-element" (element)) | 18671 | (declare-function org-element-contents "org-element" (element)) |
| 18809 | (declare-function org-element-property "org-element" (property element)) | 18672 | (declare-function org-element-property "org-element" (property element)) |
| 18810 | (declare-function org-element-paragraph-parser "org-element" (limit)) | ||
| 18811 | (declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion)) | 18673 | (declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion)) |
| 18812 | (declare-function org-element-nested-p "org-element" (elem-a elem-b)) | 18674 | (declare-function org-element-nested-p "org-element" (elem-a elem-b)) |
| 18813 | (declare-function org-element-swap-A-B "org-element" (elem-a elem-b)) | 18675 | (declare-function org-element-swap-A-B "org-element" (elem-a elem-b)) |
| @@ -19985,7 +19847,6 @@ Your bug report will be posted to the Org-mode mailing list. | |||
| 19985 | 19847 | ||
| 19986 | ;;;; Documentation | 19848 | ;;;; Documentation |
| 19987 | 19849 | ||
| 19988 | ;;;###autoload | ||
| 19989 | (defun org-require-autoloaded-modules () | 19850 | (defun org-require-autoloaded-modules () |
| 19990 | (interactive) | 19851 | (interactive) |
| 19991 | (mapc 'require | 19852 | (mapc 'require |
| @@ -20813,20 +20674,6 @@ returns the current time." | |||
| 20813 | (nth 2 date)))))) | 20674 | (nth 2 date)))))) |
| 20814 | (or defd (current-time)))) | 20675 | (or defd (current-time)))) |
| 20815 | 20676 | ||
| 20816 | (defvar org-agenda-action-marker (make-marker) | ||
| 20817 | "Marker pointing to the entry for the next agenda action.") | ||
| 20818 | |||
| 20819 | (defun org-mark-entry-for-agenda-action () | ||
| 20820 | "Mark the current entry as target of an agenda action. | ||
| 20821 | Agenda actions are actions executed from the agenda with the key `k', | ||
| 20822 | which make use of the date at the cursor." | ||
| 20823 | (interactive) | ||
| 20824 | (move-marker org-agenda-action-marker | ||
| 20825 | (save-excursion (org-back-to-heading t) (point)) | ||
| 20826 | (current-buffer)) | ||
| 20827 | (message | ||
| 20828 | "Entry marked for action; press `k' at desired date in agenda or calendar")) | ||
| 20829 | |||
| 20830 | (defun org-mark-subtree (&optional up) | 20677 | (defun org-mark-subtree (&optional up) |
| 20831 | "Mark the current subtree. | 20678 | "Mark the current subtree. |
| 20832 | This puts point at the start of the current subtree, and mark at | 20679 | This puts point at the start of the current subtree, and mark at |
| @@ -21224,7 +21071,10 @@ a footnote definition, try to fill the first paragraph within." | |||
| 21224 | ;; Check if auto-filling is meaningful. | 21071 | ;; Check if auto-filling is meaningful. |
| 21225 | (let ((fc (current-fill-column))) | 21072 | (let ((fc (current-fill-column))) |
| 21226 | (when (and fc (> (current-column) fc)) | 21073 | (when (and fc (> (current-column) fc)) |
| 21227 | (let ((fill-prefix (org-adaptive-fill-function))) | 21074 | (let* ((fill-prefix (org-adaptive-fill-function)) |
| 21075 | ;; Enforce empty fill prefix, if required. Otherwise, it | ||
| 21076 | ;; will be computed again. | ||
| 21077 | (adaptive-fill-mode (not (equal fill-prefix "")))) | ||
| 21228 | (when fill-prefix (do-auto-fill)))))) | 21078 | (when fill-prefix (do-auto-fill)))))) |
| 21229 | 21079 | ||
| 21230 | (defun org-comment-line-break-function (&optional soft) | 21080 | (defun org-comment-line-break-function (&optional soft) |
| @@ -21475,45 +21325,43 @@ beyond the end of the headline." | |||
| 21475 | 21325 | ||
| 21476 | (defun org-end-of-line (&optional arg) | 21326 | (defun org-end-of-line (&optional arg) |
| 21477 | "Go to the end of the line. | 21327 | "Go to the end of the line. |
| 21478 | If this is a headline, and `org-special-ctrl-a/e' is set, ignore tags on the | 21328 | If this is a headline, and `org-special-ctrl-a/e' is set, ignore |
| 21479 | first attempt, and only move to after the tags when the cursor is already | 21329 | tags on the first attempt, and only move to after the tags when |
| 21480 | beyond the end of the headline." | 21330 | the cursor is already beyond the end of the headline." |
| 21481 | (interactive "P") | 21331 | (interactive "P") |
| 21482 | (let ((special (if (consp org-special-ctrl-a/e) | 21332 | (let ((special (if (consp org-special-ctrl-a/e) (cdr org-special-ctrl-a/e) |
| 21483 | (cdr org-special-ctrl-a/e) | 21333 | org-special-ctrl-a/e)) |
| 21484 | org-special-ctrl-a/e))) | 21334 | (type (org-element-type |
| 21335 | (save-excursion (beginning-of-line) (org-element-at-point))))) | ||
| 21485 | (cond | 21336 | (cond |
| 21486 | ((or (not special) arg | 21337 | ((or (not special) arg) |
| 21487 | (not (or (org-at-heading-p) (org-at-item-p) (org-at-drawer-p)))) | ||
| 21488 | (call-interactively | 21338 | (call-interactively |
| 21489 | (cond ((org-bound-and-true-p line-move-visual) 'end-of-visual-line) | 21339 | (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line))) |
| 21490 | ((fboundp 'move-end-of-line) 'move-end-of-line) | 21340 | ((memq type '(headline inlinetask)) |
| 21491 | (t 'end-of-line)))) | ||
| 21492 | ((org-at-heading-p) | ||
| 21493 | (let ((pos (point))) | 21341 | (let ((pos (point))) |
| 21494 | (beginning-of-line 1) | 21342 | (beginning-of-line 1) |
| 21495 | (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\)?$")) | 21343 | (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\)?$")) |
| 21496 | (if (eq special t) | 21344 | (if (eq special t) |
| 21497 | (if (or (< pos (match-beginning 1)) | 21345 | (if (or (< pos (match-beginning 1)) (= pos (match-end 0))) |
| 21498 | (= pos (match-end 0))) | 21346 | (goto-char (match-beginning 1)) |
| 21499 | (goto-char (match-beginning 1)) | 21347 | (goto-char (match-end 0))) |
| 21500 | (goto-char (match-end 0))) | 21348 | (if (or (< pos (match-end 0)) |
| 21501 | (if (or (< pos (match-end 0)) (not (eq this-command last-command))) | 21349 | (not (eq this-command last-command))) |
| 21502 | (goto-char (match-end 0)) | 21350 | (goto-char (match-end 0)) |
| 21503 | (goto-char (match-beginning 1)))) | 21351 | (goto-char (match-beginning 1)))) |
| 21504 | (call-interactively (if (fboundp 'move-end-of-line) | 21352 | (call-interactively |
| 21505 | 'move-end-of-line | 21353 | (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line))))) |
| 21506 | 'end-of-line))))) | 21354 | ((memq type |
| 21507 | ((org-at-drawer-p) | 21355 | '(center-block comment-block drawer dynamic-block example-block |
| 21508 | (move-end-of-line 1) | 21356 | export-block item plain-list property-drawer |
| 21509 | (when (overlays-at (1- (point))) (backward-char 1))) | 21357 | quote-block special-block src-block verse-block)) |
| 21510 | ;; At an item: Move before any hidden text. | 21358 | ;; Never move past the ellipsis. |
| 21511 | (t (call-interactively | 21359 | (or (eolp) (move-end-of-line 1)) |
| 21512 | (cond ((org-bound-and-true-p line-move-visual) 'end-of-visual-line) | 21360 | (when (org-invisible-p2) (backward-char))) |
| 21513 | ((fboundp 'move-end-of-line) 'move-end-of-line) | 21361 | (t |
| 21514 | (t 'end-of-line))))) | 21362 | (call-interactively |
| 21515 | (org-no-warnings | 21363 | (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line)))) |
| 21516 | (and (featurep 'xemacs) (setq zmacs-region-stays t))))) | 21364 | (org-no-warnings (and (featurep 'xemacs) (setq zmacs-region-stays t))))) |
| 21517 | 21365 | ||
| 21518 | (define-key org-mode-map "\C-a" 'org-beginning-of-line) | 21366 | (define-key org-mode-map "\C-a" 'org-beginning-of-line) |
| 21519 | (define-key org-mode-map "\C-e" 'org-end-of-line) | 21367 | (define-key org-mode-map "\C-e" 'org-end-of-line) |
| @@ -21966,7 +21814,6 @@ Stop at the first and last subheadings of a superior heading." | |||
| 21966 | (if (< l level) (setq arg 1))) | 21814 | (if (< l level) (setq arg 1))) |
| 21967 | (setq arg (1- arg))))) | 21815 | (setq arg (1- arg))))) |
| 21968 | 21816 | ||
| 21969 | ;;;###autoload | ||
| 21970 | (defun org-forward-element () | 21817 | (defun org-forward-element () |
| 21971 | "Move forward by one element. | 21818 | "Move forward by one element. |
| 21972 | Move to the next element at the same level, when possible." | 21819 | Move to the next element at the same level, when possible." |
| @@ -21986,7 +21833,6 @@ Move to the next element at the same level, when possible." | |||
| 21986 | (goto-char (org-element-property :end parent)) | 21833 | (goto-char (org-element-property :end parent)) |
| 21987 | (goto-char end)))))) | 21834 | (goto-char end)))))) |
| 21988 | 21835 | ||
| 21989 | ;;;###autoload | ||
| 21990 | (defun org-backward-element () | 21836 | (defun org-backward-element () |
| 21991 | "Move backward by one element. | 21837 | "Move backward by one element. |
| 21992 | Move to the previous element at the same level, when possible." | 21838 | Move to the previous element at the same level, when possible." |
| @@ -22013,7 +21859,6 @@ Move to the previous element at the same level, when possible." | |||
| 22013 | ((org-before-first-heading-p) (goto-char (point-min))) | 21859 | ((org-before-first-heading-p) (goto-char (point-min))) |
| 22014 | (t (org-back-to-heading))))))) | 21860 | (t (org-back-to-heading))))))) |
| 22015 | 21861 | ||
| 22016 | ;;;###autoload | ||
| 22017 | (defun org-up-element () | 21862 | (defun org-up-element () |
| 22018 | "Move to upper element." | 21863 | "Move to upper element." |
| 22019 | (interactive) | 21864 | (interactive) |
| @@ -22026,7 +21871,6 @@ Move to the previous element at the same level, when possible." | |||
| 22026 | (error "No surrounding element") | 21871 | (error "No surrounding element") |
| 22027 | (org-with-limited-levels (org-back-to-heading))))))) | 21872 | (org-with-limited-levels (org-back-to-heading))))))) |
| 22028 | 21873 | ||
| 22029 | ;;;###autoload | ||
| 22030 | (defvar org-element-greater-elements) | 21874 | (defvar org-element-greater-elements) |
| 22031 | (defun org-down-element () | 21875 | (defun org-down-element () |
| 22032 | "Move to inner element." | 21876 | "Move to inner element." |
| @@ -22043,7 +21887,6 @@ Move to the previous element at the same level, when possible." | |||
| 22043 | (error "No content for this element")))) | 21887 | (error "No content for this element")))) |
| 22044 | (t (error "No inner element"))))) | 21888 | (t (error "No inner element"))))) |
| 22045 | 21889 | ||
| 22046 | ;;;###autoload | ||
| 22047 | (defun org-drag-element-backward () | 21890 | (defun org-drag-element-backward () |
| 22048 | "Move backward element at point." | 21891 | "Move backward element at point." |
| 22049 | (interactive) | 21892 | (interactive) |
| @@ -22060,7 +21903,6 @@ Move to the previous element at the same level, when possible." | |||
| 22060 | (goto-char (+ (org-element-property :begin prev-elem) | 21903 | (goto-char (+ (org-element-property :begin prev-elem) |
| 22061 | (- pos (org-element-property :begin elem))))))))) | 21904 | (- pos (org-element-property :begin elem))))))))) |
| 22062 | 21905 | ||
| 22063 | ;;;###autoload | ||
| 22064 | (defun org-drag-element-forward () | 21906 | (defun org-drag-element-forward () |
| 22065 | "Move forward element at point." | 21907 | "Move forward element at point." |
| 22066 | (interactive) | 21908 | (interactive) |
| @@ -22095,7 +21937,6 @@ Move to the previous element at the same level, when possible." | |||
| 22095 | (org-element-swap-A-B elem next-elem) | 21937 | (org-element-swap-A-B elem next-elem) |
| 22096 | (goto-char (+ pos size-next size-blank)))))) | 21938 | (goto-char (+ pos size-next size-blank)))))) |
| 22097 | 21939 | ||
| 22098 | ;;;###autoload | ||
| 22099 | (defun org-mark-element () | 21940 | (defun org-mark-element () |
| 22100 | "Put point at beginning of this element, mark at end. | 21941 | "Put point at beginning of this element, mark at end. |
| 22101 | 21942 | ||
| @@ -22116,7 +21957,6 @@ ones already marked." | |||
| 22116 | (push-mark (org-element-property :end element) t t) | 21957 | (push-mark (org-element-property :end element) t t) |
| 22117 | (goto-char (org-element-property :begin element)))))) | 21958 | (goto-char (org-element-property :begin element)))))) |
| 22118 | 21959 | ||
| 22119 | ;;;###autoload | ||
| 22120 | (defun org-narrow-to-element () | 21960 | (defun org-narrow-to-element () |
| 22121 | "Narrow buffer to current element." | 21961 | "Narrow buffer to current element." |
| 22122 | (interactive) | 21962 | (interactive) |
| @@ -22135,7 +21975,6 @@ ones already marked." | |||
| 22135 | (org-element-property :begin elem) | 21975 | (org-element-property :begin elem) |
| 22136 | (org-element-property :end elem)))))) | 21976 | (org-element-property :end elem)))))) |
| 22137 | 21977 | ||
| 22138 | ;;;###autoload | ||
| 22139 | (defun org-transpose-element () | 21978 | (defun org-transpose-element () |
| 22140 | "Transpose current and previous elements, keeping blank lines between. | 21979 | "Transpose current and previous elements, keeping blank lines between. |
| 22141 | Point is moved after both elements." | 21980 | Point is moved after both elements." |
| @@ -22145,7 +21984,6 @@ Point is moved after both elements." | |||
| 22145 | (org-drag-element-backward) | 21984 | (org-drag-element-backward) |
| 22146 | (goto-char end))) | 21985 | (goto-char end))) |
| 22147 | 21986 | ||
| 22148 | ;;;###autoload | ||
| 22149 | (defun org-unindent-buffer () | 21987 | (defun org-unindent-buffer () |
| 22150 | "Un-indent the visible part of the buffer. | 21988 | "Un-indent the visible part of the buffer. |
| 22151 | Relative indentation (between items, inside blocks, etc.) isn't | 21989 | Relative indentation (between items, inside blocks, etc.) isn't |
diff --git a/lisp/profiler.el b/lisp/profiler.el index e9261eb1af7..38c0c0b83a7 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el | |||
| @@ -353,7 +353,9 @@ this variable directly.") | |||
| 353 | (propertize (symbol-name entry) | 353 | (propertize (symbol-name entry) |
| 354 | 'face 'link | 354 | 'face 'link |
| 355 | 'mouse-face 'highlight | 355 | 'mouse-face 'highlight |
| 356 | 'help-echo "mouse-2 or RET jumps to definition")) | 356 | 'help-echo "\ |
| 357 | mouse-2: jump to definition\n\ | ||
| 358 | RET: expand or collapse")) | ||
| 357 | (t | 359 | (t |
| 358 | (profiler-format-entry entry))))) | 360 | (profiler-format-entry entry))))) |
| 359 | (propertize string 'profiler-entry entry))) | 361 | (propertize string 'profiler-entry entry))) |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 10fd7a75eaa..06525b354b1 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -1568,12 +1568,20 @@ Returns the compilation buffer created." | |||
| 1568 | ;; Then evaluate a cd command if any, but don't perform it yet, else | 1568 | ;; Then evaluate a cd command if any, but don't perform it yet, else |
| 1569 | ;; start-command would do it again through the shell: (cd "..") AND | 1569 | ;; start-command would do it again through the shell: (cd "..") AND |
| 1570 | ;; sh -c "cd ..; make" | 1570 | ;; sh -c "cd ..; make" |
| 1571 | (cd (if (string-match "\\`\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" | 1571 | (cd (cond |
| 1572 | command) | 1572 | ((not (string-match "\\`\\s *cd\\(?:\\s +\\(\\S +?\\|'[^']*'\\|\"\\(?:[^\"`$\\]\\|\\\\.\\)*\"\\)\\)?\\s *[;&\n]" |
| 1573 | (if (match-end 1) | 1573 | command)) |
| 1574 | (substitute-env-vars (match-string 1 command)) | 1574 | default-directory) |
| 1575 | "~") | 1575 | ((not (match-end 1)) "~") |
| 1576 | default-directory)) | 1576 | ((eq (aref command (match-beginning 1)) ?\') |
| 1577 | (substring command (1+ (match-beginning 1)) | ||
| 1578 | (1- (match-end 1)))) | ||
| 1579 | ((eq (aref command (match-beginning 1)) ?\") | ||
| 1580 | (replace-regexp-in-string | ||
| 1581 | "\\\\\\(.\\)" "\\1" | ||
| 1582 | (substring command (1+ (match-beginning 1)) | ||
| 1583 | (1- (match-end 1))))) | ||
| 1584 | (t (substitute-env-vars (match-string 1 command))))) | ||
| 1577 | (erase-buffer) | 1585 | (erase-buffer) |
| 1578 | ;; Select the desired mode. | 1586 | ;; Select the desired mode. |
| 1579 | (if (not (eq mode t)) | 1587 | (if (not (eq mode t)) |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 719471278a8..13eac8392a2 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -148,7 +148,8 @@ Used to gray out relevant toolbar icons.") | |||
| 148 | ([run] menu-item "Run" gud-run | 148 | ([run] menu-item "Run" gud-run |
| 149 | :enable (not gud-running) | 149 | :enable (not gud-running) |
| 150 | :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb))) | 150 | :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb))) |
| 151 | ([go] menu-item (if gdb-active-process "Continue" "Run") gud-go | 151 | ([go] menu-item (if (bound-and-true-p gdb-active-process) |
| 152 | "Continue" "Run") gud-go | ||
| 152 | :visible (and (eq gud-minor-mode 'gdbmi) | 153 | :visible (and (eq gud-minor-mode 'gdbmi) |
| 153 | (gdb-show-run-p))) | 154 | (gdb-show-run-p))) |
| 154 | ([stop] menu-item "Stop" gud-stop-subjob | 155 | ([stop] menu-item "Stop" gud-stop-subjob |
| @@ -178,7 +179,7 @@ Used to gray out relevant toolbar icons.") | |||
| 178 | '(gdbmi gdb dbx xdb jdb pdb))) | 179 | '(gdbmi gdb dbx xdb jdb pdb))) |
| 179 | ([pp] menu-item "Print S-expression" gud-pp | 180 | ([pp] menu-item "Print S-expression" gud-pp |
| 180 | :enable (and (not gud-running) | 181 | :enable (and (not gud-running) |
| 181 | gdb-active-process) | 182 | (bound-and-true-p gdb-active-process)) |
| 182 | :visible (and (string-equal | 183 | :visible (and (string-equal |
| 183 | (buffer-local-value | 184 | (buffer-local-value |
| 184 | 'gud-target-name gud-comint-buffer) "emacs") | 185 | 'gud-target-name gud-comint-buffer) "emacs") |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 06ded5fb53d..daa83620051 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1033,51 +1033,57 @@ subshells can nest." | |||
| 1033 | (defun sh-font-lock-paren (start) | 1033 | (defun sh-font-lock-paren (start) |
| 1034 | (unless (nth 8 (syntax-ppss)) | 1034 | (unless (nth 8 (syntax-ppss)) |
| 1035 | (save-excursion | 1035 | (save-excursion |
| 1036 | (goto-char start) | 1036 | (let ((open nil)) |
| 1037 | ;; Skip through all patterns | 1037 | (goto-char start) |
| 1038 | (while | 1038 | ;; Skip through all patterns |
| 1039 | (progn | 1039 | (while |
| 1040 | (while | 1040 | (progn |
| 1041 | (progn | 1041 | (while |
| 1042 | (forward-comment (- (point-max))) | 1042 | (progn |
| 1043 | (when (and (eolp) (sh-is-quoted-p (point))) | 1043 | (forward-comment (- (point-max))) |
| 1044 | (forward-char -1) | 1044 | (when (and (eolp) (sh-is-quoted-p (point))) |
| 1045 | t))) | 1045 | (forward-char -1) |
| 1046 | ;; Skip through one pattern | 1046 | t))) |
| 1047 | (while | 1047 | ;; Skip through one pattern |
| 1048 | (or (/= 0 (skip-syntax-backward "w_")) | 1048 | (while |
| 1049 | (/= 0 (skip-chars-backward "-$=?[]*@/\\\\")) | 1049 | (or (/= 0 (skip-syntax-backward "w_")) |
| 1050 | (and (sh-is-quoted-p (1- (point))) | 1050 | (/= 0 (skip-chars-backward "-$=?[]*@/\\\\")) |
| 1051 | (goto-char (- (point) 2))) | 1051 | (and (sh-is-quoted-p (1- (point))) |
| 1052 | (when (memq (char-before) '(?\" ?\' ?\})) | 1052 | (goto-char (- (point) 2))) |
| 1053 | (condition-case nil (progn (backward-sexp 1) t) | 1053 | (when (memq (char-before) '(?\" ?\' ?\})) |
| 1054 | (error nil))))) | 1054 | (condition-case nil (progn (backward-sexp 1) t) |
| 1055 | ;; Patterns can be preceded by an open-paren (Bug#1320). | 1055 | (error nil))))) |
| 1056 | (if (eq (char-before (point)) ?\() | 1056 | ;; Patterns can be preceded by an open-paren (bug#1320). |
| 1057 | (when (eq (char-before (point)) ?\() | ||
| 1058 | (backward-char 1) | ||
| 1059 | (setq open (point))) | ||
| 1060 | (while (progn | ||
| 1061 | (forward-comment (- (point-max))) | ||
| 1062 | ;; Maybe we've bumped into an escaped newline. | ||
| 1063 | (sh-is-quoted-p (point))) | ||
| 1057 | (backward-char 1)) | 1064 | (backward-char 1)) |
| 1058 | (while (progn | 1065 | (when (eq (char-before) ?|) |
| 1059 | (forward-comment (- (point-max))) | 1066 | (backward-char 1) t))) |
| 1060 | ;; Maybe we've bumped into an escaped newline. | 1067 | (and (> (point) (1+ (point-min))) |
| 1061 | (sh-is-quoted-p (point))) | 1068 | (progn (backward-char 2) |
| 1062 | (backward-char 1)) | 1069 | (if (> start (line-end-position)) |
| 1063 | (when (eq (char-before) ?|) | 1070 | (put-text-property (point) (1+ start) |
| 1064 | (backward-char 1) t))) | 1071 | 'syntax-multiline t)) |
| 1065 | (and (> (point) (1+ (point-min))) | 1072 | ;; FIXME: The `in' may just be a random argument to |
| 1066 | (progn (backward-char 2) | 1073 | ;; a normal command rather than the real `in' keyword. |
| 1067 | (if (> start (line-end-position)) | 1074 | ;; I.e. we should look back to try and find the |
| 1068 | (put-text-property (point) (1+ start) | 1075 | ;; corresponding `case'. |
| 1069 | 'syntax-multiline t)) | 1076 | (and (looking-at ";[;&]\\|\\_<in") |
| 1070 | ;; FIXME: The `in' may just be a random argument to | 1077 | ;; ";; esac )" is a case that looks |
| 1071 | ;; a normal command rather than the real `in' keyword. | 1078 | ;; like a case-pattern but it's really just a close |
| 1072 | ;; I.e. we should look back to try and find the | 1079 | ;; paren after a case statement. I.e. if we skipped |
| 1073 | ;; corresponding `case'. | 1080 | ;; over `esac' just now, we're not looking |
| 1074 | (and (looking-at ";[;&]\\|\\_<in") | 1081 | ;; at a case-pattern. |
| 1075 | ;; ";; esac )" is a case that looks like a case-pattern | 1082 | (not (looking-at "..[ \t\n]+esac[^[:word:]_]")))) |
| 1076 | ;; but it's really just a close paren after a case | 1083 | (progn |
| 1077 | ;; statement. I.e. if we skipped over `esac' just now, | 1084 | (when open |
| 1078 | ;; we're not looking at a case-pattern. | 1085 | (put-text-property open (1+ open) 'syntax-table sh-st-punc)) |
| 1079 | (not (looking-at "..[ \t\n]+esac[^[:word:]_]")))) | 1086 | sh-st-punc)))))) |
| 1080 | sh-st-punc)))) | ||
| 1081 | 1087 | ||
| 1082 | (defun sh-font-lock-backslash-quote () | 1088 | (defun sh-font-lock-backslash-quote () |
| 1083 | (if (eq (save-excursion (nth 3 (syntax-ppss (match-beginning 0)))) ?\') | 1089 | (if (eq (save-excursion (nth 3 (syntax-ppss (match-beginning 0)))) ?\') |
| @@ -1629,7 +1635,8 @@ before the newline and in that case point should be just before the token." | |||
| 1629 | (cmd "|" cmd) (cmd "|&" cmd) | 1635 | (cmd "|" cmd) (cmd "|&" cmd) |
| 1630 | (cmd "&&" cmd) (cmd "||" cmd) | 1636 | (cmd "&&" cmd) (cmd "||" cmd) |
| 1631 | (cmd ";" cmd) (cmd "&" cmd)) | 1637 | (cmd ";" cmd) (cmd "&" cmd)) |
| 1632 | (pattern (pattern "|" pattern)) | 1638 | (rpattern (rpattern "|" rpattern)) |
| 1639 | (pattern (rpattern) ("case-(" rpattern)) | ||
| 1633 | (branches (branches ";;" branches) | 1640 | (branches (branches ";;" branches) |
| 1634 | (branches ";&" branches) (branches ";;&" branches) ;bash. | 1641 | (branches ";&" branches) (branches ";;&" branches) ;bash. |
| 1635 | (pattern "case-)" cmd))) | 1642 | (pattern "case-)" cmd))) |
| @@ -1715,6 +1722,7 @@ Does not preserve point." | |||
| 1715 | (tok (smie-default-forward-token))) | 1722 | (tok (smie-default-forward-token))) |
| 1716 | (cond | 1723 | (cond |
| 1717 | ((equal tok ")") "case-)") | 1724 | ((equal tok ")") "case-)") |
| 1725 | ((equal tok "(") "case-(") | ||
| 1718 | ((and tok (string-match "\\`[a-z]" tok) | 1726 | ((and tok (string-match "\\`[a-z]" tok) |
| 1719 | (assoc tok smie-grammar) | 1727 | (assoc tok smie-grammar) |
| 1720 | (not | 1728 | (not |
| @@ -1759,6 +1767,7 @@ Does not preserve point." | |||
| 1759 | (let ((tok (smie-default-backward-token))) | 1767 | (let ((tok (smie-default-backward-token))) |
| 1760 | (cond | 1768 | (cond |
| 1761 | ((equal tok ")") "case-)") | 1769 | ((equal tok ")") "case-)") |
| 1770 | ((equal tok "(") "case-(") | ||
| 1762 | ((and tok (string-match "\\`[a-z]" tok) | 1771 | ((and tok (string-match "\\`[a-z]" tok) |
| 1763 | (assoc tok smie-grammar) | 1772 | (assoc tok smie-grammar) |
| 1764 | (not (save-excursion (sh-smie--sh-keyword-p tok)))) | 1773 | (not (save-excursion (sh-smie--sh-keyword-p tok)))) |
diff --git a/lisp/repeat.el b/lisp/repeat.el index e38442a434b..a6c803ae773 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el | |||
| @@ -289,6 +289,10 @@ recently executed command not bound to an input event\"." | |||
| 289 | (interactive) | 289 | (interactive) |
| 290 | (let ((repeat-message-function fun)) | 290 | (let ((repeat-message-function fun)) |
| 291 | (setq this-command 'repeat) | 291 | (setq this-command 'repeat) |
| 292 | ;; Beware: messing with `real-this-command' is *bad*, but we | ||
| 293 | ;; need it so `last-repeatable-command' can be recognized | ||
| 294 | ;; later (bug#12232). | ||
| 295 | (setq real-this-command 'repeat) | ||
| 292 | (call-interactively 'repeat)))))) | 296 | (call-interactively 'repeat)))))) |
| 293 | map))))) | 297 | map))))) |
| 294 | 298 | ||
diff --git a/lisp/startup.el b/lisp/startup.el index 56281a6b164..2e8b6b7f8c4 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -1693,7 +1693,6 @@ splash screen in another window." | |||
| 1693 | (force-mode-line-update)) | 1693 | (force-mode-line-update)) |
| 1694 | (use-local-map splash-screen-keymap) | 1694 | (use-local-map splash-screen-keymap) |
| 1695 | (setq tab-width 22) | 1695 | (setq tab-width 22) |
| 1696 | (message "%s" (startup-echo-area-message)) | ||
| 1697 | (setq buffer-read-only t) | 1696 | (setq buffer-read-only t) |
| 1698 | (goto-char (point-min)) | 1697 | (goto-char (point-min)) |
| 1699 | (forward-line 3)))) | 1698 | (forward-line 3)))) |
diff --git a/lisp/subr.el b/lisp/subr.el index 94012fc47de..d328b7cddf5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2949,8 +2949,8 @@ They default to the values of (point-min) and (point-max) in BUFFER." | |||
| 2949 | BUFFER may be a buffer or a buffer name. | 2949 | BUFFER may be a buffer or a buffer name. |
| 2950 | Arguments START and END are character positions specifying the substring. | 2950 | Arguments START and END are character positions specifying the substring. |
| 2951 | They default to the values of (point-min) and (point-max) in BUFFER. | 2951 | They default to the values of (point-min) and (point-max) in BUFFER. |
| 2952 | Strip text properties from the inserted text according to | 2952 | Before insertion, process text properties according to |
| 2953 | `yank-excluded-properties'." | 2953 | `yank-handled-properties' and `yank-excluded-properties'." |
| 2954 | ;; Since the buffer text should not normally have yank-handler properties, | 2954 | ;; Since the buffer text should not normally have yank-handler properties, |
| 2955 | ;; there is no need to handle them here. | 2955 | ;; there is no need to handle them here. |
| 2956 | (let ((opoint (point))) | 2956 | (let ((opoint (point))) |
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 57bbdf9d94a..50e3b785696 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el | |||
| @@ -133,7 +133,7 @@ positions of the thing found." | |||
| 133 | THING should be a symbol specifying a type of syntactic entity. | 133 | THING should be a symbol specifying a type of syntactic entity. |
| 134 | Possibilities include `symbol', `list', `sexp', `defun', | 134 | Possibilities include `symbol', `list', `sexp', `defun', |
| 135 | `filename', `url', `email', `word', `sentence', `whitespace', | 135 | `filename', `url', `email', `word', `sentence', `whitespace', |
| 136 | `line', and `page'. | 136 | `line', `number', and `page'. |
| 137 | 137 | ||
| 138 | See the file `thingatpt.el' for documentation on how to define | 138 | See the file `thingatpt.el' for documentation on how to define |
| 139 | a symbol as a valid THING." | 139 | a symbol as a valid THING." |
| @@ -509,6 +509,7 @@ Signal an error if the entire string was not used." | |||
| 509 | (defun number-at-point () | 509 | (defun number-at-point () |
| 510 | "Return the number at point, or nil if none is found." | 510 | "Return the number at point, or nil if none is found." |
| 511 | (form-at-point 'sexp 'numberp)) | 511 | (form-at-point 'sexp 'numberp)) |
| 512 | (put 'number 'thing-at-point 'number-at-point) | ||
| 512 | ;;;###autoload | 513 | ;;;###autoload |
| 513 | (defun list-at-point () | 514 | (defun list-at-point () |
| 514 | "Return the Lisp list at point, or nil if none is found." | 515 | "Return the Lisp list at point, or nil if none is found." |
diff --git a/lisp/time.el b/lisp/time.el index fe3cdbb57be..a3bbee0c893 100644 --- a/lisp/time.el +++ b/lisp/time.el | |||
| @@ -206,12 +206,6 @@ a string to display as the label of that TIMEZONE's time." | |||
| 206 | :type 'integer | 206 | :type 'integer |
| 207 | :version "23.1") | 207 | :version "23.1") |
| 208 | 208 | ||
| 209 | (defvar display-time-world-mode-map | ||
| 210 | (let ((map (make-sparse-keymap))) | ||
| 211 | (define-key map "q" 'kill-this-buffer) | ||
| 212 | map) | ||
| 213 | "Keymap of Display Time World mode.") | ||
| 214 | |||
| 215 | ;;;###autoload | 209 | ;;;###autoload |
| 216 | (defun display-time () | 210 | (defun display-time () |
| 217 | "Enable display of time, load level, and mail flag in mode lines. | 211 | "Enable display of time, load level, and mail flag in mode lines. |
| @@ -523,7 +517,7 @@ runs the normal hook `display-time-hook' after each update." | |||
| 523 | 'display-time-event-handler))) | 517 | 'display-time-event-handler))) |
| 524 | 518 | ||
| 525 | 519 | ||
| 526 | (define-derived-mode display-time-world-mode nil "World clock" | 520 | (define-derived-mode display-time-world-mode special-mode "World clock" |
| 527 | "Major mode for buffer that displays times in various time zones. | 521 | "Major mode for buffer that displays times in various time zones. |
| 528 | See `display-time-world'." | 522 | See `display-time-world'." |
| 529 | (setq show-trailing-whitespace nil)) | 523 | (setq show-trailing-whitespace nil)) |
| @@ -549,8 +543,8 @@ See `display-time-world'." | |||
| 549 | (setenv "TZ" old-tz)) | 543 | (setenv "TZ" old-tz)) |
| 550 | (setq fmt (concat "%-" (int-to-string max-width) "s %s\n")) | 544 | (setq fmt (concat "%-" (int-to-string max-width) "s %s\n")) |
| 551 | (dolist (timedata (nreverse result)) | 545 | (dolist (timedata (nreverse result)) |
| 552 | (insert (format fmt (car timedata) (cdr timedata))))) | 546 | (insert (format fmt (car timedata) (cdr timedata)))) |
| 553 | (delete-char -1)) | 547 | (delete-char -1))) |
| 554 | 548 | ||
| 555 | ;;;###autoload | 549 | ;;;###autoload |
| 556 | (defun display-time-world () | 550 | (defun display-time-world () |
| @@ -562,10 +556,10 @@ To turn off the world time display, go to that window and type `q'." | |||
| 562 | (not (get-buffer display-time-world-buffer-name))) | 556 | (not (get-buffer display-time-world-buffer-name))) |
| 563 | (run-at-time t display-time-world-timer-second 'display-time-world-timer)) | 557 | (run-at-time t display-time-world-timer-second 'display-time-world-timer)) |
| 564 | (with-current-buffer (get-buffer-create display-time-world-buffer-name) | 558 | (with-current-buffer (get-buffer-create display-time-world-buffer-name) |
| 565 | (display-time-world-display display-time-world-list)) | 559 | (display-time-world-display display-time-world-list) |
| 566 | (pop-to-buffer display-time-world-buffer-name) | 560 | (display-buffer display-time-world-buffer-name |
| 567 | (fit-window-to-buffer) | 561 | (cons nil '((window-height . fit-window-to-buffer)))) |
| 568 | (display-time-world-mode)) | 562 | (display-time-world-mode))) |
| 569 | 563 | ||
| 570 | (defun display-time-world-timer () | 564 | (defun display-time-world-timer () |
| 571 | (if (get-buffer display-time-world-buffer-name) | 565 | (if (get-buffer display-time-world-buffer-name) |
diff --git a/lisp/tmm.el b/lisp/tmm.el index 4bc1c9af99a..6c2adf6837a 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el | |||
| @@ -165,13 +165,15 @@ Its value should be an event that has a binding in MENU." | |||
| 165 | ;; tmm-km-list is an alist of (STRING . MEANING). | 165 | ;; tmm-km-list is an alist of (STRING . MEANING). |
| 166 | ;; It has no other elements. | 166 | ;; It has no other elements. |
| 167 | ;; The order of elements in tmm-km-list is the order of the menu bar. | 167 | ;; The order of elements in tmm-km-list is the order of the menu bar. |
| 168 | (dolist (elt menu) | 168 | (if (not not-menu) |
| 169 | (cond | 169 | (map-keymap (lambda (k v) (tmm-get-keymap (cons k v))) menu) |
| 170 | ((stringp elt) (setq gl-str elt)) | 170 | (dolist (elt menu) |
| 171 | ((listp elt) (tmm-get-keymap elt not-menu)) | 171 | (cond |
| 172 | ((vectorp elt) | 172 | ((stringp elt) (setq gl-str elt)) |
| 173 | (dotimes (i (length elt)) | 173 | ((listp elt) (tmm-get-keymap elt not-menu)) |
| 174 | (tmm-get-keymap (cons i (aref elt i)) not-menu))))) | 174 | ((vectorp elt) |
| 175 | (dotimes (i (length elt)) | ||
| 176 | (tmm-get-keymap (cons i (aref elt i)) not-menu)))))) | ||
| 175 | ;; Choose an element of tmm-km-list; put it in choice. | 177 | ;; Choose an element of tmm-km-list; put it in choice. |
| 176 | (if (and not-menu (= 1 (length tmm-km-list))) | 178 | (if (and not-menu (= 1 (length tmm-km-list))) |
| 177 | ;; If this is the top-level of an x-popup-menu menu, | 179 | ;; If this is the top-level of an x-popup-menu menu, |
| @@ -432,7 +434,7 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." | |||
| 432 | (or (keymapp (cdr-safe (cdr-safe elt))) | 434 | (or (keymapp (cdr-safe (cdr-safe elt))) |
| 433 | (eq (car (cdr-safe (cdr-safe elt))) 'lambda)) | 435 | (eq (car (cdr-safe (cdr-safe elt))) 'lambda)) |
| 434 | (and (symbolp (cdr-safe (cdr-safe elt))) | 436 | (and (symbolp (cdr-safe (cdr-safe elt))) |
| 435 | (fboundp (cdr-safe (cdr-safe elt))))) | 437 | (fboundp (cdr-safe (cdr-safe elt))))) |
| 436 | (setq km (cddr elt)) | 438 | (setq km (cddr elt)) |
| 437 | (and (stringp (car elt)) (setq str (car elt)))) | 439 | (and (stringp (car elt)) (setq str (car elt)))) |
| 438 | 440 | ||
| @@ -458,14 +460,15 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." | |||
| 458 | (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda)) | 460 | (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda)) |
| 459 | (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt)))) | 461 | (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt)))) |
| 460 | (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) | 462 | (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) |
| 461 | ; New style of easy-menu | 463 | ; New style of easy-menu |
| 462 | (setq km (cdr (cddr elt))) | 464 | (setq km (cdr (cddr elt))) |
| 463 | (and (stringp (car elt)) (setq str (car elt)))) | 465 | (and (stringp (car elt)) (setq str (car elt)))) |
| 464 | 466 | ||
| 465 | ((stringp event) ; x-popup or x-popup element | 467 | ((stringp event) ; x-popup or x-popup element |
| 466 | (if (or in-x-menu (stringp (car-safe elt))) | 468 | (setq str event) |
| 467 | (setq str event event nil km elt) | 469 | (setq event nil) |
| 468 | (setq str event event nil km (cons 'keymap elt))))) | 470 | (setq km (if (or in-x-menu (stringp (car-safe elt))) |
| 471 | elt (cons 'keymap elt))))) | ||
| 469 | (unless (or (eq km 'ignore) (null str)) | 472 | (unless (or (eq km 'ignore) (null str)) |
| 470 | (let ((binding (where-is-internal km nil t))) | 473 | (let ((binding (where-is-internal km nil t))) |
| 471 | (when binding | 474 | (when binding |
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 0e79c962b47..49b76a8e3bc 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el | |||
| @@ -478,11 +478,13 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html") | |||
| 478 | (let* ((nold (string-to-number (or (match-string 2) "1"))) | 478 | (let* ((nold (string-to-number (or (match-string 2) "1"))) |
| 479 | (nnew (string-to-number (or (match-string 4) "1"))) | 479 | (nnew (string-to-number (or (match-string 4) "1"))) |
| 480 | (endold | 480 | (endold |
| 481 | (save-excursion | 481 | (save-excursion |
| 482 | (re-search-forward (if diff-valid-unified-empty-line | 482 | (re-search-forward (if diff-valid-unified-empty-line |
| 483 | "^[- \n]" "^[- ]") | 483 | "^[- \n]" "^[- ]") |
| 484 | nil t nold) | 484 | nil t nold) |
| 485 | (line-beginning-position 2))) | 485 | (line-beginning-position |
| 486 | ;; Skip potential "\ No newline at end of file". | ||
| 487 | (if (looking-at ".*\n\\\\") 3 2)))) | ||
| 486 | (endnew | 488 | (endnew |
| 487 | ;; The hunk may end with a bunch of "+" lines, so the `end' is | 489 | ;; The hunk may end with a bunch of "+" lines, so the `end' is |
| 488 | ;; then further than computed above. | 490 | ;; then further than computed above. |
| @@ -490,7 +492,9 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html") | |||
| 490 | (re-search-forward (if diff-valid-unified-empty-line | 492 | (re-search-forward (if diff-valid-unified-empty-line |
| 491 | "^[+ \n]" "^[+ ]") | 493 | "^[+ \n]" "^[+ ]") |
| 492 | nil t nnew) | 494 | nil t nnew) |
| 493 | (line-beginning-position 2)))) | 495 | (line-beginning-position |
| 496 | ;; Skip potential "\ No newline at end of file". | ||
| 497 | (if (looking-at ".*\n\\\\") 3 2))))) | ||
| 494 | (setq end (max endold endnew))))) | 498 | (setq end (max endold endnew))))) |
| 495 | ;; We may have a first evaluation of `end' thanks to the hunk header. | 499 | ;; We may have a first evaluation of `end' thanks to the hunk header. |
| 496 | (unless end | 500 | (unless end |
| @@ -581,8 +585,9 @@ next hunk if TRY-HARDER is non-nil; otherwise signal an error." | |||
| 581 | (with-local-quit | 585 | (with-local-quit |
| 582 | (when (buffer-live-p buffer) | 586 | (when (buffer-live-p buffer) |
| 583 | (with-current-buffer buffer | 587 | (with-current-buffer buffer |
| 584 | (goto-char point) | 588 | (save-excursion |
| 585 | (diff-refine-hunk)))))))))) | 589 | (goto-char point) |
| 590 | (diff-refine-hunk))))))))))) | ||
| 586 | 591 | ||
| 587 | (easy-mmode-define-navigation | 592 | (easy-mmode-define-navigation |
| 588 | diff-file diff-file-header-re "file" diff-end-of-file) | 593 | diff-file diff-file-header-re "file" diff-end-of-file) |
| @@ -906,7 +911,7 @@ PREFIX is only used internally: don't use it." | |||
| 906 | "Convert unified diffs to context diffs. | 911 | "Convert unified diffs to context diffs. |
| 907 | START and END are either taken from the region (if a prefix arg is given) or | 912 | START and END are either taken from the region (if a prefix arg is given) or |
| 908 | else cover the whole buffer." | 913 | else cover the whole buffer." |
| 909 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) | 914 | (interactive (if (or current-prefix-arg (use-region-p)) |
| 910 | (list (region-beginning) (region-end)) | 915 | (list (region-beginning) (region-end)) |
| 911 | (list (point-min) (point-max)))) | 916 | (list (point-min) (point-max)))) |
| 912 | (unless (markerp end) (setq end (copy-marker end t))) | 917 | (unless (markerp end) (setq end (copy-marker end t))) |
| @@ -1030,7 +1035,7 @@ else cover the whole buffer." | |||
| 1030 | START and END are either taken from the region | 1035 | START and END are either taken from the region |
| 1031 | \(when it is highlighted) or else cover the whole buffer. | 1036 | \(when it is highlighted) or else cover the whole buffer. |
| 1032 | With a prefix argument, convert unified format to context format." | 1037 | With a prefix argument, convert unified format to context format." |
| 1033 | (interactive (if (and transient-mark-mode mark-active) | 1038 | (interactive (if (use-region-p) |
| 1034 | (list (region-beginning) (region-end) current-prefix-arg) | 1039 | (list (region-beginning) (region-end) current-prefix-arg) |
| 1035 | (list (point-min) (point-max) current-prefix-arg))) | 1040 | (list (point-min) (point-max) current-prefix-arg))) |
| 1036 | (if to-context | 1041 | (if to-context |
| @@ -1040,7 +1045,7 @@ With a prefix argument, convert unified format to context format." | |||
| 1040 | (inhibit-read-only t)) | 1045 | (inhibit-read-only t)) |
| 1041 | (save-excursion | 1046 | (save-excursion |
| 1042 | (goto-char start) | 1047 | (goto-char start) |
| 1043 | (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t) | 1048 | (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)\\(?: \\(.*\\)\\|$\\)" nil t) |
| 1044 | (< (point) end)) | 1049 | (< (point) end)) |
| 1045 | (combine-after-change-calls | 1050 | (combine-after-change-calls |
| 1046 | (if (match-beginning 2) | 1051 | (if (match-beginning 2) |
| @@ -1056,7 +1061,9 @@ With a prefix argument, convert unified format to context format." | |||
| 1056 | ;; Variables to use the special undo function. | 1061 | ;; Variables to use the special undo function. |
| 1057 | (old-undo buffer-undo-list) | 1062 | (old-undo buffer-undo-list) |
| 1058 | (old-end (marker-position end)) | 1063 | (old-end (marker-position end)) |
| 1059 | (reversible t)) | 1064 | ;; We currently throw away the comment that can follow |
| 1065 | ;; the hunk header. FIXME: Preserve it instead! | ||
| 1066 | (reversible (not (match-end 6)))) | ||
| 1060 | (replace-match "") | 1067 | (replace-match "") |
| 1061 | (unless (re-search-forward | 1068 | (unless (re-search-forward |
| 1062 | diff-context-mid-hunk-header-re nil t) | 1069 | diff-context-mid-hunk-header-re nil t) |
| @@ -1126,7 +1133,7 @@ With a prefix argument, convert unified format to context format." | |||
| 1126 | "Reverse the direction of the diffs. | 1133 | "Reverse the direction of the diffs. |
| 1127 | START and END are either taken from the region (if a prefix arg is given) or | 1134 | START and END are either taken from the region (if a prefix arg is given) or |
| 1128 | else cover the whole buffer." | 1135 | else cover the whole buffer." |
| 1129 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) | 1136 | (interactive (if (or current-prefix-arg (use-region-p)) |
| 1130 | (list (region-beginning) (region-end)) | 1137 | (list (region-beginning) (region-end)) |
| 1131 | (list (point-min) (point-max)))) | 1138 | (list (point-min) (point-max)))) |
| 1132 | (unless (markerp end) (setq end (copy-marker end t))) | 1139 | (unless (markerp end) (setq end (copy-marker end t))) |
| @@ -1192,7 +1199,7 @@ else cover the whole buffer." | |||
| 1192 | "Fixup the hunk headers (in case the buffer was modified). | 1199 | "Fixup the hunk headers (in case the buffer was modified). |
| 1193 | START and END are either taken from the region (if a prefix arg is given) or | 1200 | START and END are either taken from the region (if a prefix arg is given) or |
| 1194 | else cover the whole buffer." | 1201 | else cover the whole buffer." |
| 1195 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) | 1202 | (interactive (if (or current-prefix-arg (use-region-p)) |
| 1196 | (list (region-beginning) (region-end)) | 1203 | (list (region-beginning) (region-end)) |
| 1197 | (list (point-min) (point-max)))) | 1204 | (list (point-min) (point-max)))) |
| 1198 | (let ((inhibit-read-only t)) | 1205 | (let ((inhibit-read-only t)) |
| @@ -1971,8 +1978,13 @@ For use in `add-log-current-defun-function'." | |||
| 1971 | (goto-char beg) | 1978 | (goto-char beg) |
| 1972 | (pcase style | 1979 | (pcase style |
| 1973 | (`unified | 1980 | (`unified |
| 1974 | (while (re-search-forward "^\\(?:-.*\n\\)+\\(\\)\\(?:\\+.*\n\\)+" | 1981 | (while (re-search-forward |
| 1975 | end t) | 1982 | (eval-when-compile |
| 1983 | (let ((no-LF-at-eol-re "\\(?:\\\\.*\n\\)?")) | ||
| 1984 | (concat "^\\(?:-.*\n\\)+" no-LF-at-eol-re | ||
| 1985 | "\\(\\)" | ||
| 1986 | "\\(?:\\+.*\n\\)+" no-LF-at-eol-re))) | ||
| 1987 | end t) | ||
| 1976 | (smerge-refine-subst (match-beginning 0) (match-end 1) | 1988 | (smerge-refine-subst (match-beginning 0) (match-end 1) |
| 1977 | (match-end 1) (match-end 0) | 1989 | (match-end 1) (match-end 0) |
| 1978 | nil 'diff-refine-preproc props-r props-a))) | 1990 | nil 'diff-refine-preproc props-r props-a))) |
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index cac3eb559a1..07a292ae435 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el | |||
| @@ -224,6 +224,8 @@ VC commands are globally reachable under the prefix `\\[vc-prefix-map]': | |||
| 224 | 224 | ||
| 225 | (defun vc-file-clearprops (file) | 225 | (defun vc-file-clearprops (file) |
| 226 | "Clear all VC properties of FILE." | 226 | "Clear all VC properties of FILE." |
| 227 | (if (boundp 'vc-parent-buffer) | ||
| 228 | (kill-local-variable 'vc-parent-buffer)) | ||
| 227 | (setplist (intern file vc-file-prop-obarray) nil)) | 229 | (setplist (intern file vc-file-prop-obarray) nil)) |
| 228 | 230 | ||
| 229 | 231 | ||
diff --git a/lisp/wdired.el b/lisp/wdired.el index 266d1993389..9851b2046d9 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el | |||
| @@ -140,6 +140,20 @@ program `dired-chmod-program', which must exist." | |||
| 140 | (other :tag "Bits freely editable" advanced)) | 140 | (other :tag "Bits freely editable" advanced)) |
| 141 | :group 'wdired) | 141 | :group 'wdired) |
| 142 | 142 | ||
| 143 | (defcustom wdired-keep-marker-rename t | ||
| 144 | ;; Use t as default so that renamed files "take their markers with them". | ||
| 145 | "Controls marking of files renamed in WDired. | ||
| 146 | If t, files keep their previous marks when they are renamed. | ||
| 147 | If a character, renamed files (whether previously marked or not) | ||
| 148 | are afterward marked with that character. | ||
| 149 | This option affects only files renamed by `wdired-finish-edit'. | ||
| 150 | See `dired-keep-marker-rename' if you want to do the same for files | ||
| 151 | renamed by `dired-do-rename' and `dired-do-rename-regexp'." | ||
| 152 | :type '(choice (const :tag "Keep" t) | ||
| 153 | (character :tag "Mark" :value ?R)) | ||
| 154 | :version "24.3" | ||
| 155 | :group 'wdired) | ||
| 156 | |||
| 143 | (defvar wdired-mode-map | 157 | (defvar wdired-mode-map |
| 144 | (let ((map (make-sparse-keymap))) | 158 | (let ((map (make-sparse-keymap))) |
| 145 | (define-key map "\C-x\C-s" 'wdired-finish-edit) | 159 | (define-key map "\C-x\C-s" 'wdired-finish-edit) |
| @@ -416,6 +430,8 @@ non-nil means return old filename." | |||
| 416 | (set-buffer-modified-p nil) | 430 | (set-buffer-modified-p nil) |
| 417 | (setq buffer-undo-list nil)) | 431 | (setq buffer-undo-list nil)) |
| 418 | 432 | ||
| 433 | (declare-function dired-add-entry "dired-aux" (filename &optional marker-char relative)) | ||
| 434 | |||
| 419 | (defun wdired-do-renames (renames) | 435 | (defun wdired-do-renames (renames) |
| 420 | "Perform RENAMES in parallel." | 436 | "Perform RENAMES in parallel." |
| 421 | (let ((residue ()) | 437 | (let ((residue ()) |
| @@ -471,9 +487,12 @@ non-nil means return old filename." | |||
| 471 | (dired-rename-file file-ori file-new | 487 | (dired-rename-file file-ori file-new |
| 472 | overwrite) | 488 | overwrite) |
| 473 | (dired-remove-file file-ori) | 489 | (dired-remove-file file-ori) |
| 474 | (dired-add-file file-new (if (integerp dired-keep-marker-rename) | 490 | (dired-add-file |
| 475 | dired-keep-marker-rename | 491 | file-new |
| 476 | old-mark))) | 492 | (cond ((integerp wdired-keep-marker-rename) |
| 493 | wdired-keep-marker-rename) | ||
| 494 | (wdired-keep-marker-rename old-mark) | ||
| 495 | (t nil)))) | ||
| 477 | (error | 496 | (error |
| 478 | (setq errors (1+ errors)) | 497 | (setq errors (1+ errors)) |
| 479 | (dired-log (concat "Rename `" file-ori "' to `" | 498 | (dired-log (concat "Rename `" file-ori "' to `" |
diff --git a/lisp/window.el b/lisp/window.el index fa7b08375ce..bd043390d90 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -5414,6 +5414,22 @@ Recognized alist entries include: | |||
| 5414 | parameters to give a new frame, if | 5414 | parameters to give a new frame, if |
| 5415 | one is created. | 5415 | one is created. |
| 5416 | 5416 | ||
| 5417 | `window-height' -- Value specifies either an integer (the number | ||
| 5418 | of lines of a new window), a floating point number (the | ||
| 5419 | fraction of a new window with respect to the height of the | ||
| 5420 | frame's root window) or a function to be called with one | ||
| 5421 | argument - a new window. The function is supposed to adjust | ||
| 5422 | the height of the window; its return value is ignored. | ||
| 5423 | Suitable functions are `shrink-window-if-larger-than-buffer' | ||
| 5424 | and `fit-window-to-buffer'. | ||
| 5425 | |||
| 5426 | `window-width' -- Value specifies either an integer (the number | ||
| 5427 | of columns of a new window), a floating point number (the | ||
| 5428 | fraction of a new window with respect to the width of the | ||
| 5429 | frame's root window) or a function to be called with one | ||
| 5430 | argument - a new window. The function is supposed to adjust | ||
| 5431 | the width of the window; its return value is ignored. | ||
| 5432 | |||
| 5417 | The ACTION argument to `display-buffer' can also have a non-nil | 5433 | The ACTION argument to `display-buffer' can also have a non-nil |
| 5418 | and non-list value. This means to display the buffer in a window | 5434 | and non-list value. This means to display the buffer in a window |
| 5419 | other than the selected one, even if it is already displayed in | 5435 | other than the selected one, even if it is already displayed in |
diff --git a/lisp/woman.el b/lisp/woman.el index c8cc7ea6766..e41c489dbfa 100644 --- a/lisp/woman.el +++ b/lisp/woman.el | |||
| @@ -3632,7 +3632,9 @@ expression in parentheses. Leaves point after the value." | |||
| 3632 | ((looking-at "[mnuv]")) ; ignore for now | 3632 | ((looking-at "[mnuv]")) ; ignore for now |
| 3633 | ((looking-at "i") (setq n (* n 10))) ; inch | 3633 | ((looking-at "i") (setq n (* n 10))) ; inch |
| 3634 | ((looking-at "c") (setq n (* n 3.9))) ; cm | 3634 | ((looking-at "c") (setq n (* n 3.9))) ; cm |
| 3635 | ((looking-at "P") (setq n (* n 1.7))) ; Pica | 3635 | ((let ((case-fold-search nil)) |
| 3636 | (looking-at "P")) | ||
| 3637 | (setq n (* n 1.7))) ; Pica | ||
| 3636 | ((looking-at "p") (setq n (* n 0.14))) ; point | 3638 | ((looking-at "p") (setq n (* n 0.14))) ; point |
| 3637 | ;; NB: May be immediately followed by + or -, etc., | 3639 | ;; NB: May be immediately followed by + or -, etc., |
| 3638 | ;; in which case do nothing and return nil. | 3640 | ;; in which case do nothing and return nil. |
diff --git a/nt/ChangeLog b/nt/ChangeLog index 94d2ce18551..c915ee40bb6 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-10-24 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * config.nt: Sync with autogen/config.in. | ||
| 4 | |||
| 1 | 2012-10-17 Eli Zaretskii <eliz@gnu.org> | 5 | 2012-10-17 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * inc/pwd.h (getuid, geteuid): Add prototypes. | 7 | * inc/pwd.h (getuid, geteuid): Add prototypes. |
diff --git a/nt/config.nt b/nt/config.nt index 4582928cb5a..4dc7ede188b 100644 --- a/nt/config.nt +++ b/nt/config.nt | |||
| @@ -148,7 +148,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 148 | 148 | ||
| 149 | /* Enable compile-time and run-time bounds-checking, and some warnings, | 149 | /* Enable compile-time and run-time bounds-checking, and some warnings, |
| 150 | without upsetting glibc 2.15+. */ | 150 | without upsetting glibc 2.15+. */ |
| 151 | #if defined __OPTIMIZE__ && __OPTIMIZE__ | 151 | #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ |
| 152 | # define _FORTIFY_SOURCE 2 | 152 | # define _FORTIFY_SOURCE 2 |
| 153 | #endif | 153 | #endif |
| 154 | 154 | ||
| @@ -701,7 +701,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 701 | Mac OS X. */ | 701 | Mac OS X. */ |
| 702 | #undef HAVE_NS | 702 | #undef HAVE_NS |
| 703 | 703 | ||
| 704 | /* Define to use native Windows GUI. */ | 704 | /* Define to use native MS Windows GUI. */ |
| 705 | #define HAVE_NTGUI 1 | 705 | #define HAVE_NTGUI 1 |
| 706 | 706 | ||
| 707 | /* Define to 1 if libotf has OTF_get_variation_glyphs. */ | 707 | /* Define to 1 if libotf has OTF_get_variation_glyphs. */ |
diff --git a/src/ChangeLog b/src/ChangeLog index a5f76b22def..e3371796bfb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,76 @@ | |||
| 3 | * font.c (Ffont_at): If WINDOW is specified and it is not | 3 | * font.c (Ffont_at): If WINDOW is specified and it is not |
| 4 | displaying the current buffer, signal an error. | 4 | displaying the current buffer, signal an error. |
| 5 | 5 | ||
| 6 | 2012-10-29 Daniel Colascione <dancol@dancol.org> | ||
| 7 | |||
| 8 | * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In | ||
| 9 | preparation for fixing bug#12739, move these functions from | ||
| 10 | here... | ||
| 11 | |||
| 12 | * coding.h, coding.c: ... to here, and compile them only when | ||
| 13 | WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper | ||
| 14 | lets us write cygw32-agnostic code for the HAVE_NTGUI case. | ||
| 15 | |||
| 16 | 2012-10-28 Eli Zaretskii <eliz@gnu.org> | ||
| 17 | |||
| 18 | * w32proc.c (TIMER_TICKS_PER_SEC): New macro. | ||
| 19 | (timer_loop, getitimer, setitimer): Use it instead of | ||
| 20 | CLOCKS_PER_SEC, which is no longer pertinent, since we don't use | ||
| 21 | 'clock'. | ||
| 22 | (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a | ||
| 23 | literal 10000. | ||
| 24 | |||
| 25 | 2012-10-28 Jan Djärv <jan.h.d@swipnet.se> | ||
| 26 | |||
| 27 | * nsterm.m (NO_APPDEFINED_DATA): New define. | ||
| 28 | (last_appdefined_event_data): New variable | ||
| 29 | (last_appdefined_event): Remove. | ||
| 30 | (ns_select): Initialize t from last_appdefined_event_data instead | ||
| 31 | of [last_appdefined_event data1]. | ||
| 32 | (sendEvent:): Save [theEvent data1] to last_appdefined_event_data, | ||
| 33 | remove last_appdefined_event (Bug#12698). | ||
| 34 | |||
| 35 | 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 36 | |||
| 37 | * frame.c (x_set_font): Catch internal error. | ||
| 38 | |||
| 39 | 2012-10-27 Eli Zaretskii <eliz@gnu.org> | ||
| 40 | |||
| 41 | Avoid overflow in w32 implementation of interval timers. | ||
| 42 | When possible, for ITIMER_PROF count only times the main thread | ||
| 43 | actually executes. | ||
| 44 | * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now | ||
| 45 | 'volatile ULONGLONG' types. All the other data which was | ||
| 46 | previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'. | ||
| 47 | (GetThreadTimes_Proc): New typedef. | ||
| 48 | (w32_get_timer_time): New function, returns a suitable time value | ||
| 49 | for the timer. | ||
| 50 | (timer_loop): Enter critical section when accessing ULONGLONG | ||
| 51 | values of the itimer_data struct, as these accesses are no longer | ||
| 52 | atomic. Call 'w32_get_timer_time' instead of 'clock'. | ||
| 53 | Remove unused variable. | ||
| 54 | (init_timers): Initialize s_pfn_Get_Thread_Times. | ||
| 55 | (start_timer_thread): Don't assign itimer->caller_thread here. | ||
| 56 | (getitimer): Assign itimer->caller_thread here. | ||
| 57 | (setitimer): Always call getitimer to get the value of ticks_now. | ||
| 58 | (sys_spawnve): Avoid compiler warning about format mismatch. | ||
| 59 | |||
| 60 | 2012-10-26 Eli Zaretskii <eliz@gnu.org> | ||
| 61 | |||
| 62 | * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of | ||
| 63 | mouse movement events if the menu bar is active. This avoids | ||
| 64 | producing a busy "hour-glass" cursor by Windows if the mouse | ||
| 65 | pointer is positioned over a tooltip shown for some menu item. | ||
| 66 | |||
| 67 | 2012-10-25 Paul Eggert <eggert@cs.ucla.edu> | ||
| 68 | |||
| 69 | Don't assume process IDs fit in int. | ||
| 70 | * emacs.c (shut_down_emacs) [!DOS_NT]: | ||
| 71 | * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]: | ||
| 72 | * term.c (dissociate_if_controlling_tty) [!DOS_NT]: | ||
| 73 | Use pid_t, not int, to store process IDs, as 'int' | ||
| 74 | is not wide enough on a few platforms (e.g., AIX and IRIX). | ||
| 75 | |||
| 6 | 2012-10-23 Kenichi Handa <handa@gnu.org> | 76 | 2012-10-23 Kenichi Handa <handa@gnu.org> |
| 7 | 77 | ||
| 8 | The following change is to make face-font-rescale-alist work | 78 | The following change is to make face-font-rescale-alist work |
| @@ -60,8 +130,8 @@ | |||
| 60 | 130 | ||
| 61 | 2012-10-19 Eli Zaretskii <eliz@gnu.org> | 131 | 2012-10-19 Eli Zaretskii <eliz@gnu.org> |
| 62 | 132 | ||
| 63 | * puresize.h (BASE_PURESIZE): Bump the base value to 1700000. See | 133 | * puresize.h (BASE_PURESIZE): Bump the base value to 1700000. |
| 64 | http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html | 134 | See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html |
| 65 | for the reasons. | 135 | for the reasons. |
| 66 | 136 | ||
| 67 | * alloc.c (NSTATICS): Decrease to 0x800. | 137 | * alloc.c (NSTATICS): Decrease to 0x800. |
| @@ -680,8 +750,8 @@ | |||
| 680 | (ns_clear_frame_area): Remove resize handle code. | 750 | (ns_clear_frame_area): Remove resize handle code. |
| 681 | 751 | ||
| 682 | * nsfns.m (ns_in_resize): Remove. | 752 | * nsfns.m (ns_in_resize): Remove. |
| 683 | (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove | 753 | (x_set_icon_name, ns_set_name, ns_set_name_as_filename): |
| 684 | ns_in_resize check. | 754 | Remove ns_in_resize check. |
| 685 | 755 | ||
| 686 | 2012-10-07 Paul Eggert <eggert@cs.ucla.edu> | 756 | 2012-10-07 Paul Eggert <eggert@cs.ucla.edu> |
| 687 | 757 | ||
diff --git a/src/coding.c b/src/coding.c index 7628a9fbf2e..56202e4861d 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -343,6 +343,10 @@ Lisp_Object Qcoding_system_p, Qcoding_system_error; | |||
| 343 | Lisp_Object Qemacs_mule, Qraw_text; | 343 | Lisp_Object Qemacs_mule, Qraw_text; |
| 344 | Lisp_Object Qutf_8_emacs; | 344 | Lisp_Object Qutf_8_emacs; |
| 345 | 345 | ||
| 346 | #if defined (WINDOWSNT) || defined (CYGWIN) | ||
| 347 | static Lisp_Object Qutf_16le; | ||
| 348 | #endif | ||
| 349 | |||
| 346 | /* Coding-systems are handed between Emacs Lisp programs and C internal | 350 | /* Coding-systems are handed between Emacs Lisp programs and C internal |
| 347 | routines by the following three variables. */ | 351 | routines by the following three variables. */ |
| 348 | /* Coding system to be used to encode text for terminal display when | 352 | /* Coding system to be used to encode text for terminal display when |
| @@ -7971,6 +7975,40 @@ preferred_coding_system (void) | |||
| 7971 | return CODING_ID_NAME (id); | 7975 | return CODING_ID_NAME (id); |
| 7972 | } | 7976 | } |
| 7973 | 7977 | ||
| 7978 | #if defined (WINDOWSNT) || defined (CYGWIN) | ||
| 7979 | |||
| 7980 | Lisp_Object | ||
| 7981 | from_unicode (Lisp_Object str) | ||
| 7982 | { | ||
| 7983 | CHECK_STRING (str); | ||
| 7984 | if (!STRING_MULTIBYTE (str) && | ||
| 7985 | SBYTES (str) & 1) | ||
| 7986 | { | ||
| 7987 | str = Fsubstring (str, make_number (0), make_number (-1)); | ||
| 7988 | } | ||
| 7989 | |||
| 7990 | return code_convert_string_norecord (str, Qutf_16le, 0); | ||
| 7991 | } | ||
| 7992 | |||
| 7993 | wchar_t * | ||
| 7994 | to_unicode (Lisp_Object str, Lisp_Object *buf) | ||
| 7995 | { | ||
| 7996 | *buf = code_convert_string_norecord (str, Qutf_16le, 1); | ||
| 7997 | /* We need to make a another copy (in addition to the one made by | ||
| 7998 | code_convert_string_norecord) to ensure that the final string is | ||
| 7999 | _doubly_ zero terminated --- that is, that the string is | ||
| 8000 | terminated by two zero bytes and one utf-16le null character. | ||
| 8001 | Because strings are already terminated with a single zero byte, | ||
| 8002 | we just add one additional zero. */ | ||
| 8003 | str = make_uninit_string (SBYTES (*buf) + 1); | ||
| 8004 | memcpy (SDATA (str), SDATA (*buf), SBYTES (*buf)); | ||
| 8005 | SDATA (str) [SBYTES (*buf)] = '\0'; | ||
| 8006 | *buf = str; | ||
| 8007 | return WCSDATA (*buf); | ||
| 8008 | } | ||
| 8009 | |||
| 8010 | #endif /* WINDOWSNT || CYGWIN */ | ||
| 8011 | |||
| 7974 | 8012 | ||
| 7975 | #ifdef emacs | 8013 | #ifdef emacs |
| 7976 | /*** 8. Emacs Lisp library functions ***/ | 8014 | /*** 8. Emacs Lisp library functions ***/ |
| @@ -10284,6 +10322,11 @@ syms_of_coding (void) | |||
| 10284 | DEFSYM (Qutf_8, "utf-8"); | 10322 | DEFSYM (Qutf_8, "utf-8"); |
| 10285 | DEFSYM (Qutf_8_emacs, "utf-8-emacs"); | 10323 | DEFSYM (Qutf_8_emacs, "utf-8-emacs"); |
| 10286 | 10324 | ||
| 10325 | #if defined (WINDOWSNT) || defined (CYGWIN) | ||
| 10326 | /* No, not utf-16-le: that one has a BOM. */ | ||
| 10327 | DEFSYM (Qutf_16le, "utf-16le"); | ||
| 10328 | #endif | ||
| 10329 | |||
| 10287 | DEFSYM (Qutf_16, "utf-16"); | 10330 | DEFSYM (Qutf_16, "utf-16"); |
| 10288 | DEFSYM (Qbig, "big"); | 10331 | DEFSYM (Qbig, "big"); |
| 10289 | DEFSYM (Qlittle, "little"); | 10332 | DEFSYM (Qlittle, "little"); |
diff --git a/src/coding.h b/src/coding.h index 989552bf667..192be58f083 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -701,6 +701,28 @@ extern void encode_coding_object (struct coding_system *, | |||
| 701 | Lisp_Object, ptrdiff_t, ptrdiff_t, | 701 | Lisp_Object, ptrdiff_t, ptrdiff_t, |
| 702 | ptrdiff_t, ptrdiff_t, Lisp_Object); | 702 | ptrdiff_t, ptrdiff_t, Lisp_Object); |
| 703 | 703 | ||
| 704 | #if defined (WINDOWSNT) || defined (CYGWIN) | ||
| 705 | |||
| 706 | /* These functions use Lisp string objects to store the UTF-16LE | ||
| 707 | strings that modern versions of Windows expect. These strings are | ||
| 708 | not particularly useful to Lisp, and all Lisp strings should be | ||
| 709 | native Emacs multibyte. */ | ||
| 710 | |||
| 711 | /* Access the wide-character string stored in a Lisp string object. */ | ||
| 712 | #define WCSDATA(x) ((wchar_t *) SDATA (x)) | ||
| 713 | |||
| 714 | /* Convert the multi-byte string in STR to UTF-16LE encoded unibyte | ||
| 715 | string, and store it in *BUF. BUF may safely point to STR on entry. */ | ||
| 716 | extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf); | ||
| 717 | |||
| 718 | /* Convert STR, a UTF-16LE encoded string embedded in a unibyte string | ||
| 719 | object, to a multi-byte Emacs string and return it. This function | ||
| 720 | calls code_convert_string_norecord internally and has all its | ||
| 721 | failure modes. STR itself is not modified. */ | ||
| 722 | extern Lisp_Object from_unicode (Lisp_Object str); | ||
| 723 | |||
| 724 | #endif /* WINDOWSNT || CYGWIN */ | ||
| 725 | |||
| 704 | /* Macros for backward compatibility. */ | 726 | /* Macros for backward compatibility. */ |
| 705 | 727 | ||
| 706 | #define decode_coding_region(coding, from, to) \ | 728 | #define decode_coding_region(coding, from, to) \ |
diff --git a/src/cygw32.c b/src/cygw32.c index 8f63461da2a..54f2076a891 100644 --- a/src/cygw32.c +++ b/src/cygw32.c | |||
| @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 22 | #include "buffer.h" | 22 | #include "buffer.h" |
| 23 | #include <unistd.h> | 23 | #include <unistd.h> |
| 24 | #include <fcntl.h> | 24 | #include <fcntl.h> |
| 25 | static Lisp_Object Qutf_16le; | ||
| 26 | 25 | ||
| 27 | static Lisp_Object | 26 | static Lisp_Object |
| 28 | fchdir_unwind (Lisp_Object dir_fd) | 27 | fchdir_unwind (Lisp_Object dir_fd) |
| @@ -107,36 +106,6 @@ conv_filename_from_w32_unicode (const wchar_t* in, int absolute_p) | |||
| 107 | return unbind_to (count, DECODE_FILE (converted)); | 106 | return unbind_to (count, DECODE_FILE (converted)); |
| 108 | } | 107 | } |
| 109 | 108 | ||
| 110 | Lisp_Object | ||
| 111 | from_unicode (Lisp_Object str) | ||
| 112 | { | ||
| 113 | CHECK_STRING (str); | ||
| 114 | if (!STRING_MULTIBYTE (str) && | ||
| 115 | SBYTES (str) & 1) | ||
| 116 | { | ||
| 117 | str = Fsubstring (str, make_number (0), make_number (-1)); | ||
| 118 | } | ||
| 119 | |||
| 120 | return code_convert_string_norecord (str, Qutf_16le, 0); | ||
| 121 | } | ||
| 122 | |||
| 123 | wchar_t * | ||
| 124 | to_unicode (Lisp_Object str, Lisp_Object *buf) | ||
| 125 | { | ||
| 126 | *buf = code_convert_string_norecord (str, Qutf_16le, 1); | ||
| 127 | /* We need to make a another copy (in addition to the one made by | ||
| 128 | code_convert_string_norecord) to ensure that the final string is | ||
| 129 | _doubly_ zero terminated --- that is, that the string is | ||
| 130 | terminated by two zero bytes and one utf-16le null character. | ||
| 131 | Because strings are already terminated with a single zero byte, | ||
| 132 | we just add one additional zero. */ | ||
| 133 | str = make_uninit_string (SBYTES (*buf) + 1); | ||
| 134 | memcpy (SDATA (str), SDATA (*buf), SBYTES (*buf)); | ||
| 135 | SDATA (str) [SBYTES (*buf)] = '\0'; | ||
| 136 | *buf = str; | ||
| 137 | return WCSDATA (*buf); | ||
| 138 | } | ||
| 139 | |||
| 140 | DEFUN ("cygwin-convert-path-to-windows", | 109 | DEFUN ("cygwin-convert-path-to-windows", |
| 141 | Fcygwin_convert_path_to_windows, Scygwin_convert_path_to_windows, | 110 | Fcygwin_convert_path_to_windows, Scygwin_convert_path_to_windows, |
| 142 | 1, 2, 0, | 111 | 1, 2, 0, |
| @@ -162,8 +131,6 @@ DEFUN ("cygwin-convert-path-from-windows", | |||
| 162 | void | 131 | void |
| 163 | syms_of_cygw32 (void) | 132 | syms_of_cygw32 (void) |
| 164 | { | 133 | { |
| 165 | /* No, not utf-16-le: that one has a BOM. */ | ||
| 166 | DEFSYM (Qutf_16le, "utf-16le"); | ||
| 167 | defsubr (&Scygwin_convert_path_from_windows); | 134 | defsubr (&Scygwin_convert_path_from_windows); |
| 168 | defsubr (&Scygwin_convert_path_to_windows); | 135 | defsubr (&Scygwin_convert_path_to_windows); |
| 169 | } | 136 | } |
diff --git a/src/cygw32.h b/src/cygw32.h index 78e77a9a141..51571913fd1 100644 --- a/src/cygw32.h +++ b/src/cygw32.h | |||
| @@ -33,20 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 33 | #include "lisp.h" | 33 | #include "lisp.h" |
| 34 | #include "coding.h" | 34 | #include "coding.h" |
| 35 | 35 | ||
| 36 | /* *** Character conversion *** */ | ||
| 37 | |||
| 38 | /* Access the wide-character string stored in a Lisp string object. */ | ||
| 39 | #define WCSDATA(x) ((wchar_t *) SDATA (x)) | ||
| 40 | |||
| 41 | /* Convert the multi-byte string in STR to UTF-16LE encoded unibyte | ||
| 42 | string, and store it in *BUF. BUF may safely point to STR on entry. */ | ||
| 43 | extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf); | ||
| 44 | |||
| 45 | /* Convert STR, a UTF-16LE encoded string embedded in a unibyte string | ||
| 46 | object, to a multi-byte Emacs string, and return it. */ | ||
| 47 | extern Lisp_Object from_unicode (Lisp_Object str); | ||
| 48 | |||
| 49 | /* *** Misc *** */ | ||
| 50 | extern void syms_of_cygw32 (void); | 36 | extern void syms_of_cygw32 (void); |
| 51 | extern char * w32_strerror (int error_no); | 37 | extern char * w32_strerror (int error_no); |
| 52 | 38 | ||
diff --git a/src/emacs.c b/src/emacs.c index 0a2a60bee0c..7f3228641ae 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1903,8 +1903,8 @@ shut_down_emacs (int sig, Lisp_Object stuff) | |||
| 1903 | /* If we are controlling the terminal, reset terminal modes. */ | 1903 | /* If we are controlling the terminal, reset terminal modes. */ |
| 1904 | #ifndef DOS_NT | 1904 | #ifndef DOS_NT |
| 1905 | { | 1905 | { |
| 1906 | int pgrp = EMACS_GETPGRP (0); | 1906 | pid_t pgrp = EMACS_GETPGRP (0); |
| 1907 | int tpgrp = tcgetpgrp (0); | 1907 | pid_t tpgrp = tcgetpgrp (0); |
| 1908 | if ((tpgrp != -1) && tpgrp == pgrp) | 1908 | if ((tpgrp != -1) && tpgrp == pgrp) |
| 1909 | { | 1909 | { |
| 1910 | reset_all_sys_modes (); | 1910 | reset_all_sys_modes (); |
diff --git a/src/frame.c b/src/frame.c index 6478ad1e06f..17a99000c9b 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -3242,6 +3242,9 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 3242 | Lisp_Object ascii_font = fontset_ascii (fontset); | 3242 | Lisp_Object ascii_font = fontset_ascii (fontset); |
| 3243 | Lisp_Object spec = font_spec_from_name (ascii_font); | 3243 | Lisp_Object spec = font_spec_from_name (ascii_font); |
| 3244 | 3244 | ||
| 3245 | if (NILP (spec)) | ||
| 3246 | signal_error ("Invalid font name", ascii_font); | ||
| 3247 | |||
| 3245 | if (! font_match_p (spec, font_object)) | 3248 | if (! font_match_p (spec, font_object)) |
| 3246 | fontset = -1; | 3249 | fontset = -1; |
| 3247 | } | 3250 | } |
diff --git a/src/nsterm.m b/src/nsterm.m index a4eaad47ac1..9b2e544c75b 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -190,7 +190,8 @@ static BOOL ns_menu_bar_is_hidden = NO; | |||
| 190 | 190 | ||
| 191 | /* event loop */ | 191 | /* event loop */ |
| 192 | static BOOL send_appdefined = YES; | 192 | static BOOL send_appdefined = YES; |
| 193 | static NSEvent *last_appdefined_event = 0; | 193 | #define NO_APPDEFINED_DATA (-8) |
| 194 | static int last_appdefined_event_data = NO_APPDEFINED_DATA; | ||
| 194 | static NSTimer *timed_entry = 0; | 195 | static NSTimer *timed_entry = 0; |
| 195 | static NSTimer *scroll_repeat_entry = nil; | 196 | static NSTimer *scroll_repeat_entry = nil; |
| 196 | static fd_set select_readfds, select_writefds; | 197 | static fd_set select_readfds, select_writefds; |
| @@ -3436,8 +3437,7 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds, | |||
| 3436 | -------------------------------------------------------------------------- */ | 3437 | -------------------------------------------------------------------------- */ |
| 3437 | { | 3438 | { |
| 3438 | int result; | 3439 | int result; |
| 3439 | NSEvent *ev; | 3440 | int t, k, nr = 0; |
| 3440 | int k, nr = 0; | ||
| 3441 | struct input_event event; | 3441 | struct input_event event; |
| 3442 | char c; | 3442 | char c; |
| 3443 | 3443 | ||
| @@ -3521,16 +3521,11 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds, | |||
| 3521 | } | 3521 | } |
| 3522 | unblock_input (); | 3522 | unblock_input (); |
| 3523 | 3523 | ||
| 3524 | ev = last_appdefined_event; | 3524 | t = last_appdefined_event_data; |
| 3525 | 3525 | ||
| 3526 | if (ev) | 3526 | if (t != NO_APPDEFINED_DATA) |
| 3527 | { | 3527 | { |
| 3528 | int t; | 3528 | last_appdefined_event_data = NO_APPDEFINED_DATA; |
| 3529 | if ([ev type] != NSApplicationDefined) | ||
| 3530 | emacs_abort (); | ||
| 3531 | |||
| 3532 | t = [ev data1]; | ||
| 3533 | last_appdefined_event = 0; | ||
| 3534 | 3529 | ||
| 3535 | if (t == -2) | 3530 | if (t == -2) |
| 3536 | { | 3531 | { |
| @@ -4307,7 +4302,7 @@ ns_term_shutdown (int sig) | |||
| 4307 | modal loop. Just defer it until later. */ | 4302 | modal loop. Just defer it until later. */ |
| 4308 | if ([NSApp modalWindow] == nil) | 4303 | if ([NSApp modalWindow] == nil) |
| 4309 | { | 4304 | { |
| 4310 | last_appdefined_event = theEvent; | 4305 | last_appdefined_event_data = [theEvent data1]; |
| 4311 | [self stop: self]; | 4306 | [self stop: self]; |
| 4312 | } | 4307 | } |
| 4313 | else | 4308 | else |
diff --git a/src/sysdep.c b/src/sysdep.c index 35beeaa7202..c7174e91612 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -452,7 +452,7 @@ sys_suspend (void) | |||
| 452 | #if defined (SIGTSTP) && !defined (MSDOS) | 452 | #if defined (SIGTSTP) && !defined (MSDOS) |
| 453 | 453 | ||
| 454 | { | 454 | { |
| 455 | int pgrp = EMACS_GETPGRP (0); | 455 | pid_t pgrp = EMACS_GETPGRP (0); |
| 456 | EMACS_KILLPG (pgrp, SIGTSTP); | 456 | EMACS_KILLPG (pgrp, SIGTSTP); |
| 457 | } | 457 | } |
| 458 | 458 | ||
diff --git a/src/term.c b/src/term.c index f7c87b7608d..74b02b0af27 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -2919,7 +2919,7 @@ static void | |||
| 2919 | dissociate_if_controlling_tty (int fd) | 2919 | dissociate_if_controlling_tty (int fd) |
| 2920 | { | 2920 | { |
| 2921 | #ifndef DOS_NT | 2921 | #ifndef DOS_NT |
| 2922 | int pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */ | 2922 | pid_t pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */ |
| 2923 | if (pgid != -1) | 2923 | if (pgid != -1) |
| 2924 | { | 2924 | { |
| 2925 | #if defined (USG5) | 2925 | #if defined (USG5) |
diff --git a/src/w32fns.c b/src/w32fns.c index 28e8ea02e05..aa120d59ce5 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -3331,7 +3331,19 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) | |||
| 3331 | versions, there is no way of telling when the mouse leaves the | 3331 | versions, there is no way of telling when the mouse leaves the |
| 3332 | frame, so we just have to put up with help-echo and mouse | 3332 | frame, so we just have to put up with help-echo and mouse |
| 3333 | highlighting remaining while the frame is not active. */ | 3333 | highlighting remaining while the frame is not active. */ |
| 3334 | if (track_mouse_event_fn && !track_mouse_window) | 3334 | if (track_mouse_event_fn && !track_mouse_window |
| 3335 | /* If the menu bar is active, turning on tracking of mouse | ||
| 3336 | movement events might send these events to the tooltip | ||
| 3337 | frame, if the user happens to move the mouse pointer over | ||
| 3338 | the tooltip. But since we don't process events for | ||
| 3339 | tooltip frames, this causes Windows to present a | ||
| 3340 | hourglass cursor, which is ugly and unexpected. So don't | ||
| 3341 | enable tracking mouse events in this case; they will be | ||
| 3342 | restarted when the menu pops down. (Confusingly, the | ||
| 3343 | menubar_active member of f->output_data.w32, tested | ||
| 3344 | above, is only set when a menu was popped up _not_ from | ||
| 3345 | the frame's menu bar, but via x-popup-menu.) */ | ||
| 3346 | && !menubar_in_use) | ||
| 3335 | { | 3347 | { |
| 3336 | TRACKMOUSEEVENT tme; | 3348 | TRACKMOUSEEVENT tme; |
| 3337 | tme.cbSize = sizeof (tme); | 3349 | tme.cbSize = sizeof (tme); |
diff --git a/src/w32proc.c b/src/w32proc.c index 57b3860cb76..d45d9879a24 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -244,28 +244,92 @@ setpgrp (int pid, int gid) | |||
| 244 | the thread calls the appropriate signal handler when the timer | 244 | the thread calls the appropriate signal handler when the timer |
| 245 | expires, after stopping the thread which installed the timer. */ | 245 | expires, after stopping the thread which installed the timer. */ |
| 246 | 246 | ||
| 247 | /* FIXME: clock_t counts overflow after 49 days, need to handle the | ||
| 248 | wrap-around. */ | ||
| 249 | struct itimer_data { | 247 | struct itimer_data { |
| 250 | clock_t expire; | 248 | volatile ULONGLONG expire; |
| 251 | clock_t reload; | 249 | volatile ULONGLONG reload; |
| 252 | int terminate; | 250 | volatile int terminate; |
| 253 | int type; | 251 | int type; |
| 254 | HANDLE caller_thread; | 252 | HANDLE caller_thread; |
| 255 | HANDLE timer_thread; | 253 | HANDLE timer_thread; |
| 256 | }; | 254 | }; |
| 257 | 255 | ||
| 258 | static clock_t ticks_now; | 256 | static ULONGLONG ticks_now; |
| 259 | static struct itimer_data real_itimer, prof_itimer; | 257 | static struct itimer_data real_itimer, prof_itimer; |
| 260 | static clock_t clocks_min; | 258 | static ULONGLONG clocks_min; |
| 261 | /* If non-zero, itimers are disabled. Used during shutdown, when we | 259 | /* If non-zero, itimers are disabled. Used during shutdown, when we |
| 262 | delete the critical sections used by the timer threads. */ | 260 | delete the critical sections used by the timer threads. */ |
| 263 | static int disable_itimers; | 261 | static int disable_itimers; |
| 264 | 262 | ||
| 265 | static CRITICAL_SECTION crit_real, crit_prof; | 263 | static CRITICAL_SECTION crit_real, crit_prof; |
| 266 | 264 | ||
| 267 | #define MAX_SINGLE_SLEEP 30 | 265 | /* GetThreadTimes is not available on Windows 9X and possibly also on 2K. */ |
| 266 | typedef BOOL (WINAPI *GetThreadTimes_Proc) ( | ||
| 267 | HANDLE hThread, | ||
| 268 | LPFILETIME lpCreationTime, | ||
| 269 | LPFILETIME lpExitTime, | ||
| 270 | LPFILETIME lpKernelTime, | ||
| 271 | LPFILETIME lpUserTime); | ||
| 272 | |||
| 273 | static GetThreadTimes_Proc s_pfn_Get_Thread_Times; | ||
| 274 | |||
| 275 | #define MAX_SINGLE_SLEEP 30 | ||
| 276 | #define TIMER_TICKS_PER_SEC 1000 | ||
| 277 | |||
| 278 | /* Return a suitable time value, in 1-ms units, for THREAD, a handle | ||
| 279 | to a thread. If THREAD is NULL or an invalid handle, return the | ||
| 280 | current wall-clock time since January 1, 1601 (UTC). Otherwise, | ||
| 281 | return the sum of kernel and user times used by THREAD since it was | ||
| 282 | created, plus its creation time. */ | ||
| 283 | static ULONGLONG | ||
| 284 | w32_get_timer_time (HANDLE thread) | ||
| 285 | { | ||
| 286 | ULONGLONG retval; | ||
| 287 | int use_system_time = 1; | ||
| 288 | /* The functions below return times in 100-ns units. */ | ||
| 289 | const int tscale = 10 * TIMER_TICKS_PER_SEC; | ||
| 290 | |||
| 291 | if (thread && thread != INVALID_HANDLE_VALUE | ||
| 292 | && s_pfn_Get_Thread_Times != NULL) | ||
| 293 | { | ||
| 294 | FILETIME creation_ftime, exit_ftime, kernel_ftime, user_ftime; | ||
| 295 | ULARGE_INTEGER temp_creation, temp_kernel, temp_user; | ||
| 296 | |||
| 297 | if (s_pfn_Get_Thread_Times (thread, &creation_ftime, &exit_ftime, | ||
| 298 | &kernel_ftime, &user_ftime)) | ||
| 299 | { | ||
| 300 | use_system_time = 0; | ||
| 301 | temp_creation.LowPart = creation_ftime.dwLowDateTime; | ||
| 302 | temp_creation.HighPart = creation_ftime.dwHighDateTime; | ||
| 303 | temp_kernel.LowPart = kernel_ftime.dwLowDateTime; | ||
| 304 | temp_kernel.HighPart = kernel_ftime.dwHighDateTime; | ||
| 305 | temp_user.LowPart = user_ftime.dwLowDateTime; | ||
| 306 | temp_user.HighPart = user_ftime.dwHighDateTime; | ||
| 307 | retval = | ||
| 308 | temp_creation.QuadPart / tscale + temp_kernel.QuadPart / tscale | ||
| 309 | + temp_user.QuadPart / tscale; | ||
| 310 | } | ||
| 311 | else | ||
| 312 | DebPrint (("GetThreadTimes failed with error code %lu\n", | ||
| 313 | GetLastError ())); | ||
| 314 | } | ||
| 315 | |||
| 316 | if (use_system_time) | ||
| 317 | { | ||
| 318 | FILETIME current_ftime; | ||
| 319 | ULARGE_INTEGER temp; | ||
| 320 | |||
| 321 | GetSystemTimeAsFileTime (¤t_ftime); | ||
| 322 | |||
| 323 | temp.LowPart = current_ftime.dwLowDateTime; | ||
| 324 | temp.HighPart = current_ftime.dwHighDateTime; | ||
| 325 | |||
| 326 | retval = temp.QuadPart / tscale; | ||
| 327 | } | ||
| 268 | 328 | ||
| 329 | return retval; | ||
| 330 | } | ||
| 331 | |||
| 332 | /* Thread function for a timer thread. */ | ||
| 269 | static DWORD WINAPI | 333 | static DWORD WINAPI |
| 270 | timer_loop (LPVOID arg) | 334 | timer_loop (LPVOID arg) |
| 271 | { | 335 | { |
| @@ -273,14 +337,14 @@ timer_loop (LPVOID arg) | |||
| 273 | int which = itimer->type; | 337 | int which = itimer->type; |
| 274 | int sig = (which == ITIMER_REAL) ? SIGALRM : SIGPROF; | 338 | int sig = (which == ITIMER_REAL) ? SIGALRM : SIGPROF; |
| 275 | CRITICAL_SECTION *crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; | 339 | CRITICAL_SECTION *crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; |
| 276 | const DWORD max_sleep = MAX_SINGLE_SLEEP * 1000 / CLOCKS_PER_SEC; | 340 | const DWORD max_sleep = MAX_SINGLE_SLEEP * 1000 / TIMER_TICKS_PER_SEC; |
| 277 | int new_count = 0; | 341 | HANDLE hth = (which == ITIMER_REAL) ? NULL : itimer->caller_thread; |
| 278 | 342 | ||
| 279 | while (1) | 343 | while (1) |
| 280 | { | 344 | { |
| 281 | DWORD sleep_time; | 345 | DWORD sleep_time; |
| 282 | signal_handler handler; | 346 | signal_handler handler; |
| 283 | clock_t now, expire, reload; | 347 | ULONGLONG now, expire, reload; |
| 284 | 348 | ||
| 285 | /* Load new values if requested by setitimer. */ | 349 | /* Load new values if requested by setitimer. */ |
| 286 | EnterCriticalSection (crit); | 350 | EnterCriticalSection (crit); |
| @@ -290,15 +354,14 @@ timer_loop (LPVOID arg) | |||
| 290 | if (itimer->terminate) | 354 | if (itimer->terminate) |
| 291 | return 0; | 355 | return 0; |
| 292 | 356 | ||
| 293 | if (itimer->expire == 0) | 357 | if (expire == 0) |
| 294 | { | 358 | { |
| 295 | /* We are idle. */ | 359 | /* We are idle. */ |
| 296 | Sleep (max_sleep); | 360 | Sleep (max_sleep); |
| 297 | continue; | 361 | continue; |
| 298 | } | 362 | } |
| 299 | 363 | ||
| 300 | expire = itimer->expire; | 364 | if (expire > (now = w32_get_timer_time (hth))) |
| 301 | if (expire > (now = clock ())) | ||
| 302 | sleep_time = expire - now; | 365 | sleep_time = expire - now; |
| 303 | else | 366 | else |
| 304 | sleep_time = 0; | 367 | sleep_time = 0; |
| @@ -309,24 +372,30 @@ timer_loop (LPVOID arg) | |||
| 309 | if (itimer->terminate) | 372 | if (itimer->terminate) |
| 310 | return 0; | 373 | return 0; |
| 311 | Sleep (max_sleep); | 374 | Sleep (max_sleep); |
| 375 | EnterCriticalSection (crit); | ||
| 312 | expire = itimer->expire; | 376 | expire = itimer->expire; |
| 313 | sleep_time = (expire > (now = clock ())) ? expire - now : 0; | 377 | LeaveCriticalSection (crit); |
| 378 | sleep_time = | ||
| 379 | (expire > (now = w32_get_timer_time (hth))) ? expire - now : 0; | ||
| 314 | } | 380 | } |
| 315 | if (itimer->terminate) | 381 | if (itimer->terminate) |
| 316 | return 0; | 382 | return 0; |
| 317 | if (sleep_time > 0) | 383 | if (sleep_time > 0) |
| 318 | { | 384 | { |
| 319 | Sleep (sleep_time * 1000 / CLOCKS_PER_SEC); | 385 | Sleep (sleep_time * 1000 / TIMER_TICKS_PER_SEC); |
| 320 | /* Always sleep past the expiration time, to make sure we | 386 | /* Always sleep past the expiration time, to make sure we |
| 321 | never call the handler _before_ the expiration time, | 387 | never call the handler _before_ the expiration time, |
| 322 | always slightly after it. Sleep(5) makes sure we don't | 388 | always slightly after it. Sleep(5) makes sure we don't |
| 323 | hog the CPU by calling 'clock' with high frequency, and | 389 | hog the CPU by calling 'w32_get_timer_time' with high |
| 324 | also let other threads work. */ | 390 | frequency, and also let other threads work. */ |
| 325 | while (clock () < expire) | 391 | while (w32_get_timer_time (hth) < expire) |
| 326 | Sleep (5); | 392 | Sleep (5); |
| 327 | } | 393 | } |
| 328 | 394 | ||
| 329 | if (itimer->expire == 0) | 395 | EnterCriticalSection (crit); |
| 396 | expire = itimer->expire; | ||
| 397 | LeaveCriticalSection (crit); | ||
| 398 | if (expire == 0) | ||
| 330 | continue; | 399 | continue; |
| 331 | 400 | ||
| 332 | /* Time's up. */ | 401 | /* Time's up. */ |
| @@ -353,19 +422,21 @@ timer_loop (LPVOID arg) | |||
| 353 | ResumeThread (itimer->caller_thread); | 422 | ResumeThread (itimer->caller_thread); |
| 354 | } | 423 | } |
| 355 | 424 | ||
| 356 | if (itimer->expire == 0) | ||
| 357 | continue; | ||
| 358 | |||
| 359 | /* Update expiration time and loop. */ | 425 | /* Update expiration time and loop. */ |
| 360 | EnterCriticalSection (crit); | 426 | EnterCriticalSection (crit); |
| 361 | expire = itimer->expire; | 427 | expire = itimer->expire; |
| 428 | if (expire == 0) | ||
| 429 | { | ||
| 430 | LeaveCriticalSection (crit); | ||
| 431 | continue; | ||
| 432 | } | ||
| 362 | reload = itimer->reload; | 433 | reload = itimer->reload; |
| 363 | if (reload > 0) | 434 | if (reload > 0) |
| 364 | { | 435 | { |
| 365 | now = clock (); | 436 | now = w32_get_timer_time (hth); |
| 366 | if (expire <= now) | 437 | if (expire <= now) |
| 367 | { | 438 | { |
| 368 | clock_t lag = now - expire; | 439 | ULONGLONG lag = now - expire; |
| 369 | 440 | ||
| 370 | /* If we missed some opportunities (presumably while | 441 | /* If we missed some opportunities (presumably while |
| 371 | sleeping or while the signal handler ran), skip | 442 | sleeping or while the signal handler ran), skip |
| @@ -448,6 +519,15 @@ term_timers (void) | |||
| 448 | void | 519 | void |
| 449 | init_timers (void) | 520 | init_timers (void) |
| 450 | { | 521 | { |
| 522 | /* GetThreadTimes is not avaiulable on all versions of Windows, so | ||
| 523 | need to probe for its availability dynamically, and call it | ||
| 524 | through a pointer. */ | ||
| 525 | s_pfn_Get_Thread_Times = NULL; /* in case dumped Emacs comes with a value */ | ||
| 526 | if (os_subtype != OS_9X) | ||
| 527 | s_pfn_Get_Thread_Times = | ||
| 528 | (GetThreadTimes_Proc)GetProcAddress (GetModuleHandle ("kernel32.dll"), | ||
| 529 | "GetThreadTimes"); | ||
| 530 | |||
| 451 | /* Make sure we start with zeroed out itimer structures, since | 531 | /* Make sure we start with zeroed out itimer structures, since |
| 452 | dumping may have left there traces of threads long dead. */ | 532 | dumping may have left there traces of threads long dead. */ |
| 453 | memset (&real_itimer, 0, sizeof real_itimer); | 533 | memset (&real_itimer, 0, sizeof real_itimer); |
| @@ -473,14 +553,6 @@ start_timer_thread (int which) | |||
| 473 | return 0; | 553 | return 0; |
| 474 | 554 | ||
| 475 | /* Start a new thread. */ | 555 | /* Start a new thread. */ |
| 476 | if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), | ||
| 477 | GetCurrentProcess (), &itimer->caller_thread, 0, | ||
| 478 | FALSE, DUPLICATE_SAME_ACCESS)) | ||
| 479 | { | ||
| 480 | errno = ESRCH; | ||
| 481 | return -1; | ||
| 482 | } | ||
| 483 | |||
| 484 | itimer->terminate = 0; | 556 | itimer->terminate = 0; |
| 485 | itimer->type = which; | 557 | itimer->type = which; |
| 486 | /* Request that no more than 64KB of stack be reserved for this | 558 | /* Request that no more than 64KB of stack be reserved for this |
| @@ -512,17 +584,16 @@ start_timer_thread (int which) | |||
| 512 | int | 584 | int |
| 513 | getitimer (int which, struct itimerval *value) | 585 | getitimer (int which, struct itimerval *value) |
| 514 | { | 586 | { |
| 515 | volatile clock_t *t_expire; | 587 | volatile ULONGLONG *t_expire; |
| 516 | volatile clock_t *t_reload; | 588 | volatile ULONGLONG *t_reload; |
| 517 | clock_t expire, reload; | 589 | ULONGLONG expire, reload; |
| 518 | __int64 usecs; | 590 | __int64 usecs; |
| 519 | CRITICAL_SECTION *crit; | 591 | CRITICAL_SECTION *crit; |
| 592 | struct itimer_data *itimer; | ||
| 520 | 593 | ||
| 521 | if (disable_itimers) | 594 | if (disable_itimers) |
| 522 | return -1; | 595 | return -1; |
| 523 | 596 | ||
| 524 | ticks_now = clock (); | ||
| 525 | |||
| 526 | if (!value) | 597 | if (!value) |
| 527 | { | 598 | { |
| 528 | errno = EFAULT; | 599 | errno = EFAULT; |
| @@ -535,8 +606,22 @@ getitimer (int which, struct itimerval *value) | |||
| 535 | return -1; | 606 | return -1; |
| 536 | } | 607 | } |
| 537 | 608 | ||
| 538 | t_expire = (which == ITIMER_REAL) ? &real_itimer.expire: &prof_itimer.expire; | 609 | itimer = (which == ITIMER_REAL) ? &real_itimer : &prof_itimer; |
| 539 | t_reload = (which == ITIMER_REAL) ? &real_itimer.reload: &prof_itimer.reload; | 610 | |
| 611 | if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), | ||
| 612 | GetCurrentProcess (), &itimer->caller_thread, 0, | ||
| 613 | FALSE, DUPLICATE_SAME_ACCESS)) | ||
| 614 | { | ||
| 615 | errno = ESRCH; | ||
| 616 | return -1; | ||
| 617 | } | ||
| 618 | |||
| 619 | ticks_now = w32_get_timer_time ((which == ITIMER_REAL) | ||
| 620 | ? NULL | ||
| 621 | : itimer->caller_thread); | ||
| 622 | |||
| 623 | t_expire = &itimer->expire; | ||
| 624 | t_reload = &itimer->reload; | ||
| 540 | crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; | 625 | crit = (which == ITIMER_REAL) ? &crit_real : &crit_prof; |
| 541 | 626 | ||
| 542 | EnterCriticalSection (crit); | 627 | EnterCriticalSection (crit); |
| @@ -547,11 +632,13 @@ getitimer (int which, struct itimerval *value) | |||
| 547 | if (expire) | 632 | if (expire) |
| 548 | expire -= ticks_now; | 633 | expire -= ticks_now; |
| 549 | 634 | ||
| 550 | value->it_value.tv_sec = expire / CLOCKS_PER_SEC; | 635 | value->it_value.tv_sec = expire / TIMER_TICKS_PER_SEC; |
| 551 | usecs = (expire % CLOCKS_PER_SEC) * (__int64)1000000 / CLOCKS_PER_SEC; | 636 | usecs = |
| 637 | (expire % TIMER_TICKS_PER_SEC) * (__int64)1000000 / TIMER_TICKS_PER_SEC; | ||
| 552 | value->it_value.tv_usec = usecs; | 638 | value->it_value.tv_usec = usecs; |
| 553 | value->it_interval.tv_sec = reload / CLOCKS_PER_SEC; | 639 | value->it_interval.tv_sec = reload / TIMER_TICKS_PER_SEC; |
| 554 | usecs = (reload % CLOCKS_PER_SEC) * (__int64)1000000 / CLOCKS_PER_SEC; | 640 | usecs = |
| 641 | (reload % TIMER_TICKS_PER_SEC) * (__int64)1000000 / TIMER_TICKS_PER_SEC; | ||
| 555 | value->it_interval.tv_usec= usecs; | 642 | value->it_interval.tv_usec= usecs; |
| 556 | 643 | ||
| 557 | return 0; | 644 | return 0; |
| @@ -560,10 +647,11 @@ getitimer (int which, struct itimerval *value) | |||
| 560 | int | 647 | int |
| 561 | setitimer(int which, struct itimerval *value, struct itimerval *ovalue) | 648 | setitimer(int which, struct itimerval *value, struct itimerval *ovalue) |
| 562 | { | 649 | { |
| 563 | volatile clock_t *t_expire, *t_reload; | 650 | volatile ULONGLONG *t_expire, *t_reload; |
| 564 | clock_t expire, reload, expire_old, reload_old; | 651 | ULONGLONG expire, reload, expire_old, reload_old; |
| 565 | __int64 usecs; | 652 | __int64 usecs; |
| 566 | CRITICAL_SECTION *crit; | 653 | CRITICAL_SECTION *crit; |
| 654 | struct itimerval tem, *ptem; | ||
| 567 | 655 | ||
| 568 | if (disable_itimers) | 656 | if (disable_itimers) |
| 569 | return -1; | 657 | return -1; |
| @@ -573,26 +661,21 @@ setitimer(int which, struct itimerval *value, struct itimerval *ovalue) | |||
| 573 | time we are called, measure the clock tick resolution. */ | 661 | time we are called, measure the clock tick resolution. */ |
| 574 | if (!clocks_min) | 662 | if (!clocks_min) |
| 575 | { | 663 | { |
| 576 | clock_t t1, t2; | 664 | ULONGLONG t1, t2; |
| 577 | 665 | ||
| 578 | for (t1 = clock (); (t2 = clock ()) == t1; ) | 666 | for (t1 = w32_get_timer_time (NULL); |
| 667 | (t2 = w32_get_timer_time (NULL)) == t1; ) | ||
| 579 | ; | 668 | ; |
| 580 | clocks_min = t2 - t1; | 669 | clocks_min = t2 - t1; |
| 581 | } | 670 | } |
| 582 | 671 | ||
| 583 | if (ovalue) | 672 | if (ovalue) |
| 584 | { | 673 | ptem = ovalue; |
| 585 | if (getitimer (which, ovalue)) /* also sets ticks_now */ | ||
| 586 | return -1; /* errno already set */ | ||
| 587 | } | ||
| 588 | else | 674 | else |
| 589 | ticks_now = clock (); | 675 | ptem = &tem; |
| 590 | 676 | ||
| 591 | if (which != ITIMER_REAL && which != ITIMER_PROF) | 677 | if (getitimer (which, ptem)) /* also sets ticks_now */ |
| 592 | { | 678 | return -1; /* errno already set */ |
| 593 | errno = EINVAL; | ||
| 594 | return -1; | ||
| 595 | } | ||
| 596 | 679 | ||
| 597 | t_expire = | 680 | t_expire = |
| 598 | (which == ITIMER_REAL) ? &real_itimer.expire : &prof_itimer.expire; | 681 | (which == ITIMER_REAL) ? &real_itimer.expire : &prof_itimer.expire; |
| @@ -612,26 +695,26 @@ setitimer(int which, struct itimerval *value, struct itimerval *ovalue) | |||
| 612 | return 0; | 695 | return 0; |
| 613 | } | 696 | } |
| 614 | 697 | ||
| 615 | reload = value->it_interval.tv_sec * CLOCKS_PER_SEC; | 698 | reload = value->it_interval.tv_sec * TIMER_TICKS_PER_SEC; |
| 616 | 699 | ||
| 617 | usecs = value->it_interval.tv_usec; | 700 | usecs = value->it_interval.tv_usec; |
| 618 | if (value->it_interval.tv_sec == 0 | 701 | if (value->it_interval.tv_sec == 0 |
| 619 | && usecs && usecs * CLOCKS_PER_SEC < clocks_min * 1000000) | 702 | && usecs && usecs * TIMER_TICKS_PER_SEC < clocks_min * 1000000) |
| 620 | reload = clocks_min; | 703 | reload = clocks_min; |
| 621 | else | 704 | else |
| 622 | { | 705 | { |
| 623 | usecs *= CLOCKS_PER_SEC; | 706 | usecs *= TIMER_TICKS_PER_SEC; |
| 624 | reload += usecs / 1000000; | 707 | reload += usecs / 1000000; |
| 625 | } | 708 | } |
| 626 | 709 | ||
| 627 | expire = value->it_value.tv_sec * CLOCKS_PER_SEC; | 710 | expire = value->it_value.tv_sec * TIMER_TICKS_PER_SEC; |
| 628 | usecs = value->it_value.tv_usec; | 711 | usecs = value->it_value.tv_usec; |
| 629 | if (value->it_value.tv_sec == 0 | 712 | if (value->it_value.tv_sec == 0 |
| 630 | && usecs * CLOCKS_PER_SEC < clocks_min * 1000000) | 713 | && usecs * TIMER_TICKS_PER_SEC < clocks_min * 1000000) |
| 631 | expire = clocks_min; | 714 | expire = clocks_min; |
| 632 | else | 715 | else |
| 633 | { | 716 | { |
| 634 | usecs *= CLOCKS_PER_SEC; | 717 | usecs *= TIMER_TICKS_PER_SEC; |
| 635 | expire += usecs / 1000000; | 718 | expire += usecs / 1000000; |
| 636 | } | 719 | } |
| 637 | 720 | ||
| @@ -1577,7 +1660,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) | |||
| 1577 | numenv++; | 1660 | numenv++; |
| 1578 | } | 1661 | } |
| 1579 | /* extra env vars... */ | 1662 | /* extra env vars... */ |
| 1580 | sprintf (ppid_env_var_buffer, "EM_PARENT_PROCESS_ID=%d", | 1663 | sprintf (ppid_env_var_buffer, "EM_PARENT_PROCESS_ID=%lu", |
| 1581 | GetCurrentProcessId ()); | 1664 | GetCurrentProcessId ()); |
| 1582 | arglen += strlen (ppid_env_var_buffer) + 1; | 1665 | arglen += strlen (ppid_env_var_buffer) + 1; |
| 1583 | numenv++; | 1666 | numenv++; |
diff --git a/test/indent/shell.sh b/test/indent/shell.sh index 957fe74fdee..895a9325b7e 100755 --- a/test/indent/shell.sh +++ b/test/indent/shell.sh | |||
| @@ -26,7 +26,10 @@ foo () { | |||
| 26 | 26 | ||
| 27 | case $toto in | 27 | case $toto in |
| 28 | a) echo 1;; b) echo 2;; | 28 | a) echo 1;; b) echo 2;; |
| 29 | c) echo 3;; | 29 | (c) |
| 30 | echo 3;; | ||
| 31 | d) | ||
| 32 | echo 3;; | ||
| 30 | esac | 33 | esac |
| 31 | 34 | ||
| 32 | case $as_nl`(ac_space=' '; set) 2>&1` in #( | 35 | case $as_nl`(ac_space=' '; set) 2>&1` in #( |